3

384 MPI プロセス (計算ノードあたり 16 コアの 24 計算ノード) で実行されるコードがあり、次の単純なスクリプトを使用してジョブをジョブ キューに送信するとします。

#!/bin/bash
#PBS -S /bin/bash
#PBS -l nodes=24:ppn=16
#PBS -l walltime=01:00:00

cd $PBS_O_WORKDIR
module load openmpi
mpirun mycode > output_file

次のシナリオは可能ですか: 「openmp」を使用していくつかの特定の計算を実行するために、16 コアのノードをもう 1 つ割り当て、ある時点で残りの 384 プロセスを計算結果で更新する必要があります。これで、384 個の MPI プロセスがあり、それぞれで 1 つのスレッドが順次実行され、1 つの MPI プロセスが 16 個の openmp スレッドで実行されます。

OMP_NUM_THREADS と mpirun またはその他のツールでこれを達成することは可能ですか?

提案をいただければ幸いです

ありがとうございました

シーナ

4

1 に答える 1

5

You could request 25 nodes with 16 ppns and then force only 385 MPI processes:

#PBS -l nodes=25:ppn=16
...
mpirun -np 384 mycode : -np 1 -x OMP_NUM_THREADS=16 mycode > output_file

This utilises the MPMD launch mode of Open MPI with different launch configurations separated by colons. Since by default ranks are populated sequentially over node slots, the first 384 ranks will span exactly 24 nodes, then the additional rank will get started on the very last node. For it the OMP_NUM_THREADS environment variable will get set to 16 therefore enabling 16 OpenMP threads. If the OpenMP program is a different executable, just substitute its name in the second launch configuration, e.g.:

mpirun -np 384 mycode : -np 1 -x OMP_NUM_THREADS=16 myompcode > output_file
于 2013-07-02T12:12:21.700 に答える