Slurm Job Accounting Gather Plugin API

Overview

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

Slurm job accounting gather plugins must conform to the Slurm Plugin API with the following specifications:
Slurmジョブアカウンティングギャザープラグインは、次の仕様のSlurmプラグインAPIに準拠している必要があります。

const char plugin_name[]="full text name"

A free-formatted ASCII text string that identifies the plugin.
プラグインを識別する自由形式のASCIIテキスト文字列。

const char plugin_type[]="major/minor"

The major type must be "jobacct_gather." The minor type can be any suitable name for the type of accounting package.
メジャータイプは「jobacct_gather」である必要があります。マイナータイプは、アカウンティングパッケージのタイプに適した名前にすることができます。
We currently use
現在使用しています

  • cgroup — Gathers information from Linux cgroup infrastructure and adds this information to the standard rusage information also gathered for each job.
    cgroup — Linux cgroupインフラストラクチャから情報を収集し、この情報を、ジョブごとに収集される標準のrusage情報に追加します。
    (Experimental, not to be used in production.)
    (実験的であり、本番環境では使用されません。)
  • linux — Gathers information from Linux /proc table and adds this information to the standard rusage information also gathered for each job.
    linux — Linux / procテーブルから情報を収集し、この情報を、ジョブごとに収集される標準のrusage情報に追加します。
  • none — No information gathered.
    none —情報は収集されません。

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 sacct program can be used to display gathered data from regular accounting and from these plugins.
sacctプログラムを使用して、通常のアカウンティングおよびこれらのプラグインから収集されたデータを表示できます。

The programmer is urged to study src/plugins/jobacct_gather/linux and src/common/slurm_jobacct_gather.[c|h] for a sample implementation of a Slurm job accounting gather plugin.
プログラマーは、src / plugins / jobacct_gather / linuxおよびsrc / common / slurm_jobacct_gather。[c | h]を調べて、Slurmジョブアカウンティングギャザープラグインのサンプル実装を確認することをお勧めします。

API Functions

All of the following functions are required.
以下のすべての機能が必要です。
Functions which are not implemented must 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()の前に呼び出されます。

int jobacct_gather_p_poll_data(List task_list, bool pgid_plugin, uint64_t cont_id)

Description:
Build a table of all current processes.
現在のすべてのプロセスのテーブルを作成します。

Arguments:
task_list (in/out) List containing current processes
task_list(in / out)現在のプロセスを含むリスト

pgid_plugin (input) if we are running with the pgid plugin
pgidプラグインで実行している場合はpgid_plugin(入力)

cont_id (input) container id of processes if not running with pgid
pgidで実行されていない場合のプロセスのcont_id(入力)コンテナID

int jobacct_gather_p_endpoll(void)

Description:
Called when the process is finished to stop the polling thread.
ポーリングスレッドを停止するためにプロセスが終了したときに呼び出されます。

Arguments:
none

Returns:
SLURM_SUCCESS on success, or
SLURM_ERROR on failure.

int jobacct_gather_p_add_task(pid_t pid, uint16_t tid)

Description:
Used to add a task to the poller.
ポーラーにタスクを追加するために使用されます。

Arguments:
pid (input) Process id
pid(入力)プロセスID

tid (input) slurm global task id
tid(入力)slurmグローバルタスクID

Returns:
SLURM_SUCCESS on success, or
SLURM_ERROR on failure.

Job Account Gathering

All of the following functions are not required but may be used.
以下のすべての機能は必須ではありませんが、使用できます。

int jobacct_gather_init(void)

Description:
Loads the job account gather plugin.
ジョブアカウント収集プラグインをロードします。

Returns:
SLURM_SUCCESS on success, or
SLURM_ERROR on failure.

int jobacct_gather_fini(void)

Description:
Unloads the job account gathering plugin.
ジョブアカウント収集プラグインをアンロードします。

Returns:
SLURM_SUCCESS on success, or
SLURM_ERROR on failure.

int jobacct_gather_startpoll(uin16_t frequency)

Description:
Creates and starts the polling thread.
ポーリングスレッドを作成して開始します。

Arguments:
frequency (input) frequency of the polling.
ポーリングの頻度(入力)頻度。

Returns:
SLURM_SUCCESS on success, or
SLURM_ERROR on failure.

void jobacct_gather_change_poll(uint16_t frequency)

Description:
Changes the polling thread to a new frequency.
ポーリングスレッドを新しい頻度に変更します。

Arguments:
frequency (input) frequency of the polling

Returns:
SLURM_SUCCESS on success, or
SLURM_ERROR on failure.

void jobacct_gather_suspend_poll(void)

Description:
Temporarily stops the polling thread.
ポーリングスレッドを一時的に停止します。

Returns:
SLURM_SUCCESS on success, or
SLURM_ERROR on failure.

void jobacct_gather_resume_poll(void)

Description:
Resumes the polling thread that was stopped.
停止したポーリングスレッドを再開します。

Returns:
SLURM_SUCCESS on success, or
SLURM_ERROR on failure.

jobacctinfo_t *jobacct_gather_stat_task(pid_t pid)

Description:
Gets the basis of the information of the task.
タスクの情報の基礎を取得します。

Arguments:
pid (input) process id.
pid(入力)プロセスID。

Returns:
SLURM_SUCCESS on success, or
SLURM_ERROR on failure.

jobacctinfo_t *jobacct_gather_remove_task(pid_t pid)

Description:
Removes the task.
タスクを削除します。

Arguments:
pid (input) process id.
pid(入力)プロセスID。

Returns:
SLURM_SUCCESS on success, or
SLURM_ERROR on failure.

