This srun option is intended for use with MPMD (multiple program multiple data) MPI programs. In other words, tasks run different executables rather than the more typical single executable model (SPMD = single program multiple data).

Usage:

--multi-prog config_file_name

where config_file_name is the actual name of a user-created text file that describes which tasks run which executables with/without arguments. For example:

srun -n8 --multi-prog myrun.conf

Configuration file format:

Comments in the configuration file must have a "#" in column one. The configuration file contains the following fields separated by white space:

Task rank

One or more task ranks to use this configuration. Multiple values may be comma separated. Ranges may be indicated with two numbers separated with a '-' with the smaller number first (e.g. "0-4" and not "4-0"). To indicate all tasks, specify a rank of '*' (in which case you probably should not be using this option). If an attempt is made to initiate a task for which no executable program is defined, the following error message will be produced "No executable program specified for this task".

Executable

The name of the program to execute. May be fully qualified pathname if desired.

Arguments

Program arguments. The expression "%t" will be replaced with the task's number. The expression "%o" will be replaced with the task's offset within this range (e.g. a configured task rank value of "1-5" would have offset values of "0-4"). Single quotes may be used to avoid having the enclosed values interpreted. This field is optional.

Example configuration file:

################################################################### # srun multiple program configuration file # # srun -n8 -l --multi-prog myrun.conf ################################################################### 4-6 hostname 1,7 echo task:%t 0,2-3 echo offset:%o

Example output:

% srun -n8 -l --multi-prog myrun.conf 0: offset:0 1: task:1 2: offset:1 3: offset:2 4: linux15.llnl.gov 5: linux16.llnl.gov 6: linux17.llnl.gov 7: task:7