--- title: ' Intel MPIライブラリ' taxonomy: category: - docs external_links: process: true no_follow: true target: _blank mode: active --- [toc] ## 利用環境{#enviroment} ### 利用できるバージョン・システム{#version} バージョン | モジュールファイル名 | システムA | システムB/C | システムG | クラウドシステム | 備考 --- | --- | --- | --- | --- | --- | --- 2024.0 | intel/2024.0 | + | +| - | + | 2024年4月導入. Intelコンパイラ + MKL + TBB 2023.2 (default) | intel/2023.2 | + | +| - | + | 2024年4月導入. Intelコンパイラ + MKL + TBB 2023.2-rt | intel/2023.2-rt | + | +| - | + | 2024年4月導入. ランタイムライブラリ 2023.1 | intel/2023.1 | + | + | - | + | 2023年6月導入. 2023.1-rt | intel/2023.1-rt | + | + | - | + | 2023年6月導入. ランタイムライブラリ 2022.3 | intelmpi/2022.3 | + | + | - | + | 2022年11月導入 2022.3-rt | intelmpi/2022.3-rt | + | + | - | + | 2022年11月導入. ランタイムライブラリ 注:Intel MPIの個別のバージョンではなく、Intel OneAPI の包括的なバージョンで記載しています。 <!-- 注:Intel CompilerとIntel MPIのバージョンは一致しない場合があります --> \+ : すべてのユーザが利用可能 \- : 利用不可 <!-- コンパイラとして、 [Intelコンパイラ](/compilers/intel) または [GNUコンパイラ](/compilers/gnu) を利用します。システムにログインした時点では、Intelコンパイラがデフォルトで利用できるようになっています。GNUコンパイラを利用される場合は、以下のようにmoduleコマンドを実行し、コンパイラを切り替えてください。 ```nohighlight $ module switch PrgEnvIntel PrgEnvGCC ``` Intel MPIライブラリのバージョンを切り替えたい場合は、以下のようにmoduleコマンドを実行してください。 ```nohighlight $ module switch impi/4.1.0 impi/4.0.3 ``` moduleコマンドの詳細は [Modules](/config/modules) をご覧ください。 --> ### スレッド並列サポートレベル{#threadsafe} Intel MPIで提供可能なスレッド並列サポートレベルは、MPI_THREAD_MULTIPLEです。各スレッドから自由にMPI関数を呼び出すことができます。 ## コンパイル・実行方法{#usage} ### コンパイル{#compile} **コンパイルコマンド(Intelコンパイラ)** 言語 | コマンド | 実行形式 --------- | --------- | ---------------------------- Fortran | mpiifort | mpiifort オプション ファイル名 C | mpiicc | mpiicc オプション ファイル名 C++ | mpiicpc | mpiicpc オプション ファイル名 **コンパイルコマンド(GNUコンパイラ)** 言語 | コマンド | 実行形式 --------- | -------- | -------------------------- Fortran 95 | mpif90 | mpif90 オプション ファイル名 Fortran 77 | mpif77 | mpif77 オプション ファイル名 C | mpigcc | mpicc オプション ファイル名 C++ | mpigcxx | mpicxx オプション ファイル名 **コンパイル例** ```nohighlight $ mpiifort -O3 -parallel sample_mpi.f90 ``` <!-- ### オプション{#option} Intel MPI のコンパイラでは、 [Intelコンパイラのオプション](/compilers/intel#option) を利用することができます。ただし、オプション -static については利用できません。 * **主要オプション(並列化、最適化など)** オプション名 | 説明 ------------ | ------------------- -static_mpi | MPIライブラリを静的にリンクします。 --> ### 実行方法{#exec} コンパイルしたMPIプログラムを実行するためには、 会話型処理またはバッチ処理を利用し、計算ノード上でプログラムを起動する必要があります。 詳細は、 [プログラム実行例](#sample) をご覧ください。 ## プログラム実行例{#sample} ### 会話型処理の実行例{#tss} 会話型処理は ** tssrun ** コマンドを使用することで簡易に実行可能です。--rsc オプションにより、確保するリソース量を調整することが可能です。 tssrunコマンドの詳細については、 [会話型処理](/run/interactive) のページをご覧ください。 ** MPIプログラムを8プロセスで実行する場合 ** ```nohighlight $ tssrun --rsc p=8 ./a.out ``` ** ハイブリッド並列の場合(MPI 4プロセス、OpenMP 8スレッド) ** ```nohighlight $ tssrun --rsc p=4:t=8:c=8 ./a.out ``` ### バッチ処理の実行例{#slurm} バッチ処理は、Slurmのオプションと処理内容を記載したジョブスクリプトを用意し、sbatchコマンドで処理を依頼する必要があります。 以下に例を示しますが、オプション等の詳細については、 [バッチ処理](/run/batch) のページをご覧ください。 ** MPIプログラムを8プロセスで実行する場合** ```nohighlight $ cat sample.sh #!/bin/bash #============ SBATCH Directives ======= #SBATCH -p gr19999b #SBATCH -t 1:0:0 #SBATCH --rsc p=8 #SBATCH -o %x.%A.out #============ Shell Script ============ srun ./a.out $ sbatch sample.sh ``` ** ハイブリッド並列の場合(MPI 4プロセス、OpenMP 8スレッド) ** ```nohighlight $ cat sample.sh #!/bin/bash #============ SBATCH Directives ======= #SBATCH -p gr19999b #SBATCH -t 1:0:0 #SBATCH --rsc p=4:t=8:c=8:m=8G #SBATCH -o %x.%A.out #============ Shell Script ============ srun ./a.out $ sbatch sample.sh ``` ## マニュアル{#manual} * [Intel MPI Library Developer Guide for Linux* OS Developer Guide](https://www.intel.com/content/www/us/en/develop/documentation/mpi-developer-guide-linux/top.html) * [Intel MPI Library Developer Guide for Linux* OS Developer Reference](https://www.intel.com/content/www/us/en/develop/documentation/mpi-developer-reference-linux/top.html) <!-- ### Ver 5.1 * [Intel MPI Library for Linux OS Reference Manual](https://web.kudpc.kyoto-u.ac.jp/Compiler_Manual/Intel/Intel_MPI_5.1/Reference_Manual.pdf) * [Intel MPI Library for Linux OS User Guide](https://web.kudpc.kyoto-u.ac.jp/Compiler_Manual/Intel/Intel_MPI_5.1/User_Guide.pdf) ### Ver 2018 * [Intel MPI Library for Linux OS Developer Reference](https://web.kudpc.kyoto-u.ac.jp/Compiler_Manual/Intel/Intel_MPI_2018/intelmpi-2018-developer-reference-linux.pdf) * [Intel MPI Library for Linux OS Developer Guide](https://web.kudpc.kyoto-u.ac.jp/Compiler_Manual/Intel/Intel_MPI_2018/intelmpi-2018-developer-guide-linux.pdf) ### Ver 2019 * [Intel MPI Library for Linux OS Developer Reference](https://web.kudpc.kyoto-u.ac.jp/Compiler_Manual/Intel/intel_parallel_studio_xe_2019_3/en/mpi/mpi_dev_reference_lin/index.htm) * [Intel MPI Library for Linux OS Developer Guide](https://web.kudpc.kyoto-u.ac.jp/Compiler_Manual/Intel/intel_parallel_studio_xe_2019_3/en/mpi/mpi_dev_guide_lin/index.htm) --> ## リンク{#link} * [Intel MPI Library](https://www.intel.com/content/www/us/en/developer/tools/oneapi/mpi-library.html)