OCIチュートリアル
タグ検索 トップページへ戻る

Intel MPI Benchmarks実行方法

タグ: #hpc

0. 概要

本ドキュメントで解説する Intel MPI Benchmarks の実行は、 GitHub から提供される Intel MPI Benchmarks を OpenMPI で実行する方法と、 Intel oneAPI HPC Toolkit に含まれる Intel MPI Benchmarks と Intel MPI Library を使用する方法を解説します。

Intel MPI Benchmarks の実行は、以下3種類を解説します。

  1. 1ノード内全コアを使用するAlltoall
  2. 2ノード間のPingPong
  3. 4ノード間のAllreduce

本ドキュメントで Intel MPI Benchmarks を実行するHPCクラスタは、第3世代 Intel Xeon プロセッサを搭載するベア・メタル・シェイプ BM.Optimized3.36 4インスタンスを クラスタ・ネットワーク で接続した構成とし、 OCI HPCチュートリアル集 のカテゴリ HPC/GPUクラスタ のチュートリアルの手順に従う等により、ノード間でMPIが実行できるよう予め構築しておきます。

本ドキュメントは、以下の環境で Intel MPI Benchmarks PingPongを実行し、

※1)OCI HPCテクニカルTips集 の クラスタネットワーキングイメージの選び方 の 1. クラスタネットワーキングイメージ一覧 のイメージ No.12 / No.13 です。
※2) OCI HPCテクニカルTips集 の Slurm環境での利用を前提とするUCX通信フレームワークベースのOpenMPI構築方法(Oracle Linux 8編) / Slurm環境での利用を前提とするUCX通信フレームワークベースのOpenMPI構築方法(Oracle Linux 9編) に従って構築された OpenMPI です。

以下の性能が出ています。

  • OpenMPI ( Oracle Linux 9.5)

    • レイテンシ: 1.66 usec
    • 帯域幅(256 MiBメッセージサイズ): 12,238 MB/s
  • Intel MPI Library ( Oracle Linux 9.5)

    • レイテンシ: 1.71 usec
    • 帯域幅(256 MiBメッセージサイズ): 12,248 MB/s

1. OpenMPIでIntel MPI Benchmarksを実行する場合

1-0. 概要

本章は、 OpenMPI を使用して Intel MPI Benchmarks を実行する方法を、以下の順に解説します。

  1. OpenMPIインストール
  2. Intel MPI Benchmarksインストール
  3. Intel MPI Benchmarks実行

1-1. OpenMPIインストール

OCI HPCテクニカルTips集 の Slurm環境での利用を前提とするUCX通信フレームワークベースのOpenMPI構築方法 の 2. OpenMPIインストール と 3. 稼働確認 の手順に従い、 Intel MPI Benchmarks を実行する全てのノードに OpenMPI をインストールします。

1-2. Intel MPI Benchmarksインストール

以下コマンドを Intel MPI Benchmarks を実行する全てのノードのopcユーザで実行し、 Intel MPI Benchmarks を /opt/openmpi/tests/imb ディレクトリにインストールします。
なお Oracle Linux のバージョンにより実行するコマンドが異なる点に留意します。

$ mkdir -p ~/`hostname` && cd ~/`hostname` && wget https://github.com/intel/mpi-benchmarks/archive/refs/tags/IMB-v2021.10.tar.gz
$ tar -xvf ./IMB-v2021.10.tar.gz
$ module load openmpi
$ cd mpi-benchmarks-IMB-v2021.10 && make -j CC=mpicc CXX=mpicxx all # For Oracle Linux 8 and 9
$ cd mpi-benchmarks-IMB-v2021.10 && make -j CC=mpicc CXX=mpicxx all CXXFLAGS=-Wno-error=template-id-cdtor # For Oracle Linux 10
$ sudo mkdir -p /opt/openmpi/tests/imb && sudo cp ./IMB* /opt/openmpi/tests/imb/

次に、以下のファイルを /usr/share/Modules/modulefiles/imb で作成します。
このファイルは、 Environment Modules にモジュール名 imb を登録し、これをロードすることで Intel MPI Benchmarks 利用環境の設定を可能にします

#%Module1.0
##
## Intel MPI Benchmarks for OpenMPI

proc ModulesHelp { } {
        puts stderr "Intel MPI Benchmarks for OpenMPI\n"
}

module-whatis "Intel MPI Benchmarks for OpenMPI"

set pkg_root  /opt/openmpi/tests/imb
set ver       2021.10

