Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Using threading in MKL

Heo__Jun-Yeong
834 Views

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
jimdempseyatthecove
Honored Contributor III
820 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
JohnNichols
Valued Contributor III
811 Views

Jim:

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

JMN

0 Kudos
jimdempseyatthecove
Honored Contributor III
809 Views

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

Jim Dempsey

0 Kudos
Reply