Slurm Preemption Plugin API
Overview
This document describes Slurm preemption plugins and the API that defines
them. It is intended as a resource to programmers wishing to write their own
Slurm preemption plugins.
このドキュメントでは、Slurmプリエンプションプラグインとそれらを定義するAPIについて説明します。独自のSlurmプリエンプションプラグインを作成したいプログラマへのリソースとして意図されています。
Slurm preemption plugins are Slurm plugins that identify which jobs
can be preempted by a pending job. They must conform to the Slurm Plugin
API with the following specifications:
Slurmプリエンプションプラグインは、保留中のジョブによってプリエンプトできるジョブを識別するSlurmプラグインです。これらは、次の仕様のSlurm Plugin APIに準拠している必要があります。
const char
plugin_type[]="major/minor"
The major type must be "preempt." The minor type can be any
recognizable abbreviation for the type of preemption.
We recommend, for example:
主なタイプは「プリエンプト」である必要があります。マイナータイプは、プリエンプションのタイプの認識可能な省略形です。たとえば、次のことをお勧めします。
- none — This plugin prevents any job preemption.
none —このプラグインは、ジョブのプリエンプションを防ぎます。 - partition_prio — This plugin permit pending jobs from one
partition to preempt jobs from a lower priority partition.
partition_prio —このプラグインは、1つのパーティションからの保留中のジョブが優先度の低いパーティションからのジョブをプリエンプトすることを許可します。 - qos — This plugin permits jobs to preempt others based
upon their Quality Of Service values as defined in the Slurm database.
qos —このプラグインは、Slurmデータベースで定義されているサービスの品質値に基づいて、ジョブが他のジョブを先取りできるようにします。
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関数の変更が原因で障害を診断することが困難になる場合があります。
The programmer is urged to study
src/plugins/preempt/partition_prio/preempt_partition_prio.c
for an example implementation of a Slurm preemption plugin.
プログラマーは、slurmプリエンプションプラグインの実装例について、src / plugins / preempt / partition_prio / preempt_partition_prio.cを調べることをお勧めします。
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()の前に呼び出されます。
List find_preemptable_jobs(job_record_t *job_ptr)
Description: Identifies the jobs
which can be preempted by a specific pending job.
説明:特定の保留中のジョブによって横取りされる可能性のあるジョブを識別します。
Arguments:
job_ptr (input) a pointer to the
pending job which is attempting to be started
job_ptr(入力)開始しようとしている保留中のジョブへのポインタ
Returns: A list of pointers to
jobs which may be preempted.
The list should be be released using the list_destroy function when
no longer required.
This list should be sorted in order from most attractive to
preempt to least attractive to preempt (e.g. lowest to highest priority).
For example, even within a given partition or QOS one might want to
smaller jobs first.
戻り値:横取りされる可能性のあるジョブへのポインタのリスト。リストは、不要になったときにlist_destroy関数を使用して解放する必要があります。このリストは、最も魅力的なものからプリエンプトするもの、最も魅力的でないものからプリエンプトするもの(たとえば、最低から最高の優先度)の順にソートする必要があります。たとえば、特定のパーティションまたはQoS内であっても、最初にジョブを小さくしたい場合があります。
uint16_t job_preempt_mode(job_record_t *job_ptr)
Description: Identifies the mechanism
used to preempt the specified job.
説明:指定されたジョブをプリエンプトするために使用されるメカニズムを識別します。
Arguments:
job_ptr (input) a pointer to the
running job to be preempted
job_ptr(入力)横取りされる実行中のジョブへのポインタ
Returns: PREEMPT_MODE as defined in
the slurm/slurm.h file
戻り値:slurm / slurm.hファイルで定義されているPREEMPT_MODE
bool preemption_enabled(void)
Description: Report whether or not job
preemption is enabled.
説明:ジョブのプリエンプションが有効かどうかを報告します。
Returns: true if running jobs may be
preempted, otherwise false
戻り値:実行中のジョブがプリエンプトされる可能性がある場合はtrue、そうでない場合はfalse
Last modified 23 October 2019