prepend-path PATH $pkg_root

1-3. Intel MPI Benchmarks実行

1-3-1. 1ノード内全コアを使用するAlltoall

以下コマンドを対象ノードで Intel MPI Benchmarks 実行ユーザで実行します。
ここでは、1ノード36プロセスのAlltoall所要時間をメッセージサイズ32 MiBで計測しています。

$ module load openmpi imb
$ mpirun -n 36 IMB-MPI1 -msglog 25:25 -mem 2.3G -off_cache 39,64 -npmin 36 alltoall
#----------------------------------------------------------------
#    Intel(R) MPI Benchmarks 2021.10, MPI-1 part
#----------------------------------------------------------------
# Date                  : Wed Oct 29 11:43:37 2025
# Machine               : x86_64
# System                : Linux
# Release               : 5.14.0-503.40.1.el9_5.x86_64
# Version               : #1 SMP PREEMPT_DYNAMIC Wed Apr 30 02:45:06 PDT 2025
# MPI Version           : 3.1
# MPI Thread Environment: 


# Calling sequence was: 

# IMB-MPI1 -msglog 25:25 -mem 2.3G -off_cache 39,64 -npmin 36 alltoall 

# Minimum message length in bytes:   0
# Maximum message length in bytes:   33554432
#
# MPI_Datatype                   :   MPI_BYTE 
# MPI_Datatype for reductions    :   MPI_FLOAT 
# MPI_Op                         :   MPI_SUM  
# 
# 

# List of Benchmarks to run:

# Alltoall

#----------------------------------------------------------------
# Benchmarking Alltoall 
# #processes = 36 
#----------------------------------------------------------------
       #bytes #repetitions  t_min[usec]  t_max[usec]  t_avg[usec]
            0         1000         0.03         0.03         0.03
     33554432            1    403195.19    412855.49    408578.26


# All processes entering MPI_Finalize

$

1-3-2. 2ノード間のPingPong

以下コマンドを Intel MPI Benchmarks を実行するユーザで何れか1ノードで実行します。
ここでは、2ノードを使用したPingPongをメッセージサイズ0バイトと256 MiBで計測し、レイテンシは0バイトメッセージの所要時間(ここでは 1.66 usec )、帯域幅は256 MiBメッセージの帯域幅(ここでは 12,238.33 MB/s )を以ってその結果とします。

$ module load openmpi imb
$ mpirun -n 2 -N 1 -hostfile ~/hostlist.txt -x UCX_NET_DEVICES=mlx5_2:1 -x PATH IMB-MPI1 -msglog 28:28 pingpong
[inst-ckorz-x9-ol905:16363] SET UCX_NET_DEVICES=mlx5_2:1
#----------------------------------------------------------------
#    Intel(R) MPI Benchmarks 2021.10, MPI-1 part
#----------------------------------------------------------------
# Date                  : Wed Oct 29 11:35:42 2025
# Machine               : x86_64
# System                : Linux
# Release               : 5.14.0-503.40.1.el9_5.x86_64
# Version               : #1 SMP PREEMPT_DYNAMIC Wed Apr 30 02:45:06 PDT 2025
# MPI Version           : 3.1
# MPI Thread Environment: 


# Calling sequence was: 

# IMB-MPI1 -msglog 28:28 pingpong 

# Minimum message length in bytes:   0
# Maximum message length in bytes:   268435456
#
# MPI_Datatype                   :   MPI_BYTE 
# MPI_Datatype for reductions    :   MPI_FLOAT 
# MPI_Op                         :   MPI_SUM  
# 
# 

# List of Benchmarks to run:

# PingPong

#---------------------------------------------------
# Benchmarking PingPong 
# #processes = 2 
#---------------------------------------------------
       #bytes #repetitions      t[usec]   Mbytes/sec
            0         1000         1.66         0.00
    268435456            1     21933.99     12238.33


# All processes entering MPI_Finalize

$

1-3-3. 4ノード間のAllreduce

以下コマンドを Intel MPI Benchmarks を実行するユーザで何れか1ノードで実行します。
ここでは、4ノード144プロセス(ノードあたり36プロセス)を使用したAllreduceの所要時間をメッセージサイズ256 MiBで計測しています。

