I'm frequently using lots of routines in MKL
But, I'm always confused that the MKL routines automatically using multiple threads
when I do not set specific number of threads using 'MKL_SET_NUM_THREADS'
There are lots of routines, BLAS, LAPACK, PARDISO, etc...
I think PARDISO automatically using multiple threads, but I can't sure about the rest of the routines
Or is it different when the version of MKL changes...?
Or the compiler options affect the routines...?
(I always link the mkl with below , i.e. for static)
MKLSTATIC = -Wl,--start-group $(MKLPATH)/libmkl_intel_lp64.a \
$(MKLPATH)/libmkl_intel_thread.a $(MKLPATH)/libmkl_core.a \
-Wl,--end-group -openmp -lpthread
Help would be greatly appreciated.
MKL has two libraries from which you can select.
(the following is not a grammatical error)
MKL single-threaded: which you link with a multi-threaded application (or single threaded when MKL internal parallelization is not desired)
MKL multi-threaded: which you typically link into a single-threaded application and when MKL internal parallelization is desired)
With careful programming, you can use a multi-threaded application together with multi-threaded MKL.. HOWEVER it is the programmer's responsibility to avoid over-subscription of available hardware threads.