Slurm Job Completion Logging Plugin API
Overview
This document describes Slurm job completion logging plugins and the API that defines
them. It is intended as a resource to programmers wishing to write their own Slurm
job completion logging plugins.
このドキュメントでは、Slurmジョブ完了ロギングプラグインとそれらを定義するAPIについて説明します。独自のSlurmジョブ完了ログプラグインを作成したいプログラマ向けのリソースとして意図されています。
Slurm job completion logging plugins are Slurm plugins that implement the Slurm
API for logging job information upon their completion. This may be used to log job information
to a text file, database, etc. The plugins 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 "jobcomp." The minor type can be any recognizable
abbreviation for the type of scheduler. We recommend, for example:
主なタイプは「jobcomp」である必要があります。マイナータイプは、スケジューラのタイプの認識可能な省略形です。たとえば、次のことをお勧めします。
- none — No job logging.
none —ジョブのロギングはありません。 - elasticsearch — Log job information to an Elasticsearch server.
elasticsearch —ジョブ情報をElasticsearchサーバーに記録します。 - filetxt — Log job information to a text file.
filetxt —ジョブ情報をテキストファイルに記録します。 - mysql — Job completion is written to a mysql database.
mysql —ジョブの完了はmysqlデータベースに書き込まれます。 - script — Execute a script passing in job information in environment variables.
script —環境変数のジョブ情報を渡してスクリプトを実行します。
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.
const uint32_t plugin_version指定された場合、このプラグインのビルドに使用された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/jobcomp/filetxt/jobcomp_filetxt.c and
src/plugins/jobcomp/none/jobcomp_none.c
for sample implementations of a Slurm job completion logging plugin.
プログラマーは、Slurmジョブ完了ロギングプラグインのサンプル実装について、src / plugins / jobcomp / filetxt / jobcomp_filetxt.cおよびsrc / plugins / jobcomp / none / jobcomp_none.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()の前に呼び出されます。
int slurm_jobcomp_set_location (char * location);
Description: Specify the location to be used for job logging.
説明:ジョブのロギングに使用する場所を指定します。
Argument: location
(input) specification of where logging should be done. The interpretation of
this string is at the discretion of the plugin implementation.
引数:ロギングを行う場所の場所(入力)指定。この文字列の解釈は、プラグイン実装の裁量に任されています。
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 slurm_jobcomp_log_record(job_record_t *job_ptr);
Description: Note that a job is about to
terminate or change size. The job's state will include the JOB_RESIZING flag
if and only if it is about to change size. Otherwise the job is terminating.
Note the existence of resize_time in the job record if one wishes to
record information about a job at each size (i.e. a history of the job as
its size changes through time).
説明:ジョブが終了するか、サイズを変更しようとしていることに注意してください。ジョブの状態には、サイズを変更しようとしている場合にのみ、JOB_RESIZINGフラグが含まれます。そうでない場合、ジョブは終了します。各サイズでジョブに関する情報を記録したい場合は、ジョブレコードにresize_timeが存在することに注意してください(つまり、時間とともにサイズが変化するジョブの履歴)。
Argument:
job_ptr (input) Pointer to
job record as defined in src/slurmctld/slurmctld.h
job_ptr(入力)src / slurmctld / slurmctld.hで定義されているジョブレコードへのポインタ
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を適切な値に設定して、失敗の理由を示す必要があります。
List slurm_jobcomp_get_jobs(acct_job_cond_t *job_cond);
Description: Get completed job info from
storage.
説明:完了したジョブ情報をストレージから取得します。
Arguments:
job_cond
(input) specification of filters to identify the jobs we wish information about
(start time, end time, cluster name, user id, etc).
acct_job_cond_t is defined in common/slurm_accounting_storage.h.
job_cond(入力)フィルターの指定。これにより、情報が必要なジョブ(開始時間、終了時間、クラスター名、ユーザーIDなど)を識別します。acct_job_cond_tはcommon / slurm_accounting_storage.hで定義されています。
Returns: A list of job records or NULL on
error. Elements on the list are of type jobcomp_job_rec_t, which is
defined in common/slurm_jobcomp.h.
Any returned list must be destroyed to avoid memory leaks.
戻り値:ジョブレコードのリスト、またはエラーの場合はNULL。リストの要素は、common / slurm_jobcomp.hで定義されているタイプjobcomp_job_rec_tです。戻されたリストは、メモリリークを回避するために破棄する必要があります。
void slurm_jobcomp_archive(List selected_parts, void *params)
Description: used to archive old data.
Arguments:
List selected_parts
(input) list containing char *'s of names of partitions to query against.
照会するパーティションの名前のchar *を含むselected_parts(入力)リストをリストします。
void *params
(input) to be cast as sacct_parameters_t in the plugin.
プラグインでsacct_parameters_tとしてキャストされるvoid * params(入力)。
Returns: None
Last modified 23 October 2019