Slurm Energy Accounting Plugin API (AcctGatherEnergyType)

Overview

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

Slurm energy accounting 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 "acct_gather_energy." The minor type can be any suitable name for the type of energy accounting.
メジャータイプは「acct_gather_energy」である必要があります。マイナータイプは、エネルギー会計のタイプに適した名前にすることができます。
We currently use
現在使用しています

  • 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(Intelligent Platform Management Interface)ツールを使用して、BMC(Baseboard Management Controller)からエネルギー消費データを取得します。
  • rapl — Gets energy consumption data from hardware sensors on each core/socket, using RAPL (Running Average Power Limit) sensors.
    rapl — RAPL(Running Average Power Limit)センサーを使用して、各コア/ソケットのハードウェアセンサーからエネルギー消費データを取得します。
    Note that enabling RAPL may require the execution of the command "sudo modprobe msr".
    RAPLを有効にするには、コマンド「sudomodprobemsr」の実行が必要になる場合があることに注意してください。
  • 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.
指定されている場合、このプラグインのビルドに使用された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/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.
注:これらの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 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.
呼び出されたノードのacct_gather_energy_t構造体のエネルギーおよび電力アカウンティング値を設定/更新します。
Called by the slurmd daemon.
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.
指定されたdata_typeに従って、タスクのエネルギー消費量を更新して返すか、ノードの現在のエネルギーと電力消費量を返します。
Called by jobacct_gather plugin to update and return energy consumption of a task.
タスクのエネルギー消費を更新して返すためにjobacct_gatherプラグインによって呼び出されます。
Called by slurmd to return energy and power consumption of a node.
ノードのエネルギーと電力消費を返すために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.
エネルギー/電力データが返されるacct_gather_energy_t構造体へのenergy(入力)ポインター。

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.
エネルギー/電力データの取得元となる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