diff --git a/stdlib/LinearAlgebra/src/LinearAlgebra.jl b/stdlib/LinearAlgebra/src/LinearAlgebra.jl index 28dd32e1cec5b..38f7b8588d1fa 100644 --- a/stdlib/LinearAlgebra/src/LinearAlgebra.jl +++ b/stdlib/LinearAlgebra/src/LinearAlgebra.jl @@ -580,6 +580,10 @@ function __init__() end # register a hook to disable BLAS threading Base.at_disable_library_threading(() -> BLAS.set_num_threads(1)) + + if !haskey(ENV, "OPENBLAS_NUM_THREADS") + BLAS.set_num_threads(max(1, Sys.CPU_THREADS รท 2)) + end end end # module LinearAlgebra