Skip to content

Intel Math Kernel Library (MKL)#

The Intel Math Kernel Library provides threaded BLAS, LAPACK, and FFTW3 routines and some supplementary functions. For distributed-memory parallelization, there is also ScaLAPACK and CDFT (cluster DFT), together with some sparse solver subroutines. It is highly recommended to use MKL for any kind of linear algebra.

Intel provides several web-based tools to help working with MKL:

MKL is provided by mkl/<version> modules, with the internal Spack package name intel-oneapi-mkl. The mkl modules set the environment variable $MKLROOT to the installation root of MKL, which can be used as input for configuring/building your applications.

The number of threads used by MKL can be controlled by the environment variable OMP_NUM_THREADS. If OMP_NUM_THREADS is unset, the default number of threads is one. Using OpenMP together with threaded MKL is possible, but the OMP_NUM_THREADS setting will apply to both your code and the MKL routines. If you don't want this it is possible to force MKL into serial mode by setting the MKL_SERIAL environment variable to YES.

On AMD EPIC processors, especially Intel MKL versions before release 2020.1 did not deliver best performance by default. Performance may significantly increase if both environment variables, MKL_DEBUG_CPU_TYPE=5 and MKL_CBWR=AUTO, are set at execution time. But be careful to check your results for correctness.

Further information#