SLURM Reference Manual
Multiple Program Usage
SRUN's --multi-prog option (see SRUN Resource-Allocation Options
lets you assign to each parallel task in your job a different program
with (if you wish) a different argument.
If you invoke --multi-prog, then SRUN's own argument is not the name
of one executable program (as usual) but rather the name of a local
configuration file that specifies
how to assign multiple programs and arguments among your job's tasks.
srun -n8 -l --multi-prog test.config
(where -l here labels each task's output by task number for clarity).
Each row in an SRUN --multi-prog configuration file contains these
three ordered fields, separated by blanks:
- Task number
- specifies by a comma-delimited series of nonnegative
integers the specific tasks configured on this row, with ranges
specified by hyphens (for instance: 2,4-8,10,12).
Star (*) specifies all tasks, which of course defeats the point
of invoking --multi-prog.
- Executable file
- assigns to this row's tasks the specified program to
execute (may be an absolute pathname if you wish, such as
- assigns to this row's program the argument(s) listed.
You can parameterize the argument(s) by including either of these
- evaluates to the task number of the responsible task.
- (lowercase oh)
evaluates to the task offset, that is, to the task's
relative position within the task range
configured on this row (always starts with zero).
Here is a sample --multi-prog configuration file to illustrate the
1,7 echo task:%t
0,2,3 echo task:%o
Here is the output of using the SRUN execute line shown above with
this file serving as test.config (and run on machine ALC):
Navigation Links: [
Document List ] [
HPC Home ]