.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Slurm::Stepctx 3pm" .TH Slurm::Stepctx 3pm "2021-08-23" "perl v5.32.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Slurm::Stepctx \- Step launching functions in libslurm .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Slurm; \& \& $slurm = Slurm::new(); \& $params = {job_id => 1234, ...}; \& $ctx = $slurm\->step_ctx_create($params); \& $rc = $ctx\->launch({...}, {task_start => sub {...}, \& task_finish => sub {...} }); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" The Slurm::Stepctx class is a wrapper of the job step context and step launching functions in libslurm. This package is loaded and bootstraped with package Slurm. .SH "METHODS" .IX Header "METHODS" .SS "\s-1STEP CONTEXT CREATION FUNCTIONS\s0" .IX Subsection "STEP CONTEXT CREATION FUNCTIONS" Please see \*(L"\s-1SLURM TASK SPAWNING FUNCTIONS\*(R"\s0 in Slurm for step context creation functions. .SS "\s-1STEP CONTEXT MANIPULATION FUNCTIONS\s0" .IX Subsection "STEP CONTEXT MANIPULATION FUNCTIONS" \fI\f(CI$rc\fI = \f(CI$ctx\fI\->get($ctx_key, ...);\fR .IX Subsection "$rc = $ctx->get($ctx_key, ...);" .PP Get parameters from a job step context. .IP "\(bu" 2 \&\s-1INPUT\s0 \f(CW$ctx_key:\fR type of the parameter to get. Supported key and the corresponding result data are: .RS 2 .IP "\(bu" 2 \&\f(CW$rc\fR = \f(CW$ctx\fR\->get(\s-1SLURM_STEP_CTX_STEPID,\s0 \f(CW$stepid\fR); .Sp Get the created job step id. \f(CW$stepid\fR will be set to the step id number. .IP "\(bu" 2 \&\f(CW$rc\fR = \f(CW$ctx\fR\->get(\s-1SLURM_STEP_CTX_TASKS,\s0 \f(CW$tasks\fR); .Sp Get array of task count on each node. \f(CW$tasks\fR will be set to an array reference. .IP "\(bu" 2 \&\f(CW$rc\fR = \f(CW$ctx\fR\->get(\s-1SLURM_STEP_CTX_TID,\s0 \f(CW$nodeid\fR, \f(CW$tids\fR); .Sp Get array of task IDs for specified node. \f(CW$nodeid\fR specifies index of the node. \f(CW$tids\fR will be set to an array reference. .IP "\(bu" 2 \&\f(CW$rc\fR = \f(CW$ctx\fR\->get(\s-1SLURM_STEP_CTX_RESP,\s0 \f(CW$resp\fR); .Sp \&\s-1TODO:\s0 this is not exported. Get job step create response message. .IP "\(bu" 2 \&\f(CW$rc\fR = \f(CW$ctx\fR\->get(\s-1SLURM_STEP_CTX_CRED,\s0 \f(CW$cred\fR); .Sp Get credential of the created job step. \f(CW$cred\fR will be an opaque object blessed to \*(L"Slurm::slurm_cred_t\*(R". .IP "\(bu" 2 \&\f(CW$rc\fR = \f(CW$ctx\fR\->get(\s-1SLURM_STEP_CTX_SWITCH_JOB,\s0 \f(CW$switch_info\fR); .Sp Get switch plugin specific info of the step. \f(CW$switch_info\fR will be an opaque object blessed to \*(L"Slurm::dynamic_plugin_data_t\*(R". .IP "\(bu" 2 \&\f(CW$rc\fR = \f(CW$ctx\fR\->get(\s-1SLURM_STEP_CTX_NUM_HOSTS,\s0 \f(CW$num\fR); .Sp Get number of nodes allocated to the job step. .IP "\(bu" 2 \&\f(CW$rc\fR = \f(CW$ctx\fR\->get(\s-1SLURM_STEP_CTX_HOST,\s0 \f(CW$nodeid\fR, \f(CW$nodename\fR); .Sp Get node name allocated to the job step. \f(CW$nodeid\fR specifies index of the node. .IP "\(bu" 2 \&\f(CW$rc\fR = \f(CW$ctx\fR\->get(\s-1SLURM_STEP_CTX_JOBID,\s0 \f(CW$jobid\fR); .Sp Get job \s-1ID\s0 of the job step. .IP "\(bu" 2 \&\f(CW$rc\fR = \f(CW$ctx\fR\->get(\s-1SLURM_STEP_CTX_USER_MANAGED_SOCKETS,\s0 \f(CW$numtasks\fR, \f(CW$sockets\fR); .Sp Get user managed I/O sockets. \s-1TODO:\s0 describe the parameters. .RE .RS 2 .RE .IP "\(bu" 2 \&\s-1RET:\s0 error code. .PP \fI\f(CI$rc\fI = \f(CI$ctx\fI\->daemon_per_node_hack($node_list, \f(CI$node_cnt\fI, \f(CI$curr_task_num\fI);\fR .IX Subsection "$rc = $ctx->daemon_per_node_hack($node_list, $node_cnt, $curr_task_num);" .PP Hack the step context to run a single process per node, regardless of the settings selected at \fBSlurm::Stepctx::create()\fR time. .IP "\(bu" 2 \&\s-1RET:\s0 error code. .SS "\s-1STEP TASK LAUNCHING FUNCTIONS\s0" .IX Subsection "STEP TASK LAUNCHING FUNCTIONS" \fI\f(CI$rc\fI = \f(CI$ctx\fI\->launch($params, \f(CI$callbacks\fI);\fR .IX Subsection "$rc = $ctx->launch($params, $callbacks);" .PP Launch a parallel job step. .IP "\(bu" 2 \&\s-1IN\s0 \f(CW$params:\fR parameters of task launching, with structure of \f(CW\*(C`slurm_step_launch_params_t\*(C'\fR. .IP "\(bu" 2 \&\s-1IN\s0 \f(CW$callbacks:\fR callback functions, with structure of \f(CW\*(C`slurm_step_launch_callbacks_t\*(C'\fR. \s-1NOTE:\s0 the callback functions will be called in a thread different from the thread calling the \f(CW\*(C`launch()\*(C'\fR function. .IP "\(bu" 2 \&\s-1RET:\s0 error code. .PP \fI\f(CI$rc\fI = \f(CI$ctx\fI\->\f(BIlaunch_wait_start()\fI;\fR .IX Subsection "$rc = $ctx->launch_wait_start();" .PP Block until all tasks have started. .IP "\(bu" 2 \&\s-1RET:\s0 error code. .PP \fI\f(CI$ctx\fI\->\f(BIlaunch_wait_finish()\fI;\fR .IX Subsection "$ctx->launch_wait_finish();" .PP Block until all tasks have finished (or failed to start altogether). .PP \fI\f(CI$ctx\fI\->\f(BIlaunch_abort()\fI;\fR .IX Subsection "$ctx->launch_abort();" .PP Abort an in-progress launch, or terminate the fully launched job step. Can be called from a signal handler. .PP \fI\f(CI$ctx\fI\->launch_fwd_signal($signo);\fR .IX Subsection "$ctx->launch_fwd_signal($signo);" .PP Forward a signal to all those nodes with running tasks. .IP "\(bu" 2 \&\s-1IN\s0 \f(CW$signo:\fR signal number. .SH "SEE ALSO" .IX Header "SEE ALSO" Slurm .SH "AUTHOR" .IX Header "AUTHOR" This library is created by Hongjia Cao, and Danny Auble, . It is distributed with Slurm. .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.4 or, at your option, any later version of Perl 5 you may have available.