Slurm MPI Plugin API

Overview

This document describes Slurm MPI selection plugins and the API that defines them.
このドキュメントでは、SlurmMPI選択プラグインとそれらを定義するAPIについて説明します。
It is intended as a resource to programmers wishing to write their own Slurm node selection plugins.
これは、独自のSlurmノード選択プラグインを作成したいプログラマー向けのリソースとして意図されています。

Slurm MPI selection plugins are Slurm plugins that implement the which version of mpi is used during execution of the new Slurm job.
Slurm MPI選択プラグインは、新しいSlurmジョブの実行中に使用されるmpiのバージョンを実装するSlurmプラグインです。
API described herein.
ここで説明するAPI。
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.
これらは、保留中のジョブのMPIバージョンを選択することと、ジョブの起動または終了のためにmpi固有のタスクを実行することの両方のメカニズムを提供することを目的としています。
The plugins must conform to the Slurm Plugin API with the following specifications:
プラグインは、次の仕様のSlurmプラグイン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.
メジャータイプは「mpi」である必要があります。マイナータイプは、ノード選択アルゴリズムのタイプの認識可能な省略形にすることができます。
We recommend, for example:
たとえば、次のことをお勧めします。

  • 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()を実行します。これにより、正しいmpiを使用してsrunと対話するように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デーモンおよびsrunメモリ内のデータ構造を直接読み取ったり変更したりすることが期待されています。
Slurmd is a multi-threaded program with independent read and write locks on each data structure type.
Slurmdは、各データ構造タイプに独立した読み取りおよび書き込みロックを備えたマルチスレッドプログラムです。
Therefore the type of operations permitted on various data structures is identified for each function.
したがって、さまざまなデータ構造で許可される操作のタイプは、関数ごとに識別されます。

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.
注:これらのinitおよびfini関数は、dlopen(3)システムライブラリで説明されているものと同じではありません。
The C run-time system co-opts those symbols for its own initialization.
Cランタイムシステムは、独自の初期化のためにこれらのシンボルを採用します。
The system _init() is called before the Slurm init(), and the Slurm fini() is called before the system's _fini().
システム_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.
説明:srunによって呼び出され、slurmdの環境を正しいmpiの環境に構成します。

Arguments:
job    (input) Pointer to the Job Step (stepd_step_rec_t) that about to run.
job(入力)実行しようとしているジョブステップ(stepd_step_rec_t)へのポインター。
Cannot be NULL.
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.
戻り値:成功した場合はSLURM_SUCCESS。
On failure, the plugin should return SLURM_ERROR.
失敗すると、プラグインは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.
説明:最初のジョブプロセスを作成するためにフォークする前に、slurmstepdによって呼び出されます。
Most all the real processing happens here.
ほとんどすべての実際の処理はここで行われます。
This is not called for batch jobs and extern steps.
これは、バッチジョブおよび外部ステップでは呼び出されません。

Arguments:
job    (input) Pointer to the Job Step (stepd_step_rec_t) that about to run.
job(入力)実行しようとしているジョブステップ(stepd_step_rec_t)へのポインター。
Cannot be NULL.
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.
戻り値:成功した場合はSLURM_SUCCESS。
On failure, the plugin should return SLURM_ERROR.
失敗すると、プラグインは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.
説明:forkしてジョブユーザーになった直後、ただしユーザータスクの実行直前にslurmstepdプロセスによって呼び出されます。
This is not called for batch job steps and extern steps.
これは、バッチジョブステップおよび外部ステップでは呼び出されません。

Arguments:
job    (input) Pointer to the Job Step (stepd_step_rec_t) that about to run.
job(入力)実行しようとしているジョブステップ(stepd_step_rec_t)へのポインター。
Cannot be NULL.
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.
説明:すべてのタスクが完了した後、srunによって呼び出されます。
Cleans up anything that needs cleaning up after execution.
実行後にクリーンアップが必要なものはすべてクリーンアップします。

Arguments:
state Launch state of MPI.
stateMPIの起動状態。
Currently, a typedef of void.
現在、voidのtypedefです。

Returns: SLURM_SUCCESS if successful.
戻り値:成功した場合はSLURM_SUCCESS。
On failure, the plugin should return SLURM_ERROR, causing slurmctld to exit.
失敗すると、プラグインはSLURM_ERRORを返し、slurmctldを終了させます。

Last modified 15 December 2018