Skip to content

Commit 9af12d3

Browse files
authored
Add some additional information to LinearAlgebra.versioninfo() (#44220)
1 parent 9b8253c commit 9af12d3

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

stdlib/LinearAlgebra/src/LinearAlgebra.jl

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,10 +531,34 @@ end
531531

532532

533533
function versioninfo(io::IO=stdout)
534+
indent = " "
534535
config = BLAS.get_config()
535-
println(io, "BLAS: $(BLAS.libblastrampoline) ($(join(string.(config.build_flags), ", ")))")
536+
build_flags = join(string.(config.build_flags), ", ")
537+
println(io, "BLAS: ", BLAS.libblastrampoline, " (", build_flags, ")")
536538
for lib in config.loaded_libs
537-
println(io, " --> $(lib.libname) ($(uppercase(string(lib.interface))))")
539+
interface = uppercase(string(lib.interface))
540+
println(io, indent, "--> ", lib.libname, " (", interface, ")")
541+
end
542+
println(io, "Threading:")
543+
println(io, indent, "Threads.nthreads() = ", Base.Threads.nthreads())
544+
println(io, indent, "LinearAlgebra.BLAS.get_num_threads() = ", BLAS.get_num_threads())
545+
println(io, "Relevant environment variables:")
546+
env_var_names = [
547+
"JULIA_NUM_THREADS",
548+
"MKL_DYNAMIC",
549+
"MKL_NUM_THREADS",
550+
"OPENBLAS_NUM_THREADS",
551+
]
552+
printed_at_least_one_env_var = false
553+
for name in env_var_names
554+
if haskey(ENV, name)
555+
value = ENV[name]
556+
println(io, indent, name, " = ", value)
557+
printed_at_least_one_env_var = true
558+
end
559+
end
560+
if !printed_at_least_one_env_var
561+
println(io, indent, "[none]")
538562
end
539563
return nothing
540564
end

0 commit comments

Comments
 (0)