ICC Home Privacy and Legal Notice LC User Documents Banner

UCRL-WEB-201386

SLURM Reference Manual


Multiple Program Usage

Strategy.
SRUN's --multi-prog option (see SRUN Resource-Allocation Options above) 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. For example,

srun -n8 -l --multi-prog test.config

(where -l here labels each task's output by task number for clarity).

Configuration File.
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 /usr/bin/spell).
Argument
assigns to this row's program the argument(s) listed. You can parameterize the argument(s) by including either of these special expressions:
%t
evaluates to the task number of the responsible task.
%o
(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).

Example Usage.
Here is a sample --multi-prog configuration file to illustrate the above features:

          4-6     hostname
          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):

          0: offset:0
          1: task:1
          2: offset:1
          3: offset:2
          4: alc20.llnl.gov
          5: alc21.llnl.gov
          6: alc22.llnl.gov
          7: task:7



Navigation Links: [ Document List ] [ HPC Home ] [ Next ]