Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 8 additions & 17 deletions src/LinearAlgebra.jl
Original file line number Diff line number Diff line change
Expand Up @@ -788,31 +788,22 @@
println(io, indent, "LinearAlgebra.BLAS.get_num_threads() = ", BLAS.get_num_threads())
println(io, "Relevant environment variables:")
env_var_names = [
"JULIA_NUM_THREADS",
"MKL_DYNAMIC",
"MKL_NUM_THREADS",
["JULIA_NUM_THREADS"],
["MKL_DYNAMIC"],
["MKL_NUM_THREADS"],
# OpenBLAS has a hierarchy of environment variables for setting the
# number of threads, see
# https://github.com/xianyi/OpenBLAS/blob/c43ec53bdd00d9423fc609d7b7ecb35e7bf41b85/README.md#setting-the-number-of-threads-using-environment-variables
("OPENBLAS_NUM_THREADS", "GOTO_NUM_THREADS", "OMP_NUM_THREADS"),
["OPENBLAS_NUM_THREADS", "GOTO_NUM_THREADS", "OMP_NUM_THREADS"],
]
printed_at_least_one_env_var = false
print_var(io, indent, name) = println(io, indent, name, " = ", ENV[name])
for name in env_var_names
if name isa Tuple
# If `name` is a Tuple, then find the first environment which is
# defined, and disregard the following ones.
for nm in name
if haskey(ENV, nm)
print_var(io, indent, nm)
printed_at_least_one_env_var = true
break
end
end
else
if haskey(ENV, name)
print_var(io, indent, name)
for nm in name
if haskey(ENV, nm)
print_var(io, indent, nm)

Check warning on line 804 in src/LinearAlgebra.jl

View check run for this annotation

Codecov / codecov/patch

src/LinearAlgebra.jl#L802-L804

Added lines #L802 - L804 were not covered by tests
printed_at_least_one_env_var = true
break

Check warning on line 806 in src/LinearAlgebra.jl

View check run for this annotation

Codecov / codecov/patch

src/LinearAlgebra.jl#L806

Added line #L806 was not covered by tests
end
end
end
Expand Down