carstenbauer / ThreadPinning.jl

Readily pin Julia threads to CPU-threads
https://carstenbauer.github.io/ThreadPinning.jl/
MIT License
106 stars 7 forks source link

Could not load library libmkl_rt #48

Closed jishnub closed 1 year ago

jishnub commented 1 year ago

I'm trying to use this package on a cluster, and came across the following error:

julia> using MKL, ThreadPinning

julia> threadinfo(; blas=true, hints=true)

| 0,1,2,3,4,5,6,14,15,16,17,18,19,20 | 7,8,9,10,11,12,13,21,22,23,24,25,26,27 | 

# = Julia thread, | = Socket seperator

Julia threads: 14
├ Occupied CPU-threads: 14
└ Mapping (Thread => CPUID): 1 => 6, 2 => 14, 3 => 15, 4 => 16, 5 => 18, ...

BLAS: libmkl_rt.so
├ mkl_get_num_threads: 2
ERROR: could not load library "libmkl_rt"
libmkl_rt.so: cannot open shared object file: No such file or directory
Stacktrace:
 [1] dlopen(s::String, flags::UInt32; throw_error::Bool)
   @ Base.Libc.Libdl ./libdl.jl:117
 [2] dlopen (repeats 2 times)
   @ ./libdl.jl:116 [inlined]
 [3] dlpath(libname::String)
   @ Base.Libc.Libdl ./libdl.jl:240
 [4] mkl_get_dynamic
   @ /scratch/user/.julia/packages/ThreadPinning/UMdJD/src/mkl.jl:26 [inlined]
 [5] threadinfo(; blas::Bool, hints::Bool, color::Bool, masks::Bool, groupby::Symbol, threadpool::Symbol, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ ThreadPinning /scratch/user/.julia/packages/ThreadPinning/UMdJD/src/threadinfo.jl:95
 [6] top-level scope
   @ REPL[2]:1

julia> using LinearAlgebra

julia> BLAS.get_config()
LinearAlgebra.BLAS.LBTConfig
Libraries: 
├ [ILP64] libmkl_rt.so
└ [ LP64] libmkl_rt.so

julia> versioninfo()
Julia Version 1.8.4
Commit 00177ebc4fc (2022-12-23 21:32 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 28 × Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.40GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, broadwell)
  Threads: 14 on 28 virtual cores
Environment:
  LD_LIBRARY_PATH = /home/user/lib:/lib:/home/user/lib:/lib::/home/user/.local/lib
  JULIA_DEPOT_PATH = /scratch/user/.julia
  JULIA_REVISE_POLL = 1
  JULIA_NUM_PRECOMPILE_TASKS = 1

(RossbyWaveSpectrum) pkg> st MKL
Project RossbyWaveSpectrum v0.1.0
Status `/scratch/user/RossbyWaveSpectrum.jl/Project.toml`
  [33e6dc65] MKL v0.6.0

I remember this package working on a previous Julia version on this cluster long back.

carstenbauer commented 1 year ago

Thanks for the issue. I can reproduce locally. This is definitely a mistake on my side (likely introduced in the big rewrite). I'll fix this soon (and will also add tests that test this...).

carstenbauer commented 1 year ago

Will tag a new patch release with the fix in the next 30 minutes.

jishnub commented 1 year ago

Thanks for the swift response!