Slurm Plugin API

Overview

A Slurm plugin is a dynamically linked code object which is loaded explicitly at run time by the Slurm libraries.
Slurmプラグインは、動的にリンクされたコードオブジェクトであり、実行時にSlurmライブラリによって明示的にロードされます。
A plugin provides a customized implementation of a well-defined API connected to tasks such as authentication, interconnect fabric, and task scheduling.
プラグインは、認証、インターコネクトファブリック、タスクスケジューリングなどのタスクに接続された、明確に定義されたAPIのカスタマイズされた実装を提供します。

Identification

A Slurm plugin identifies itself by a short character string formatted similarly to a MIME type: <major>/<minor>.
Slurmプラグインは、MIMEタイプ<major> / <minor>と同様にフォーマットされた短い文字列によって自身を識別します。
The major type identifies which API the plugin implements.
メジャータイプは、プラグインが実装するAPIを識別します。
The minor type uniquely distinguishes a plugin from other plugins that implement that same API, by such means as the intended platform or the internal algorithm.
マイナータイプは、目的のプラットフォームや内部アルゴリズムなどの手段によって、プラグインを同じAPIを実装する他のプラグインと一意に区別します。
For example, a plugin to interface to the Maui scheduler would give its type as "sched/maui." It would implement the Slurm Scheduler API.
たとえば、Mauiスケジューラーに接続するプラグインは、そのタイプを「sched / maui」として指定します。Slurm SchedulerAPIを実装します。

Versioning

Slurm plugin version numbers comprise a major, minor and micro revision number.
Slurmプラグインのバージョン番号は、メジャー、マイナー、およびマイクロリビジョン番号で構成されます。
If the major and/or minor revision number changes, this indicates major changes to the Slurm functionality including changes to APIs, command options, and plugins.
メジャーおよび/またはマイナーリビジョン番号が変更された場合、これは、API、コマンドオプション、プラグインの変更など、Slurm機能の大幅な変更を示しています。
These plugin changes may include new functions and/or function arguments.
これらのプラグインの変更には、新しい関数や関数の引数が含まれる場合があります。
If only the micro revision number changes, this is indicative of bug fixes and possibly minor enhancements which should not adversely impact users.
マイクロリビジョン番号のみが変更された場合、これはバグ修正と、ユーザーに悪影響を及ぼさない可能性のあるマイナーな機能強化を示しています。
In all cases, rebuilding and installing all Slurm plugins is recommended at upgrade time.
いずれの場合も、アップグレード時にすべてのSlurmプラグインを再構築してインストールすることをお勧めします。
Not all compute nodes in a cluster need be updated at the same time, but all Slurm APIs, commands, plugins, etc. on a compute node should represent the same version of Slurm.
クラスター内のすべての計算ノードを同時に更新する必要はありませんが、計算ノード上のすべてのSlurm API、コマンド、プラグインなどは、同じバージョンのSlurmを表す必要があります。

Data Objects

A plugin must define and export the following symbols:

  • char plugin_type[]
    a unique, short, formatted string to identify the plugin's purpose as described above.
    上記のようにプラグインの目的を識別するための、一意の短いフォーマットされた文字列。
    A "null" plugin (i.e., one that implements the desired API as stubs) should have a minor type of "none."
    「null」プラグイン(つまり、目的のAPIをスタブとして実装するプラグイン)には、マイナータイプの「none」が必要です。
  • char plugin_name[]
    a free-form string that identifies the plugin in human-readable terms, such as "Kerberos authentication." Slurm will use this string to identify the plugin to end users.
    「Kerberos認証」など、人間が読める形式でプラグインを識別する自由形式の文字列。Slurmはこの文字列を使用して、エンドユーザーにプラグインを識別します。

A plugin may optionally define and export the following symbols:
プラグインは、オプションで次のシンボルを定義およびエクスポートできます。

  • 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関数の変更により、障害の診断が困難になる可能性があります。

API Functions in All Plugins

int init (void);

Description: If present, this function is called just after the plugin is loaded.
説明:存在する場合、この関数はプラグインがロードされた直後に呼び出されます。
This allows the plugin to perform any global initialization prior to any actual API calls.
これにより、プラグインは実際のAPI呼び出しの前にグローバル初期化を実行できます。

Arguments: None.

Returns: SLURM_SUCCESS if the plugin's initialization was successful.
戻り値:プラグインの初期化が成功した場合はSLURM_SUCCESS。
Any other return value indicates to Slurm that the plugin should be unloaded and not used.
その他の戻り値は、プラグインをアンロードして使用しないようにする必要があることをSlurmに示します。

void fini (void);

Description: If present, this function is called just before the plugin is unloaded.
説明:存在する場合、この関数はプラグインがアンロードされる直前に呼び出されます。
This allows the plugin to do any finalization after the last plugin-specific API call is made.
これにより、プラグイン固有のAPI呼び出しが最後に行われた後、プラグインは任意のファイナライズを実行できます。

Arguments: None.

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