int jobacct_gather_set_proctrack_container_id(uint64_t id)

Description:
Sets the proctrack container to a given id.
proctrackコンテナを指定されたIDに設定します。

Arguments:
id (input) id to set.
id(入力)設定するID。

Returns:
SLURM_SUCCESS on success, or
SLURM_ERROR on failure.

int jobacct_gather_set_mem_limit(uint32_t job_id, uint32_t step_id, uint64_t mem_limit)

Description:
Sets the memory limit of the job account.
ジョブアカウントのメモリ制限を設定します。

Arguments:
job_id (input) id of the job.
job_id(入力)ジョブのID。

sted_id (input) id of the step.
ステップのsted_id(入力)ID。

mem_limit (input) memory limit in megabytes.
mem_limit(入力)メモリ制限(メガバイト単位)。

Returns:
SLURM_SUCCESS on success, or
SLURM_ERROR on failure.

void jobacct_gather_handle_mem_limit(uint64_t total_job_mem, uint64_t total_job_vsize)

Description:
Called to find out how much memory is used.
使用されているメモリの量を調べるために呼び出されます。

Arguments:
total_job_mem (input) total amount of memory for jobs.
total_job_mem(入力)ジョブのメモリの合計量。

total_job_vsize (input) the total job size.
total_job_vsize(入力)合計ジョブサイズ。

Returns:
SLURM_SUCCESS on success, or
SLURM_ERROR on failure.

Job Account Info

All of the following functions are not required but may be used.
以下のすべての機能は必須ではありませんが、使用できます。

jobacctinfo_t *jobacctinfo_create(jobacct_id_t *jobacct_id)

Description:
Creates the job account info.
ジョブアカウント情報を作成します。

Arguments:
jobacct_id (input) the job account id.
jobacct_id(入力)ジョブアカウントID。

Returns:
SLURM_SUCCESS on success, or
SLURM_ERROR on failure.

void jobacctinfo_destroy(void *object)

Description:
Destroys the job account info.
ジョブアカウント情報を破棄します。

Arguments:
object (input) the job that needs to be destroyed
オブジェクト(入力)破棄する必要のあるジョブ

Returns:
SLURM_SUCCESS on success, or
SLURM_ERROR on failure.

int jobacctinfo_setinfo(jobacctinfo_t *jobacct, enum jobacct_data_type type, void *data)

Description:
Set the information for the job.
ジョブの情報を設定します。

Arguments:
jobacct (input) job account
jobacct(入力)ジョブアカウント

type(input) enum telling the plugin how to transform the data.
タイプ(入力)列挙型は、プラグインにデータの変換方法を指示します。

data (input/output) Is a void * and the actual data type depends upon the first argument to this function (type).
data(input / output)はvoid *であり、実際のデータ型はこの関数(type)の最初の引数に依存します。

Returns:
SLURM_SUCCESS on success, or
SLURM_ERROR on failure.

int jobacctinfo_getinfo(jobacctinfo_t *jobacct, enum jobacct_data_type type, void *data)

Description:
Gets the information about the job.
ジョブに関する情報を取得します。

Arguments:
jobacct (input) job account.
jobacct(入力)ジョブアカウント。

type (input) the data type of the job account.
タイプ(入力)ジョブアカウントのデータ型。
data

Returns:
SLURM_SUCCESS on success, or
SLURM_ERROR on failure.

void jobacctinfo_pack(jobacctinfo_t *jobacct, uint16_t rpc_version, Buf buffer)

Description:
Packs the job account information.
ジョブアカウント情報をパックします。

Arguments:
jobacct (input) the job account.
jobacct(入力)ジョブアカウント。

rpc_version (input) the rpc version.
rpc_version(入力)rpcバージョン。

buffer (input) the buffer.
buffer(入力)バッファ。

Returns:
SLURM_SUCCESS on success, or
SLURM_ERROR on failure.

int jobacctinfo_unpack(jobacctinfo_t **jobacct, uint16_t rpc_version, Buf buffer)

Description:
Unpacks the job account information.
ジョブアカウント情報を解凍します。

Arguments:
jobacct (input) the job account.
jobacct(入力)ジョブアカウント。

rpc_version (input) the rpc version.
rpc_version(入力)rpcバージョン。

buffer (input) the buffer.
buffer(入力)バッファ。

Returns:
SLURM_SUCCESS on success, or
SLURM_ERROR on failure.

void jobacctinfo_aggregate(jobacctinfo_t *dest, jobacctinfo_t *from)

Description:
Aggregates the jobs.
ジョブを集約します。

Arguments:
dest (input) New destination of the job.
dest(入力)ジョブの新しい宛先。

from (input) Original location of job.
from(入力)ジョブの元の場所。

Returns:
SLURM_SUCCESS on success, or
SLURM_ERROR on failure.

void jobacctinfo_2_stats(slurmdb_stats_t *stats, jobacctinfo_t *jobacct)

Description:
Gets the stats of the job in accounting.
経理の仕事の統計を取得します。

Arguments:
stats (input) slurm data base stat.
stats(入力)slurmデータベース統計。

jobacct (input) the job account.
jobacct(入力)ジョブアカウント。

Returns:
SLURM_SUCCESS on success, or
SLURM_ERROR on failure.

Parameters

These parameters can be used in the slurm.conf to configure the plugin and the frequency at which to gather information about running jobs.
これらのパラメーターをslurm.confで使用して、プラグインと、実行中のジョブに関する情報を収集する頻度を構成できます。

JobAcctGatherType
Specifies which plugin should be used.
JobAcctGatherFrequency
Time interval between pollings in seconds.

Last modified 27 March 2015