External Sensors Plugin API (ExtSensorsType)

Overview

This document describe.
このドキュメントでは説明します。
Slurm external sensors plugins and the API that defines them.
Slurm外部センサープラグインとそれらを定義するAPI。
It is intended as a resource to programmers wishing to write their own Slurm external sensors plugins.
これは、独自のSlurm外部センサープラグインを作成したいプログラマー向けのリソースとして意図されています。

Slurm external sensors 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 "ext_sensors." The minor type can be any suitable name for the type of external sensors.
メジャータイプは「ext_sensors」である必要があります。マイナータイプは、外部センサーのタイプに適した名前にすることができます。
We currently use
現在使用しています

  • none — No external sensors data is collected.
    none —外部センサーデータは収集されません。
  • rrd — Gets external sensors data from the RRD database.
    rrd —RRDデータベースから外部センサーデータを取得します。

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 programmer is urged to study src/plugins/ext_sensors/rrd and src/common/slurm_ext_sensors.c for a sample implementation of a Slurm external sensors plugin.
プログラマーは、Slurm外部センサープラグインのサンプル実装について、src / plugins / ext_sensors / rrdおよびsrc / common /slurm_ext_sensors.cを調べることをお勧めします。

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()の前に呼び出されます。

extern int ext_sensors_read_conf(void)

Description:
Reads the external sensors plugin configuration file (ext_sensors.conf) and populates the configuration structure.
外部センサープラグイン構成ファイル(ext_sensors.conf)を読み取り、構成構造を設定します。
Called by the slurmctld daemon.
slurmctldデーモンによって呼び出されます。

Arguments:
None

Returns:
SLURM_SUCCESS on success, or
SLURM_ERROR on failure.

extern int ext_sensors_free_conf(void)

Description:
Frees the memory allocated for the external sensors configuration.
外部センサー構成に割り当てられたメモリを解放します。
Called by the slurmctld daemon.
slurmctldデーモンによって呼び出されます。

Arguments:
None

Returns:
SLURM_SUCCESS on success, or
SLURM_ERROR on failure.

extern int ext_sensors_p_update_component_data(void)

Description:
Updates external sensors data for data types and component types as configured in ext_sensors.conf.
ext_sensors.confで構成されているように、データタイプとコンポーネントタイプの外部センサーデータを更新します。
Called by the slurmctld daemon.
slurmctldデーモンによって呼び出されます。

Arguments:
None

Returns:
SLURM_SUCCESS on success, or
SLURM_ERROR on failure.

extern int ext_sensors_p_get_stepstartdata(step_record_t *step_rec)

Description:
Sets external sensors data in the step record when a job step starts.
ジョブステップの開始時に、ステップレコードに外部センサーデータを設定します。
Called by slurmctld.
slurmctldによって呼び出されます。

Arguments:
step_rec (input) pointer to step record.
step_rec(入力)ステップレコードへのポインタ。

Returns:
SLURM_SUCCESS on success, or
SLURM_ERROR on failure.

extern int ext_sensors_p_get_stependdata(step_record_t *step_rec)

Description:
Sets external sensors data in the step record when a job step ends.
ジョブステップが終了したときに、ステップレコードに外部センサーデータを設定します。
Called by slurmctld.
slurmctldによって呼び出されます。

Arguments:
step_rec (input) pointer to step record.
step_rec(入力)ステップレコードへのポインタ。

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 external sensors data.
これらのパラメーターをslurm.confで使用して、プラグインと外部センサーデータを収集する頻度を構成できます。

ExtSensorsType
Specifies which external sensors plugin should be used.
使用する外部センサープラグインを指定します。
ExtSensorsFreq
Time interval between pollings in seconds.
ポーリング間の時間間隔(秒単位)。

Last modified 23 October 2019