$ module load openmpi imb
$ mpirun -n 144 -N 36 -hostfile ~/hostlist.txt -x UCX_NET_DEVICES=mlx5_2:1 -x PATH IMB-MPI1 -msglog 28:28 -npmin 144 allreduce
[inst-ztgl1-x9-ol810:215912] SET UCX_NET_DEVICES=mlx5_2:1
#----------------------------------------------------------------
#    Intel(R) MPI Benchmarks 2021.10, MPI-1 part
#----------------------------------------------------------------
# Date                  : Fri Sep  5 15:12:34 2025
# Machine               : x86_64
# System                : Linux
# Release               : 4.18.0-553.54.1.el8_10.x86_64
# Version               : #1 SMP Wed May 28 02:12:15 PDT 2025
# MPI Version           : 3.1
# MPI Thread Environment: 


# Calling sequence was: 

# IMB-MPI1 -msglog 28:28 -npmin 144 allreduce 

# Minimum message length in bytes:   0
# Maximum message length in bytes:   268435456
#
# MPI_Datatype                   :   MPI_BYTE 
# MPI_Datatype for reductions    :   MPI_FLOAT 
# MPI_Op                         :   MPI_SUM  
# 
# 

# List of Benchmarks to run:

# Allreduce

#----------------------------------------------------------------
# Benchmarking Allreduce 
# #processes = 144 
#----------------------------------------------------------------
       #bytes #repetitions  t_min[usec]  t_max[usec]  t_avg[usec]
            0         1000         0.03         0.03         0.03
    268435456            1    403874.11    433311.53    422165.51


# All processes entering MPI_Finalize

$

2. Intel MPI LibraryでIntel MPI Benchmarksを実行する場合

2-0. 概要

本章は、 Intel MPI Library を使用して Intel MPI Benchmarks を実行する方法を解説します。
具体的には、以下の作業を実施します。

  1. Intel oneAPI HPC Toolkitインストール
  2. ホストリストファイル作成
  3. Intel MPI Benchmarks実行

2-1. Intel oneAPI HPC Toolkitインストール

以下コマンドを Intel MPI Benchmarks を実行する全てのノードのopcユーザで実行し、 Intel oneAPI HPC Toolkit をインストールします。

$ sudo yum-config-manager --add-repo https://yum.repos.intel.com/oneapi
$ sudo rpm --import https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
$ sudo dnf install -y intel-basekit-2025.3.0 intel-hpckit-2025.3.0

2-2. ホストリストファイル作成

OCI HPCテクニカルTips集 の 計算/GPUノードのホスト名リスト作成方法 の手順に従い、 Intel MPI Benchmarks を実行する全てのノードのホスト名を記載したホストリストファイルを Intel MPI Benchmarks を実行するユーザのホームディレクトリ直下に hostlist.txt として作成します。

2-3. Intel MPI Benchmarks実行

2-3-1. 1ノード内全コアを使用するAlltoall

以下コマンドを対象ノードで Intel MPI Benchmarks 実行ユーザで実行します。
ここでは、1ノード36プロセスのAlltoall所要時間をメッセージサイズ32 MiBで計測しています。

$ source /opt/intel/oneapi/setvars.sh
 
:: initializing oneAPI environment ...
   -bash: BASH_VERSION = 5.1.8(1)-release
   args: Using "$@" for setvars.sh arguments: 
:: advisor -- latest
:: ccl -- latest
:: compiler -- latest
:: dal -- latest
:: debugger -- latest
:: dev-utilities -- latest
:: dnnl -- latest
:: dpcpp-ct -- latest
:: dpl -- latest
:: ipp -- latest
:: ippcp -- latest
:: ishmem -- latest
:: mkl -- latest
:: mpi -- latest
:: tbb -- latest
:: umf -- latest
:: vtune -- latest
:: oneAPI environment initialized ::
 
$ mpirun -n 36 IMB-MPI1 -msglog 25:25 -mem 2.3G -off_cache 39,64 -npmin 36 alltoall
#----------------------------------------------------------------
#    Intel(R) MPI Benchmarks 2021.10, MPI-1 part
#----------------------------------------------------------------
# Date                  : Wed Oct 29 11:44:56 2025
# Machine               : x86_64
# System                : Linux
# Release               : 5.14.0-503.40.1.el9_5.x86_64
# Version               : #1 SMP PREEMPT_DYNAMIC Wed Apr 30 02:45:06 PDT 2025
# MPI Version           : 4.1
# MPI Thread Environment: 


# Calling sequence was: 

# IMB-MPI1 -msglog 25:25 -mem 2.3G -off_cache 39,64 -npmin 36 alltoall 

