Module BLAS in Julia Base is a blas library wrapper that can be openblas , openblas , etc.
By default, OpenBLAS uses a single thread for small matrices and a multi-thread that you specify in variable variables for large matrices.
Set the number of threads with environment variables.
Examples:
export OPENBLAS_NUM_THREADS = 4 or
export GOTO_NUM_THREADS = 4 or
export OMP_NUM_THREADS = 4 Priorities: OPENBLAS_NUM_THREADS> GOTO_NUM_THREADS> OMP_NUM_THREADS.
If you compile this lib with USE_OPENMP = 1, you must set the OMP_NUM_THREADS> environment variable. OpenBLAS ignores OPENBLAS_NUM_THREADS and> GOTO_NUM_THREADS with USE_OPENMP = 1.
MKL can automatically adjust the number of threads for different matrix sizes.
You can use the global variable const dict
ENV in Julia to get environment variables. But the number of threads you use will differ if you install it at run time or install it more than the kernels available on your computer.
If you use the Apple BLAS provided by vecLi , you can use ENV["VECLIB_MAXIMUM_THREADS"] to get the number of threads that you use, regardless of whether you set the number of threads with environment variables or set them at run time.
source share