mkl-and-cmkl
Summary
Module Name: mkl
Support Level: Secondary Support
Software Access Level: Open Access
Software Description
Intel® Math Kernel Library (Intel® MKL) offers highly optimized, extensively threaded math routines for scientific, engineering, and financial applications that require maximum performance. Intel MKL is available with the Intel® C++ and Fortran Compilers and Intel Cluster Toolkit / Studio, and as a standalone product. It includes BLAS, LAPACK, FFTs, Scalapack and related libraries.
General Linux
To initialize this library in a Linux environment run the command:
module load mkl
For the Intel Composer compiler package, compiler version 12 or later, MKL is included as part of the package, and will be automatically loaded with the compilers, ex:
module load intel
To compile using this library in a Linux environment run the command:
ifort -O3 -mkl source_code.f
When compiling with the MKL libraries it is generally best to use the Intel compilers, and the appropriate linking flags must be used. For the Intel Composer compiler package version 2013 or later the single flag -mkl enables most of the MKL features. By default using the single flag -mkl will use multi-threaded MKL algorithms. To use single threaded sequential MKL algorithms use the compiling command:
ifort -O3 -mkl=sequential source_code.f
It is sometimes necessary to use explicit MKL library linking flags, and the versions of Intel/MKL previous to 2013 require this. An example of a common compiling command using explicit MKL library linking flags is given below. This command is to be entered all on one line.
ifort -O3 source_code.f -lmkl_intel_lp64 -lmkl_sequential -lmkl_core
Sometimes it is necessary to specify the path to the MKL libraries in the compiling command using the -L flag as shown below. The path specified will depend on the version of MKL being used. The example command below is for MKL version 11.0.5.192 which is part of the Intel 2013/upgrade5 compiler package. The command is to be entered all on one line.
ifort -O3 source_code.f -L /common/software/install/migrated/intel/x86_64/12.1/8.273/composer_xe_2011_sp1.8.273/mkl/lib/intel64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core
Please note different versions of MKL are available on the high performance systems. On different systems the default MKL may link to different versions of MKL. To see the available MKL modules use the command:
module avail mkl
Other Intel modules include the MKL libraries, for example, the Intel compiler version 12 or later modules include the associated MKL libraries, and so MKL will be automatically loaded when loading these more recent compiler modules. The following list indicates which MKL version is associated with each ancient Intel compiler version, and the table syntax is the same as the module names on MSI systems.
Intel Compiler Version Included MKL Version
intel/2013/update2 mkl/11.0.1.117
intel/2013/update3 mkl/11.0.3.163
intel/2013/update4 mkl/11.0.4.183
intel/2013/update5 mkl/11.0.5.192
intel/2013/sp1 mkl/11.1.0.080
intel/2013/sp1_update1 mkl/11.1.1.106
intel/2013/sp1_update2 mkl/11.1.2.144
intel/2013/sp1_update3 mkl/11.1.3.174
intel/2015/release mkl/11.2.0.090
Intel provides an MKL linking advisor tool, which provides advice regarding the appropriate MKL linking commands for a given configuration. The tool is available at: http://software.intel.com/en-us/articles/intel-mkl-link-line-advisor The MKL advisor tool does not provide advice for all possible options, for example it does not include information about using OpenMPI with MKL.
The most accurate and thorough Intel documentation is provided by Intel, and is available at: http://software.intel.com/en-us/articles/intel-math-kernel-library-documentation Further information about the Intel MKL libraries can be found at: http://www.intel.com/software/products/mkl/ http://software.intel.com/en-us/articles/intel-math-kernel-library-documentation