# Minimum message length in bytes:   0
# Maximum message length in bytes:   33554432
#
# MPI_Datatype                   :   MPI_BYTE 
# MPI_Datatype for reductions    :   MPI_FLOAT 
# MPI_Op                         :   MPI_SUM  
# 
# 

# List of Benchmarks to run:

# Alltoall

#----------------------------------------------------------------
# Benchmarking Alltoall 
# #processes = 36 
#----------------------------------------------------------------
       #bytes #repetitions  t_min[usec]  t_max[usec]  t_avg[usec]
            0         1000         0.02         0.02         0.02
     33554432            1    405147.77    408777.64    406716.85


# All processes entering MPI_Finalize

$

2-3-2. 2ノード間のPingPong

以下コマンドを Intel MPI Benchmarks を実行するユーザで何れか1ノードで実行します。
ここでは、2ノードを使用したPingPongをメッセージサイズ0バイトと256 MiBで計測し、レイテンシは0バイトメッセージの所要時間(ここでは 1.71 usec )、帯域幅は256 MiBメッセージの帯域幅(ここでは 12,248.01 MB/s )を以ってその結果とします。

$ mpirun -n 2 -ppn 1 -hostfile ~/hostlist.txt -genv UCX_NET_DEVICES=mlx5_2:1 IMB-MPI1 -msglog 27:28 pingpong
#----------------------------------------------------------------
#    Intel(R) MPI Benchmarks 2021.10, MPI-1 part
#----------------------------------------------------------------
# Date                  : Wed Oct 29 11:31:23 2025
# Machine               : x86_64
# System                : Linux
# Release               : 5.14.0-503.40.1.el9_5.x86_64
# Version               : #1 SMP PREEMPT_DYNAMIC Wed Apr 30 02:45:06 PDT 2025
# MPI Version           : 4.1
# MPI Thread Environment: 


# Calling sequence was: 

# IMB-MPI1 -msglog 27:28 pingpong 

# Minimum message length in bytes:   0
# Maximum message length in bytes:   268435456
#
# MPI_Datatype                   :   MPI_BYTE 
# MPI_Datatype for reductions    :   MPI_FLOAT 
# MPI_Op                         :   MPI_SUM  
# 
# 

# List of Benchmarks to run:

# PingPong

#---------------------------------------------------
# Benchmarking PingPong 
# #processes = 2 
#---------------------------------------------------
       #bytes #repetitions      t[usec]   Mbytes/sec
            0         1000         1.71         0.00
    134217728            1     10963.55     12242.18
    268435456            1     21916.67     12248.01


# All processes entering MPI_Finalize

$

2-3-3. 4ノード間のAllreduce

以下コマンドを Intel MPI Benchmarks を実行するユーザで何れか1ノードで実行します。
ここでは、4ノード144プロセス(ノードあたり36プロセス)を使用したAllreduceの所要時間をメッセージサイズ256 MiBで計測しています。

$ mpirun -n 144 -ppn 36 -hostfile ~/hostlist.txt -genv UCX_NET_DEVICES=mlx5_2:1 IMB-MPI1 -msglog 27:28 -npmin 144 allreduce
#----------------------------------------------------------------
#    Intel(R) MPI Benchmarks 2021.2, MPI-1 part
#----------------------------------------------------------------
# Date                  : Thu Jun 20 16:46:03 2024
# Machine               : x86_64
# System                : Linux
# Release               : 4.18.0-513.11.0.1.el8_9.x86_64
# Version               : #1 SMP Thu Jan 11 11:30:45 PST 2024
# MPI Version           : 3.1
# MPI Thread Environment: 


# Calling sequence was: 

# IMB-MPI1 -msglog 27:28 -npmin 144 allreduce 

# Minimum message length in bytes:   0
# Maximum message length in bytes:   268435456
#
# MPI_Datatype                   :   MPI_BYTE 
# MPI_Datatype for reductions    :   MPI_FLOAT 
# MPI_Op                         :   MPI_SUM  
# 
# 

# List of Benchmarks to run:

# Allreduce

#----------------------------------------------------------------
# Benchmarking Allreduce 
# #processes = 144 
#----------------------------------------------------------------
       #bytes #repetitions  t_min[usec]  t_max[usec]  t_avg[usec]
            0         1000         0.03         0.03         0.03
    134217728            1    105362.17    106363.65    105716.44
    268435456            1    205579.37    206503.46    205992.71


# All processes entering MPI_Finalize

$