Power Management Plugin Programmer Guide

Overview

This document describes the Slurm power management plugins and the APIs that defines them.
このドキュメントでは、Slurm電源管理プラグインとそれらを定義するAPIについて説明します。
It is intended as a resource to programmers wishing to write their own Slurm power management plugin.
これは、独自のSlurm電源管理プラグインを作成したいプログラマー向けのリソースとして意図されています。
This is version 100 of the API.
これはAPIのバージョン100です。

Slurm power management 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 "power".
主要なタイプは「パワー」でなければなりません。
The minor type can be any suitable name for the type of power management package.
マイナータイプは、電源管理パッケージのタイプに適した名前にすることができます。
The following power management plugins are included in the Slurm distribution
以下の電源管理プラグインがSlurmディストリビューションに含まれています

  • cray_aries — Use Cray XC APIs to provide power management.
    cray_aries — Cray XCAPIを使用して電源管理を提供します。
  • none — Can be configured to log calls to its functions, but otherwise does nothing.
    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関数の変更により、障害の診断が困難になる可能性があります。

Slurm can be configured to use multiple power management plugins if desired.
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()の前に呼び出されます。

void power_p_reconfig(void)

Description:
This function is called when updated configuration information should be read.
この関数は、更新された構成情報を読み取る必要があるときに呼び出されます。

void power_p_job_resume(job_record_t *job_ptr)

Description:
Note that a previously suspended job is being resumed.
以前に中断されたジョブが再開されていることに注意してください。
Called by the slurmctld daemon.
slurmctldデーモンによって呼び出されます。

Arguments:
job_ptr (input) pointer to the job record being resumed.
job_ptr(入力)再開されるジョブレコードへのポインタ。

void power_p_job_start(job_record_t *job_ptr)

Description:
Note that a job has been allocated resources and is about to begin execution.
ジョブにリソースが割り当てられ、実行を開始しようとしていることに注意してください。
Called by the slurmctld daemon.
slurmctldデーモンによって呼び出されます。

Arguments:
job_ptr (input) pointer to the job record being started.
job_ptr(入力)開始されるジョブレコードへのポインタ。

Last modified 23 October 2019