/usr/lib/perl5/Slurm/Stepctx.pm is in libslurm-perl 2.3.2-1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | package Slurm::Stepctx;
1;
__END__
=head1 NAME
Slurm::Stepctx - Step launching functions in libslurm
=head1 SYNOPSIS
use Slurm;
$slurm = Slurm::new();
$params = {job_id => 1234, ...};
$ctx = $slurm->step_ctx_create($params);
$rc = $ctx->launch({...}, {task_start => sub {...},
task_finish => sub {...} });
=head1 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.
=head1 METHODS
=head2 STEP CONTEXT CREATION FUNCTIONS
Please see L<Slurm/"SLURM TASK SPAWNING FUNCTIONS"> for step context creation functions.
=head2 STEP CONTEXT MANIPULATION FUNCTIONS
=head3 $rc = $ctx->get($ctx_key, ...);
Get parameters from a job step context.
=over 2
=item * INPUT $ctx_key: type of the parameter to get. Supported key and the corresponding result data are:
=over 2
=item * $rc = $ctx->get(SLURM_STEP_CTX_STEPID, $stepid);
Get the created job step id. $stepid will be set to the step id number.
=item * $rc = $ctx->get(SLURM_STEP_CTX_TASKS, $tasks);
Get array of task count on each node. $tasks will be set to an array reference.
=item * $rc = $ctx->get(SLURM_STEP_CTX_TID, $nodeid, $tids);
Get array of task IDs for specified node. $nodeid specifies index of the node. $tids will be set to an array reference.
=item * $rc = $ctx->get(SLURM_STEP_CTX_RESP, $resp);
TODO: this is not exported. Get job step create response message.
=item * $rc = $ctx->get(SLURM_STEP_CTX_CRED, $cred);
Get credential of the created job step. $cred will be an opaque object blessed to "Slurm::slurm_cred_t".
=item * $rc = $ctx->get(SLURM_STEP_CTX_SWITCH_JOB, $switch_info);
Get switch plugin specific info of the step. $switch_info will be an opaque object blessed to "Slurm::switch_jobinfo_t".
=item * $rc = $ctx->get(SLURM_STEP_CTX_NUM_HOSTS, $num);
Get number of nodes allocated to the job step.
=item * $rc = $ctx-E<gt>get(SLURM_STEP_CTX_HOST, $nodeid, $nodename);
Get node name allocated to the job step. $nodeid specifies index of the node.
=item * $rc = $ctx->get(SLURM_STEP_CTX_JOBID, $jobid);
Get job ID of the job step.
=item * $rc = $ctx->get(SLURM_STEP_CTX_USER_MANAGED_SOCKETS, $numtasks, $sockets);
Get user managed I/O sockets. TODO: describe the parameters.
=back
=item * RET: error code.
=back
=head3 $rc = $ctx->daemon_per_node_hack();
Hack the step context to run a single process per node, regardless of the settings selected at Slurm::Stepctx::create() time.
=over 2
=item * RET: error code.
=back
=head2 STEP TASK LAUNCHING FUNCTIONS
=head3 $rc = $ctx->launch($params, $callbacks);
Launch a parallel job step.
=over 2
=item * IN $params: parameters of task launching, with structure of C<slurm_step_launch_params_t>.
=item * IN $callbacks: callback functions, with structure of C<slurm_step_launch_callbacks_t>. NOTE: the callback functions will be called in a thread different from the thread calling the C<launch()> function.
=item * RET: error code.
=back
=head3 $rc = $ctx->launch_wait_start();
Block until all tasks have started.
=over 2
=item * RET: error code.
=back
=head3 $ctx->launch_wait_finish();
Block until all tasks have finished (or failed to start altogether).
=head3 $ctx->launch_abort();
Abort an in-progress launch, or terminate the fully launched job step. Can be called from a signal handler.
=head3 $ctx->launch_fwd_signal($signo);
Forward a signal to all those nodes with running tasks.
=over 2
=item * IN $signo: signal number.
=back
=head1 SEE ALSO
Slurm
=head1 AUTHOR
This library is created by Hongjia Cao, E<lt>hjcao(AT)nudt.edu.cnE<gt> and Danny Auble, E<lt>da(AT)llnl.govE<gt>. It is distributed with SLURM.
=head1 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.
=cut
|