MPI and UPC Users Guide
MPI use depends upon the type of MPI being used.
There are three fundamentally different modes of operation used
by these various MPI implementation.
MPIの使用は、使用するMPIのタイプによって異なります。これらのさまざまなMPI実装で使用される基本的に異なる3つの動作モードがあります。
- Slurm directly launches the tasks and performs initialization of
communications through the PMI2 or PMIx APIs. (Supported by most
modern MPI implementations.)
Slurmはタスクを直接起動し、PMI2またはPMIx APIを介して通信の初期化を実行します。(最新のMPI実装でサポートされています。) - Slurm creates a resource allocation for the job and then
mpirun launches tasks using Slurm's infrastructure (older versions of
OpenMPI).
Slurmはジョブのリソース割り当てを作成し、mpirunはSlurmのインフラストラクチャ(古いバージョンのOpenMPI)を使用してタスクを起動します。 - Slurm creates a resource allocation for the job and then
mpirun launches tasks using some mechanism other than Slurm,
such as SSH or RSH.
These tasks initiated outside of Slurm's monitoring
or control. Slurm's epilog should be configured to purge
these tasks when the job's allocation is relinquished. The
use of pam_slurm_adopt is also strongly recommended.
Slurmはジョブのリソース割り当てを作成し、mpirunはSSHやRSHなどのSlurm以外のメカニズムを使用してタスクを起動します。これらのタスクは、Slurmの監視または制御の外部で開始されました。Slurmのエピローグは、ジョブの割り当てが放棄されたときにこれらのタスクをパージするように構成する必要があります。pam_slurm_adoptの使用も強く推奨されます。
Note: Slurm is not directly launching the user application in case 3,
which may prevent the desired behavior of binding tasks to CPUs and/or
accounting. Some versions of some MPI implementations work, so testing your
particular installation may be required to determie the actual behavior.
注:ケース3では、Slurmはユーザーアプリケーションを直接起動していません。これにより、タスクをCPUやアカウンティングにバインドするという望ましい動作が妨げられる可能性があります。一部のMPI実装の一部のバージョンは機能するため、実際の動作を判別するには、特定のインストールのテストが必要になる場合があります。
Two Slurm parameters control which MPI implementation will be
supported. Proper configuration is essential for Slurm to establish the
proper environment for the MPI job, such as setting the appropriate
environment variables. The MpiDefault configuration parameter
in slurm.conf establishes the system default MPI to be supported.
The srun option --mpi= (or the equivalent environment
variable SLURM_MPI_TYPE can be used to specify when a
different MPI implementation is to be supported for an individual job).
2つのSlurmパラメータは、サポートされるMPI実装を制御します。適切な構成は、適切な環境変数の設定など、SlurmがMPIジョブに適切な環境を確立するために不可欠です。slurm.confのMpiDefault構成パラメーターは、サポートされるシステムのデフォルトMPIを確立します。srunオプション--mpi =(または同等の環境変数SLURM_MPI_TYPEを使用して、個々のジョブで異なるMPI実装をサポートする時期を指定できます)。
Note: Use of an MPI implementation without the appropriate Slurm
plugin may result in application failure. If multiple MPI implementations
are used on a system then some users may be required to explicitly specify
a suitable Slurm MPI plugin.
注:適切なSlurmプラグインなしでMPI実装を使用すると、アプリケーションエラーが発生する可能性があります。システムで複数のMPI実装が使用されている場合、一部のユーザーは適切なSlurm MPIプラグインを明示的に指定する必要があります。
Links to instructions for using several varieties of MPI/PMI
with Slurm are provided below.
Slurmでいくつかの種類のMPI / PMIを使用するための手順へのリンクを以下に示します。
PMIx
Building PMIx
Before building PMIx, it is advisable to read these
How-To Guides. They provide
some details on
building dependencies and installation steps as well as some relevant notes
with regards to Slurm
Support.
PMIxを構築する前に、これらのハウツーガイドを読むことをお勧めします。依存関係の構築とインストール手順の詳細、およびSlurmサポートに関するいくつかの関連メモを提供します。
This section is intended to complement the PMIx FAQ with some notes on how to
prepare Slurm and PMIx to work together. PMIx can be obtained from the official
PMIx GitHub repository, either by
cloning the repository or by downloading a packaged release.
このセクションは、PMIx FAQを補足して、SlurmとPMIxが連携するように準備する方法に関するいくつかの注意事項を補足することを目的としています。PMIxは、公式のPMIx GitHubリポジトリから、リポジトリのクローンを作成するか、パッケージ化されたリリースをダウンロードすることによって取得できます。
Slurm support for PMIx was first included in Slurm 16.05 based on the PMIx
v1.2 release. It has since been updated to support the PMIx v2.x and v3.x
series, as per the following table:
PMIxのSlurmサポートは、PMIx v1.2リリースに基づくSlurm 16.05に最初に含まれました。以降、次の表のように、PMIx v2.xおよびv3.xシリーズをサポートするように更新されました。
- Slurm 16.05+ supports only the PMIx v1.x series, starting with v1.2.0. This
Slurm version specifically does not support PMIx v2.x and above.
Slurm 16.05+は、v1.2.0以降のPMIx v1.xシリーズのみをサポートしています。このSlurmバージョンは、特にPMIx v2.x以降をサポートしていません。 - Slurm 17.11+ supports both PMIx v1.2+ and v2.x but not v3.x.
Slurm 17.11+はPMIx v1.2 +とv2.xの両方をサポートしますが、v3.xはサポートしません。 - Slurm 18.08+ supports PMIx v1.2+, v2.x and v3.x.
Slurm 18.08+はPMIx v1.2 +、v2.x、v3.xをサポートしています。
PMIx v1を実行している場合、古いバージョンではpmiおよびpmi2 APIのサポートに互換性の問題がある可能性があるため、少なくとも1.2.5を実行することをお勧めします。また、インテルMPIはPMIxを公式にサポートしていないため、実行できるとは考えても保証はありません。
Altough it is recommended to build PMIx from the
packaged releases, here is
an example on how to build PMIx v2.1 by cloning the git repository:
パッケージ化されたリリースからPMIxをビルドすることをお勧めしますが、gitリポジトリを複製してPMIx v2.1をビルドする方法の例を次に示します。
user@testbox:~/git$ mkdir -p pmix/build/2.1 pmix/install/2.1 user@testbox:~/git$ cd pmix user@testbox:~/git/pmix$ git clone https://github.com/pmix/pmix.git source user@testbox:~/git/pmix$ cd source/ user@testbox:~/git/pmix/source$ git branch -a user@testbox:~/git/pmix/source$ git checkout v2.1 user@testbox:~/git/pmix/source$ git pull user@testbox:~/git/pmix/source$ ./autogen.sh user@testbox:~/git/pmix/source$ cd ../build/2.1/ user@testbox:~/git/pmix/build/2.1$ ../../source/configure \ > --prefix=/home/user/git/pmix/install/2.1 user@testbox:~/git/pmix/build/2.1$ make -j install >/dev/null user@testbox:~/git/pmix/build/2.1$ cd ../../install/2.1/ user@testbox:~/git/pmix/install/2.1$ grep PMIX_VERSION include/pmix_version.h #define PMIX_VERSION_MAJOR 2L #define PMIX_VERSION_MINOR 1L user@testbox:~/git/pmix/install/2.1$
For the purpose of these instructions let's imagine PMIx v2.1 has been
installed on the following path:
これらの指示の目的のために、PMIx v2.1が次のパスにインストールされていると想像してみましょう。
user@testbox:/home/user/git/pmix/install/2.1
Additional PMIx notes can be found in the SchedMD
Publications and Presentations page.
追加のPMIxノートは、SchedMDの出版物およびプレゼンテーションのページにあります。
Building Slurm with PMIx support
At configure time, Slurm looks by default for a PMIx installation under:
構成時に、SlurmはデフォルトでPMIxインストールを探します。
/usr /usr/local
If PMIx isn't installed in any of the previous locations, the Slurm configure
script can be requested to point to the non default location. Here's an example:
PMIxが以前の場所のいずれにもインストールされていない場合、Slurm構成スクリプトがデフォルト以外の場所を指すように要求できます。次に例を示します。
user@testbox:~/slurm/17.11/testbox/slurm$ ../../slurm/configure \ > --prefix=/home/user/slurm/17.11/testbox \ > --with-pmix=/home/user/git/pmix/install/2.1 \ > --enable-multiple-slurmd
Or the analogous with RPM based building:
または、RPMベースのビルドと同様:
[user@testbox Downloads]$ rpmbuild \ > --define '_prefix /home/user/slurm/17.11/testbox' \ > --define '_slurm_sysconfdir /home/user/slurm/17.11/testbox/etc' \ > --with multiple_slurmd \ > --define '_with_pmix --with-pmix=/home/user/git/pmix/install/2.1' \ > -ta slurm-17.11.1.tar.bz2
NOTE: It is also possible to build against multiple PMIx versions with a ':'
separator. For instance to build against 1.2 and 2.1:
注:複数のPMIxバージョンに対して「:」区切り文字を使用してビルドすることもできます。たとえば、1.2と2.1に対してビルドする場合:
... > --with-pmix=/path/to/pmix/install/1.2:/path/to/pmix/install/2.1 \ ...
NOTE: When submitting a job, the desired version can then be selected using
any of the available from --mpi=list. The default for pmix will be the highest
version of the library:
注:ジョブを送信するときに、-mpi = listから利用可能なものを使用して目的のバージョンを選択できます。pmixのデフォルトは、ライブラリの最も高いバージョンです。
user@testbox:~/t$ srun --mpi=list srun: MPI types are... srun: pmix_v1 srun: pmi2 srun: none srun: pmix srun: pmix_v2
NOTE: There is no need to configure Slurm with the multiple-slurmd option,
but if it is configured with it, additional steps will be required to make PMIx
work. That case is covered a few paragraphs below.
注:Slurmをmultiple-slurmdオプションで構成する必要はありませんが、それが構成されている場合、PMIxを機能させるために追加の手順が必要になります。そのケースは、以下のいくつかの段落でカバーされています。
Continuing with the configuration, if Slurm is unable to locate the PMIx
installation and/or finds it but considers it not usable, the configure output
should log something like this:
構成を続行すると、SlurmがPMIxインストールを見つけることができないか、PMIxインストールを見つけることができないが、それが使用できないと見なした場合、構成出力は次のようなログを記録するはずです。
checking for pmix installation... configure: WARNING: unable to locate pmix installation
Otherwise, if Slurm finds it and considers it usable, something like this:
それ以外の場合、Slurmがそれを見つけて使用可能と見なすと、次のようになります。
checking for pmix installation... /home/user/git/pmix/install/2.1
Inspecting the generated config.log in the Slurm build directory might
provide even more detail for troubleshooting purposes. After configuration,
we can proceed to install Slurm (using make or rpm accordingly):
Slurmビルドディレクトリで生成されたconfig.logを検査すると、トラブルシューティングの目的でさらに詳細な情報が得られる場合があります。構成後、Slurmのインストールに進むことができます(それに応じてmakeまたはrpmを使用)。
user@testbox:~/slurm/17.11/testbox/slurm$ make -j install > /dev/null user@testbox:~/slurm/17.11/testbox/slurm$ cd ../lib/slurm/ user@testbox:~/slurm/17.11/testbox/lib/slurm$ ls -l | grep pmix lrwxrwxrwx 1 user user 16 Dec 6 19:35 mpi_pmix.so -> ./mpi_pmix_v2.so -rw-r--r-- 1 user user 7008260 Dec 6 19:35 mpi_pmix_v2.a -rwxr-xr-x 1 user user 1040 Dec 6 19:35 mpi_pmix_v2.la -rwxr-xr-x 1 user user 1020112 Dec 6 19:35 mpi_pmix_v2.so user@testbox:~/slurm/17.11/testbox/lib/slurm$
If support for PMI2 version is also needed, it can also be installed from
the contribs directory:
PMI2バージョンのサポートも必要な場合は、contribsディレクトリからインストールすることもできます。
user@testbox:~/slurm/17.11/testbox/lib/slurm$ cd ../../slurm/contribs/pmi2 user@testbox:~/slurm/17.11/testbox/slurm/contribs/pmi2$ make -j install user@testbox:~/slurm/17.11/testbox/slurm/contribs/pmi2$ cd ../../../lib user@testbox:~/slurm/17.11/testbox/lib$ ls -l | grep pmi -rw-r--r-- 1 user user 498144 Dec 6 20:05 libpmi2.a -rwxr-xr-x 1 user user 958 Dec 6 20:05 libpmi2.la lrwxrwxrwx 1 user user 16 Dec 6 20:05 libpmi2.so -> libpmi2.so.0.0.0 lrwxrwxrwx 1 user user 16 Dec 6 20:05 libpmi2.so.0 -> libpmi2.so.0.0.0 -rwxr-xr-x 1 user user 214512 Dec 6 20:05 libpmi2.so.0.0.0 -rw-r--r-- 1 user user 414680 Dec 6 19:35 libpmi.a -rwxr-xr-x 1 user user 1011 Dec 6 19:35 libpmi.la lrwxrwxrwx 1 user user 15 Dec 6 19:35 libpmi.so -> libpmi.so.0.0.0 lrwxrwxrwx 1 user user 15 Dec 6 19:35 libpmi.so.0 -> libpmi.so.0.0.0 -rwxr-xr-x 1 user user 230552 Dec 6 19:35 libpmi.so.0.0.0 user@testbox:~/slurm/17.11/testbox/lib$
NOTE: Since both Slurm and PMIx provide libpmi[2].so libraries, we recommend
to install both pieces of software in different locations. Otherwise, both
libraries provided by Slurm and PMIx might end up being installed under standard
locations like /usr/lib64 and the package manager erroring out and reporting
the conflict. It is planned to alleviate that by putting these libraries in a
separate libpmi-slurm package.
注:SlurmとPMIxの両方がlibpmi [2] .soライブラリを提供しているため、両方のソフトウェアを異なる場所にインストールすることをお勧めします。そうしないと、SlurmとPMIxの両方で提供されるライブラリが/ usr / lib64などの標準の場所にインストールされ、パッケージマネージャーがエラーを報告して競合を報告する可能性があります。これらのライブラリを個別のlibpmi-slurmパッケージに配置することで、この問題を緩和する予定です。
NOTE: If support for multiple-slurmd is required, the TmpFS option in
slurm.conf needs to be specified and as many directory paths as nodes be
created. These directories are used by the Slurm PMIx plugin to create temporal
files and/or UNIX sockets. Here's an example setup for two nodes named
compute[1-2]:
注:複数のslurmdのサポートが必要な場合は、slurm.confのTmpFSオプションを指定し、ノードを作成するのと同じ数のディレクトリパスを指定する必要があります。これらのディレクトリは、一時ファイルやUNIXソケットを作成するためにSlurm PMIxプラグインによって使用されます。以下は、compute [1-2]という名前の2つのノードの設定例です。
TmpFS=/home/user/slurm/17.11/testbox/spool/slurmd-tmpfs-%n user@testbox:~/slurm/17.11/testbox$ mkdir spool/slurmd-tmpfs-compute1 user@testbox:~/slurm/17.11/testbox$ mkdir spool/slurmd-tmpfs-compute2
Testing Slurm and PMIx
It is possible to directly test Slurm and PMIx without the need of a MPI
implementation software being installed. Here's an example indicating that
both components work properly:
MPI実装ソフトウェアをインストールしなくても、SlurmとPMIxを直接テストできます。次の例は、両方のコンポーネントが正しく機能することを示しています。
user@testbox:~/t$ srun --mpi=list srun: MPI types are... srun: pmi2 srun: none srun: pmix srun: pmix_v2 user@testbox:~/t$ srun --mpi=pmix -n2 -N2 \ > ~/git/pmix/build/2.1/test/pmix_client -n 2 --job-fence -c OK OK user@testbox:~/t$ srun --mpi=pmix_v2 -n2 -N2 \ > ~/git/pmix/build/2.1/test/pmix_client -n 2 --job-fence -c OK OK user@testbox:~/t$
OpenMPI
The current versions of Slurm and Open MPI support task launch using the
srun command.
It relies upon Slurm managing reservations of communication ports for use by
the Open MPI version 1.5.
SlurmおよびOpen MPIの現在のバージョンは、srunコマンドを使用したタスクの起動をサポートしています。Open MPIバージョン1.5で使用する通信ポートの予約を管理するSlurmに依存しています。
If OpenMPI is configured with --with-pmi either pmi or pmi2,
the OMPI jobs can be launched directly using the srun command. This is
the preferred mode of operation. If the pmi2 support is enabled, the option
'--mpi=pmi2' or '--mpi=pmi2_v2' must be specified on the srun command line.
Alternately configure 'MpiDefault=pmi' or 'MpiDefault=pmi_v2' in slurm.conf.
OpenMPIが--with-pmiでpmiまたはpmi2のいずれかで構成されている場合、OMPIジョブはsrunコマンドを使用して直接起動できます。これは、推奨される操作モードです。pmi2サポートが有効になっている場合、srunコマンドラインでオプション '--mpi = pmi2'または '--mpi = pmi2_v2'を指定する必要があります。または、slurm.confで「MpiDefault = pmi」または「MpiDefault = pmi_v2」を構成します。
Starting with Open MPI version 3.1, PMIx version 2 is natively supported.
To launch Open MPI application using PMIx version 2 the '--mpi=pmix_v2' option
must be specified on the srun command line or 'MpiDefault=pmi_v2' configured
in slurm.conf. Open MPI version 4.0, adds support for PMIx version 3 and is
invoked in the same way, with '--mpi=pmix_v3'.
Open MPIバージョン3.1以降、PMIxバージョン2がネイティブでサポートされています。PMIxバージョン2を使用してOpen MPIアプリケーションを起動するには、srunコマンドラインで '--mpi = pmix_v2'オプションを指定するか、slurm.confで構成された 'MpiDefault = pmi_v2'を指定する必要があります。MPIバージョン4.0を開き、PMIxバージョン3のサポートを追加し、「-mpi = pmix_v3」を使用して同じ方法で起動します。
In Open MPI version 2.0, PMIx is natively supported too. To launch
Open MPI application using PMIx the '--mpi=pmix' or '--mpi=pmix_v1' option has
to be specified on the srun command line. It is also possible to build OpenMPI
using an external PMIx installation. That option can take one of three values:
"internal", "external", or a valid directory name. "internal" (or no DIR value)
forces Open MPI to use its internal copy of PMIx. "external" forces Open MPI to
use an external installation of PMIx. Supplying a valid directory name also
forces Open MPI to use an external installation of PMIx, and adds DIR/include,
DIR/lib, and DIR/lib64 to the search path for headers and libraries.
Note that Open MPI does not support --without-pmix. Note also that if building
OpenMPI using an external PMIx installation, both OpenMPI and PMIx need to be
built against the same libevent/hwloc installations, otherwise a warning is
shown. OpenMPI configure script provides the options --with-libevent=PATH
and/or --with-hwloc=PATH to make OpenMPI match what PMIx was built
against.
Open MPIバージョン2.0では、PMIxもネイティブでサポートされています。PMIxを使用してOpen MPIアプリケーションを起動するには、 '-mpi = pmix'または '--mpi = pmix_v1'オプションをsrunコマンドラインで指定する必要があります。外部PMIxインストールを使用してOpenMPIを構築することもできます。このオプションは、「内部」、「外部」、または有効なディレクトリ名の3つの値のいずれかを取ります。"internal"(またはDIR値なし)は、Open MPIがPMIxの内部コピーを使用するように強制します。"external"は、Open MPIがPMIxの外部インストールを使用するように強制します。有効なディレクトリ名を指定すると、Open MPIはPMIxの外部インストールを強制的に使用し、DIR / include、DIR / lib、およびDIR / lib64をヘッダーとライブラリの検索パスに追加します。Open MPIは--without-pmixをサポートしないことに注意してください。外部PMIxインストールを使用してOpenMPIをビルドする場合、OpenMPIとPMIxの両方を同じlibevent / hwlocインストールに対してビルドする必要があることにも注意してください。それ以外の場合は警告が表示されます。OpenMPI構成スクリプトは、オプション--with-libevent = PATHおよび/または--with-hwloc = PATHを提供して、OpenMPIがPMIxの構築対象と一致するようにします。
A set of environment variables are available to control the behavior of Slurm
PMIx plugin:
Slurm PMIxプラグインの動作を制御するために、一連の環境変数を使用できます。
- SLURM_PMIX_SRV_TMPDIR base directory for PMIx/server service files.
PMIx /サーバーサービスファイルのSLURM_PMIX_SRV_TMPDIRベースディレクトリ。
- SLURM_PMIX_TMPDIR base directory for applications session
directories.
アプリケーションセッションディレクトリのSLURM_PMIX_TMPDIRベースディレクトリ。
- SLURM_PMIX_DIRECT_CONN (default - yes) enables (1/yes/true) or
disables (0/no/false) controls wheter direct connections between slurmstepd's
are astablished or Slurm RPCs are used for data exchange. Direct connection
shows better performanse for fully-packed nodes when PMIx is running in the
direct-modex mode.
SLURM_PMIX_DIRECT_CONN(デフォルト-はい)は、slurmstepd間の直接接続を確立するか、データ交換にSlurm RPCを使用するかを制御します(1 / yes / true)または無効にします(0 / no / false)。直接接続は、PMIxが直接モデムモードで実行されているときに、完全にパックされたノードのパフォーマンスを向上させます。
For older versions of OMPI not compiled with the pmi support
the system administrator must specify the range of ports to be reserved
in the slurm.conf file using the MpiParams parameter.
For example: MpiParams=ports=12000-12999
pmiサポートを使用してコンパイルされていない古いバージョンのOMPIの場合、システム管理者はMpiParamsパラメーターを使用して、slurm.confファイルで予約するポートの範囲を指定する必要があります。例:MpiParams = ports = 12000-12999
Alternatively tasks can be launched using the srun command
plus the option --resv-ports or using the environment
variable SLURM_RESV_PORT, which is equivalent to always including
--resv-ports on srun's execute line.
The ports reserved on every allocated node will be identified in an
environment variable available to the tasks as shown here:
SLURM_STEP_RESV_PORTS=12000-12015
あるいは、srunコマンドとオプション--resv-portsを使用するか、環境変数SLURM_RESV_PORTを使用してタスクを起動できます。これは、常にsrunの実行行に--resv-portsを含めることと同じです。割り当てられたすべてのノードで予約されているポートは、次に示すように、タスクで使用可能な環境変数で識別されます。SLURM_STEP_RESV_PORTS= 12000-12015
$ salloc -n4 sh # allocates 4 processors and spawns shell for job > srun a.out > exit # exits shell spawned by initial salloc command
or
> srun -n 4 a.out
or using the pmi2 support
> srun --mpi=pmi2 -n 4 a.out
or using the pmix support
> srun --mpi=pmix -n 4 a.out
If the ports reserved for a job step are found by the Open MPI library
to be in use, a message of this form will be printed and the job step
will be re-launched:
ジョブステップ用に予約されたポートが使用中のOpen MPIライブラリによって検出された場合、このフォームのメッセージが出力され、ジョブステップが再起動されます。
srun: error: sun000: task 0 unble to claim reserved port, retrying
srun:エラー:sun000:タスク0が予約済みポートを要求できません。再試行しています
After three failed attempts, the job step will be aborted.
Repeated failures should be reported to your system administrator in
order to rectify the problem by cancelling the processes holding those
ports.
3回失敗すると、ジョブステップは中止されます。これらのポートを保持しているプロセスをキャンセルして問題を修正するには、繰り返し発生する障害をシステム管理者に報告する必要があります。
NOTE: Some kernels and system configurations have resulted in a locked memory
too small for proper OpemMPI functionality, resulting in application failure
with a segmentation fault. This may be fixed by configuring the slurmd daemon
to execute with a larger limit. For example, add "LimitMEMLOCK=infinity" to
your slurmd.service file.
注:一部のカーネルとシステム構成では、ロックされたメモリが小さすぎて適切なOpemMPI機能を実行できず、セグメンテーション違反でアプリケーションが失敗しました。これは、より大きな制限で実行するようにslurmdデーモンを構成することで修正できます。たとえば、「LimitMEMLOCK = infinity」をslurmd.serviceファイルに追加します。
Intel MPI
Intel® MPI Library for Linux OS supports the following methods of
launching the MPI jobs under the control of the Slurm job manager:
Linux OS用インテル®MPIライブラリーは、Slurmジョブマネージャーの制御下でMPIジョブを起動する次の方法をサポートしています。
This description provides detailed information on all of these methods.
この説明では、これらすべての方法の詳細を説明します。
The mpirun Command over the MPD Process Manager
Slurm is supported by the mpirun command of the Intel® MPI Library 3.1
Build 029 for Linux OS and later releases.
Slurmは、Linux OS以降のリリース用のインテル®MPIライブラリー3.1ビルド029のmpirunコマンドでサポートされています。
When launched within a session allocated using the Slurm commands sbatch or
salloc, the mpirun command automatically detects and queries certain Slurm
environment variables to obtain the list of the allocated cluster nodes.
Slurmコマンドのsbatchまたはsallocを使用して割り当てられたセッション内で起動されると、mpirunコマンドは自動的に特定のSlurm環境変数を検出してクエリし、割り当てられたクラスターノードのリストを取得します。
Use the following commands to start an MPI job within an existing Slurm
session over the MPD PM:
次のコマンドを使用して、MPD PM上の既存のSlurmセッション内でMPIジョブを開始します。
export I_MPI_PROCESS_MANAGER=mpd mpirun -n <num_procs> a.out
The mpirun Command over the Hydra Process Manager
Slurm is supported by the mpirun command of the Intel® MPI Library 4.0
Update 3 through the Hydra PM by default. The behavior of this command is
analogous to the MPD case described above.
Slurmは、デフォルトでHydra PMを介してインテル®MPIライブラリー4.0アップデート3のmpirunコマンドでサポートされています。このコマンドの動作は、上記のMPDの場合と類似しています。
Use the one of the following commands to start an MPI job within an existing
Slurm session over the Hydra PM:
Hydra PM上の既存のSlurmセッション内でMPIジョブを開始するには、次のいずれかのコマンドを使用します。
mpirun -n <num_procs> a.out
or
mpirun -bootstrap slurm -n <num_procs> a.out
We recommend that you use the second command. It uses the srun command
rather than the default ssh based method to launch the remote Hydra PM
service processes.
2番目のコマンドを使用することをお勧めします。デフォルトのsshベースのメソッドではなくsrunコマンドを使用して、リモートHydra PMサービスプロセスを起動します。
The mpiexec.hydra Command (Hydra Process Manager)
Slurm is supported by the Intel® MPI Library 4.0 Update 3 directly
through the Hydra PM.
Slurmは、Hydra PMを介して直接、インテル®MPIライブラリー4.0アップデート3でサポートされています。
Use the following command to start an MPI job within an existing Slurm session:
次のコマンドを使用して、既存のSlurmセッション内でMPIジョブを開始します。
mpiexec.hydra -bootstrap slurm -n <num_procs> a.out
The srun Command (Slurm, recommended)
This advanced method is supported by the Intel® MPI Library 4.0 Update 3.
This method is the best integrated with Slurm and supports process tracking,
accounting, task affinity, suspend/resume and other features.
Use the following commands to allocate a Slurm session and start an MPI job in
it, or to start an MPI job within a Slurm session already created using the
sbatch or salloc commands:
この高度な方法は、インテル®MPIライブラリー4.0アップデート3でサポートされています。この方法はSlurmとの統合に最適で、プロセスの追跡、アカウンティング、タスクアフィニティ、一時停止/再開、その他の機能をサポートしています。次のコマンドを使用して、Slurmセッションを割り当て、その中でMPIジョブを開始するか、sbatchまたはsallocコマンドを使用してすでに作成されているSlurmセッション内でMPIジョブを開始します。
- Set the I_MPI_PMI_LIBRARY environment variable to point to the
Slurm Process Management Interface (PMI) library:
I_MPI_PMI_LIBRARY環境変数を設定して、Slurm Process Management Interface(PMI)ライブラリーを指すようにします。
export I_MPI_PMI_LIBRARY=/path/to/slurm/pmi/library/libpmi.so
NOTE: Due to licensing reasons IMPI doesn't link directly to any external
PMI implementation. Instead one must point to the desired library just
exporting the environment variable mentioned above, which will then be dlopened
by IMPI. Also, there is no official support provided by Intel against PMIx
libraries. Since IMPI is based on MPICH, using PMIx with Intel may work due
PMIx mantaining compatibility with pmi and pmi2, which are the ones used in
MPICH, but it is not guaranteed to run in all cases.
注:ライセンス上の理由により、IMPIは外部のPMI実装に直接リンクしていません。代わりに、上記の環境変数をエクスポートするだけの目的のライブラリをポイントする必要があります。これは、IMPIによって傾斜されます。また、PMIxライブラリに対してIntelが提供する公式サポートはありません。IMPIはMPICHに基づいているため、PMIxをIntelで使用すると、PMIxがMPICHで使用されているものであるpmiおよびpmi2と互換性があるために機能する場合がありますが、すべてのケースで実行できるとは限りません。
srunコマンドを使用して、MPIジョブを起動します。
srun -n <num_procs> a.out
Above information used by permission from Intel.
For more information see
Intel MPI Library.
上記の情報は、インテルからの許可を得て使用しています。詳細については、インテルMPIライブラリーを参照してください。
MPICH (a.k.a. MPICH2)
MPICH2 jobs can be launched using the srun command using
pmi 1 or 2, or mpiexec.
All modes of operation are described below.
MPICH2ジョブは、pmi 1または2を使用するsrunコマンド、またはmpiexecを使用して起動できます。すべての動作モードについて、以下で説明します。
MPICH2 with srun and PMI version 2
MPICH2 must be built specifically for use with Slurm and PMI2 using a configure
line similar to that shown below.
MPICH2は、以下に示すような設定行を使用して、SlurmおよびPMI2で使用するために特別に構築する必要があります。
./configure --with-slurm=<PATH> --with-pmi=pmi2
The PATH must point to the Slurm installation directory, in other words the parent
directory of bin and lib.
In addition, if Slurm is not configured with MpiDefault=pmi2, then
the srun command must be invoked with the option --mpi=pmi2 as shown
in the example below below.
PATHはSlurmインストールディレクトリ、つまりbinとlibの親ディレクトリを指す必要があります。さらに、SlurmがMpiDefault = pmi2で構成されていない場合、以下の例に示すように、オプション--mpi = pmi2を指定してsrunコマンドを呼び出す必要があります。
srun -n4 --mpi=pmi2 ./a.out
The PMI2 support in Slurm works only if the MPI implementation supports it, in other words if the MPI has
the PMI2 interface implemented. The --mpi=pmi2 will load the library lib/slurm/mpi_pmi2.so
which provides the server side functionality but the client side must implement PMI2_Init()
and the other interface calls.
SlurmでのPMI2サポートは、MPI実装がサポートしている場合、つまりMPIにPMI2インターフェースが実装されている場合にのみ機能します。--mpi = pmi2は、サーバー側の機能を提供するライブラリlib / slurm / mpi_pmi2.soをロードしますが、クライアント側はPMI2_Init()およびその他のインターフェース呼び出しを実装する必要があります。
This does require that the MPICH intallation have been installed with the --with-pmi=pmi2 configure option.
これには、MPICHインストールが--with-pmi = pmi2設定オプションでインストールされている必要があります。
To check if the MPI version you are using supports PMI2 check for PMI2_* symbols in the MPI library.
使用しているMPIバージョンがPMI2をサポートしているかどうかを確認するには、MPIライブラリのPMI2_ *シンボルを確認します。
Slurm provides a version of the PMI2 client library in the contribs directory. This library gets
installed in the Slurm lib directory. If your MPI implementation supports PMI2 and you wish to use
the Slurm provided library you have to link the Slurm provided library explicitly:
Slurmは、contribsディレクトリにPMI2クライアントライブラリのバージョンを提供します。このライブラリはSlurm libディレクトリにインストールされます。MPI実装がPMI2をサポートし、Slurm提供のライブラリを使用したい場合は、Slurm提供のライブラリを明示的にリンクする必要があります。
$ mpicc -L<path_to_pmi2_lib> -lpmi2 ... $ srun -n20 a.out
MPICH2 with srun and PMI version 1
Link your program with
Slurm's implementation of the PMI library so that tasks can communicate
host and port information at startup. (The system administrator can add
these option to the mpicc and mpif77 commands directly, so the user will not
need to bother). For example:
タスクが起動時にホストとポートの情報を通信できるように、プログラムをSlurmのPMIライブラリの実装とリンクします。(システム管理者はこれらのオプションをmpiccおよびmpif77コマンドに直接追加できるため、ユーザーが煩わされる必要はありません)。例えば:
$ mpicc -L<path_to_slurm_lib> -lpmi ... $ srun -n20 a.outNOTES:
- Some MPICH2 functions are not currently supported by the PMI
library integrated with Slurm
一部のMPICH2関数は、現在Slurmと統合されたPMIライブラリによってサポートされていません - Set the environment variable PMI_DEBUG to a numeric value
of 1 or higher for the PMI library to print debugging information.
Use srun's -l option for better clarity.
PMIライブラリがデバッグ情報を出力するように、環境変数PMI_DEBUGを1以上の数値に設定します。より明確にするためにsrunの-lオプションを使用します。 - Set the environment variable SLURM_PMI_KVS_NO_DUP_KEYS for
improved performance with MPICH2 by eliminating a test for duplicate keys.
環境変数SLURM_PMI_KVS_NO_DUP_KEYSを設定して、重複キーのテストを排除することにより、MPICH2でのパフォーマンスを向上させます。 - The environment variables can be used to tune performance depending upon
network performance: PMI_FANOUT, PMI_FANOUT_OFF_HOST, and
PMI_TIME.
See the srun man pages in the INPUT ENVIRONMENT VARIABLES section for a more
information.
環境変数を使用して、ネットワークパフォーマンスに応じてパフォーマンスを調整できます:PMI_FANOUT、PMI_FANOUT_OFF_HOST、およびPMI_TIME。詳細については、「入力環境変数」セクションのsrun manページを参照してください。 - Information about building MPICH2 for use with Slurm is described on the
MPICH2 FAQ web page and below.
Slurmで使用するためのMPICH2の構築に関する情報は、MPICH2 FAQ Webページおよび以下で説明されています。
MPICH2 with mpiexec
Do not add any flags to mpich and build the default
(e.g. "./configure -prefix ... ".
Do NOT pass the --with-slurm, --with-pmi, --enable-pmiport options).
mpichにフラグを追加してデフォルトを構築しないでください(例:「./configure -prefix ...」。--with-slurm、-with-pmi、-enable-pmiportオプションを渡さないでください)。
Do not add -lpmi to your application (it will force slurm's pmi 1
interface which doesn't support PMI_Spawn_multiple).
アプリケーションに-lpmiを追加しないでください(PMI_Spawn_multipleをサポートしないslurmのpmi 1インターフェースが強制されます)。
Launch the application using salloc to create the job allocation and mpiexec
to launch the tasks. A simple example is shown below.
sallocを使用してアプリケーションを起動してジョブ割り当てを作成し、mpiexecを使用してタスクを起動します。簡単な例を以下に示します。
salloc -N 2 mpiexec my_application
All MPI_comm_spawn work fine now going through hydra's PMI 1.1 interface.
すべてのMPI_comm_spawnが正常に機能し、ヒドラのPMI 1.1インターフェイスを通過します。
MVAPICH (a.k.a. MVAPICH2)
MVAPICH2 supports launching multithreaded programs by Slurm as well as
mpirun_rsh.
Please note that if you intend to use use srun, you need to build MVAPICH2
with Slurm support with a command line of this sort:
MVAPICH2は、mpirun_rshだけでなく、Slurmによるマルチスレッドプログラムの起動をサポートします。srunを使用する場合は、次のようなコマンドラインでSlurmをサポートするMVAPICH2をビルドする必要があることに注意してください。
$ ./configure --with-pmi=pmi2 --with-pm=slurm
Use of Slurm's pmi2 plugin provides substantially higher performance and
scalability than Slurm's pmi plugin.
If pmi2 is not configured to be Slurm's default MPI plugin at your site,
this can be specified using the srun command's "--mpi-pmi2" option as shown
below or with the environment variable setting of "SLURM_MPI_TYPE=pmi2".
Slurmのpmi2プラグインを使用すると、Slurmのpmiプラグインよりも大幅に高いパフォーマンスとスケーラビリティが得られます。サイトでpmi2がSlurmのデフォルトのMPIプラグインとして構成されていない場合、これは、以下に示すようにsrunコマンドの「--mpi-pmi2」オプションを使用するか、環境変数を「SLURM_MPI_TYPE = pmi2」に設定して指定できます。
$ srun -n16 --mpi=pmi2 a.out
MVAPICH2 can be built using the following options:
MVAPICH2は、次のオプションを使用して構築できます。
--with-pmi=pmi2 \
--with-pm=slurm \
--with-slurm=<install directory> \
--enable-slurm=yes
For more information, please see the
MVAPICH2 User Guide
詳細については、MVAPICH2ユーザーガイドを参照してください。
UPC (Unified Parallel C)
Berkeley UPC (and likely other UPC implementations) rely upon Slurm to
allocate resources and launch the application's tasks. The UPC library then
read. Slurm environment variables in order to determine how the job's task
count and location. One would build the UPC program in the normal manner
then initiate it using a command line of this sort:
Berkeley UPC(およびおそらく他のUPC実装)は、リソースの割り当てとアプリケーションのタスクの起動をSlurmに依存しています。次に、UPCライブラリーが読み取ります。ジョブのタスクのカウント方法と場所を決定するためのスラム環境変数。通常の方法でUPCプログラムを構築し、次のようなコマンドラインを使用してUPCプログラムを開始します。
$ srun -N4 -n16 a.out
Last modified 18 December 2019