Slurm Task Plugin Programmer Guide

Overview

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

Slurm task management plugins are Slurm plugins that implement the Slurm task management API described herein.
Slurmタスク管理プラグインは、ここで説明するSlurmタスク管理APIを実装するSlurmプラグインです。
They would typically be used to control task affinity (i.e. binding tasks to processors).
これらは通常、タスクのアフィニティを制御するために使用されます(つまり、タスクをプロセッサにバインドします)。
They must conform to the Slurm Plugin API with the following specifications:
これらは、次の仕様のSlurmプラグインAPIに準拠している必要があります。

const char plugin_type[]
The major type must be "task." The minor type can be any recognizable abbreviation for the type of task management.
主要なタイプは「タスク」でなければなりません。マイナータイプは、タスク管理のタイプの認識可能な省略形にすることができます。
We recommend, for example:
たとえば、次のことをお勧めします。

  • affinity — A plugin that implements task binding to processors.
    アフィニティ—プロセッサへのタスクバインディングを実装するプラグイン。
    The actual mechanism used to task binding is dependent upon the available infrastructure as determined by the "configure" program when Slurm is built and the value of the TaskPluginParam as defined in the slurm.conf (Slurm configuration file).
    タスクバインディングに使用される実際のメカニズムは、Slurmのビルド時に「configure」プログラムによって決定される使用可能なインフラストラクチャと、slurm.conf(Slurm構成ファイル)で定義されているTaskPluginParamの値によって異なります。
  • cgroup — Use Linux cgroups for binding tasks to resources.
    cgroup —タスクをリソースにバインドするためにLinuxcgroupを使用します。
  • none — A plugin that implements the API without providing any services.
    none —サービスを提供せずにAPIを実装するプラグイン。
    This is the default behavior and provides no task binding.
    これはデフォルトの動作であり、タスクのバインドは提供されません。

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関数の変更により、障害の診断が困難になる可能性があります。

Data Objects

The implementation must maintain (though not necessarily directly export) an enumerated errno to allow Slurm to discover as practically as possible the reason for any failed API call.
実装は、列挙型errnoを維持する必要があります(必ずしも直接エクスポートする必要はありません)。これにより、SlurmはAPI呼び出しの失敗の理由を可能な限り実際に検出できるようになります。
These values must not be used as return values in integer-valued functions in the API.
これらの値は、APIの整数値関数の戻り値として使用しないでください。
The proper error return value from integer-valued functions is SLURM_ERROR.
整数値関数からの適切なエラー戻り値はSLURM_ERRORです。

API Functions

The following functions must appear.
次の関数が表示される必要があります。
Functions which are not implemented should be stubbed.
実装されていない関数はスタブする必要があります。

int init (void)

Description:
Called when the plugin is loaded, 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.
プラグインが削除されたときに呼び出されます。
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()の前に呼び出されます。

int task_p_slurmd_batch_request (batch_job_launch_msg_t *req);

Description: Prepare to launch a batch job.
説明:バッチジョブを起動する準備をします。
Establish node, socket, and core resource availability for it.
ノード、ソケット、およびコアリソースの可用性を確立します。
Executed by the slurmd daemon as user root.
slurmdデーモンによってユーザーrootとして実行されます。

Argument:
req   (input/output) Batch job launch request specification.
req(入力/出力)バッチジョブ起動要求の指定。
See src/common/slurm_protocol_defs.h for the data structure definition.
データ構造の定義については、src / common /slurm_protocol_defs.hを参照してください。

Returns: SLURM_SUCCESS if successful.
戻り値:成功した場合はSLURM_SUCCESS。
On failure, the plugin should return SLURM_ERROR and set the errno to an appropriate value to indicate the reason for failure.
失敗した場合、プラグインはSLURM_ERRORを返し、errnoを適切な値に設定して失敗の理由を示す必要があります。

int task_p_slurmd_launch_request ( launch_tasks_request_msg_t *req, uint32_t node_id);

Description: Prepare to launch a job.
説明:ジョブを開始する準備をします。
Establish node, socket, and core resource availability for it.
ノード、ソケット、およびコアリソースの可用性を確立します。
Executed by the slurmd daemon as user root.
slurmdデーモンによってユーザーrootとして実行されます。

Arguments:
req   (input/output) Task launch request specification including node, socket, and core specifications.
req(入力/出力)ノード、ソケット、およびコアの仕様を含むタスク起動要求の仕様。
See src/common/slurm_protocol_defs.h for the data structure definition.
データ構造の定義については、src / common /slurm_protocol_defs.hを参照してください。

node_id   (input) ID of the node on which resources are being acquired (zero origin).
node_id(入力)リソースが取得されているノードのID(ゼロ原点)。

