Slurm Switch Plugin API
Overview
This document describe. Slurm switch (interconnect) plugins and the API that defines
them. It is intended as a resource to programmers wishing to write their own Slurm
switch plugins.
Note that many of the API functions are used only by one of the daemons. For
example the slurmctld daemon builds a job step's switch credential
(switch_p_build_jobinfo) while the
slurmd daemon enables and disables that credential for the job step's
tasks on a particular node(switch_p_job_init,
etc.).
このドキュメントで説明します。Slurmスイッチ(相互接続)プラグインとそれらを定義するAPI。独自のSlurmスイッチプラグインを作成したいプログラマ向けのリソースです。API関数の多くは、デーモンの1つでのみ使用されることに注意してください。たとえば、slurmctldデーモンはジョブステップのスイッチ認証情報(switch_p_build_jobinfo)を構築し、slurmdデーモンは特定のノード(switch_p_job_initなど)でジョブステップのタスクの認証情報を有効または無効にします。
Slurm switch plugins are Slurm plugins that implement the Slurm switch or interconnect
API described herein. They must conform to the Slurm Plugin API with the following
specifications:
Slurmスイッチプラグインは、ここで説明するSlurmスイッチまたは相互接続APIを実装するSlurmプラグインです。これらは、次の仕様のSlurm Plugin APIに準拠している必要があります。
const char plugin_type[]
The major type must be "switch." The minor type can be any recognizable
abbreviation for the type of switch. We recommend, for example:
主なタイプは「スイッチ」でなければなりません。マイナータイプは、スイッチのタイプの認識可能な省略形にすることができます。たとえば、次のことをお勧めします。
- none — A plugin that implements the API without providing any actual
switch service. This is the case for Ethernet and Myrinet interconnects.
none —実際のスイッチサービスを提供せずにAPIを実装するプラグイン。これは、イーサネットとMyrinetの相互接続の場合です。
const char plugin_name[]
Some descriptive name for the plugin.
There is no requirement with respect to its format.
プラグインの説明的な名前。その形式に関して要件はありません。
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関数の変更が原因で、障害の診断が困難になる可能性があります。
Data Objects
The implementation must support two opaque data classes.
One is used as an job step's switch "credential."
This class must encapsulate all job step specific information necessary
for the operation of the API specification below.
The second is a node's switch state record.
Both data classes are referred to in Slurm code using an anonymous
pointer (void *).
実装は2つの不透明なデータクラスをサポートする必要があります。1つはジョブステップのスイッチ「資格情報」として使用されます。このクラスは、以下のAPI仕様の操作に必要なすべてのジョブステップ固有の情報をカプセル化する必要があります。2番目は、ノードのスイッチ状態レコードです。両方のデータクラスは、匿名ポインター(void *)を使用してSlurmコードで参照されます。
API Functions
The following functions must appear. Functions which are not implemented should
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ランタイムシステムは、これらのシンボルを独自の初期化用にco-optします。システムの_init()はSlurm init()の前に呼び出され、Slurm fini()はシステムの_fini()の前に呼び出されます。
Global Switch State Functions
int switch_p_libstate_save (char *dir_name);
Description: Save any global switch state to a file
within the specified directory. The actual file name used is plugin specific. It is recommended
that the global switch state contain a magic number for validation purposes. This function
is called by the slurmctld daemon on shutdown. Note that if the slurmctld daemon fails,
this function will not be called. The plugin may save state independently and/or make
use of the switch_p_job_step_allocated function to restore state.
説明:グローバルスイッチの状態を、指定したディレクトリ内のファイルに保存します。使用される実際のファイル名はプラグイン固有です。検証のために、グローバルスイッチの状態にマジックナンバーを含めることをお勧めします。この関数は、シャットダウン時にslurmctldデーモンによって呼び出されます。slurmctldデーモンが失敗した場合、この関数は呼び出されないことに注意してください。プラグインは状態を個別に保存するか、switch_p_job_step_allocated関数を使用して状態を復元します。
Arguments: dir_name
(input) fully-qualified pathname of a directory into which user SlurmUser (as defined
in slurm.conf) can create a file and write state information into that file. Cannot be NULL.
引数:dir_name(入力)ユーザーのSlurmUser(slurm.confで定義)がファイルを作成し、状態情報をそのファイルに書き込むことができるディレクトリの完全修飾パス名。NULLにすることはできません。
Returns: SLURM_SUCCESS if successful. On failure,
the plugin should return SLURM_ERROR and set the errno to an appropriate value
to indicate the reason for failure.
戻り値:成功した場合はSLURM_SUCCESS。失敗すると、プラグインはSLURM_ERRORを返し、errnoを適切な値に設定して、失敗の理由を示す必要があります。
int switch_p_libstate_restore(char *dir_name, bool recover);
Description: Restore any global switch state from a file
within the specified directory. The actual file name used is plugin specific. It is recommended
that any magic number associated with the global switch state be verified. This function
is called by the slurmctld daemon on startup.
説明:指定したディレクトリ内のファイルからグローバルスイッチの状態を復元します。使用される実際のファイル名はプラグイン固有です。グローバルスイッチの状態に関連付けられているマジック番号を確認することをお勧めします。この関数は、起動時にslurmctldデーモンによって呼び出されます。
Arguments:
dir_name
(input) fully-qualified pathname of a directory containing a state information file
from which user SlurmUser (as defined in slurm.conf) can read. Cannot be NULL.
dir_name(入力)ユーザーSlurmUser(slurm.confで定義されている)から読み取ることができる状態情報ファイルを含むディレクトリの完全修飾パス名。NULLにすることはできません。
recover
true of restart with state preserved, false if no state recovery.
状態を保持したまま再起動の場合はtrue、状態が回復しない場合はfalse。
Returns: SLURM_SUCCESS if successful. On failure,
the plugin should return SLURM_ERROR and set the errno to an appropriate value
to indicate the reason for failure.
戻り値:成功した場合はSLURM_SUCCESS。失敗すると、プラグインはSLURM_ERRORを返し、errnoを適切な値に設定して、失敗の理由を示す必要があります。
int switch_p_libstate_clear (void);
Description: Clear switch state information.
説明:スイッチの状態情報を消去します。
Returns: SLURM_SUCCESS if successful. On failure,
the plugin should return SLURM_ERROR and set the errno to an appropriate value
to indicate the reason for failure.
戻り値:成功した場合はSLURM_SUCCESS。失敗すると、プラグインはSLURM_ERRORを返し、errnoを適切な値に設定して、失敗の理由を示す必要があります。
Node's Switch State Monitoring Functions
Nodes will register with current switch state information when the slurmd daemon
is initiated. The slurmctld daemon will also request that slurmd supply current
switch state information on a periodic basis.
slurmdデーモンが開始されると、ノードは現在のスイッチ状態情報に登録されます。slurmctldデーモンは、slurmdが現在のスイッチ状態情報を定期的に提供することも要求します。
int switch_p_clear_node_state (void);
Description: Initialize node state.
If any switch state has previously been established for a job step, it will be cleared.
This will be used to establish a "clean" state for the switch on the node upon
which it is executed.
説明:ノードの状態を初期化します。ジョブステップの切り替え状態が以前に確立されている場合、それはクリアされます。これは、それが実行されるノード上のスイッチの「クリーン」状態を確立するために使用されます。
Returns: SLURM_SUCCESS if successful. On failure,
the plugin should return SLURM_ERROR and set the errno to an appropriate value
to indicate the reason for failure.
戻り値:成功した場合はSLURM_SUCCESS。失敗すると、プラグインはSLURM_ERRORを返し、errnoを適切な値に設定して、失敗の理由を示す必要があります。
int switch_p_alloc_node_info(switch_node_info_t *switch_node);
Description: Allocate storage for a node's switch
state record. It is recommended that the record contain a magic number for validation
purposes.
説明:ノードのスイッチ状態レコードにストレージを割り当てます。検証のために、レコードにマジックナンバーを含めることをお勧めします。
Arguments: switch_node
(output) location for writing location of node's switch state record.
引数:ノードのスイッチ状態レコードの場所を書き込むためのswitch_node(出力)の場所。
Returns: SLURM_SUCCESS if successful. On failure,
the plugin should return SLURM_ERROR and set the errno to an appropriate value
to indicate the reason for failure.
戻り値:成功した場合はSLURM_SUCCESS。失敗すると、プラグインはSLURM_ERRORを返し、errnoを適切な値に設定して、失敗の理由を示す必要があります。
int switch_p_build_node_info(switch_node_info_t switch_node);
Description: Fill in a previously allocated switch state
record for the node on which this function is executed.
It is recommended that the magic number be validated.
説明:この関数が実行されるノードに以前に割り当てられたスイッチ状態レコードを入力します。マジック番号を検証することをお勧めします。
Returns: SLURM_SUCCESS if successful. On failure,
the plugin should return SLURM_ERROR and set the errno to an appropriate value
to indicate the reason for failure.
戻り値:成功した場合はSLURM_SUCCESS。失敗すると、プラグインはSLURM_ERRORを返し、errnoを適切な値に設定して、失敗の理由を示す必要があります。
int switch_p_pack_node_info (switch_node_info_t switch_node, Buf buffer);
Description: Pack the data associated with a
node's switch state into a buffer for network transmission.
説明:ノードのスイッチ状態に関連するデータを、ネットワーク送信用のバッファーにパックします。
Arguments:
switch_node (input) an existing
node's switch state record.
switch_node(入力)既存のノードのスイッチ状態レコード。
buffer (input/output) buffer onto
which the switch state information is appended.
バッファ(入力/出力)スイッチの状態情報が追加されるバッファ。
Returns:
The number of bytes written should be returned if successful. On failure,
the plugin should return SLURM_ERROR and set the errno to an appropriate value
to indicate the reason for failure.
戻り値:成功した場合、書き込まれたバイト数が返されます。失敗すると、プラグインはSLURM_ERRORを返し、errnoを適切な値に設定して、失敗の理由を示す必要があります。
int switch_p_unpack_node_info (switch_node_info_t **switch_node, Buf buffer);
Description: Allocate and unpack
the data associated with a node's switch state record from a buffer.
説明:ノードのスイッチ状態レコードに関連付けられたデータをバッファーから割り当て、アンパックします。
Arguments:
switch_node (output) a
node switch state record will be allocated and filled in with data read from
the buffer.
switch_node(出力)ノードのスイッチ状態レコードが割り当てられ、バッファから読み取られたデータで埋められます。
buffer (input/output) buffer from
which the record's contents are read.
buffer(入力/出力)レコードの内容が読み込まれるバッファー。
Returns: SLURM_SUCCESS if successful. On failure,
the plugin should return SLURM_ERROR and set the errno to an appropriate value
to indicate the reason for failure.
戻り値:成功した場合はSLURM_SUCCESS。失敗すると、プラグインはSLURM_ERRORを返し、errnoを適切な値に設定して、失敗の理由を示す必要があります。
void switch_p_free_node_info (switch_node_info_t switch_node);
Description: Release the storage associated with
a node's switch state record.
説明:ノードのスイッチ状態レコードに関連付けられたストレージを解放します。
Arguments: switch_node
(input/output) a previously allocated node switch state record.
引数:switch_node(入力/出力)以前に割り当てられたノードスイッチ状態レコード。
Returns: None
char * switch_p_sprintf_node_info (switch_node_info_t switch_node, char *buf, size_t size);
Description: Print the contents of a node's switch state
record to a buffer.
説明:ノードのスイッチ状態レコードの内容をバッファーに出力します。
Arguments:
switch_node (input) a
node's switch state record.
switch_node(入力)ノードのスイッチ状態レコード。
buf (input/output) point to
buffer into which the switch state record is to be written.
buf(入力/出力)は、スイッチ状態レコードが書き込まれるバッファーを指します。
size (input) size
of buf in bytes.
size(入力)bufのサイズ(バイト単位)。
Returns: Location of buffer, same as buf.
戻り値:バッファの場所。bufと同じです。
Job's Switch Credential Management Functions
int switch_p_alloc_jobinfo(switch_jobinfo_t *switch_job, uint32_t job_id, uint32_t step_id);
Description: Allocate storage for a job step's switch credential.
It is recommended that the credential contain a magic number for validation purposes.
説明:ジョブステップのスイッチ資格情報にストレージを割り当てます。クレデンシャルには、検証のためにマジックナンバーを含めることをお勧めします。
Arguments:
switch_job
(output) location for writing location of job step's
switch credential.
switch_job(出力)ジョブのステップの資格情報の場所を書き込む場所。
job_id (input) the
job id for this job step NO_VAL for not set.
job_id(入力)このジョブステップのジョブID NO_VALは設定されていません。
step_id (input) the
step id for this job step NO_VAL for not set.
step_id(入力)このジョブステップのステップID NO_VALは設定されません。
Returns: SLURM_SUCCESS if successful. On failure,
the plugin should return SLURM_ERROR and set the errno to an appropriate value
to indicate the reason for failure.
戻り値:成功した場合はSLURM_SUCCESS。失敗すると、プラグインはSLURM_ERRORを返し、errnoを適切な値に設定して、失敗の理由を示す必要があります。
int switch_p_build_jobinfo (switch_jobinfo_t switch_job, slurm_step_layout_t *step_layout, char *network);
Description: Build a job's switch credential.
It is recommended that the credential's magic number be validated.
説明:ジョブのスイッチ資格情報を作成します。資格情報のマジックナンバーを検証することをお勧めします。
Arguments:
switch_job (input/output) Job's
switch credential to be updated
switch_job(入力/出力)更新されるジョブのスイッチ資格情報
step_layout (input) the layout of the step with at least the node_list, tasks and tids set.
step_layout(入力)少なくともnode_list、tasks、およびtidsが設定されたステップのレイアウト。
network (input) Job step's network
specification from srun command.
network(入力)srunコマンドからのジョブステップのネットワーク仕様。
Returns: SLURM_SUCCESS if successful. On failure,
the plugin should return SLURM_ERROR and set the errno to an appropriate value
to indicate the reason for failure.
戻り値:成功した場合はSLURM_SUCCESS。失敗すると、プラグインはSLURM_ERRORを返し、errnoを適切な値に設定して、失敗の理由を示す必要があります。
switch_jobinfo_t switch_p_copy_jobinfo (switch_jobinfo_t switch_job);
Description: Allocate storage for a job's switch credential
and copy an existing credential to that location.
説明:ジョブのスイッチ資格情報にストレージを割り当て、既存の資格情報をその場所にコピーします。
Arguments: switch_job
(input) an existing job step switch credential.
引数:switch_job(入力)既存のジョブステップスイッチ資格情報。
Returns: A newly allocated job step switch
credential containing a copy of the function argument.
戻り値:関数の引数のコピーを含む、新しく割り当てられたジョブステップスイッチ資格情報。
void switch_p_free_jobinfo (switch_jobinfo_t switch_job);
Description: Release the storage associated with a job's
switch credential.
説明:ジョブのスイッチ資格情報に関連付けられたストレージを解放します。
Arguments: switch_job
(input) an existing job step switch credential.
引数:switch_job(入力)既存のジョブステップスイッチ資格情報。
Returns: None
int switch_p_pack_jobinfo (switch_jobinfo_t switch_job, Buf buffer);
Description: Pack the data associated with a job step's
switch credential into a buffer for network transmission.
説明:ジョブステップのスイッチ資格情報に関連付けられたデータを、ネットワーク送信用のバッファーにパックします。
Arguments:
switch_job (input) an
existing job step switch credential.
switch_job(入力)既存のジョブステップスイッチ資格情報。
buffer (input/output) buffer onto
which the credential's contents are appended.
資格情報の内容が追加されるバッファー(入力/出力)バッファー。
Returns:
The number of bytes written should be returned if successful. On failure,
the plugin should return SLURM_ERROR and set the errno to an appropriate value
to indicate the reason for failure.
戻り値:成功した場合、書き込まれたバイト数が返されます。失敗すると、プラグインはSLURM_ERRORを返し、errnoを適切な値に設定して、失敗の理由を示す必要があります。
int switch_p_unpack_jobinfo (switch_jobinfo_t **switch_job, Buf buffer);
Description: Allocate and unpack the data associated with a job's
switch credential from a buffer.
説明:ジョブのスイッチ資格情報に関連付けられたデータをバッファから割り当て、アンパックします。
Arguments:
switch_job
(output) a job step switch credential will be allocated and filled in with data read from the buffer.
switch_job(出力)ジョブステップスイッチ資格情報が割り当てられ、バッファーから読み取られたデータが入力されます。
buffer (input/output) buffer from
which the credential's contents are read.
資格情報の内容が読み取られるバッファー(入力/出力)バッファー。
Returns: SLURM_SUCCESS if successful. On failure,
the plugin should return SLURM_ERROR and set the errno to an appropriate value
to indicate the reason for failure.
戻り値:成功した場合はSLURM_SUCCESS。失敗すると、プラグインはSLURM_ERRORを返し、errnoを適切な値に設定して、失敗の理由を示す必要があります。
int switch_p_get_jobinfo (switch_jobinfo_t switch_job, int data_type, void *data);
Description: Get some specific data from a job's switch credential.
説明:ジョブのスイッチ資格情報から特定のデータを取得します。
Arguments:
switch_job (input) a job's switch credential.
switch_job(入力)ジョブのスイッチ資格情報。
data_type (input) identification
as to the type of data requested. The interpretation of this value is plugin dependent.
要求されたデータのタイプに関するdata_type(入力)識別。この値の解釈はプラグインに依存します。
data (output) filled in with the desired
data. The form of this data is dependent upon the value of data_type and the plugin.
必要なデータが入力されたデータ(出力)。このデータの形式は、data_typeの値とプラグインによって異なります。
Returns: SLURM_SUCCESS if successful. On failure,
the plugin should return SLURM_ERROR and set the errno to an appropriate value
to indicate the reason for failure.
戻り値:成功した場合はSLURM_SUCCESS。失敗すると、プラグインはSLURM_ERRORを返し、errnoを適切な値に設定して、失敗の理由を示す必要があります。
int switch_p_job_step_complete (switch_jobinfo_t switch_job, char *nodelist);
Description: Note that the job step associated
with the specified nodelist has completed execution.
説明:指定されたノードリストに関連付けられたジョブステップが実行を完了したことに注意してください。
Arguments:
switch_job (input)
The completed job step's switch credential.
switch_job(入力)完了したジョブステップのスイッチ資格情報。
nodelist (input) A list of nodes
on which the job step has completed. This may contain expressions to specify
node ranges. (e.g. "linux[1-20]" or "linux[2,4,6,8]").
nodelist(入力)ジョブステップが完了したノードのリスト。これには、ノード範囲を指定する式が含まれる場合があります。(例: "linux [1-20]"または "linux [2,4,6,8]")。
Returns: SLURM_SUCCESS if successful. On failure,
the plugin should return SLURM_ERROR and set the errno to an appropriate value
to indicate the reason for failure.
戻り値:成功した場合はSLURM_SUCCESS。失敗すると、プラグインはSLURM_ERRORを返し、errnoを適切な値に設定して、失敗の理由を示す必要があります。
int switch_p_job_step_part_comp (switch_jobinfo_t switch_job, char *nodelist);
Description: Note that the job step has completed
execution on the specified node list. The job step is not necessarily completed on all
nodes, but switch resources associated with it on the specified nodes are no longer
in use.
説明:指定したノードリストでジョブステップの実行が完了したことに注意してください。ジョブステップは必ずしもすべてのノードで完了する必要はありませんが、指定されたノードでそれに関連付けられているスイッチリソースは使用されなくなりました。
Arguments:
switch_job (input)
The completed job's switch credential.
switch_job(入力)完了したジョブのスイッチ資格情報。
nodelist (input) A list of nodes
on which the job step has completed. This may contain expressions to specify node ranges.
(e.g. "linux[1-20]" or "linux[2,4,6,8]").
nodelist(入力)ジョブステップが完了したノードのリスト。これには、ノード範囲を指定する式が含まれる場合があります。(例: "linux [1-20]"または "linux [2,4,6,8]")。
Returns: SLURM_SUCCESS if successful. On failure,
the plugin should return SLURM_ERROR and set the errno to an appropriate value
to indicate the reason for failure.
戻り値:成功した場合はSLURM_SUCCESS。失敗すると、プラグインはSLURM_ERRORを返し、errnoを適切な値に設定して、失敗の理由を示す必要があります。
bool switch_p_part_comp (void);
Description: Indicate if the switch plugin should
process partial job step completions (i.e. switch_g_job_step_part_comp). Support
of partition completions is compute intensive, so it should be avoided unless switch
resources are in short supply (e.g. former switch/nrt).
説明:スイッチプラグインが部分的なジョブステップの完了を処理するかどうかを示します(つまり、switch_g_job_step_part_comp)。パーティション補完のサポートは計算負荷が高いため、スイッチリソースが不足している場合(たとえば、以前のスイッチ/ nrt)を除いて、これを回避する必要があります。
Returns: True if partition step completions are
to be recorded. False if only full job step completions are to be noted.
戻り値:パーティションステップの完了が記録される場合はTrue。完全なジョブステップの完了のみを記録する場合はfalse。
void switch_p_print_jobinfo(FILE *fp, switch_jobinfo_t switch_job);
Description: Print the contents of a job's
switch credential to a file.
説明:ジョブのスイッチ資格情報の内容をファイルに出力します。
Arguments:
fp (input) pointer to an open file.
開いているファイルへのfp(入力)ポインター。
switch_job (input) a job's
switch credential.
switch_job(入力)ジョブのスイッチ資格情報。
Returns: None.
char *switch_p_sprint_jobinfo(switch_jobinfo_t switch_job, char *buf, size_t size);
Description: Print the contents of a job's
switch credential to a buffer.
説明:ジョブのスイッチ資格情報の内容をバッファーに出力します。
Arguments:
switch_job (input) a job's
switch credential.
switch_job(入力)ジョブのスイッチ資格情報。
buf (input/output) pointer to
buffer into which the job credential information is to be written.
ジョブ資格情報が書き込まれるバッファへのbuf(入力/出力)ポインタ。
size (input) size of buf in
bytes
size(入力)bufのサイズ(バイト)
Returns: location of buffer, same as buf.
戻り値:バッファの場所。bufと同じ。
int switch_p_get_data_jobinfo(switch_jobinfo_t switch_job, int key, void *resulting_data);
Description: Get data from a job step's
switch credential.
説明:ジョブステップのスイッチ資格情報からデータを取得します。
Arguments:
switch_job (input) a job
step's switch credential.
switch_job(入力)ジョブステップのスイッチ資格情報。
key (input) identification
of the type of data to be retrieved from the switch credential. NOTE: The
interpretation of this key is dependent upon the switch type.
スイッチクレデンシャルから取得するデータのタイプのキー(入力)識別。注:このキーの解釈は、スイッチのタイプによって異なります。
resulting_data (input/output)
pointer to where the requested data should be stored.
result_data(入力/出力)要求されたデータを格納する場所へのポインタ。
Returns: SLURM_SUCCESS if successful. On failure,
the plugin should return SLURM_ERROR and set the errno to an appropriate value
to indicate the reason for failure.
戻り値:成功した場合はSLURM_SUCCESS。失敗すると、プラグインはSLURM_ERRORを返し、errnoを適切な値に設定して、失敗の理由を示す必要があります。
Node Specific Switch Management Functions
int switch_p_node_init (void);
Description: This function is run from the top level slurmd
only once per slurmd run. It may be used, for instance, to perform some one-time
interconnect setup or spawn an error handling thread.
説明:この関数は、最上位のslurmdから、slurmdの実行ごとに1回だけ実行されます。たとえば、1回限りの相互接続セットアップを実行したり、エラー処理スレッドを生成したりするために使用できます。
Arguments: None
引数:なし
Returns: SLURM_SUCCESS if successful. On failure,
the plugin should return SLURM_ERROR and set the errno to an appropriate value
to indicate the reason for failure.
戻り値:成功した場合はSLURM_SUCCESS。失敗すると、プラグインはSLURM_ERRORを返し、errnoを適切な値に設定して、失敗の理由を示す必要があります。
int switch_p_node_fini (void);
Description: This function is called once as slurmd exits
(slurmd will wait for this function to return before continuing the exit process).
説明:この関数は、slurmdの終了時に一度呼び出されます(slurmdは、この関数が戻るのを待ってから、終了プロセスを続行します)。
Arguments: None
引数:なし
Returns: SLURM_SUCCESS if successful. On failure,
the plugin should return SLURM_ERROR and set the errno to an appropriate value
to indicate the reason for failure.
戻り値:成功した場合はSLURM_SUCCESS。失敗すると、プラグインはSLURM_ERRORを返し、errnoを適切な値に設定して、失敗の理由を示す必要があります。
Job Step Management Functions
========================================================================= Process 1 (root) Process 2 (root, user) | Process 3 (user task) | switch_p_job_preinit | fork ------------------ switch_p_job_init | waitpid setuid, chdir, etc. | fork N procs -----------+--- switch_p_job_attach wait all | exec mpi process switch_p_job_fini* | switch_p_job_postfini | =========================================================================
int switch_p_job_preinit (switch_jobinfo_t jobinfo switch_job);
Description: Preinit is run as root in the first slurmd process,
the so called job step manager. This function can be used to perform any initialization
that needs to be performed in the same process as switch_p_job_fini().
説明:Preinitは、最初のslurmdプロセス、いわゆるジョブステップマネージャーでrootとして実行されます。この関数は、switch_p_job_fini()と同じプロセスで実行する必要がある初期化を実行するために使用できます。
Arguments:
switch_job (input) a job's
switch credential.
引数:switch_job(入力)ジョブのスイッチ資格情報。
Returns: SLURM_SUCCESS if successful. On failure,
the plugin should return SLURM_ERROR and set the errno to an appropriate value
to indicate the reason for failure.
戻り値:成功した場合はSLURM_SUCCESS。失敗すると、プラグインはSLURM_ERRORを返し、errnoを適切な値に設定して、失敗の理由を示す必要があります。
int switch_p_job_init (stepd_step_rec_t *job, uid_t uid);
Description: Initialize interconnect on node for a job.
This function is run from the second slurmd process (some interconnect implementations
may require the switch_p_job_init functions to be executed from a separate process
than the process executing switch_p_job_fini() [e.g. Quadrics Elan]).
説明:ジョブのノードで相互接続を初期化します。この関数は、2番目のslurmdプロセスから実行されます(一部の相互接続実装では、switch_p_job_fini()を実行するプロセスとは別のプロセスからswitch_p_job_init関数を実行する必要がある場合があります(例:Quadrics Elan])。
Arguments:
job (input)
structure representing the slurmstepd's view of the job step.
ジョブステップのslurmstepdのビューを表すジョブ(入力)構造。
Returns: SLURM_SUCCESS if successful. On failure,
the plugin should return SLURM_ERROR and set the errno to an appropriate value
to indicate the reason for failure.
戻り値:成功した場合はSLURM_SUCCESS。失敗すると、プラグインはSLURM_ERRORを返し、errnoを適切な値に設定して、失敗の理由を示す必要があります。
int switch_p_job_attach ( switch_jobinfo_t switch_job, char ***env, uint32_t nodeid, uint32_t procid, uint32_t nnodes, uint32_t nprocs, uint32_t rank );
Description: Attach process to interconnect
(Called from within the process, so it is appropriate to set interconnect specific
environment variables here).
説明:プロセスを相互接続に接続します(プロセス内から呼び出されるため、相互接続固有の環境変数をここで設定するのが適切です)。
Arguments:
switch_job (input) a job's
switch credential.
switch_job(入力)ジョブのスイッチ資格情報。
env (input/output) the
environment variables to be set upon job step initiation. Switch specific
environment variables are added as needed.
env(入力/出力)ジョブステップの開始時に設定される環境変数。必要に応じて、スイッチ固有の環境変数が追加されます。
nodeid (input) zero-origin
id of this node.
nodeid(入力)このノードのゼロ起点ID。
procid (input) zero-origin
process id local to slurmd and not equivalent to the global task id or MPI rank.
procid(入力)slurmdにローカルな原点がゼロのプロセスID。グローバルタスクIDまたはMPIランクとは異なります。
nnodes (input) count of
nodes allocated to this job step.
nnodes(入力)このジョブステップに割り当てられたノードの数。
nprocs (input) total count of
processes or tasks to be initiated for this job step.
nprocs(入力)このジョブステップで開始されるプロセスまたはタスクの総数。
rank (input) zero-origin
id of this task.
ランク(入力)このタスクのゼロ生成ID。
Returns: SLURM_SUCCESS if successful. On failure,
the plugin should return SLURM_ERROR and set the errno to an appropriate value
to indicate the reason for failure.
戻り値:成功した場合はSLURM_SUCCESS。失敗すると、プラグインはSLURM_ERRORを返し、errnoを適切な値に設定して、失敗の理由を示す必要があります。
int switch_p_job_fini (switch_jobinfo_t jobinfo switch_job);
Description: This function is run from the same process
as switch_p_job_init() after all job tasks have exited. It is *not* run as root, because
the process in question has already setuid to the job step owner.
説明:この関数は、すべてのジョブタスクが終了した後、switch_p_job_init()と同じプロセスから実行されます。問題のプロセスはすでにジョブステップの所有者にsetuidしているため、ルートとしては実行されません。
Arguments:
switch_job (input) a job
step's switch credential.
引数:switch_job(入力)ジョブステップのスイッチ資格情報。
Returns: SLURM_SUCCESS if successful. On failure,
the plugin should return SLURM_ERROR and set the errno to an appropriate value
to indicate the reason for failure.
戻り値:成功した場合はSLURM_SUCCESS。失敗すると、プラグインはSLURM_ERRORを返し、errnoを適切な値に設定して、失敗の理由を示す必要があります。
int switch_p_job_postfini ( stepd_step_rec_t *job );
Description: This function is run from the initial slurmd
process (same process as switch_p_job_preinit()), and is run as root. Any cleanup routines
that need to be run with root privileges should be run from this function.
説明:この関数は最初のslurmdプロセス(switch_p_job_preinit()と同じプロセス)から実行され、rootとして実行されます。root権限で実行する必要があるクリーンアップルーチンは、この関数から実行する必要があります。
Arguments:
job (input)
structure representing the slurmstepd's view of the job step.
ジョブステップのslurmstepdのビューを表すジョブ(入力)構造。
Returns: SLURM_SUCCESS if successful. On failure,
the plugin should return SLURM_ERROR and set the errno to an appropriate value
to indicate the reason for failure.
戻り値:成功した場合はSLURM_SUCCESS。失敗すると、プラグインはSLURM_ERRORを返し、errnoを適切な値に設定して、失敗の理由を示す必要があります。
int switch_p_job_step_allocated (switch_jobinfo_t jobinfo switch_job, char *nodelist);
Description: Note that the identified
job step is active at restart time. This function can be used to
restore global switch state information based upon job steps known to be
active at restart time. Use of this function is preferred over switch state
saved and restored by the switch plugin. Direct use of job step switch
information eliminates the possibility of inconsistent state information
between the switch and job steps.
説明:識別されたジョブステップは再起動時にアクティブであることに注意してください。この機能を使用すると、再起動時にアクティブであることがわかっているジョブステップに基づいて、グローバルスイッチの状態情報を復元できます。この関数の使用は、スイッチプラグインによって保存および復元されるスイッチ状態よりも優先されます。ジョブステップスイッチ情報を直接使用することで、スイッチとジョブステップ間で状態情報が矛盾する可能性がなくなります。
Arguments:
switch_job (input) a job's
switch credential.
switch_job(入力)ジョブのスイッチ資格情報。
nodelist (input) the nodes
allocated to a job step.
nodelist(入力)ジョブステップに割り当てられたノード。
Returns: SLURM_SUCCESS if successful. On failure,
the plugin should return SLURM_ERROR and set the errno to an appropriate value
to indicate the reason for failure.
戻り値:成功した場合はSLURM_SUCCESS。失敗すると、プラグインはSLURM_ERRORを返し、errnoを適切な値に設定して、失敗の理由を示す必要があります。
Job Management Suspend/Resume Functions
int switch_p_job_suspend_test(switch_jobinfo_t *switch_job);
Description: Determine if a specific job
step can be preempted.
説明:特定のジョブステップをプリエンプトできるかどうかを決定します。
Arguments:
switch_job (input) a job
step's switch credential.
switch_job(入力)ジョブステップのスイッチ資格情報。
Returns: SLURM_SUCCESS if the job step can be
preempted and SLURM_ERROR otherwise.
戻り値:ジョブステップをプリエンプトできる場合はSLURM_SUCCESS、それ以外の場合はSLURM_ERROR。
void switch_p_job_suspend_info_get(switch_jobinfo_t *switch_job, void **suspend_info);
Description: Pack any information needed
for a job step to be preempted into an opaque data structure.
説明:ジョブステップを先取りするために必要な情報を不透明なデータ構造にパックします。
NOTE: Use switch_p_job_suspend_info_free() to free the opaque data structure.
注:不透明なデータ構造を解放するには、switch_p_job_suspend_info_free()を使用します。
Arguments:
switch_job (input) a job
step's switch credential.
switch_job(入力)ジョブステップのスイッチ資格情報。
suspend_info (input/output)
information needed for a job to be preempted. This should be NULL for the
first call and data about job steps will be added to the opaque data structure
for addition function call (i.e. for each addition job step).
ジョブを横取りするために必要なsuspend_info(入力/出力)情報。これは最初の呼び出しではNULLである必要があり、ジョブステップに関するデータは、追加の関数呼び出し(つまり、各追加ジョブステップ)の不透明なデータ構造に追加されます。
void switch_p_job_suspend_info_pack(void *suspend_info, Buf buffer);
Description: Pack the information needed
for a job to be preempted into a buffer
説明:ジョブをプリエンプトするために必要な情報をバッファーにパックします
Arguments:
suspend_info (input)
information needed for a job to be preempted, including information for all
steps in that job.
ジョブを横取りするために必要なsuspend_info(入力)情報(そのジョブのすべてのステップの情報を含む)。
buffer (input/output)
the buffer that has suspend_info added to it.
buffer(入力/出力)suspend_infoが追加されたバッファー。
int switch_p_job_suspend_info_unpack(void **suspend_info, Buf buffer);
Description: Unpack the information needed
for a job to be preempted from a buffer.
説明:ジョブをバッファーからプリエンプトするために必要な情報を解凍します。
NOTE: Use switch_p_job_suspend_info_free() to free the opaque data structure.
注:不透明なデータ構造を解放するには、switch_p_job_suspend_info_free()を使用します。
Arguments:
suspend_info (output)
information needed for a job to be preempted, including information for all
steps in that job.
ジョブをプリエンプトするために必要なsuspend_info(出力)情報(そのジョブのすべてのステップの情報を含む)。
buffer (input/output)
the buffer that has suspend_info extracted from it.
buffer(入力/出力)suspend_infoが抽出されたバッファー。
Returns: SLURM_SUCCESS if the suspend_info
data was successfully read from buffer and SLURM_ERROR otherwise.
戻り値:suspend_infoデータがバッファから正常に読み取られた場合はSLURM_SUCCESS、それ以外の場合はSLURM_ERROR。
int switch_p_job_suspend(void *suspend_info, int max_wait);
Description: Suspend a job's use of switch
resources. This may reset MPI timeout values and/or release switch resources.
説明:ジョブによるスイッチリソースの使用を一時停止します。これにより、MPIタイムアウト値がリセットされたり、スイッチリソースが解放されたりする場合があります。
Arguments:
suspend_info (input)
information needed for a job to be preempted, including information for all
steps in that job.
ジョブを横取りするために必要なsuspend_info(入力)情報(そのジョブのすべてのステップの情報を含む)。
max_wait (input) maximum
time interval to wait for the operation to complete, in seconds
max_wait(入力)操作の完了を待機する最大時間間隔(秒)
Returns: SLURM_SUCCESS if job's switch
resources suspended and SLURM_ERROR otherwise.
戻り値:ジョブのスイッチリソースが中断された場合はSLURM_SUCCESS、それ以外の場合はSLURM_ERROR。
int switch_p_job_resume(void *suspend_info, int max_wait);
Description: Resume a job's use of switch
resources. This may reset MPI timeout values and/or release switch resources.
説明:ジョブによるスイッチリソースの使用を再開します。これにより、MPIタイムアウト値がリセットされたり、スイッチリソースが解放されたりする場合があります。
Arguments:
suspend_info (input)
information needed for a job to be resumed, including information for all
steps in that job.
ジョブを再開するために必要なsuspend_info(入力)情報(そのジョブのすべてのステップの情報を含む)。
max_wait (input) maximum
time interval to wait for the operation to complete, in seconds
max_wait(入力)操作の完了を待機する最大時間間隔(秒)
Returns: SLURM_SUCCESS if job's switch
resources resumed and SLURM_ERROR otherwise.
戻り値:ジョブのスイッチリソースが再開した場合はSLURM_SUCCESS、それ以外の場合はSLURM_ERROR。
void switch_p_job_suspend_info_free(void *suspend_info);
Description: Free the resources allocated
to store job suspend/resume information as generated by the
switch_p_job_suspend_info_get() and switch_p_job_suspend_info_unpack() functions.
説明:switch_p_job_suspend_info_get()およびswitch_p_job_suspend_info_unpack()関数によって生成されたジョブの中断/再開情報を格納するために割り当てられたリソースを解放します。
Arguments:
suspend_info (input)
information needed for a job to be preempted, including information for all
steps in that job.
ジョブを横取りするために必要なsuspend_info(入力)情報(そのジョブのすべてのステップの情報を含む)。
Job Step Management Suspend/Resume Functions
int switch_p_job_step_pre_suspend (stepd_step_rec_t *jobstep);
Description: Perform any job step pre-suspend functionality (done before the application PIDs are stopped).
説明:ジョブステップのプレサスペンド機能を実行します(アプリケーションPIDが停止する前に行われます)。
Arguments:
job (input)
structure representing the slurmstepd's view of the job step.
ジョブステップのslurmstepdのビューを表すジョブ(入力)構造。
Returns: SLURM_SUCCESS if the job step can be
suspended and SLURM_ERROR otherwise.
戻り値:ジョブステップを中断できる場合はSLURM_SUCCESS、それ以外の場合はSLURM_ERROR。
int switch_p_job_step_post_suspend (stepd_step_rec_t *jobstep);
Description: Perform any job step post-suspend functionality (done after the application PIDs are stopped).
説明:一時停止後のジョブステップを実行します(アプリケーションのPIDが停止した後に実行されます)。
Arguments:
job (input)
structure representing the slurmstepd's view of the job step.
ジョブステップのslurmstepdのビューを表すジョブ(入力)構造。
Returns: SLURM_SUCCESS if the job step has been suspended and SLURM_ERROR otherwise.
戻り値:ジョブステップが一時停止されている場合はSLURM_SUCCESS、それ以外の場合はSLURM_ERROR。
int switch_p_job_step_pre_resume (stepd_step_rec_t *jobstep);
Description: Perform any job step pre-resume functionality (done before the application PIDs are re-started).
説明:ジョブステップの再開前機能を実行します(アプリケーションPIDが再起動される前に行われます)。
Arguments:
job (input)
structure representing the slurmstepd's view of the job step.
ジョブステップのslurmstepdのビューを表すジョブ(入力)構造。
Returns: SLURM_SUCCESS if the job step can be
resumed and SLURM_ERROR otherwise.
戻り値:ジョブステップを再開できる場合はSLURM_SUCCESS、それ以外の場合はSLURM_ERROR。
int switch_p_job_step_post_resume (stepd_step_rec_t *jobstep);
Description: Perform any job step post-resume functionality (done after the application PIDs are re-started).
説明:ジョブステップの再開後機能を実行します(アプリケーションPIDが再起動された後に実行されます)。
Arguments:
job (input)
structure representing the slurmstepd's view of the job step.
ジョブステップのslurmstepdのビューを表すジョブ(入力)構造。
Returns: SLURM_SUCCESS if the job step has been resumed and SLURM_ERROR otherwise.
戻り値:ジョブステップが再開された場合はSLURM_SUCCESS、それ以外の場合はSLURM_ERROR。
Last modified 7 March 2019