Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some additional information to LinearAlgebra.versioninfo() #44220

Merged
merged 1 commit into from
Feb 25, 2022

Conversation

DilumAluthge
Copy link
Member

Example output:

julia> LinearAlgebra.versioninfo()
BLAS: libblastrampoline (f2c_capable)
  --> /Users/dilum/.asdf/installs/julia/1.7.2/lib/julia/libopenblas64_.0.3.13.dylib (ILP64)
Threading:
  Threads.nthreads() = 1
  BLAS.get_num_threads() = 1
Relevant environment variables:
  JULIA_NUM_THREADS = 1
  MKL_NUM_THREADS = 1
  OPENBLAS_NUM_THREADS = 1

@DilumAluthge
Copy link
Member Author

cc: @carstenbauer

@DilumAluthge DilumAluthge force-pushed the dpa/linearalgebra-versioninfo branch from 4271b90 to 6e41879 Compare February 17, 2022 03:26
@carstenbauer
Copy link
Member

A first comment: I would probably strip the path and only show --> libopenblas64_.0.3.13.dylib (ILP64). Actually, why not align it with the BLAS.get_config() output and do something like this:

julia> LinearAlgebra.versioninfo()
BLAS Libraries (libblastrampoline):
 └ [ILP64] libopenblas64_.0.3.13.dylib
Threading:
 ├ Threads.nthreads() = 1
 └ BLAS.get_num_threads() = 1
Relevant environment variables:
 ├ JULIA_NUM_THREADS = 1
 ├ MKL_NUM_THREADS = 1
 └ OPENBLAS_NUM_THREADS = 1

(or without the lines)

julia> LinearAlgebra.versioninfo()
BLAS Libraries (libblastrampoline):
  [ILP64] libopenblas64_.0.3.13.dylib
Threading:
  Threads.nthreads() = 1
  BLAS.get_num_threads() = 1
Relevant environment variables:
  JULIA_NUM_THREADS = 1
  MKL_NUM_THREADS = 1
  OPENBLAS_NUM_THREADS = 1

@ViralBShah
Copy link
Member

Perhaps good to show the full path, since it helps debug if someone has a weird setup and the wrong library is being picked up.

@DilumAluthge
Copy link
Member Author

Yeah, currently LinearAlgebra.versioninfo() prints the full path, and I think we should keep that behavior.

@carstenbauer
Copy link
Member

Alright then let's keep the path. But, in any case, multiple libraries can be loaded and the current output doesn't reflect this.

@DilumAluthge
Copy link
Member Author

Doesn't this cover the case of multiple libraries?

for lib in config.loaded_libs
interface = uppercase(string(lib.interface))
println(io, indent, "--> ", lib.libname, " (", interface, ")")
end

@carstenbauer
Copy link
Member

Oh, it does, my bad. Sorry for the noise.

@ViralBShah
Copy link
Member

ViralBShah commented Feb 18, 2022

Would be nice to see if @staticfloat has any thoughts here. It's more verbose than this, but essentially along the same lines.

julia> BLAS.get_config()
LinearAlgebra.BLAS.LBTConfig
Libraries: 
└ [ILP64] libopenblas64_.0.3.17.dylib

Although, I did not know that LinearAlgebra.versioninfo() already existed.

@staticfloat
Copy link
Member

Can't we just re-use the BLAS.get_config() output here?

@DilumAluthge
Copy link
Member Author

BLAS.get_config() does not print the full path to the libraries.

@DilumAluthge DilumAluthge merged commit 9af12d3 into master Feb 25, 2022
@DilumAluthge DilumAluthge deleted the dpa/linearalgebra-versioninfo branch February 25, 2022 16:38
@ViralBShah
Copy link
Member

I still feel that this is a bit redundant. We should try to have one function to query all the relevant information for LinearAlgebra stuff in Julia.

For now this is fine, but would be nice to refactor and clean it all up into one reporting function.

@DilumAluthge
Copy link
Member Author

We've talked (see e.g. #43834 (comment)) about having $(stdlib_name).__diagnostics__() functions that would return data in a structured form. And then InteractiveUtils.diagnostics() would pretty-print the data from all stdlibs.

staticfloat pushed a commit to JuliaCI/julia-buildkite-testing that referenced this pull request Mar 2, 2022
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linear algebra Linear algebra
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants