Slurm Priority Plugin API
Overview
This document describes Slurm priority plugins and the API that defines
them. It is intended as a resource to programmers wishing to write their own
Slurm priority plugins.
このドキュメントでは、Slurm優先プラグインとそれらを定義するAPIについて説明します。これは、独自のSlurm優先プラグインを作成したいプログラマへのリソースとして意図されています。
Slurm priority plugins are Slurm plugins that implement the Slurm priority
API described herein. They must conform to the Slurm Plugin API with the
following specifications:
Slurm優先度プラグインは、ここで説明するSlurm優先度APIを実装するSlurmプラグインです。これらは、次の仕様のSlurm Plugin APIに準拠している必要があります。
const char
plugin_type[]="major/minor"
The major type must be "priority." The minor type can be any
recognizable abbreviation for the type of priority.
We recommend, for example:
主なタイプは「優先度」でなければなりません。マイナータイプは、優先度のタイプの認識可能な省略形です。たとえば、次のことをお勧めします。
- basic — A plugin that implements the API and provides basic FIFO
job priority.
basic — APIを実装し、基本的なFIFOジョブの優先順位を提供するプラグイン。 - multifactor — The multi-factor job priority plugin.
multifactor —多要素ジョブ優先プラグイン。
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関数の変更が原因で障害を診断することが困難になる場合があります。
The programmer is urged to study
src/plugins/priority/basic/priority_basic.c
for an example implementation of a Slurm priority plugin.
プログラマーは、slurm優先度プラグインの実装例について、src / plugins / priority / basic / priority_basic.cを調べることをお勧めします。
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. Plugin-specific enumerated integer values
may be used when appropriate.
実装は、列挙されたerrnoを維持する必要があります(必ずしも直接エクスポートする必要はありません)。これにより、Slurmは、API呼び出しの失敗の理由を可能な限り実用的に発見できます。プラグイン固有の列挙整数値は、適切な場合に使用できます。
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. The implementation should endeavor to provide useful and pertinent
information by whatever means is practical. Successful API calls are not
required to reset any errno to a known value. However, the initial value of any
errno, prior to any error condition arising, should be SLURM_SUCCESS.
これらの値は、APIの整数値関数の戻り値として使用しないでください。整数値関数からの適切なエラー戻り値はSLURM_ERRORです。実装は、実用的であるどんな手段によっても有用で適切な情報を提供するよう努めるべきです。errnoを既知の値にリセットするために、成功したAPI呼び出しは必要ありません。ただし、エラー状態が発生する前のerrnoの初期値はSLURM_SUCCESSである必要があります。
job_record
Description: A slurmctld structure that
contains details about a job.
説明:ジョブに関する詳細を含むslurmctld構造。
acct_assoc_rec_t
Description: A slurm_accounting_storage
structure that contains details about an association.
説明:関連付けに関する詳細を含むslurm_accounting_storage構造。
priority_factors_object_t
Description: A structure that contains a
job's priority factors.
説明:ジョブの優先要素を含む構造。
priority_factors_request_msg_t
Description: Used to request job priority
factors. Contains a list of specific job and user ids of the jobs the user
wants to see.
説明:ジョブの優先度を要求するために使用されます。特定のジョブのリストと、ユーザーが表示したいジョブのユーザーIDが含まれています。
priority_factors_response_msg_t
Description: Used to return the list of
priority_factors_object_t's containing the job priority factors the user has
asked to see.
説明:ユーザーが表示を要求したジョブの優先度要素を含むpriority_factors_object_tのリストを返すために使用されます。
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()の前に呼び出されます。
uint32_t priority_p_set(uint32_t last_prio, job_record_t *job_ptr)
Description: Sets the priority of the job.
説明:ジョブの優先順位を設定します。
Arguments:
last_prio (input) the priority assigned to the
last job
last_prio(入力)最後のジョブに割り当てられた優先順位
job_ptr (input) pointer to the job record.
job_ptr(入力)ジョブレコードへのポインタ。
Returns: the priority assigned to the job
戻り値:ジョブに割り当てられた優先度
void priority_p_reconfig(bool assoc_clear)
Description: Refresh the plugin's
configuration. Called whenever slurmctld is reconfigured.
説明:プラグインの構成を更新します。slurmctldが再構成されるたびに呼び出されます。
Arguments:
assoc_clear (input) true if association
and QOS used_cpu_run_secs field has been reset. This should be set to true
when Slurm is reconfigured, but false if an RPC is used to change only the
debug level of debug flags.
引数:assoc_clear(入力)アソシエーションとQOSのused_cpu_run_secsフィールドがリセットされている場合はtrue。Slurmが再構成されている場合はtrueに設定する必要がありますが、RPCを使用してデバッグフラグのデバッグレベルのみを変更する場合はfalseに設定する必要があります。
Returns: void
void priority_p_set_assoc_usage(acct_assoc_rec_t *assoc)
Description: Set the normalized and
effective usage for an association.
説明:関連付けの正規化された有効な使用法を設定します。
Arguments:
assoc (input/output) pointer to the association.
引数:関連付けへのassoc(入力/出力)ポインター。
Returns: void
List priority_p_get_priority_factors_list(priority_factors_request_msg_t *req_msg)
Description: Retrieves the priority factors
for all or specified jobs.
説明:すべてのジョブまたは指定されたジョブの優先度係数を取得します。
Arguments:
req_msg (input) pointer to the message request
that contains the specific jobs or users of interest (of any).
引数:req_msg(入力)特定のジョブまたは(任意の)ユーザーを含むメッセージ要求へのポインター。
Returns: a list of priority_factors_object_t's
containing the requested job priority factors
戻り値:要求されたジョブの優先度係数を含むpriority_factors_object_tのリスト
void priority_p_job_end(job_record_t *job_ptr)
Description: Handle ending of job
with decayable limits.
説明:減衰可能な制限のあるジョブの終了を処理します。
Arguments:
job_ptr (input) pointer to the job record.
引数:job_ptr(入力)ジョブレコードへのポインター。
Returns: void
Last modified 23 October 2019