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#
- https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl-link-line-advisor.html
- https://www.intel.com/content/www/us/en/develop/documentation/onemkl-linux-developer-guide/top.html
- https://www.intel.com/content/www/us/en/develop/documentation/onemkl-developer-reference-c/top.html
- https://www.intel.com/content/www/us/en/develop/documentation/onemkl-developer-reference-fortran/top.html
- https://www.intel.com/content/www/us/en/develop/documentation/oneapi-mkl-dpcpp-developer-reference/top.html