The functions need not appear.
関数が表示される必要はありません。
The plugin may provide either init() or fini() or both.
プラグインは、init()またはfini()、あるいはその両方を提供できます。

Thread Safety

Slurm is a multithreaded application.
Slurmはマルチスレッドアプリケーションです。
The Slurm plugin library may exercise the plugin functions in a re-entrant fashion.
Slurmプラグインライブラリは、再入可能な方法でプラグイン機能を実行する場合があります。
It is the responsibility of the plugin author to provide the necessarily mutual exclusion and synchronization in order to avoid the pitfalls of re-entrant code.
再入可能なコードの落とし穴を回避するために、必然的に相互排除と同期を提供するのはプラグイン作成者の責任です。

Run-time Support

The standard system libraries are available to the plugin.
プラグインは標準のシステムライブラリを利用できます。
The Slurm libraries are also available and plugin authors are encouraged to make use of them rather than develop their own substitutes.
Slurmライブラリも利用可能であり、プラグインの作成者は、独自の代替ライブラリを開発するのではなく、それらを利用することをお勧めします。
Plugins should use the Slurm log to print error messages.
プラグインはSlurmログを使用してエラーメッセージを出力する必要があります。

The plugin author is responsible for specifying any specific non-standard libraries needed for correct operation.
プラグインの作成者は、正しい操作に必要な特定の非標準ライブラリを指定する責任があります。
Plugins will not load if their dependent libraries are not available, so it is the installer's job to make sure the specified libraries are available.
依存ライブラリが利用できない場合、プラグインはロードされないため、指定されたライブラリが利用可能であることを確認するのはインストーラーの仕事です。

Performance

All plugin functions are expected to execute very quickly.
すべてのプラグイン関数は非常に高速に実行されることが期待されています。
If any function entails delays (e.g. transactions with other systems), it should be written to utilize a thread for that functionality.
関数に遅延が伴う場合(他のシステムとのトランザクションなど)、その機能にスレッドを利用するように作成する必要があります。
This thread may be created by the init() function and deleted by the fini() functions.
このスレッドは、init()関数によって作成され、fini()関数によって削除される場合があります。
See plugins/sched/backfill for an example of how to do this.
これを行う方法の例については、plugins / sched / backfillを参照してください。

Data Structure Consistency

In certain situations Slurm iterates over different data structures elements using counters.
特定の状況では、Slurmはカウンターを使用してさまざまなデータ構造要素を反復処理します。
For example, with environment variable arrays.
たとえば、環境変数配列を使用します。
In order to avoid buffer overflows and other undesired situations, when a plugin modifies certain elements it must also update these counters accordingly.
バッファオーバーフローやその他の望ましくない状況を回避するために、プラグインが特定の要素を変更する場合は、それに応じてこれらのカウンタも更新する必要があります。
Other situations may require other types of changes.
他の状況では、他のタイプの変更が必要になる場合があります。

The following advice indicates which structures have arrays with associated counters that must be maintained when modifying data, plus other possible important information to take in consideration when manipulating these structures.
次のアドバイスは、データを変更するときに維持する必要のあるカウンターが関連付けられた配列を持つ構造体と、これらの構造体を操作するときに考慮すべきその他の重要な情報を示しています。
This list is not fully exhaustive due to constant modifications in code, but it is a first start point and basic guideline for most common situations.
このリストは、コードが絶えず変更されているため、完全に網羅されているわけではありませんが、最も一般的な状況の最初の開始点であり、基本的なガイドラインです。
Complete structure information can be seen in the slurm/slurm.h.in file.
完全な構造情報は、slurm /slurm.h.inファイルで確認できます。

slurm_job_info_t (job_info_t) Data Structure

  uint32_t env_size;
  char **environment;

  uint32_t spank_job_env_size;
  char **spank_job_env;

  uint32_t gres_detail_cnt;
  char **gres_detail_str;

These pairs of array pointers and element counters must kept updated in order to avoid subsequent buffer overflows, so if you update the array you must also update the related counter.
配列ポインタと要素カウンタのこれらのペアは、後続のバッファオーバーフローを回避するために更新され続ける必要があるため、配列を更新する場合は、関連するカウンタも更新する必要があります。

  char *nodes;
  int32_t *node_inx;

  int32_t *req_node_inx;
  char *req_nodes;

node_inx and req_node_inx represents a list of index pairs for ranges of nodes defined in the nodes and req_nodes fields respectively.
node_inxとreq_node_inxは、それぞれnodesフィールドとreq_nodesフィールドで定義されたノードの範囲のインデックスペアのリストを表します。
In each case, both array variables must match the count.
いずれの場合も、両方の配列変数がカウントと一致する必要があります。

  uint32_t het_job_id;
  char *het_job_id_set;

The het_job_id field should be the first element of the het_job_id_set array.
het_job_idフィールドは、het_job_id_set配列の最初の要素である必要があります。

job_step_info_t Data Structure

  char *nodes;
  int32_t *node_inx;

