Slurm Job Accounting Gather Plugin API

Overview

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

Slurm job accounting gather plugins must conform to the Slurm Plugin API with the following specifications:
Slurmジョブアカウンティング収集プラグインは、次の仕様のSlurm Plugin 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. We currently use
主なタイプは「jobacct_gather」でなければなりません。マイナータイプは、アカウンティングパッケージのタイプに適した任意の名前にすることができます。現在使用しています

  • cgroup — Gathers information from Linux cgroup infrastructure and adds this information to the standard rusage information also gathered for each job. (Experimental, not to be used in production.)
    cgroup — Linux cgroupインフラストラクチャから情報を収集し、この情報を、各ジョブについて収集された標準のルサージュ情報に追加します。(実験的、実稼働では使用されません。)
  • 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. 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 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.
プログラマーは、Slurmジョブアカウンティング収集プラグインのサンプル実装について、src / plugins / jobacct_gather / linuxおよびsrc / common / slurm_jobacct_gather。[c | h]を調査することをお勧めします。

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. 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 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
cont_id(入力)pgidで実行されていない場合のプロセスのコンテナー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.
type(input)列挙型。プラグインにデータの変換方法を指示します。

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

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.
type(入力)ジョブアカウントのデータ型。
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.
(入力)ジョブの元の場所から。

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.
統計(入力)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