1Slurm::Stepctx(3)     User Contributed Perl Documentation    Slurm::Stepctx(3)
2
3
4

NAME

6       Slurm::Stepctx - Step launching functions in libslurm
7

SYNOPSIS

9        use Slurm;
10
11        $slurm = Slurm::new();
12        $params = {job_id => 1234, ...};
13        $ctx = $slurm->step_ctx_create($params);
14        $rc = $ctx->launch({...}, {task_start => sub {...},
15                                task_finish => sub {...} });
16

DESCRIPTION

18       The Slurm::Stepctx class is a wrapper of the job step context and step
19       launching functions in libslurm. This package is loaded and bootstraped
20       with package Slurm.
21

METHODS

23   STEP CONTEXT CREATION FUNCTIONS
24       Please see "SLURM TASK SPAWNING FUNCTIONS" in Slurm for step context
25       creation functions.
26
27   STEP CONTEXT MANIPULATION FUNCTIONS
28       $rc = $ctx->get($ctx_key, ...);
29
30       Get parameters from a job step context.
31
32       · INPUT $ctx_key: type of the parameter to get. Supported key and the
33         corresponding result data are:
34
35         · $rc = $ctx->get(SLURM_STEP_CTX_STEPID, $stepid);
36
37           Get the created job step id. $stepid will be set to the step id
38           number.
39
40         · $rc = $ctx->get(SLURM_STEP_CTX_TASKS, $tasks);
41
42           Get array of task count on each node. $tasks will be set to an
43           array reference.
44
45         · $rc = $ctx->get(SLURM_STEP_CTX_TID, $nodeid, $tids);
46
47           Get array of task IDs for specified node. $nodeid specifies index
48           of the node. $tids will be set to an array reference.
49
50         · $rc = $ctx->get(SLURM_STEP_CTX_RESP, $resp);
51
52           TODO: this is not exported. Get job step create response message.
53
54         · $rc = $ctx->get(SLURM_STEP_CTX_CRED, $cred);
55
56           Get credential of the created job step. $cred will be an opaque
57           object blessed to "Slurm::slurm_cred_t".
58
59         · $rc = $ctx->get(SLURM_STEP_CTX_SWITCH_JOB, $switch_info);
60
61           Get switch plugin specific info of the step. $switch_info will be
62           an opaque object blessed to "Slurm::dynamic_plugin_data_t".
63
64         · $rc = $ctx->get(SLURM_STEP_CTX_NUM_HOSTS, $num);
65
66           Get number of nodes allocated to the job step.
67
68         · $rc = $ctx->get(SLURM_STEP_CTX_HOST, $nodeid, $nodename);
69
70           Get node name allocated to the job step. $nodeid specifies index of
71           the node.
72
73         · $rc = $ctx->get(SLURM_STEP_CTX_JOBID, $jobid);
74
75           Get job ID of the job step.
76
77         · $rc = $ctx->get(SLURM_STEP_CTX_USER_MANAGED_SOCKETS, $numtasks,
78           $sockets);
79
80           Get user managed I/O sockets. TODO: describe the parameters.
81
82       · RET: error code.
83
84       $rc = $ctx->daemon_per_node_hack($node_list, $node_cnt,
85       $curr_task_num);
86
87       Hack the step context to run a single process per node, regardless of
88       the settings selected at Slurm::Stepctx::create() time.
89
90       · RET: error code.
91
92   STEP TASK LAUNCHING FUNCTIONS
93       $rc = $ctx->launch($params, $callbacks);
94
95       Launch a parallel job step.
96
97       · IN $params: parameters of task launching, with structure of
98         "slurm_step_launch_params_t".
99
100       · IN $callbacks: callback functions, with structure of
101         "slurm_step_launch_callbacks_t". NOTE: the callback functions will be
102         called in a thread different from the thread calling the "launch()"
103         function.
104
105       · RET: error code.
106
107       $rc = $ctx->launch_wait_start();
108
109       Block until all tasks have started.
110
111       · RET: error code.
112
113       $ctx->launch_wait_finish();
114
115       Block until all tasks have finished (or failed to start altogether).
116
117       $ctx->launch_abort();
118
119       Abort an in-progress launch, or terminate the fully launched job step.
120       Can be called from a signal handler.
121
122       $ctx->launch_fwd_signal($signo);
123
124       Forward a signal to all those nodes with running tasks.
125
126       · IN $signo: signal number.
127

SEE ALSO

129       Slurm
130

AUTHOR

132       This library is created by Hongjia Cao, <hjcao(AT)nudt.edu.cn> and
133       Danny Auble, <da(AT)llnl.gov>. It is distributed with Slurm.
134
136       This library is free software; you can redistribute it and/or modify it
137       under the same terms as Perl itself, either Perl version 5.8.4 or, at
138       your option, any later version of Perl 5 you may have available.
139
140
141
142perl v5.32.0                      2021-01-19                 Slurm::Stepctx(3)
Impressum