Slurm Task Plugin Programmer Guide

Overview

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

Slurm task management plugins are Slurm plugins that implement the Slurm task management API described herein. 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タスク管理プラグインは、ここで説明するSlurmタスク管理APIを実装するSlurmプラグインです。これらは通常、タスクの親和性を制御するために使用されます(つまり、タスクをプロセッサにバインドします)。これらは、次の仕様のSlurm Plugin 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).
    affinity —プロセッサへのタスクバインディングを実装するプラグイン。タスクバインディングに使用される実際のメカニズムは、Slurmのビルド時に「configure」プログラムによって決定される利用可能なインフラストラクチャと、slurm.conf(Slurm構成ファイル)で定義されているTaskPluginParamの値に依存します。
  • cgroup — Use Linux cgroups for binding tasks to resources.
    cgroup —タスクをリソースにバインドするためにLinux cgroupを使用します。
  • none — A plugin that implements the API without providing any services. This is the default behavior and provides no task binding.
    none —サービスを提供せずにAPIを実装するプラグイン。これはデフォルトの動作であり、タスクバインディングは提供されません。

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. 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からプラグインをロードしようとすると、エラーが発生します。指定されていない場合、プラグインは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. These values must not be used as return values in integer-valued functions in the API. The proper error return value from integer-valued functions is SLURM_ERROR.
実装は、列挙されたerrnoを維持する必要があります(必ずしも直接エクスポートする必要はありません)。これにより、SlurmがAPI呼び出しの失敗の理由を可能な限り実際に発見できるようになります。これらの値は、APIの整数値関数の戻り値として使用しないでください。整数値関数からの適切なエラー戻り値は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. 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()の前に呼び出されます。

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.
説明:バッチジョブを起動する準備をします。ノード、ソケット、およびコアリソースの可用性を確立します。ユーザーrootとしてslurmdデーモンによって実行されます。

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

Returns: SLURM_SUCCESS if successful. On failure, the plugin should return SLURM_ERROR and set the errno to an appropriate value to indicate the reason for failure.
戻り値:成功した場合はSLURM_SUCCESS。失敗すると、プラグインは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.
説明:ジョブを起動する準備をします。ノード、ソケット、およびコアリソースの可用性を確立します。ユーザーrootとしてslurmdデーモンによって実行されます。

Arguments:
req   (input/output) Task launch request specification including node, socket, and core specifications. See src/common/slurm_protocol_defs.h for the data structure definition.
req(入力/出力)ノード、ソケット、およびコア仕様を含むタスク起動要求仕様。データ構造の定義については、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. On failure, the plugin should return SLURM_ERROR and set the errno to an appropriate value to indicate the reason for failure.
戻り値:成功した場合はSLURM_SUCCESS。失敗すると、プラグインは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.
説明:ジョブの開始用にリソースを予約します。ユーザーrootとしてslurmdデーモンによって実行されます。

Arguments:
req   (input) Task launch request specification including node, socket, and core specifications. See src/common/slurm_protocol_defs.h for the data structure definition.
req(入力)ノード、ソケット、およびコア仕様を含むタスク起動要求仕様。データ構造の定義については、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. On failure, the plugin should return SLURM_ERROR and set the errno to an appropriate value to indicate the reason for failure.
戻り値:成功した場合はSLURM_SUCCESS。失敗すると、プラグインは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.
説明:以前にジョブに予約されたリソースを一時的に解放します。ユーザーrootとしてslurmdデーモンによって実行されます。

Arguments: job_id   (input) ID of the job which is being suspended.
job_id(入力)一時停止中のジョブのID。

Returns: SLURM_SUCCESS if successful. On failure, the plugin should return SLURM_ERROR and set the errno to an appropriate value to indicate the reason for failure.
戻り値:成功した場合はSLURM_SUCCESS。失敗すると、プラグインは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. Executed by the slurmd daemon as user root.
説明:task_p_slurmd_suspend_job関数を使用して以前に解放されたリソースを再利用します。ユーザーrootとしてslurmdデーモンによって実行されます。

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

Returns: SLURM_SUCCESS if successful. On failure, the plugin should return SLURM_ERROR and set the errno to an appropriate value to indicate the reason for failure.
戻り値:成功した場合はSLURM_SUCCESS。失敗すると、プラグインは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.
説明:ジョブのために以前に予約されたリソースを解放します。ユーザーrootとしてslurmdデーモンによって実行されます。

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

Returns: SLURM_SUCCESS if successful. On failure, the plugin should return SLURM_ERROR and set the errno to an appropriate value to indicate the reason for failure.
戻り値:成功した場合はSLURM_SUCCESS。失敗すると、プラグインは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. Executed by the slurmstepd program as user root.
説明:task_p_pre_setuid()は、ユーザーがジョブを起動するためのUIDを設定する前に呼び出されます。ユーザーrootとしてslurmstepdプログラムによって実行されます。

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. On failure, the plugin should return SLURM_ERROR and set the errno to an appropriate value to indicate the reason for failure.
戻り値:成功した場合はSLURM_SUCCESS。失敗すると、プラグインは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. Note that no particular task related information is available in the job structure at that time. Executed by the slurmstepd program as user root.
説明:task_p_pre_launch_priv()は、フォークの直後に各フォークタスクによって呼び出されます。現時点では、ジョブ構造で特定のタスク関連情報を利用できないことに注意してください。ユーザーrootとしてslurmstepdプログラムによって実行されます。

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. On failure, the plugin should return SLURM_ERROR and set the errno to an appropriate value to indicate the reason for failure.
戻り値:成功した場合はSLURM_SUCCESS。失敗すると、プラグインは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. Executed by the slurmstepd program as the job's owner. It is followed by TaskProlog program (as configured in slurm.conf) and --task-prolog (from srun command line).
説明:task_p_pre_launch()は、アプリケーションタスクの実行前に呼び出されます。ジョブの所有者としてslurmstepdプログラムによって実行されます。続いて、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. On failure, the plugin should return SLURM_ERROR and set the errno to an appropriate value to indicate the reason for failure.
戻り値:成功した場合はSLURM_SUCCESS。失敗すると、プラグインは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. Executed by the slurmstepd program as the job's owner. It is preceded by --task-epilog (from srun command line) followed by TaskEpilog program (as configured in slurm.conf).
説明:task_p_term()は、ジョブステップの終了後に呼び出されます。ジョブの所有者としてslurmstepdプログラムによって実行されます。--task-epilog(srunコマンドラインから)の後にTaskEpilogプログラム(slurm.confで構成されている)が続きます。

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

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

Returns: SLURM_SUCCESS if successful. On failure, the plugin should return SLURM_ERROR and set the errno to an appropriate value to indicate the reason for failure.
戻り値:成功した場合はSLURM_SUCCESS。失敗すると、プラグインは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. Executed by the slurmstepd program as user root.
説明:task_p_post_step()は、ジョブステップのすべてのタスクの終了後に呼び出されます。ユーザーrootとしてslurmstepdプログラムによって実行されます。

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

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

Last modified 30 January 2018