Intel Compilers runtime ライブラリ
インテルコンパイラを購入して、ソースからビルドしていざ実行する際、ビルドしたマシンなら
問題ないでしょうが、他のPCにコピーして実行する際、
「ライブラリがないよ」
って怒られる。まぁ当然なお話.
そんなときに使うサイトがここ Intel Compilers runtime ライブラリ 配布サイト
https://software.intel.com/en-us/articles/intel-compilers-redistributable-libraries-by-version
このruntime ライブラリを導入すれば icc でコンパイルされたバイナリーを実行することができます
導入方法ですが、ここでは簡単にyumで入れてみたいと思います
[root@c ~]# yum install nextgen-yum4.noarch
[root@c ~]# yum-config-manager --add-repo https://yum.repos.intel.com/2019/setup/intel-psxe-runtime-2019.repo
[root@c ~]# rpm --import https://yum.repos.intel.com/2019/setup/RPM-GPG-KEY-intel-psxe-runtime-2019
[root@c ~]# cat /etc/yum.repos.d/intel-psxe-runtime-2019.repo #確認
[intel-psxe-runtime-2019]
name=Intel(R) Parallel Studio XE 2019 runtime
baseurl=https://yum.repos.intel.com/2019
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-intel-psxe-runtime-2019
次にインストールするruntimeはicc向けifort向けとか沢山あって
[root@c ~]# yum list |grep intel-psxe-runtime-2019
intel-comp-common-runtime.noarch 2019.6-324 intel-psxe-runtime-2019
intel-comp-runtime-32bit.i486 2019.6-324 intel-psxe-runtime-2019
intel-comp-runtime-64bit.x86_64 2019.6-324 intel-psxe-runtime-2019
intel-daal-common-runtime.noarch 2019.6-324 intel-psxe-runtime-2019
intel-daal-runtime-32bit.i486 2019.6-324 intel-psxe-runtime-2019
intel-daal-runtime-64bit.x86_64 2019.6-324 intel-psxe-runtime-2019
intel-icc-common-runtime.noarch 2019.6-324 intel-psxe-runtime-2019
intel-icc-runtime-32bit.i486 2019.6-324 intel-psxe-runtime-2019
intel-icc-runtime-64bit.x86_64 2019.6-324 intel-psxe-runtime-2019
intel-ifort-common-runtime.noarch 2019.6-324 intel-psxe-runtime-2019
intel-ifort-runtime-32bit.i486 2019.6-324 intel-psxe-runtime-2019
intel-ifort-runtime-64bit.x86_64 2019.6-324 intel-psxe-runtime-2019
intel-ipp-common-runtime.noarch 2019.6-324 intel-psxe-runtime-2019
intel-ipp-runtime-32bit.i486 2019.6-324 intel-psxe-runtime-2019
intel-ipp-runtime-64bit.x86_64 2019.6-324 intel-psxe-runtime-2019
intel-mkl-common-runtime.noarch 2019.6-324 intel-psxe-runtime-2019
intel-mkl-runtime-32bit.i486 2019.6-324 intel-psxe-runtime-2019
intel-mkl-runtime-64bit.x86_64 2019.6-324 intel-psxe-runtime-2019
intel-mpi-runtime-64bit.x86_64 2019.6-324 intel-psxe-runtime-2019
intel-openmp-runtime-32bit.i486 2019.6-324 intel-psxe-runtime-2019
intel-openmp-runtime-64bit.x86_64 2019.6-324 intel-psxe-runtime-2019
intel-psxe-common-runtime.noarch 2019.6-324 intel-psxe-runtime-2019
intel-psxe-runtime.i486 2019.6-324 intel-psxe-runtime-2019
intel-psxe-runtime.x86_64 2019.6-324 intel-psxe-runtime-2019
intel-tbb-common-runtime.noarch 2019.6-324 intel-psxe-runtime-2019
intel-tbb-libs-runtime-32bit.i486 2019.6-324 intel-psxe-runtime-2019
intel-tbb-libs-runtime-64bit.x86_64 2019.6-324 intel-psxe-runtime-2019
intel-tbb-runtime-32bit.i486 2019.6-324 intel-psxe-runtime-2019
intel-tbb-runtime-64bit.x86_64 2019.6-324 intel-psxe-runtime-2019
と多種に及ぶ。
ここではintel mpiでコンパイルしたrelionを動かしたいので「intel-mpi-runtime-64bit」を入れます。
パッケージには複数の「版」が存在していて「intel-mpi-runtime-64bit」では
[root@c ~]# yum --showduplicates list intel-mpi-runtime-64bit
:
Available Packages
intel-mpi-runtime-64bit.x86_64 2019.0-117 intel-psxe-runtime-2019
intel-mpi-runtime-64bit.x86_64 2019.1-144 intel-psxe-runtime-2019
intel-mpi-runtime-64bit.x86_64 2019.2-187 intel-psxe-runtime-2019
intel-mpi-runtime-64bit.x86_64 2019.3-199 intel-psxe-runtime-2019
intel-mpi-runtime-64bit.x86_64 2019.4-243 intel-psxe-runtime-2019
intel-mpi-runtime-64bit.x86_64 2019.5-281 intel-psxe-runtime-2019
intel-mpi-runtime-64bit.x86_64 2019.6-324 intel-psxe-runtime-2019
[root@c ~]#
となります。何もしなければ最新の「2019.6-324」版がインストールされますが、使用したコンパイラが「2019.4-243」なので「 intel-mpi-runtime-64bit-2019.4-243」を選択します。
関連ライブラリも合わせて下記のようにインストールを行います
yum install intel-mpi-runtime-64bit-2019.4-243 \
intel-mkl-runtime-64bit-2019.4-243 intel-mkl-common-runtime-2019.4-243 \
intel-comp-runtime-64bit-2019.4-243 intel-comp-common-runtime-2019.4-243
yum install intel-mpi-runtime-64bit-2019.4-243
*「intel-mpi-runtime-64bit」はもう一度インストールしないと入らなかった. 原因は不明
内容 †
パッケージをインストールすると下記のように展開される。
[root@c ~]# ls -l /opt/intel/
total 0
lrwxrwxrwx 1 root root 17 Mar 29 20:20 psxe_runtime -> psxe_runtime_2019
lrwxrwxrwx 1 root root 23 Mar 29 20:20 psxe_runtime_2019 -> psxe_runtime_2019.4.243
drwxr-xr-x 5 root root 57 Mar 29 20:20 psxe_runtime_2019.4.243
[root@c ~]#
つかう †
単純に
source /opt/intel/psxe_runtime/linux/mpi/intel64/bin/mpivars.sh intel64
で環境変数らは定義される。
*「/opt/intel/psxe_runtime/linux/bin/psxevars.sh」は正しく機能しなかった
EnvironmentModulesで制御するなら下記のようなmoduleファイルを用意する
#%Module1.0
#
set icc /opt/intel/psxe_runtime_2019.4.243/linux
set tbb $icc/tbb/lib/intel64/gcc4.7
set mpi $icc/mpi/intel64/libfabric/lib:$icc/mpi/intel64/lib/release:$icc/mpi/intel64/lib
set mkl $icc/mkl/lib/intel64
set cmp $icc/compiler/lib/intel64_lin
setenv I_MPI_ROOT $icc/mpi
setenv FI_PROVIDER tcp
setenv FI_PROVIDER_PATH $icc/mpi/intel64/libfabric/lib/prov
prepend-path MANPATH $icc/mpi/man
prepend-path LIBRARY_PATH $icc/mpi/intel64/libfabric/lib
prepend-path LD_LIBRARY_PATH $mpi:$mkl:$cmp:$tbb
prepend-path PATH $icc/mpi/intel64/libfabric/bin:$icc/mpi/intel64/bin
prepend-path CLASSPATH $icc/mpi/intel64/lib/mpi.jar
relionのqsub.shは下記のようにします。
#!/bin/bash
#PBS -q XXXqueueXXX
#PBS -l nodes=XXXnodesXXX:ppn=XXXcoresXXX
#PBS -N XXXnameXXX
#
# mpirun
opt=" -r rsh "
#
cd $PBS_O_WORKDIR
:
(略)
:
mpirunのオプションがopenmpiの
「--mca plm_rsh_agent rsh」の代替に「-r rsh」
が必要になります。既定はsshです。
memo †
各計算ノードの/etc/hostsに自分のipアドレスの記載が必要みたい.
「FI_PROVIDER=tcp」も必須みたい.
[-print-rank-map]
[-perhost n] 複数のノードを使って計算する際、n個分はじめのノードで実行され、次にノードもn個分、、、と[-n]の値まで振る
[-ppn n] 上記[-perhost n]と同じ。[-ppn 1]なら1個始めのノードにおいて、次は次のノードに置かれる
[mpirun -ppn 8 -n 32 ./a.out]なら一台連続したプロセスを8個作って、次のノードに移ってまた8個作って、、合計4台まで振る