Launch Plugin API
Overview
This document describes the launch plugin that is responsible for
launching a parallel task in Slurm and the API that defines them. It
is intended as a resource to programmers wishing to write their own
launch plugin.
このドキュメントでは、Slurmで並列タスクを起動する起動プラグインと、それらを定義するAPIについて説明します。独自の起動プラグインを作成したいプログラマへのリソースとして意図されています。
const char plugin_name[]="launch Slurm plugin"
const char
plugin_type[]="launch/slurm"
- slurm — Use Slurm's default launching infrastructure
slurm — Slurmのデフォルトの起動インフラストラクチャを使用する
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/launch/slurm/launch_slurm.c
for a sample implementation of a Slurm launch plugin.
プログラマーは、slurm起動プラグインのサンプル実装についてsrc / plugins / launch / slurm / launch_slurm.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.
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()の前に呼び出されます。
int launch_p_setup_srun_opt(char **rest, opt_t *opt_local)
Description:
Sets up the srun operation.
srun操作をセットアップします。
Arguments:
rest: extra parameters on the
command line not processed by srun
残り:srunで処理されないコマンドラインの追加パラメーター
opt_local: task launch options from srun command
Returns:
opt_local:srunコマンドからのタスク起動オプション
SLURM_SUCCESS on success, or
SLURM_ERROR on failure.
int launch_p_handle_multi_prog_verify(int command_pos, opt_t *opt_local)
Description:
Is called to verify a multi-prog file if verifying needs to be done.
検証を行う必要がある場合に、マルチプログラムファイルを検証するために呼び出されます。
Arguments:
command_pos: to be used with
global opt variable to tell which spot the command is in opt.argv.
command_pos:コマンドがopt.argv内のどこにあるかを通知するためにグローバルopt変数と共に使用されます。
opt_local: task launch options from srun command
opt_local:srunコマンドからのタスク起動オプション
Returns:
1 if handled, or
0 if not.
int launch_p_create_job_step(srun_job_t *job, bool use_all_cpus, void (*signal_function)(int), sig_atomic_t *destroy_job, opt_t *opt_local, int pack_offset)
Description:
Creates the job step.
ジョブステップを作成します。
Arguments:
job: the job to run.
job:実行するジョブ。
use_all_cpus: choice whether to use
all cpus.
use_all_cpus:すべてのcpusを使用するかどうかの選択。
signal_function: function that
handles the signals coming in.
signal_function:入ってくる信号を処理する関数。
destroy_job: pointer to a global
flag signifying if the job was canceled while allocating.
destroy_job:割り当て中にジョブがキャンセルされたかどうかを示すグローバルフラグへのポインター。
opt_local: task launch options from srun command
opt_local:srunコマンドからのタスク起動オプション
pack_offset: zero-origin index into a
heterogeneous job allocation, -1 if not heterogeneous job
pack_offset:異種ジョブ割り当てへのゼロ原点インデックス、異種ジョブでない場合は-1
Returns:
SLURM_SUCCESS on success, or
SLURM_ERROR on failure.
launch_p_step_launch(srun_job_t *job, slurm_step_io_fds_t *cio_fds, uint32_t *global_rc, opt_t *opt_local)
Description:
Launches the job step.
ジョブステップを起動します。
Arguments:
job: the job to launch.
job:起動するジョブ。
cio_fds: filled in io descriptors
cio_fds:io記述子を入力
global_rc: srun global return code.
global_rc:srunグローバル戻りコード。
opt_local: task launch options from srun command
opt_local:srunコマンドからのタスク起動オプション
Returns:
SLURM_SUCCESS on success, or
SLURM_ERROR on failure.
int launch_p_step_wait(srun_job_t *job, bool got_alloc, opt_t *opt_local, int pack_offset)
Description:
Waits for the job to be finished.
ジョブが完了するのを待ちます。
Arguments:
job: the job to wait for.
job:待機するジョブ。
got_alloc: if the resource
allocation was created inside srun.
got_alloc:リソース割り当てがsrun内で作成された場合。
opt_local: task launch options from srun command
opt_local:srunコマンドからのタスク起動オプション
pack_offset: zero-origin index into a
heterogeneous job allocation, -1 if not heterogeneous job
pack_offset:異種ジョブ割り当てへのゼロ原点インデックス、異種ジョブでない場合は-1
Returns:
SLURM_SUCCESS on success, or
SLURM_ERROR on failure.
int launch_p_step_terminate(void)
Description:
Terminates the job step.
ジョブステップを終了します。
Returns:
SLURM_SUCCESS on success, or
SLURM_ERROR on failure.
void launch_p_print_status(void)
Description:
Gets the status of the job.
ジョブのステータスを取得します。
void launch_p_fwd_signal(int signal)
Description:
Sends a forward signal to any underlying tasks.
基になるタスクに転送信号を送信します。
Arguments:
signal: the signal that needs to be sent.
signal:送信する必要があるシグナル。
Last modified 14 June 2018