Slurm Energy Accounting Plugin API (AcctGatherEnergyType)

Overview

This document describes Slurm's energy accounting plugins and the API that defines them. It is intended as a resource to programmers wishing to write their own Slurm energy accounting plugins.
このドキュメントでは、Slurmのエネルギー会計プラグインとそれらを定義するAPIについて説明します。独自のSlurmエネルギー会計プラグインを作成したいプログラマーへのリソースとして意図されています。

Slurm energy accounting 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 "acct_gather_energy." The minor type can be any suitable name for the type of energy accounting. We currently use
主なタイプは「acct_gather_energy」でなければなりません。マイナータイプは、エネルギー計算のタイプに適した任意の名前にすることができます。現在使用しています

  • none — No energy consumption data is provided.
    none —エネルギー消費データは提供されません。
  • ipmi — Gets energy consumption data from the BMC (Baseboard Management Controller) using the IPMI (Intelligent Platform Management Interface) tool.
    ipmi — IPMI(インテリジェントプラットフォーム管理インターフェース)ツールを使用して、BMC(ベースボード管理コントローラー)からエネルギー消費データを取得します。
  • rapl — Gets energy consumption data from hardware sensors on each core/socket, using RAPL (Running Average Power Limit) sensors. Note that enabling RAPL may require the execution of the command "sudo modprobe msr".
    rapl — RAPL(平均電力制限の実行)センサーを使用して、各コア/ソケットのハードウェアセンサーからエネルギー消費データを取得します。RAPLを有効にするには、コマンド「sudo modprobe msr」の実行が必要になる場合があることに注意してください。
  • xcc — Gets energy consumption data from the Lenovo ThinkSystem SD650 XClarity Controller (XCC) using IPMI OEM raw commands.
    xcc — IPMI OEM rawコマンドを使用して、Lenovo ThinkSystem SD650 XClarity Controller(XCC)からエネルギー消費データを取得します。

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/acct_gather_energy/rapl and src/common/slurm_acct_gather_energy.c for a sample implementation of a Slurm energy accounting plugin.
プログラマーは、Slurmエネルギーアカウンティングプラグインのサンプル実装について、src / plugins / acct_gather_energy / raplおよびsrc / common / slurm_acct_gather_energy.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. 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ランタイムシステムは、独自の初期化のためにこれらのシンボルを選択します。システムの_init()はSlurm init()の前に呼び出され、Slurm fini()はシステムの_fini()の前に呼び出されます。

int acct_gather_energy_p_update_node_energy(void)

Description:
Updates energy accounting data for a node. Sets/updates the energy and power accounting values in the acct_gather_energy_t structure for the node on which it is called. Called by the slurmd daemon.
ノードのエネルギー会計データを更新します。呼び出されたノードのacct_gather_energy_t構造体のエネルギーおよび電力計算値を設定/更新します。slurmdデーモンによって呼び出されます。

Arguments:
None

Returns:
SLURM_SUCCESS on success, or
SLURM_ERROR on failure.

int acct_gather_energy_p_get_data(enum acct_energy_type data_type, acct_gather_energy_t *energy)

Description:
Updates and returns energy consumption of a task, or returns current energy and power consumption of a node, according to specified data_type. Called by jobacct_gather plugin to update and return energy consumption of a task. Called by slurmd to return energy and power consumption of a node.
指定されたdata_typeに従って、タスクのエネルギー消費量を更新して返します。または、ノードの現在のエネルギー消費量と電力消費量を返します。タスクのエネルギー消費量を更新して返すためにjobacct_gatherプラグインによって呼び出されます。ノードのエネルギーと電力消費を返すためにslurmdによって呼び出されます。

Arguments:
data_type (input) type of energy/power data to be returned.
data_type(入力)返されるエネルギー/電力データのタイプ。

energy (input) pointer to acct_gather_energy_t struct in which energy/power data is to be returned.
energy(入力)エネルギー/電力データが返されるacct_gather_energy_t構造体へのポインター。

Returns:
SLURM_SUCCESS on success, or
SLURM_ERROR on failure.

int acct_gather_energy_p_set_data(enum acct_energy_type data_type, acct_gather_energy_t *energy)

Description:
Sets the energy consumption data for a node. Not currently used.
ノードのエネルギー消費データを設定します。現在使用されていません。

Arguments:
data_type (input) type of energy/power data to be set.
data_type(入力)設定するエネルギー/電力データのタイプ。

energy (input) pointer to acct_gather_energy_t struct from which energy/power data is to be taken.
energy(入力)エネルギー/電力データの取得元となるacct_gather_energy_t構造体へのポインター。

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 node energy data.
これらのパラメーターをslurm.confで使用して、ノードのエネルギーデータを収集するプラグインと頻度を構成できます。

AcctGatherEnergyType
Specifies which plugin should be used.
使用するプラグインを指定します。
AcctGatherNodeFreq
Time interval between pollings in seconds.
秒単位のポーリング間の時間間隔。

Last modified 14 April 2020