Node Features Plugin Programmer Guide

Overview

This document describes the node features plugin that is responsible for managing a node's active features. This is typically used for changing a node's characteristics at boot time. For example, an Intel Knights Landing (KNL) processor can be booted in various MCDRAM and NUMA modes. This document is intended as a resource to programmers wishing to write their own node features plugin.
このドキュメントでは、ノードのアクティブな機能を管理するノード機能プラグインについて説明します。これは通常、起動時にノードの特性を変更するために使用されます。たとえば、Intel Knights Landing(KNL)プロセッサは、さまざまなMCDRAMおよびNUMAモードで起動できます。このドキュメントは、独自のノード機能プラグインを作成したいプログラマ向けのリソースとして意図されています。

const char plugin_name[]="launch Slurm plugin"

const char plugin_type[]="node_features/[knl_cray]"

  • knl_cray — Use Cray's capmc command to manage an Intel KNL processor.
    knl_cray — Crayのcapmcコマンドを使用してIntel KNLプロセッサーを管理します。
  • knl_generic — Use Intel commands to manage KNL processor.
    knl_generic — Intelコマンドを使用してKNLプロセッサーを管理します。

const uint32_t plugin_version=SLURM_VERSION_NUMBER
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/node_features/knl_cray/node_features_knl_cray.c for a sample implementation of a Slurm node features plugin.
プログラマーは、slurmノード機能プラグインのサンプル実装について、src / plugins / node_features / knl_cray / node_features_knl_cray.cを調べることをお勧めします。

API Functions

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.

int fini (void)

Description:
Called when the plugin is removed. Clear any allocated storage here.
プラグインが削除されたときに呼び出されます。ここで割り当て済みのストレージをすべてクリアします。

Returns:
SLURM_SUCCESS on success, or
SLURM_ERROR on failure.

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

bool node_features_p_changeable_feature(char *feature)

Description:
Determine if this (one) specified node feature is under the control of this plugin. The feature must be in a node's available features in order for the node to be reconfigured and the feature become active.
この(1つの)指定されたノード機能がこのプラグインの制御下にあるかどうかを確認します。ノードを再構成して機能をアクティブにするには、機能がノードの使用可能な機能に含まれている必要があります。

Arguments:
feature: One node feature.
機能:1つのノードの機能。

Returns:
true this feature can be set by this plugin
trueこの機能はこのプラグインで設定できます

false this feature can not be et this plugin.
falseこの機能をこのプラグインにすることはできません。

int node_features_p_reconfig(void)

Description:
Note that the configuration has changed, read configuration parameters again.
構成が変更されたことに注意してください。構成パラメーターを再度読み取ります。

Returns:
SLURM_SUCCESS on success, or
SLURM_ERROR on failure.

uint32_t node_features_p_boot_time(void)

Description:
Return the estimated node reboot time in units of seconds. Used as a basis for optimizing scheduling decisions.
ノードの推定再起動時間を秒単位で返します。スケジューリングの決定を最適化するための基礎として使用されます。

Returns:
Estimated boot time in seconds.
推定起動時間(秒)。

int node_features_p_get_node(char *node_list)

Description:
Update active and available features on specified nodes. Executed from the slurmctld daemon only and directly updates internal node data structures.
指定したノードのアクティブで使用可能な機能を更新します。slurmctldデーモンからのみ実行され、内部ノードのデータ構造を直接更新します。

Arguments:
node_list: Regular expression identifying the nodes to be updated. Update information about all nodes is value is NULL.
node_list:更新するノードを識別する正規表現。すべてのノードに関する更新情報は値がNULLです。

Returns:
SLURM_SUCCESS on success, or
SLURM_ERROR on failure.

int node_features_p_job_valid(char *job_features)

Description:
Determine of the user's job constraint string is valid. This may be used to limit the type of operators supported (Slurm's active feature logic only supports the AND operator) and prevent illegal combinations of node features (e.g. multiple NUMA modes). Executed from the slurmctld daemon only when either the job submit or modify operation is invoked.
ユーザーのジョブ制約文字列が有効であることを確認します。これを使用して、サポートされる演算子のタイプを制限し(Slurmのアクティブ機能ロジックはAND演算子のみをサポート)、ノード機能の不正な組み合わせ(たとえば、複数のNUMAモード)を防止できます。ジョブの実行依頼または変更操作が呼び出された場合にのみ、slurmctldデーモンから実行されます。

Arguments:
job_features: Job constraints specified by the user (-c/--constraint options).
job_features:ユーザーが指定したジョブの制約(-c /-constraintオプション)。

Returns:
SLURM_SUCCESS on success, or
SLURM_ERROR on failure.