Returns: SLURM_SUCCESS if successful.
戻り値:成功した場合はSLURM_SUCCESS。
On failure, the plugin should return SLURM_ERROR and set the errno to an appropriate value to indicate the reason for failure.
失敗した場合、プラグインはSLURM_ERRORを返し、errnoを適切な値に設定して失敗の理由を示す必要があります。

int task_p_slurmd_reserve_resources ( launch_tasks_request_msg_t *req, uint32_t node_id);

Description: Reserve resources for the initiation of a job.
説明:ジョブの開始のためにリソースを予約します。
Executed by the slurmd daemon as user root.
slurmdデーモンによってユーザーrootとして実行されます。

Arguments:
req   (input) Task launch request specification including node, socket, and core specifications.
req(入力)ノード、ソケット、およびコアの仕様を含むタスク起動要求の仕様。
See src/common/slurm_protocol_defs.h for the data structure definition.
データ構造の定義については、src / common /slurm_protocol_defs.hを参照してください。

node_id   (input) ID of the node on which the resources are being acquired (zero origin).
node_id(入力)リソースが取得されているノードのID(ゼロ原点)。

Returns: SLURM_SUCCESS if successful.
戻り値:成功した場合はSLURM_SUCCESS。
On failure, the plugin should return SLURM_ERROR and set the errno to an appropriate value to indicate the reason for failure.
失敗した場合、プラグインはSLURM_ERRORを返し、errnoを適切な値に設定して失敗の理由を示す必要があります。

int task_p_slurmd_suspend_job (uint32_t job_id);

Description: Temporarily release resources previously reserved for a job.
説明:以前にジョブ用に予約されていたリソースを一時的に解放します。
Executed by the slurmd daemon as user root.
slurmdデーモンによってユーザーrootとして実行されます。

Arguments: job_id   (input) ID of the job which is being suspended.
job_id(入力)中断されているジョブのID。

Returns: SLURM_SUCCESS if successful.
戻り値:成功した場合はSLURM_SUCCESS。
On failure, the plugin should return SLURM_ERROR and set the errno to an appropriate value to indicate the reason for failure.
失敗した場合、プラグインはSLURM_ERRORを返し、errnoを適切な値に設定して失敗の理由を示す必要があります。

int task_p_slurmd_resume_job (uint32_t job_id);

Description: Reclaim resources which were previously released using the task_p_slurmd_suspend_job function.
説明:task_p_slurmd_suspend_job関数を使用して以前に解放されたリソースを再利用します。
Executed by the slurmd daemon as user root.
slurmdデーモンによってユーザーrootとして実行されます。

Arguments: job_id   (input) ID of the job which is being resumed.
引数:job_id(入力)再開されるジョブのID。

Returns: SLURM_SUCCESS if successful.
戻り値:成功した場合はSLURM_SUCCESS。
On failure, the plugin should return SLURM_ERROR and set the errno to an appropriate value to indicate the reason for failure.
失敗した場合、プラグインはSLURM_ERRORを返し、errnoを適切な値に設定して失敗の理由を示す必要があります。

int task_p_slurmd_release_resources (uint32_t job_id);

Description: Release resources previously reserved for a job.
説明:以前にジョブ用に予約されていたリソースを解放します。
Executed by the slurmd daemon as user root.
slurmdデーモンによってユーザーrootとして実行されます。

Arguments: job_id   (input) ID of the job which has completed.
引数:job_id(入力)完了したジョブのID。

Returns: SLURM_SUCCESS if successful.
戻り値:成功した場合はSLURM_SUCCESS。
On failure, the plugin should return SLURM_ERROR and set the errno to an appropriate value to indicate the reason for failure.
失敗した場合、プラグインはSLURM_ERRORを返し、errnoを適切な値に設定して失敗の理由を示す必要があります。

int task_p_pre_setuid (stepd_step_rec_t *job);

Description: task_p_pre_setuid() is called before setting the UID for the user to launch his jobs.
説明:task_p_pre_setuid()は、ユーザーがジョブを起動するためのUIDを設定する前に呼び出されます。
Executed by the slurmstepd program as user root.
slurmstepdプログラムによってユーザーrootとして実行されます。

Arguments: job   (input) pointer to the job to be initiated.
引数:開始するジョブへのジョブ(入力)ポインター。
See src/slurmd/slurmstepd/slurmstepd_job.h for the data structure definition.
データ構造の定義については、src / slurmd / slurmstepd /slurmstepd_job.hを参照してください。

Returns: SLURM_SUCCESS if successful.
戻り値:成功した場合はSLURM_SUCCESS。
On failure, the plugin should return SLURM_ERROR and set the errno to an appropriate value to indicate the reason for failure.
失敗した場合、プラグインはSLURM_ERRORを返し、errnoを適切な値に設定して失敗の理由を示す必要があります。

int task_p_pre_launch_priv (stepd_step_rec_t *job);

