Job Container Plugin API
Overview
This document describes Slurm job container plugins and the API
that defines them.
It is intended as a resource to programmers wishing to write their
own Slurm job container plugins.
Note that job container plugin is designed for use with Slurm jobs.
It also applies to the sbcast server process on compute nodes.
There is a proctrack plugin
designed for use with Slurm job steps.
このドキュメントでは、Slurmジョブコンテナプラグインとそれらを定義するAPIについて説明します。独自のSlurmジョブコンテナープラグインを作成したいプログラマーへのリソースとして意図されています。ジョブコンテナープラグインはSlurmジョブで使用するように設計されていることに注意してください。また、計算ノードのsbcastサーバープロセスにも適用されます。Slurmジョブステップで使用するために設計されたproctrackプラグインがあります。
Slurm job container plugins are Slurm plugins that implement
the Slurm job container 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[]
The major type must be "job_container."
The minor type can be any recognizable abbreviation for the type
of proctrack. We recommend, for example:
主なタイプは「job_container」である必要があります。マイナータイプは、proctrackのタイプの認識可能な省略形です。たとえば、次のことをお勧めします。
- cncu — Designed for use on Cray systems only and interface with
Compute Node Clean Up (CNCU) the Cray infrastructure.
cncu — Crayシステムでのみ使用するように設計されており、Crayインフラストラクチャの計算ノードクリーンアップ(CNCU)とインターフェースします。 - none — Designed for all other systems.
なし—他のすべてのシステム用に設計されています。
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/proctrack/job_container/job_container_cncu.c
for an example implementation of a Slurm proctrack plugin.
プログラマーは、slurm proctrackプラグインの実装例について、src / plugins / proctrack / job_container / job_container_cncu.cを調べることをお勧めします。
Data Objects
The implementation must support a container ID of type uint64_t.
This container ID is generated by the
proctrack plugin.
実装は、タイプuint64_tのコンテナーIDをサポートする必要があります。このコンテナIDは、proctrackプラグインによって生成されます。
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.
The implementation should endeavor to provide useful and pertinent information
by whatever means is practical.
Successful API calls are not required to reset errno to a known value.
実装は、列挙されたerrnoを維持する必要があります(必ずしも直接エクスポートする必要はありません)。これにより、Slurmは、API呼び出しの失敗の理由を可能な限り実際に発見できるようになります。これらの値は、APIの整数値関数の戻り値として使用しないでください。整数値関数からの適切なエラー戻り値はSLURM_ERRORです。実装は、実用的であるどんな手段によっても有用で適切な情報を提供するよう努めるべきです。errnoを既知の値にリセットするために、成功したAPI呼び出しは必要ありません。
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 container_p_create (uint32_t job_id);
Description: Create a container.
The caller should ensure that the valid
container_p_delete() is called.
説明:コンテナを作成します。呼び出し元は、有効なcontainer_p_delete()が呼び出されていることを確認する必要があります。
Argument:
job_id (input)
Job ID.
引数: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 container_p_add_cont (uint32_t job_id, uint64_t cont_id);
Description: Add a specific process tracking
container (PAGG) to a given job's container.
説明:特定のプロセス追跡コンテナー(PAGG)を特定のジョブのコンテナーに追加します。
Arguments:
job_id (input)
Job ID.
job_id(入力)ジョブID。
cont_id (input)
Process tracking container value as set by the proctrack plugin.
cont_id(入力)proctrackプラグインによって設定されたプロセス追跡コンテナの値。
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 container_p_delete (uint32_t job_id);
Description: Destroy or otherwise
invalidate a job container.
This does not imply the container is empty, just that it is no longer
needed.
説明:ジョブコンテナーを破棄するか、無効にします。これは、コンテナーが空であるという意味ではなく、コンテナーが不要になったという意味です。
Arguments:
job_id (input)
Job ID.
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 container_p_join(uint32_t job_id, uid_t uid);
Description: Add this process
to a given job's container. The process is first placed into a process tracking
container (PAGG).
説明:このプロセスを特定のジョブのコンテナーに追加します。プロセスは、最初にプロセス追跡コンテナー(PAGG)に配置されます。
Arguments:
job_id (input)
Job ID.
job_id(入力)ジョブID。
uid (input)
Owning user ID.
uid(入力)所有ユーザー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を適切な値に設定して、失敗の理由を示す必要があります。
void container_p_reconfig (void);
Description: Note change in configuration,
especially the value of the DebugFlags with respect to JobContainer.
説明:設定の変更、特にJobContainerに関するDebugFlagsの値に注意してください。
Last modified 22 April 2019