node_inx represents a list of index pairs for range of nodes defined in nodes.
node_inxは、ノードで定義されたノードの範囲のインデックスペアのリストを表します。
Both variables must match the node count.
両方の変数がノード数と一致する必要があります。

priority_factors_object_t Data Structure

  uint32_t tres_cnt;
  char **tres_names;
  double *tres_weights;

This value must match the configured TRES on the system, otherwise iteration over the tres_names or tres_weights arrays can cause buffer overflows.
この値は、システムで構成されたTRESと一致する必要があります。一致しない場合、tres_namesまたはtres_weights配列を反復すると、バッファーオーバーフローが発生する可能性があります。

job_step_pids_t Data Structure

  uint32_t pid_cnt;
  uint32_t *pid;

Array pid represents the list of Process IDs for the job step, and pid_cnt is the counter that must match the size of the array.
配列pidは、ジョブステップのプロセスIDのリストを表し、pid_cntは、配列のサイズと一致する必要があるカウンターです。

slurm_step_layout_t Data Structure

  uint32_t node_cnt;
  char *node_list;

The node_list array size must match node_cnt.
node_list配列のサイズはnode_cntと一致する必要があります。

  uint16_t *tasks;
  uint32_t node_cnt;
  uint32_t task_cnt;

In the tasks array, each element is the number of tasks assigned to the corresponding node, to its size must match node_cnt.
タスク配列では、各要素は対応するノードに割り当てられたタスクの数であり、そのサイズはnode_cntと一致する必要があります。
Moreover task_cnt represents the sum of tasks registered in tasks.
さらに、task_cntは、タスクに登録されているタスクの合計を表します。

  uint32_t **tids;

tids is an array of length node_cnt of task ID arrays.
tidsは、タスクID配列の長さnode_cntの配列です。
Each subarray is designated by the corresponding value in the tasks array, so tasks, tids and task_cnt must be set to match this layout.
各サブ配列は、tasks配列内の対応する値によって指定されるため、tasks、tids、およびtask_cntは、このレイアウトに一致するように設定する必要があります。

slurm_step_launch_params_t Data Structure

  uint32_t envc;
  char **env;

When modifying the environment variables in the env array, you must also modify the envc counter accordingly to prevent buffer overflows in subsequent loops over that array.
env配列の環境変数を変更するときは、それに応じてenvcカウンターも変更して、その配列の後続のループでバッファーオーバーフローが発生しないようにする必要があります。

  uint32_t het_job_nnodes;
  uint32_t het_job_ntasks;

  uint16_t *het_job_task_cnts;
  uint32_t **het_job_tids;
  uint32_t *het_job_node_list;

This het_job_* related variables must match the current heterogeneous job configuration.
このhet_job_ *関連変数は、現在の異種ジョブ構成と一致する必要があります。

For example, if for whatever reason you are reducing the number of tasks for a node in a heterogeneous job, you should at least remove that task ID from het_job_tids, decrement het_job_ntasks and het_job_task_cnts, and possibly decrement the number of nodes of the heterogeneous job in het_job_nnodes and het_job_node_list.
たとえば、何らかの理由で異種ジョブのノードのタスク数を減らす場合は、少なくともそのタスクIDをhet_job_tidsから削除し、het_job_ntasksとhet_job_task_cntsをデクリメントし、場合によっては、の異種ジョブのノード数をデクリメントする必要があります。 het_job_nnodesおよびhet_job_node_list。

  char **spank_job_env;
  uint32_t spank_job_env_size;

When modifying the spank_job_env structure, the spank_job_env_size field must be updated to prevent buffer overflows in subsequent loops over that array.
spank_job_env構造を変更するときは、spank_job_env_sizeフィールドを更新して、その配列上の後続のループでバッファオーバーフローが発生しないようにする必要があります。

node_info_t Data Structure

  char *features;
  char *features_act;

In a system containing Intel KNL processors the features_act field is set by the plugin to match the currently running modes on the node.
Intel KNLプロセッサを含むシステムでは、features_actフィールドは、ノードで現在実行されているモードと一致するようにプラグインによって設定されます。
On other systems the features_act is not usually used.
他のシステムでは、features_actは通常使用されません。
If you program such a plugin you must ensure that features_act contains a subset of features.
このようなプラグインをプログラムする場合は、features_actに機能のサブセットが含まれていることを確認する必要があります。

char *reason;
time_t reason_time;
uint32_t reason_uid;

If reason is modified then reason_time and reason_uid should be updated.
reasonが変更された場合は、reason_timeとreason_uidを更新する必要があります。

reserve_info_t Data Structure

  int32_t *node_inx;
  uint32_t node_cnt;

node_inx represents a list of index pairs for range of nodes associated with the reservation and its count must equal node_cnt.
node_inxは、予約に関連付けられたノードの範囲のインデックスペアのリストを表し、そのカウントはnode_cntと等しくなければなりません。

partition_info_t Data Structure

No special advice.

slurm_step_layout_req_t Data Structure

No special advice.

slurm_step_ctx_params_t

No special advice.

Last modified 20 January 2020