Slurm MPI Plugin API
Overview
This document describes Slurm MPI selection plugins and the API that defines
them. It is intended as a resource to programmers wishing to write their own Slurm
node selection plugins.
このドキュメントでは、Slurm MPI選択プラグインとそれらを定義するAPIについて説明します。独自のSlurmノード選択プラグインを作成したいプログラマーへのリソースとして意図されています。
Slurm MPI selection plugins are Slurm plugins that implement the which version of
mpi is used during execution of the new Slurm job. API described herein. They are
intended to provide a mechanism for both selecting MPI versions for pending jobs and
performing any mpi-specific tasks for job launch or termination. The plugins must
conform to the Slurm Plugin API with the following specifications:
Slurm MPI選択プラグインは、新しいSlurmジョブの実行中に使用されるmpiのバージョンを実装するSlurmプラグインです。ここで説明するAPI。これらは、保留中のジョブのMPIバージョンを選択し、ジョブの起動または終了のためにmpi固有のタスクを実行するためのメカニズムを提供することを目的としています。プラグインは、次の仕様のSlurm Plugin APIに準拠している必要があります。
const char plugin_type[]
The major type must be "mpi." The minor type can be any recognizable
abbreviation for the type of node selection algorithm. We recommend, for example:
主なタイプは「mpi」である必要があります。マイナータイプは、ノード選択アルゴリズムのタイプの認識可能な省略形です。たとえば、次のことをお勧めします。
- pmi2 — For use with MPI2 and MVAPICH2.
pmi2 — MPI2およびMVAPICH2で使用します。 - pmix — Exascale PMI implementation (currently supported by
OpenMPI starting from version 2.0)
pmix — Exascale PMI実装(現在、バージョン2.0以降のOpenMPIでサポートされています) - none — For use with most other versions of MPI.
none —他のほとんどのバージョンのMPIで使用します。
const char plugin_name[]
Some descriptive name for the plugin.
There is no requirement with respect to its format.
プラグインの説明的な名前。その形式に関して要件はありません。
const uint32_t plugin_version
If specified, identifies the version of Slurm used to build this plugin and
any attempt to load the plugin from a different version of Slurm will result
in an error.
指定した場合、このプラグインのビルドに使用されたSlurmのバージョンを識別し、異なるバージョンのSlurmからプラグインをロードしようとすると、エラーが発生します。
If not specified, then the plugin may be loaded by Slurm commands and
daemons from any version, however this may result in difficult to diagnose
failures due to changes in the arguments to plugin functions or changes
in other Slurm functions used by the plugin.
指定されていない場合、プラグインはSlurmコマンドとデーモンによって任意のバージョンから読み込まれる可能性がありますが、プラグイン関数の引数の変更やプラグインで使用される他のSlurm関数の変更が原因で、障害の診断が困難になる可能性があります。
A simplified flow of logic follows:
ロジックの簡略化されたフローは次のとおりです。
- srun is able to specify the correct mpi to use with --mpi=MPITYPE
srunは--mpi = MPITYPEで使用する正しいmpiを指定できます -
srun command runs
p_mpi_hook_client_prelaunch()
which will set up the correct environment for the specified mpi.
srunコマンドはp_mpi_hook_client_prelaunch()を実行し、指定されたmpiの正しい環境をセットアップします。
-
slurmstepd process runs
p_mpi_hook_slurmstepd_prefork()
which will set configure the slurmd to use the correct mpi as well to interact with the srun.
slurmstepdプロセスはp_mpi_hook_slurmstepd_prefork()を実行し、srunと対話するために正しいmpiも使用するようにslurmdを設定します。
-
slurmstepd process runs
p_mpi_hook_slurmstepd_task()
which executes immediately before fork/exec of each task.
slurmstepdプロセスは、各タスクのfork / execの直前に実行されるp_mpi_hook_slurmstepd_task()を実行します。
-
srun command runs
p_mpi_hook_client_fini()
which executes after all tasks have finished.
srunコマンドは、すべてのタスクが完了した後に実行されるp_mpi_hook_client_fini()を実行します。
Data Objects
These functions are expected to read and/or modify data structures directly in
the slurmd daemon's and srun memory. Slurmd is a multi-threaded program with independent
read and write locks on each data structure type. Therefore the type of operations
permitted on various data structures is identified for each function.
これらの関数は、slurmdデーモンとsrunメモリー内のデータ構造を直接読み取りまたは変更することが期待されています。Slurmdは、各データ構造タイプに対して独立した読み取りおよび書き込みロックを備えたマルチスレッドプログラムです。したがって、さまざまなデータ構造で許可される操作のタイプは、関数ごとに識別されます。
Environment Variables
Slurm will set the following environment variables for plugins:
Slurmはプラグインに対して次の環境変数を設定します。
- SLURM_MPI_TYPE — MPI plugin name that has been loaded for job.
SLURM_MPI_TYPE —ジョブ用にロードされたMPIプラグイン名。
API Functions
The following functions should be defined or at least be stubbed.
次の関数を定義するか、少なくともスタブ化する必要があります。
int init (void)
Description:
Called when the plugin is loaded or reloaded, before any other functions are
called. Put global initialization here.
プラグインがロードまたは再ロードされたとき、他の関数が呼び出される前に呼び出されます。ここにグローバル初期化を配置します。
Returns:
SLURM_SUCCESS on success, or
SLURM_ERROR on failure.
void fini (void)
Description:
Called when the plugin is removed or reloaded. Clear any allocated storage
here.
プラグインが削除または再ロードされたときに呼び出されます。ここで割り当て済みのストレージをすべてクリアします。
Returns: None.
Note: These init and fini functions are not the same as those
described in the dlopen (3) system library.
The C run-time system co-opts those symbols for its own initialization.
The system _init() is called before the Slurm
init(), and the Slurm
fini() is called before the system's
_fini().
注:これらのinitおよびfini関数は、dlopen(3)システムライブラリで説明されているものと同じではありません。Cランタイムシステムは、これらのシンボルを独自の初期化用にco-optします。システムの_init()はSlurm init()の前に呼び出され、Slurm fini()はシステムの_fini()の前に呼び出されます。
mpi_plugin_client_state_t* p_mpi_hook_client_prelaunch (const mpi_plugin_client_info_t *job, char ***env)
Description: Called by srun to configure the slurmd's environment
to that of the correct mpi.
説明:slurmdの環境を正しいmpiの環境に構成するためにsrunによって呼び出されます。
Arguments:
job
(input) Pointer to the Job Step (stepd_step_rec_t) that about to run.
Cannot be NULL.
job(入力)実行しようとしているジョブステップ(stepd_step_rec_t)へのポインター。NULLにすることはできません。
env
(input/output) Pointer to pointer of job environment to allow plugin
to modify job environment as needed.
env(入力/出力)プラグインが必要に応じてジョブ環境を変更できるようにするジョブ環境のポインターへのポインター。
Returns: SLURM_SUCCESS if successful. On
failure, the plugin should return SLURM_ERROR.
戻り値:成功した場合はSLURM_SUCCESS。失敗すると、プラグインはSLURM_ERRORを返します。
int p_mpi_hook_slurmstepd_prefork(const stepd_step_rec_t *job, char ***env)
Description: Called by slurmstepd before
forking to create the first job process. Most all the real processing happens
here. This is not called for batch jobs and extern steps.
説明:最初のジョブプロセスを作成するためにフォークする前に、slurmstepdによって呼び出されます。ほとんどすべての実際の処理はここで行われます。これは、バッチジョブおよび外部ステップでは呼び出されません。
Arguments:
job
(input) Pointer to the Job Step (stepd_step_rec_t) that about to run.
Cannot be NULL.
job(入力)実行しようとしているジョブステップ(stepd_step_rec_t)へのポインター。NULLにすることはできません。
env
(input/output) Pointer to pointer of job environment to allow plugin
to modify job environment as needed.
env(入力/出力)プラグインが必要に応じてジョブ環境を変更できるようにするジョブ環境のポインターへのポインター。
Returns: SLURM_SUCCESS if successful. On
failure, the plugin should return SLURM_ERROR.
戻り値:成功した場合はSLURM_SUCCESS。失敗すると、プラグインはSLURM_ERRORを返します。
void p_mpi_hook_slurmstepd_task(const mpi_plugin_task_info_t *job, char ***env)
Description:
Called by slurmstepd process immediately after fork and becoming job user, but
immediatly prior to exec of user task. This is not called for batch job steps
and extern steps.
説明:フォークしてジョブユーザーになった直後に、ユーザータスクの実行の直前にslurmstepdプロセスによって呼び出されます。これは、バッチジョブステップと外部ステップでは呼び出されません。
Arguments:
job
(input) Pointer to the Job Step (stepd_step_rec_t) that about to run.
Cannot be NULL.
job(入力)実行しようとしているジョブステップ(stepd_step_rec_t)へのポインター。NULLにすることはできません。
env
(input/output) Pointer to pointer of job environment to allow plugin
to modify job environment as needed.
env(入力/出力)プラグインが必要に応じてジョブ環境を変更できるようにするジョブ環境のポインターへのポインター。
Returns: void returning function.
戻り値:voidを返す関数。
int p_mpi_hook_client_fini(mpi_plugin_client_state_t *state);
Description: Called by srun after all tasks
are complete. Cleans up anything that needs cleaning up after execution.
説明:すべてのタスクが完了した後にsrunによって呼び出されます。実行後にクリーンアップが必要なものをすべてクリーンアップします。
Arguments:
state Launch state of MPI. Currently, a
typedef of void.
MPIの起動状態。現在、typedefはvoidです。
Returns: SLURM_SUCCESS if successful. On
failure, the plugin should return SLURM_ERROR, causing slurmctld to exit.
戻り値:成功した場合はSLURM_SUCCESS。失敗すると、プラグインはSLURM_ERRORを返し、slurmctldが終了します。
Last modified 15 December 2018