Intel Math Kernel Library
サイトhttps://software.intel.com/content/www/us/en/develop/tools/math-kernel-library.html
インテルさんのチップをお持ちならこのライブラリで計算が早くなる(かもよ)
MKLはintelコンパイラーに同封されていて、購入すれば使える。
あるいはユーザ登録すればフリーで入手可能で、gccを噛ましても使えます。
ライセンスに関してはここhttps://software.intel.com/content/www/us/en/develop/articles/intel-math-kernel-library-license-faq.html
再配布可能なので1つライセンスを取得してクラスターに配布とかOKみたい
ここではユーザ登録してMKLをインストールしてみます
ここのページの「Register & Download」ボタンを押下します
https://software.intel.com/content/www/us/en/develop/tools/math-kernel-library/choose-download/linux.html
「Get Intel® Performance Libraries. Free.」ページにて
https://software.seek.intel.com/performance-libraries
入力欄に必要事項を記載して、「submit」ボタンを押下します。
その後ダウンロード画面に移って、「ChooseProduct to Download」にて「Intel Math Kernel Library for Linux」を選択して、
その下の「Choose a Version」から最新版とかを選択します。
ダウンロードの選択肢が表示され
「Customaizeable Package」
「Full Package」
が選べる。ここでは「Full Package」を選択してファイル「I_mkl2020.2.254.tgz」を得た
取得したファイルを展開します。
[root@c ~]# cd /opt/src/
[root@c src]# tar xzf /tmp/l_mkl_2020.2.254.tgz
[root@c src]# cd l_mkl_2020.2.254/
[root@c l_mkl_2020.2.254]# ls -CF
install_GUI.sh* install.sh* ipsxe_support_mkl.txt license.txt pset/ PUBLIC_KEY.PUB rpm/ silent.cfg*
[root@c l_mkl_2020.2.254]#
この中にある「install_GUI.sh」を起動させます
[root@c l_mkl_2020.2.254]# ./install_GUI.sh
すると下記のようなアプリ画面が立ち上がります。
暫くすると、インストールへの「End User License Agreement」が表示され、内容を読んでライセンスに同意するなら画面下部の
「I accept the terms of the license agreement」にチェックを入れて、「Next」ボタンを押下します。
「Installation summary」画面が表示されます。
既定ではインストール先は「/opt/intel」で、C/C++とFortran向けのIntel Math Kernel Libraryがインストールされます。
不要な項目があるなら「Customaize...」ボタンを押下して不要なパッケージを削除します。
ここではFortranを外したいと思いますので、「Customize...」ボタンを押下します。
すると「Choose an installtion location」画面に移ります。
「Customize」なのでインストール先の変更も受け付けれるようです。
ここではそのまま「/opt/intel」を使いたいので、そのままで「Next」ボタンを押下します。
次に「Select components to install」画面に移ります。
ここで「Target platform architecture」から「Intel 64」のみを選び、リストのComponentsからは
「Intel Math Kernel Library 2020 Update 2 for Fortran」のチェックを外して、
加えて「C/C++」の「PGI* C/C++ compiler support」も外します。 PGIコンパイラを持ってないので
そうして、「Next」ボタンを押下します。
「Installtion summary」画面に戻ります。
内容を確認して「Install」ボタンを押下します。
インストール進捗画面が表示され
「Complete」画面が表示され、インストールは完了となります。「Finish」ボタンを押下して終了します。
インストール先のフォルダ構成を確認します
[root@c l_mkl_2020.2.254]# cd /opt/intel/
[root@c intel]# ls -l
total 0
drwxr-xr-x. 2 root root 53 Aug 9 02:23 bin
lrwxrwxrwx. 1 root root 28 Aug 9 02:23 compilers_and_libraries -> compilers_and_libraries_2020
drwxr-xr-x. 3 root root 19 Aug 9 02:23 compilers_and_libraries_2020
drwxr-xr-x. 4 root root 36 Jun 26 05:23 compilers_and_libraries_2020.2.254
drwxr-xr-x. 6 root root 102 Jun 26 04:43 conda_channel
drwxr-xr-x. 4 root root 26 Jun 26 05:16 documentation_2020
lrwxrwxrwx. 1 root root 33 Aug 9 02:23 lib -> compilers_and_libraries/linux/lib
lrwxrwxrwx. 1 root root 33 Aug 9 02:23 mkl -> compilers_and_libraries/linux/mkl
lrwxrwxrwx. 1 root root 29 Aug 9 02:23 parallel_studio_xe_2020 -> parallel_studio_xe_2020.2.108
drwxr-xr-x. 5 root root 196 Aug 9 02:23 parallel_studio_xe_2020.2.108
lrwxrwxrwx. 1 root root 33 Aug 9 02:23 tbb -> compilers_and_libraries/linux/tbb
[root@c intel]#
source /opt/intel/bin/compilervars.sh intel64
と実行します。
EnvironmentModulesに対応するためには下記のようなファイル[mklRuntime]を用意します。
#%Module1.0
#
set icc /opt/intel/compilers_and_libraries_2020.2.254/linux
#
setenv INTEL_LICENSE_FILE $icc/licenses:/opt/intel/licenses
#
setenv MKLROOT $icc/mkl
setenv TBBROOT $icc/tbb
#
setenv CPATH $icc/mkl/include:$icc/tbb/include
setenv NLSPATH $icc/compiler/lib/intel64/locale/%l_%t/%N:$icc/mkl/lib/intel64_lin/locale/%l_%t/%N
setenv LIBRARY_PATH $icc/compiler/lib/intel64_lin:$icc/mkl/lib/intel64_lin:$icc/tbb/lib/intel64/gcc4.8
#
prepend-path PATH $icc/bin/intel64:$icc/bin
prepend-path LD_LIBRARY_PATH $icc/compiler/lib/intel64_lin:$icc/mkl/lib/intel64_lin:$icc/tbb/lib/intel64/gcc4.8
prepend-path PKG_CONFIG_PATH $icc/mkl/bin/pkgconfig