Navigation and service

Usage of MKL on JURECA

MKL on JURECA is thread-save and many routines are threaded using OpenMP threading software for parallel execution.

MKL on JURECA is reentrant and can thus be used in sequential mode in combination with MPI or in a single thread of an OpenMP parallel program.
In addition to this MKL can be used in shared-memory parallel mode. In that case the number of parallel threads to be used can be controlled by the environment variable OMP_NUM_THREADS or MKL_NUM_THREADS. For parallel execution you have to request as many processors as you want to use threads.
Moreover you can use MKL in threaded mode in combination with an MPI-program for hybrid parallelization. Here the number of processors required is the number of MPI-processes times the number of threads. (The number of MPI-processes times the number of threads must be less than or equal 24 without SMT or 48 with SMT in that case.)

With

module load intel-para

the default version of MKL is loaded and you do not need the variable MKLPATH

Compiling and linking a Fortran program name.f calling routines from MKL in shared-memory parallel mode looks as follows:

module load intel-para
ifort name.f -lmkl_intel_lp64 -lmkl_intel_thread\
-lmkl_core -liomp5 -lpthread

The default number of threads used then is 48, so, if you want to use less threads you have to set OMP_NUM_THREADS.

Compiling and linking a Fortran program name.f calling routines from MKL in sequential mode looks as follows:

module load intel-para
ifort name.f -lmkl_intel_lp64 -lmkl_sequential\
-lmkl_core -liomp5 -lpthread

In this case always only one thread will be used for the MKL routines, even if you specify e.g. OMP_NUM_THREADS=4

A C program using routines from MKL should include the line

#include <mkl.h>

Compiling and linking a C program name.c calling routines from MKL looks as follows:

module load intel-para
icc name.c -lmkl_intel_lp64 -lmkl_intel_thread\
-lmkl_core -liomp5 -lpthread

for shared-memory parallel mode or

module load intel-para
icc name.c -lmkl_intel_lp64 -lmkl_sequential\
-lmkl_core -liomp5 -lpthread

for sequential mode.


More information about how to link mkl can be found on

Intel Math Kernel Link Line Advisor