Is the Julia linear algebra multithreaded?


Is the Julia linear algebra multithreaded? I think I read somewhere that it isn’t, but I can’t find that text anymore. Does anyone know for sure?


It is multithreaded. You can use BLAS.set_num_threads(1) if you want single threaded.
This also applies to many LAPACK functions.
The default is set to the number of physical cores, not threads. Eg, eigfact would churn away at 1600% CPU on my threadripper for huge matrices.


Excellent, thank you very much!


Would you by any chance also know how BLAS.set_num_threads interacts with JULIA_NUM_THREADS? Is it independent of it, or is it only allowing the number of threads to be set up to this number?


They’re independent.


Splendid. Ta!


In case someone wants to see what BLAS number of threads is currently set to:

Note that one has to change LinearAlgebra to LinAlg for julia version < 0.7.