char *node_features_p_job_xlate(char *job_features)

Description:
Translate a job's feature request to the node features needed at boot time. Job features not required by this plugin (e.g. rack number) will not be returned. For example, a user requested features may be "cache&quad&knl&rack1". Since the "knl" and "rack1" represent physical characteristics of the node and are not used by the node features plugin to boot the node, this function's return value will be "cache,quad". Executed from the slurmctld daemon only.
ジョブの機能要求を、起動時に必要なノード機能に変換します。このプラグインが必要としないジョブ機能(ラック番号など)は返されません。たとえば、ユーザーが要求した機能は「cache&quad&knl&rack1」の場合があります。「knl」と「rack1」はノードの物理的特性を表し、ノードを起動するノード機能プラグインでは使用されないため、この関数の戻り値は「cache、quad」になります。slurmctldデーモンからのみ実行されます。

Arguments:
job_features: Job constraints specified by the user (-c/--constraint options).
job_features:ユーザーが指定したジョブの制約(-c /-constraintオプション)。

Returns:
Node features used by this plugin when configuring or booting a node. A string with its memory allocated by xmalloc (i.e. the return value must be released using Slurm's xfree function).
ノードの構成または起動時にこのプラグインによって使用されるノード機能。xmallocによってメモリが割り当てられた文字列(つまり、戻り値はSlurmのxfree関数を使用して解放する必要があります)。

bitstr_t *node_features_g_get_node_bitmap(void)

Description:
Return a bitmap of the nodes under this plugin's control. This may be a subset of the nodes on a cluster of heterogeneous nodes (e.g. some KNL and some Haswell nodes on the same cluster).
このプラグインの制御下にあるノードのビットマップを返します。これは、異種ノードのクラスター上のノードのサブセットである場合があります(たとえば、同じクラスター上のいくつかのKNLノードといくつかのHaswellノード)。

Returns:
Bitmap of the nodes under this plugin's control. If no NodeFeatures plugins configured this may be NULL. Use FREE_NULL_BITMAP() function to release returned memory.
このプラグインの制御下にあるノードのビットマップ。NodeFeaturesプラグインが構成されていない場合、これはNULLになる可能性があります。FREE_NULL_BITMAP()関数を使用して、返されたメモリを解放します。

bool node_features_p_node_power(void)

Description:
Report if the PowerSave mode is required to boot nodes. Executed from the slurmctld daemon only.
ノードの起動に省電力モードが必要かどうかを報告します。slurmctldデーモンからのみ実行されます。

Returns:
True if the plugin requires PowerSave mode for booting nodes.
プラグインがノードの起動にパワーセーブモードを必要とする場合はTrue。

void node_features_p_node_state(char **avail_modes, char **current_mode)

Description:
Get this node's available and current features (e.g. MCDRAM and NUMA settings from BIOS for a KNL processor, for example avail_modes="cache,flat,equal,a2a,quad,hemi,snc2,snc4" and current_mode="cache,quad"). Executed from the slurmd daemon only.
このノードの利用可能な現在の機能(たとえば、avl_modes = "cache、flat、equal、a2a、quad、hemi、snc2、snc4"およびcurrent_mode = "cache、quad"などのKNLプロセッサのBIOSからのMCDRAMおよびNUMA設定)を取得します。slurmdデーモンからのみ実行されます。

Arguments:
avail_modes: Nodes state features which are available. Value is allocated or appended to as appropriate with xmalloc functions.
avail_modes:ノードは利用可能な機能を示します。値は、xmalloc関数で適切に割り当てまたは追加されます。

current_modes: Nodes state features which are currently in effect. Value is allocated or appended to as appropriate with xmalloc functions.
current_modes:ノードは、現在有効な機能を示します。値は、xmalloc関数で適切に割り当てまたは追加されます。

bool node_features_g_node_update_valid(void *node_ptr, update_node_msg_t *update_node_msg)

Description:
Determine if this node update request is valid. For example, validate that a non-KNL node does not include any MCDRAM or NUMA modes that are KNL specific.
このノード更新要求が有効かどうかを判別してください。たとえば、非KNLノードに、KNL固有のMCDRAMまたはNUMAモードが含まれていないことを確認します。

Arguments:
node_ptr: Pointer to node_record_t record being updated.
node_ptr:更新されるnode_record_tレコードへのポインター。

update_node_msg: Node update request.
update_node_msg:ノード更新リクエスト。

Returns:
True if the update request is valid, otherwise false.
更新リクエストが有効な場合はtrue、それ以外の場合はfalse。

uint32_t node_features_g_reboot_weight(void)

Description:
Return the node "weight" field if reboot required to change mode.
モードを変更するために再起動が必要な場合は、ノードの「重み」フィールドを返します。

Returns:
Node "weight" field if reboot required to change mode.
モードを変更するために再起動が必要な場合のノードの「重み」フィールド。

char *node_features_p_node_xlate(char *new_features, char *orig_features, char *avail_features, int node_inx)

Description:
Translate a node's new active feature specification as needed to preserve any original features (i.e. features outside of the domain of this plugin).
必要に応じてノードの新しいアクティブな機能仕様を変換し、元の機能(つまり、このプラグインのドメイン外の機能)を保持します。
Also validate that the new features are a subset of available features.
また、新機能が利用可能な機能のサブセットであることを確認します。
For example, a node's new features may be "cache,quad", while its original features may have been "knl,rack1,flat,hemi".
たとえば、ノードの新しい機能は「キャッシュ、クワッド」である可能性がありますが、元の機能は「knl、rack1、フラット、ヘミ」であった可能性があります。
The original plugin-specific features are "flat,hemi", while features configured outside of the domain of this plugin are "knl,rack1".
元のプラグイン固有の機能は「フラット、ヘミ」ですが、このプラグインのドメイン外で構成された機能は「knl、rack1」です。
In this case, this function's return value will be "knl,rack1,cache,quad".
この場合、この関数の戻り値は「knl、rack1、cache、quad」になります。
This function may also be used to ensure a specific ordering of features (e.g. on a KNL node, always put the MCDRAM mode before the NUMA mode).
この機能は、特定の機能の順序を確保するためにも使用できます(たとえば、KNLノードでは、常にMCDRAMモードをNUMAモードの前に置きます)。
Executed from the slurmctld daemon only.
slurmctldデーモンからのみ実行されます。

Arguments:
new_features: Node's new active features.
new_features:ノードの新しいアクティブな機能。

orig_features: Node's previous active feature state.
orig_features:ノードの以前のアクティブな機能の状態。

avail_features: Node's available features.
avail_features:ノードで利用可能な機能。

node_inx: Node's index in the slurmctld daemon's node record table.
node_inx:slurmctldデーモンのノードレコードテーブル内のノードのインデックス。

Returns:
Node's currently active features, validate and sorted. A string with its memory allocated by xmalloc (i.e. the return value must be released using Slurm's xfree function).
ノードの現在アクティブな機能、検証およびソート。xmallocによってメモリが割り当てられた文字列(つまり、戻り値はSlurmのxfree関数を使用して解放する必要があります)。

