Slurm Scheduler Plugin API

Overview

This document describe.
このドキュメントでは説明します。
Slurm scheduler 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スケジューラプラグインを作成したいプログラマー向けのリソースとして意図されています。

It is noteworthy that two different models are used for job scheduling.
ジョブのスケジューリングに2つの異なるモデルが使用されていることは注目に値します。
The backfill scheduler let.
バックフィルスケジューラーが許可します。
Slurm establishes the initial job priority and can periodically alter job priorities to change their order within the queue.
Slurmは初期ジョブ優先度を確立し、定期的にジョブ優先度を変更してキュー内の順序を変更できます。
Developers may use the model that best fits their needs.
開発者は、ニーズに最適なモデルを使用できます。
Note that a separate node selection plugin is available for controlling that aspect of scheduling.
スケジューリングのその側面を制御するために、別のノード選択プラグインが利用可能であることに注意してください。

Slurm scheduler plugins are Slurm plugins that implement the Slurm scheduler API described herein.
Slurmスケジューラプラグインは、ここで説明するSlurmスケジューラAPIを実装するSlurmプラグインです。
They must conform to the Slurm Plugin API with the following specifications:
これらは、次の仕様のSlurmプラグインAPIに準拠している必要があります。

const char plugin_type[]
The major type must be "sched." The minor type can be any recognizable abbreviation for the type of scheduler.
メジャータイプは「スケジュール」する必要があります。マイナータイプは、スケジューラーのタイプの認識可能な省略形にすることができます。
We recommend, for example:
たとえば、次のことをお勧めします。

  • builtin — A plugin that implements the API without providing any actual scheduling services.
    組み込み—実際のスケジューリングサービスを提供せずにAPIを実装するプラグイン。
    This is the default behavior and implements first-in-first-out scheduling.
    これはデフォルトの動作であり、先入れ先出しスケジューリングを実装します。
  • backfill — Raise the priority of jobs if doing so results in their starting earlier without any delay in the expected initiation time of any higher priority job.
    バックフィル—優先度の高いジョブの予想開始時間に遅れることなく、ジョブの開始が早くなる場合は、ジョブの優先度を上げます。

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

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 slurm_sched_p_reconfig (void);

Description: Reread any configuration files.
説明:構成ファイルを再読み込みします。

Arguments: None

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

int slurm_sched_p_schedule (void);

Description: For passive schedulers, invoke a scheduling pass.
説明:パッシブスケジューラの場合、スケジューリングパスを呼び出します。

Arguments: None

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 slurm_sched_p_newalloc(job_record_t *job_ptr);

Description: Note the successful allocation of resources to a job.
説明:ジョブへのリソースの割り当てが成功したことに注意してください。

Arguments: Pointer to the slurmctld job structure.
引数:slurmctldジョブ構造へのポインター。
This can be used to get partition, allocated resources, time limit, etc.
これは、パーティション、割り当てられたリソース、時間制限などを取得するために使用できます。

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 slurm_sched_p_freealloc(job_record_t *job_ptr);

Description: Note the successful release of resources for a job.
説明:ジョブのリソースが正常に解放されたことに注意してください。

Arguments: Pointer to the slurmctld job structure.
引数:slurmctldジョブ構造へのポインター。
This can be used to get partition, allocated resources, time limit, etc.
これは、パーティション、割り当てられたリソース、時間制限などを取得するために使用できます。

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を適切な値に設定して失敗の理由を示す必要があります。

uint32_t slurm_sched_p_initial_priority(uint32_t last_prio, job_record_t *job_ptr);

Description: Establish the initial priority of a new job.
説明:新しいジョブの初期優先度を確立します。

Arguments:
last_prio (input) default priority of the previously submitted job.
last_prio(入力)以前に送信されたジョブのデフォルトの優先度。
This can be used to provide First-In-First-Out scheduling by assigning the new job a priority lower than this value.
これを使用して、新しいジョブにこの値よりも低い優先度を割り当てることにより、先入れ先出しスケジューリングを提供できます。
This could also be used to establish an initial priority of zero for all jobs, representing a "held" state.
これを使用して、すべてのジョブの初期優先度をゼロに設定し、「保留」状態を表すこともできます。
The scheduler plugin can then decide where and when to initiate pending jobs by altering their priority and (optionally) list of required nodes.
スケジューラプラグインは、優先度と(オプションで)必要なノードのリストを変更することにより、保留中のジョブを開始する場所とタイミングを決定できます。

job_ptr (input) Pointer to the slurmctld job structure.
job_ptr(入力)slurmctldジョブ構造へのポインター。
This can be used to get partition, resource requirements, time limit, etc.
これは、パーティション、リソース要件、時間制限などを取得するために使用できます。

Returns: The priority to be assigned to this job.
戻り値:このジョブに割り当てられる優先順位。

void slurm_sched_p_job_is_pending (void);

Description: Note that some job is pending execution.
説明:一部のジョブは実行を保留していることに注意してください。

Arguments: None

Returns: Nothing.

void slurm_sched_p_partition_change (void);

Description: Note that some partition state change happened such as time or size limits.
説明:時間やサイズの制限など、パーティションの状態が変化したことに注意してください。

Arguments: None

Returns: Nothing.

char *slurm_sched_p_get_conf (void);

Description: Return scheduler specific configuration information to be reported for the scontrol show configuration command.
説明:scontrol showconfigurationコマンドで報告されるスケジューラー固有の構成情報を返します。

Arguments: None

Returns: A string containing configuration information.
戻り値:構成情報を含む文字列。
The return value is released using the xfree() function.
戻り値は、xfree()関数を使用して解放されます。

Last modified 23 October 2019