Slurm Preemption Plugin API

Overview

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

Slurm preemption plugins are Slurm plugins that identify which jobs can be preempted by a pending job.
Slurmプリエンプションプラグインは、保留中のジョブによってプリエンプションできるジョブを識別するSlurmプラグインです。
They must conform to the Slurm Plugin API with the following specifications:
これらは、次の仕様のSlurmプラグイン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.
注:これらの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()の前に呼び出されます。

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.
リストは、不要になったときにlist_destroy関数を使用して解放する必要があります。
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.
たとえば、特定のパーティションまたは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