char *node_features_p_node_xlate2(char *new_features)

Description:
Translate a node's newly configured available feature specification as needed to order the entries as desired.
必要に応じてノードの新しく構成された利用可能な機能仕様を必要に応じて変換し、エントリを必要に応じて順序付けします。
For example on a KNL node, always put the MCDRAM mode before the NUMA mode (i.e. an input of "hemi,flat" is translated to "flat,hemi").
たとえば、KNLノードでは、常にMCDRAMモードをNUMAモードの前に置きます(つまり、 "hemi、flat"の入力は "flat、hemi"に変換されます)。
Executed from the slurmctld daemon only.
slurmctldデーモンからのみ実行されます。

Arguments:
new_features: Node's newly configured features.
new_features:ノードの新しく構成された機能。

Returns:
Node's currently available features, validate and sorted. A string with its memory allocated by xmalloc (i.e. the return value must be released using Slurm's xfree function).
ノードの現在利用可能な機能、検証およびソート。xmallocによってメモリが割り当てられた文字列(つまり、戻り値はSlurmのxfree関数を使用して解放する必要があります)。

void node_features_p_step_config(bool mem_sort, bitstr_t *numa_bitmap)

Description:
Perform any desired initialization operations prior to launching a job step.
ジョブステップを起動する前に、必要な初期化操作を実行します。

Arguments:
mem_sort: If true, run zonesort before launching a job step.
mem_sort:trueの場合、ジョブステップを起動する前にzonesortを実行します。

numa_bitmap: Identify NUMA nodes on which to execute zonesort. If NULL, then execute zonesort on all NUMA nodes
numa_bitmap:zonesortを実行するNUMAノードを特定します。NULLの場合、すべてのNUMAノードでzonesortを実行します

char *node_features_p_user_update(uid_t uid)

Description:
Determine if the specified user can modify the currently available node features.
指定されたユーザーが現在使用可能なノード機能を変更できるかどうかを決定します。

Arguments:
uid: User ID of user making request.
uid:リクエストを行っているユーザーのユーザーID。

Returns:
True if user can change node active features to other available features.
ユーザーがノードのアクティブな機能を他の使用可能な機能に変更できる場合はTrue。

Last modified 23 October 2019