Description: task_p_pre_launch_priv() is called by each forked task just after the fork.
説明:task_p_pre_launch_priv()は、フォークの直後にフォークされた各タスクによって呼び出されます。
Note that no particular task related information is available in the job structure at that time.
現時点では、ジョブ構造で特定のタスク関連情報を利用できないことに注意してください。
Executed by the slurmstepd program as user root.
slurmstepdプログラムによってユーザーrootとして実行されます。

Arguments: job   (input) pointer to the job to be initiated.
引数:開始するジョブへのジョブ(入力)ポインター。
See src/slurmd/slurmstepd/slurmstepd_job.h for the data structure definition.
データ構造の定義については、src / slurmd / slurmstepd /slurmstepd_job.hを参照してください。

Returns: SLURM_SUCCESS if successful.
戻り値:成功した場合はSLURM_SUCCESS。
On failure, the plugin should return SLURM_ERROR and set the errno to an appropriate value to indicate the reason for failure.
失敗した場合、プラグインはSLURM_ERRORを返し、errnoを適切な値に設定して失敗の理由を示す必要があります。

int task_p_pre_launch (stepd_step_rec_t *job);

Description: task_p_pre_launch() is called prior to exec of application task.
説明:task_p_pre_launch()は、アプリケーションタスクの実行前に呼び出されます。
Executed by the slurmstepd program as the job's owner.
ジョブの所有者としてslurmstepdプログラムによって実行されます。
It is followed by TaskProlog program (as configured in slurm.conf) and --task-prolog (from srun command line).
その後に、TaskPrologプログラム(slurm.confで構成されている)と--task-prolog(srunコマンドラインから)が続きます。

Arguments: job   (input) pointer to the job to be initiated.
引数:開始するジョブへのジョブ(入力)ポインター。
See src/slurmd/slurmstepd/slurmstepd_job.h for the data structure definition.
データ構造の定義については、src / slurmd / slurmstepd /slurmstepd_job.hを参照してください。

Returns: SLURM_SUCCESS if successful.
戻り値:成功した場合はSLURM_SUCCESS。
On failure, the plugin should return SLURM_ERROR and set the errno to an appropriate value to indicate the reason for failure.
失敗した場合、プラグインはSLURM_ERRORを返し、errnoを適切な値に設定して失敗の理由を示す必要があります。

int task_p_post_term (stepd_step_rec_t *job, slurmd_task_p_info_t *task);

Description: task_p_term() is called after termination of job step.
説明:task_p_term()は、ジョブステップの終了後に呼び出されます。
Executed by the slurmstepd program as the job's owner.
ジョブの所有者としてslurmstepdプログラムによって実行されます。
It is preceded by --task-epilog (from srun command line) followed by TaskEpilog program (as configured in slurm.conf).
その前に--task-epilog(srunコマンドラインから)が続き、その後にTaskEpilogプログラム(slurm.confで構成されている)が続きます。

Arguments:
job   (input) pointer to the job which has terminated.
job(入力)終了したジョブへのポインター。
See src/slurmd/slurmstepd/slurmstepd_job.h for the data structure definition.
データ構造の定義については、src / slurmd / slurmstepd /slurmstepd_job.hを参照してください。

task   (input) pointer to the task which has terminated.
task(入力)終了したタスクへのポインター。
See src/slurmd/slurmstepd/slurmstepd_job.h for the data structure definition.
データ構造の定義については、src / slurmd / slurmstepd /slurmstepd_job.hを参照してください。

Returns: SLURM_SUCCESS if successful.
戻り値:成功した場合はSLURM_SUCCESS。
On failure, the plugin should return SLURM_ERROR and set the errno to an appropriate value to indicate the reason for failure.
失敗した場合、プラグインはSLURM_ERRORを返し、errnoを適切な値に設定して失敗の理由を示す必要があります。

int task_p_post_step (stepd_step_rec_t *job);

Description: task_p_post_step() is called after termination of all the tasks of the job step.
説明:task_p_post_step()は、ジョブステップのすべてのタスクの終了後に呼び出されます。
Executed by the slurmstepd program as user root.
slurmstepdプログラムによってユーザーrootとして実行されます。

Arguments: job   (input) pointer to the job which has terminated.
引数:終了したジョブへのjob(入力)ポインター。
See src/slurmd/slurmstepd/slurmstepd_job.h for the data structure definition.
データ構造の定義については、src / slurmd / slurmstepd /slurmstepd_job.hを参照してください。

Returns: SLURM_SUCCESS if successful.
戻り値:成功した場合はSLURM_SUCCESS。
On failure, the plugin should return SLURM_ERROR and set the errno to an appropriate value to indicate the reason for failure.
失敗した場合、プラグインはSLURM_ERRORを返し、errnoを適切な値に設定して失敗の理由を示す必要があります。

Last modified 30 January 2018