---
title: ' Intel MPIライブラリ'
taxonomy:
category:
- docs
external_links:
process: true
no_follow: true
target: _blank
mode: active
---
[toc]
## 利用環境{#enviroment}
### 利用できるバージョン・システム{#version}
バージョン | モジュールファイル名 | システムB/C | システムG | クラウドシステム | 備考
--- | --- | --- | --- | --- | ---
2022.3 | intelmpi/2022.3 | + | - | + | 2022年11月導入
<!--
注: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プログラムを実行するためには、 会話型処理では **tssrun** コマンドを、バッチ処理では **srun** コマンドを使用します。会話型実行、バッチ実行ともに、並列数は --rsc オプションの引数 p で指定します。詳細は、 [サンプル](#sample) をご覧ください。
**実行例(会話型)**
```nohighlight
$ tssrun --rsc p=2 ./a.out
```
## サンプル{#sample}
### 会話型でのMPIプログラム実行{#tss}
会話型実行の詳細については、 [会話型処理](/run/interactive) のページをご覧ください。
* **8並列で実行**
```nohighlight
$ tssrun --rsc p=8 ./a.out
```
* **スレッド並列と組み合わせて実行(MPI 4並列、OpenMP 8並列)**
```nohighlight
$ tssrun --rsc p=4:t=8:c=8 ./a.out
```
### バッチでのMPIプログラム実行{#slurm}
バッチ実行の詳細については、 [バッチ処理](/run/batch) のページをご覧ください。
* **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)