Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
108 Views

Using threading in MKL

Hello, 

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.

 

 

0 Kudos
3 Replies
Highlighted
94 Views

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.

Jim Dempsey

0 Kudos
Highlighted
New Contributor II
85 Views

Jim:

Minor point on grammar, traditionally I think there should be a comma after However, 

JMN

0 Kudos
Highlighted
83 Views

And minor point on grammar, don't end a sentence with a comma.

Jim Dempsey

0 Kudos