Slurm Workload Manager -

    Option(s) define multiple jobs in a co\-scheduled heterogeneous job.
    For more details about heterogeneous jobs see the document
    .br
    https://slurm.schedmd.com/heterogeneous_jobs.html

    .SH "DESCRIPTION"
    Run a parallel job on cluster managed by Slurm. If necessary, srun will
    first create a resource allocation in which to run the parallel job.

    The following document describes the influence of various options on the
    allocation of cpus to jobs and tasks.
    .br
    https://slurm.schedmd.com/cpu_management.html

    .SH "RETURN VALUE"
    srun will return the highest exit code of all tasks run or the highest signal
    (with the high\-order bit set in an 8\-bit integer \-\- e.g. 128 + signal) of any
    task that exited with a signal.
    .br
    The value 253 is reserved for out\-of\-memory errors.

    .SH "EXECUTABLE PATH RESOLUTION"

    The executable is resolved in the following order:
    .br

    1. If executable starts with ".", then path is constructed as:
    current working directory / executable
    .br
    2. If executable starts with a "/", then path is considered absolute.
    .br
    3. If executable can be resolved through PATH. See \fBpath_resolution\fR(7).
    .br
    4. If executable is in current working directory.
    .br
    .P
    Current working directory is the calling process working directory unless the
    \fB\-\-chdir\fR argument is passed, which will override the current working
    directory.

    .SH "OPTIONS"
    .LP

    .TP
    \fB\-A\fR, \fB\-\-account\fR=<\fIaccount\fR>
    Charge resources used by this job to specified account.
    The \fIaccount\fR is an arbitrary string. The account name may
    be changed after job submission using the \fBscontrol\fR
    command. This option applies to job allocations.
    .IP

    Sampling interval for the jobacct_gather plugins and for task
    profiling by the acct_gather_profile plugin.
    .br
    \fBNOTE\fR: This frequency is used to monitor memory usage. If memory limits
    are enforced the highest frequency a user can request is what is configured in
    the slurm.conf file. It can not be disabled.
    .IP

    .TP
    \fBenergy\fR
    Sampling interval for energy profiling using the
    acct_gather_energy plugin.
    .IP

    .TP
    \fBnetwork\fR
    Sampling interval for infiniband profiling using the
    acct_gather_interconnect plugin.
    .IP

    .TP
    \fBfilesystem\fR
    Sampling interval for filesystem profiling using the
    acct_gather_filesystem plugin.

    .LP
    The default value for the task sampling interval is 30 seconds.
    The default value for all other intervals is 0.
    An interval of 0 disables sampling of the specified type.
    If the task sampling interval is 0, accounting
    information is collected only at job termination (reducing Slurm
    interference with the job).
    .br
    Smaller (non\-zero) values have a greater impact upon job performance,
    but a value of 30 seconds is not likely to be noticeable for
    applications having less than 10,000 tasks. This option applies to job
    allocations.
    .RE
    .IP

    .TP
    \fB\-\-bb\fR=<\fIspec\fR>
    Burst buffer specification. The form of the specification is system dependent.
    Also see \fB\-\-bbf\fR. This option applies to job allocations.
    When the \fB\-\-bb\fR option is used, Slurm parses this option and creates a
    temporary burst buffer script file that is used internally by the burst buffer
    plugins. See Slurm's burst buffer guide for more information and examples:
    .br
    https://slurm.schedmd.com/burst_buffer.html
    .IP

    .TP
    If the path specified ends with '/' it is treated as a target directory, and
    the destination file name will be slurm_bcast_<job_id>.<step_id>_<nodename>.
    If no dest_path is specified and the slurm.conf \fBBcastParameters\fR
    \fBDestDir\fR is configured then it is used, and the filename follows the
    above pattern. If none of the previous is specified, then \fB\-\-chdir\fR is
    used, and the filename follows the above pattern too.
    For example, "srun \-\-bcast=/tmp/mine \-N3 a.out" will copy the file "a.out"
    from your current directory to the file "/tmp/mine" on each of the three
    allocated compute nodes and execute that file. This option applies to step
    allocations.
    .IP

    .TP
    \fB\-\-bcast\-exclude\fR={NONE|<\fIexclude_path\fR>[,<\fIexclude_path\fR>...]}
    Comma\-separated list of absolute directory paths to be excluded when
    autodetecting and broadcasting executable shared object dependencies through
    \fB\-\-bcast\fR. If the keyword "\fINONE\fR" is configured, no directory paths
    will be excluded. The default value is that of slurm.conf \fBBcastExclude\fR and
    this option overrides it. See also \fB\-\-bcast\fR and \fB\-\-send\-libs\fR.
    .IP

    .TP
    \fB\-b\fR, \fB\-\-begin\fR=<\fItime\fR>
    Defer initiation of this job until the specified time.
    It accepts times of the form \fIHH:MM:SS\fR to run a job at
    a specific time of day (seconds are optional).
    (If that time is already past, the next day is assumed.)
    You may also specify \fImidnight\fR, \fInoon\fR, \fIelevenses\fR (11 AM),
    \fIfika\fR (3 PM) or \fIteatime\fR (4 PM) and you can have a time\-of\-day
    suffixed with \fIAM\fR or \fIPM\fR for running in the morning or the evening.
    You can also say what day the job will be run, by specifying
    a date of the form \fIMMDDYY\fR or \fIMM/DD/YY\fR
    \fIYYYY\-MM\-DD\fR. Combine date and time using the following
    format \fIYYYY\-MM\-DD[THH:MM[:SS]]\fR. You can also
    give times like \fInow + count time\-units\fR, where the time\-units
    can be \fIseconds\fR (default), \fIminutes\fR, \fIhours\fR,
    \fIdays\fR, or \fIweeks\fR and you can tell Slurm to run
    the job today with the keyword \fItoday\fR and to run the
    job tomorrow with the keyword \fItomorrow\fR.
    The value may be changed after job submission using the
    \fBscontrol\fR command.
    For example:
    .IP
    .nf
       \-\-begin=16:00
       \-\-begin=now+1hour
       \-\-begin=now+60           (seconds by default)
       \-\-begin=2010\-01\-20T12:34:00
    .fi

    .RS
    .PP
    .IP

    .TP
    \fB\-D\fR, \fB\-\-chdir\fR=<\fIpath\fR>
    Have the remote processes do a chdir to \fIpath\fR before beginning
    execution. The default is to chdir to the current working directory
    of the \fBsrun\fR process. The path can be specified as full path or
    relative path to the directory where the command is executed. This
    option applies to job allocations.
    .IP

    .TP
    \fB\-\-cluster\-constraint\fR=<\fIlist\fR>
    Specifies features that a federated cluster must have to have a sibling job
    submitted to it. Slurm will attempt to submit a sibling job to a cluster if it
    has at least one of the specified features.
    .IP

    .TP
    \fB\-M\fR, \fB\-\-clusters\fR=<\fIstring\fR>
    Clusters to issue commands to. Multiple cluster names may be comma separated.
    The job will be submitted to the one cluster providing the earliest expected
    job initiation time. The default value is the current cluster. A value of
    \(aq\fIall\fR' will query to run on all clusters. Note the
    \fB\-\-export\fR option to control environment variables exported
    between clusters.
    This option applies only to job allocations.
    Note that the \fBslurmdbd\fR must be up for this option to work properly, unless
    running in a federation with \fBFederationParameters=fed_display\fR configured.
    .IP

    .TP
    \fB\-\-comment\fR=<\fIstring\fR>
    An arbitrary comment. This option applies to job allocations.
    .IP

    .TP
    \fB\-\-compress\fR[=\fItype\fR]
    Compress file before sending it to compute hosts.
    The optional argument specifies the data compression library to be used.
    The default is \fBBcastParameters\fR \fBCompression=\fR if set or "lz4"
    otherwise.
    Supported values are "lz4".
    Some compression libraries may be unavailable on some systems.
    For use with the \fB\-\-bcast\fR option. This option applies to step
    allocations.
    .IP

    .TP
    \fB\-\-consolidate\-segments\fR
    Ensure that all segments from the allocation will be consolidated
    into one higher-level aggregated block.
    resource counts, etc. (some operators are not supported on all system types).

    \fBNOTE\fR: Changeable features are features defined by a NodeFeatures plugin.

    Supported \fB\-\-constraint\fR options include:
    .IP
    .PD 1
    .RS
    .TP
    \fBSingle Name\fR
    Only nodes which have the specified feature will be used.
    For example, \fB\-\-constraint="intel"\fR
    .IP

    .TP
    \fBNode Count\fR
    A request can specify the number of nodes needed with some feature
    by appending an asterisk and count after the feature name.
    For example, \fB\-\-nodes=16 \-\-constraint="graphics*4"\fR
    indicates that the job requires 16 nodes and that at least four of those
    nodes must have the feature "graphics."
    If requesting more than one feature and using node counts, the request
    must have square brackets surrounding it.

    \fBNOTE\fR: This option is not supported by the helpers NodeFeatures plugin.
    Heterogeneous jobs can be used instead.
    .IP

    .TP
    \fBAND\fR
    Only nodes with all of specified features will be used.
    The ampersand is used for an AND operator.
    For example, \fB\-\-constraint="intel&gpu"\fR
    .IP

    .TP
    \fBOR\fR
    Only nodes with at least one of specified features will be used.
    The vertical bar is used for an OR operator. If changeable features are not
    requested, nodes in the allocation can have different features. For example,
    \fBsalloc -N2 \-\-constraint="intel|amd"\fR can result in a job allocation
    where one node has the intel feature and the other node has the amd feature.
    However, if the expression contains a changeable feature, then all OR operators
    are automatically treated as Matching OR so that all nodes in the job
    allocation have the same set of features. For example,
    \fBsalloc -N2 \-\-constraint="foo|bar&baz"\fR
    The job is allocated two nodes where both nodes have foo, or bar and baz (one
    or both nodes could have foo, bar, and baz). The helpers NodeFeatures plugin
    will find the first set of node features that matches all nodes in the job
    allocation; these features are set as active features on the node and passed to
    RebootProgram (see \fBslurm.conf\fR(5)) and the helper script (see
    \fBhelpers.conf\fR(5)). In this case, the helpers plugin uses the first of
    Specific counts of multiple resources may be specified by using the AND
    operator and enclosing the options within square brackets.
    For example, \fB\-\-constraint="[rack1*2&rack2*4]"\fR might
    be used to specify that two nodes must be allocated from nodes with the feature
    of "rack1" and four nodes must be allocated from nodes with the feature
    "rack2".

    \fBNOTE\fR: This option is not supported by the helpers NodeFeatures plugin.

    \fBNOTE\fR: Multiple Counts can cause jobs to be allocated with a non-optimal
    network layout.
    .IP

    .TP
    \fBBrackets\fR
    Brackets can be used to indicate that you are looking for a set of nodes with
    the different requirements contained within the brackets. For example,
    \fB\-\-constraint="[(rack1|rack2)*1&(rack3)*2]"\fR will get you one node with
    either the "rack1" or "rack2" features and two nodes with the "rack3" feature.
    If requesting more than one feature and using node counts, the request
    must have square brackets surrounding it.

    \fBNOTE\fR: Brackets are only reserved for \fBMultiple Counts\fR and
    \fBMatching OR\fR syntax.
    AND operators require a count for each feature inside square brackets
    (i.e. "[quad*2&hemi*1]"). Slurm will only allow a single set of bracketed
    constraints per job.

    \fBNOTE\fR: Square brackets are not supported by the helpers NodeFeatures
    plugin. Matching OR can be requested without square brackets by using the
    vertical bar character with at least one changeable feature.
    .IP

    .TP
    \fBParentheses\fR
    Parentheses can be used to group like node features together. For example,
    \fB\-\-constraint="[(knl&snc4&flat)*4&haswell*1]"\fR might be used to specify
    that four nodes with the features "knl", "snc4" and "flat" plus one node with
    the feature "haswell" are required.
    Parentheses can also be used to group operations. Without parentheses, node
    features are parsed strictly from left to right.
    For example,
    \fB\-\-constraint="foo&bar|baz"\fR requests nodes with foo and bar, or baz.
    \fB\-\-constraint="foo|bar&baz"\fR requests nodes with foo and baz, or bar and
    baz (note how baz was AND'd with everything).
    \fB\-\-constraint="foo&(bar|baz)"\fR requests nodes with foo and at least
    one of bar or baz.
    \fBNOTE\fR: OR within parentheses should not be used with a KNL
    NodeFeatures plugin but is supported by the helpers NodeFeatures plugin.
    .RE
    .IP

    .TP
    \fB\-\-container-id\fR=<\fIcontainer_id\fR>
    Unique name for OCI container.
    .IP

    .TP
    \fB\-\-contiguous\fR
    If set, then the allocated nodes must form a contiguous set.

    \fBNOTE\fR: This option will only work with the \fBtopology/flat\fR plugin.
    Other topology plugins modify the node ordering and prevent this option from
    taking effect. This option applies to job allocations.
    .IP

    .TP
    \fB\-S\fR, \fB\-\-core\-spec\fR=<\fInum\fR>
    Count of Specialized Cores per node reserved by the job for system operations
    and not used by the application.
    If AllowSpecResourcesUsage is enabled a job can override the CoreSpecCount of
    all its allocated nodes with this option.
    The overridden Specialized Cores will still be reserved for system processes.
    The job will get an implicit \fB--exclusive\fR allocation for the rest of
    the Cores on the nodes, resulting in the job's processes being able to use (and
    being charged for) all the Cores on the nodes except for the overridden
    Specialized Cores.
    This option can not be used with the \fB\-\-thread\-spec\fR option.

    \fBNOTE\fR: Explicitly setting a job's specialized core value implicitly sets
    the --exclusive option.

    \fBNOTE\fR: This option may implicitly impact the number of tasks if \fB\-n\fR
    was not specified.

    This option applies to job allocations.
    .IP

    .TP
    \fB\-\-cores\-per\-socket\fR=<\fIcores\fR>
    Restrict node selection to nodes with at least the specified number of
    cores per socket. See additional information under \fB\-B\fR option
    above when task/affinity plugin is enabled. This option applies to job
    allocations.
    .IP

    .TP
    \fB\-\-cpu\-bind\fR=[{quiet|verbose},]<\fItype\fR>
    Bind tasks to CPUs.
    Used only when the task/affinity plugin is enabled.
    \fBNOTE\fR: To have Slurm always report on the selected CPU binding for all
    commands executed in a shell, you can enable verbose mode by setting
    the SLURM_CPU_BIND environment variable value to "verbose".

    CPU binding is inherited from the parent of the process. This means that
    the multithreaded task should either specify or clear the CPU binding
    itself to avoid having all threads of the multithreaded task use the same
    mask/CPU as the parent. Alternatively, fat masks (masks which specify more
    than one allowed CPU) could be used for the tasks in order to provide
    multiple CPUs for the multithreaded tasks.

    Note that a job step can be allocated different numbers of CPUs on each node
    or be allocated CPUs not starting at location zero. Therefore one of the
    options which automatically generate the task binding is recommended.
    Explicitly specified masks or bindings are only honored when the job step
    has been allocated every available CPU on the node.

    Binding a task to a NUMA locality domain means to bind the task to the set of
    CPUs that belong to the NUMA locality domain or "NUMA node".
    If NUMA locality domain options are used on systems with no NUMA support, then
    each socket is considered a locality domain.

    If the \fB\-\-cpu\-bind\fR option is not used, the default binding mode will
    depend upon Slurm's configuration and the step's resource allocation.
    If all allocated nodes have the same configured CpuBind mode, that will be used.
    Otherwise if the job's Partition has a configured CpuBind mode, that will be used.
    Otherwise if Slurm has a configured TaskPluginParam value, that mode will be used.
    Otherwise automatic binding will be performed as described below.
    .IP
    .RS
    .TP
    \fBAuto Binding\fR
    Applies only when task/affinity is enabled. If the job step allocation includes an
    allocation with a number of
    sockets, cores, or threads equal to the number of tasks times cpus\-per\-task,
    then the tasks will by default be bound to the appropriate resources (auto
    binding). Disable this mode of operation by explicitly setting
    "\-\-cpu\-bind=none". Use TaskPluginParam=autobind=[threads|cores|sockets] to set
    a default cpu binding in case "auto binding" doesn't find a match.
    .RE
    .IP

    .RS
    Supported options include:
    .PD 1
    .RS
    .TP
    .B q[uiet]
    Quietly bind before task runs (default)
    .IP

    .TP
    .B v[erbose]
    Verbosely report binding before task runs
    .IP

    For example "map_cpu:0*4,3*4".
    .IP

    .TP
    .B mask_cpu:<list>
    Bind by setting CPU masks on tasks (or ranks) as specified where <list> is
    fR(5) man page and \fBOverMemoryKill\fR in the
    \fBslurm.conf\fR(5) man page for more details.

    This option applies to job and step allocations.
    .IP

    .TP
    \fB\-\-mem\-bind\fR=[{quiet|verbose},]<\fItype\fR>
    Bind tasks to memory. Used only when the task/affinity plugin is enabled
    and the NUMA memory functions are available.
    \fBNote that the resolution of CPU and memory binding
    may differ on some architectures.\fR For example, CPU binding may be performed
    at the level of the cores within a processor while memory binding will
    be performed at the level of nodes, where the definition of "nodes"
    may differ from system to system.
    By default no memory binding is performed; any task using any CPU can use
    any memory. This option is typically used to ensure that each task is bound to
    the memory closest to its assigned CPU. \fBThe use of any type other than
    	SLURM_MEM_BIND_PREFER
    	SLURM_MEM_BIND_TYPE
    	SLURM_MEM_BIND_VERBOSE
    .fi

    See the \fBENVIRONMENT VARIABLES\fR section for a more detailed description
    of the individual SLURM_MEM_BIND* variables.

    Supported options include:
    .IP
    .RS
    .TP
    .B help
    show this help message
    .IP

    .TP
    .B local
    Use memory local to the processor in use
    .IP

    .TP
    .B map_mem:<list>
    Bind by setting memory masks on tasks (or ranks) as specified where <list> is
    setbuf(3). If this option is specified the tasks are executed with
    a pseudo terminal so that the application output is unbuffered. This option
    applies to step allocations.
    .IP

    .TP
    \fB\-\-usage\fR
    Display brief help message and exit.
    .IP

    .TP
    \fB\-\-use\-min\-nodes\fR
    If a range of node counts is given, prefer the smaller count.
    .IP

    .TP
    \fB\-v\fR, \fB\-\-verbose\fR
    Increase the verbosity of srun's informational messages. Multiple
    '\fB\-v\fR's will further increase srun's verbosity. By default only
    errors will be displayed. This option applies to job and step allocations.
    .IP

    .TP
    \fB\-V\fR, \fB\-\-version\fR
    Display version information and exit.
    .IP

    .TP
    \fB\-\-wait\-for\-children\fR
    Wait for all processes in each task to finish before considering a task as
    ended. The default behavior without this option is to only wait for the parent
    process in each task to finish.

    Depending on the setting of \fB\-\-kill\-on\-bad\-exit\fR, the task may end if
    the parent process exits with a non-zero exit code. If
    \fB\-\-kill\-on\-bad\-exit\fR=1 and the parent process exits with a non-zero
    exit code, the task will end. If \fB\-\-kill\-on\-bad\-exit\fR=0 and the parent
    process exits with a non-zero exit code, the task will continue until all
    children processes have exited.

    This option requires proctrack/cgroup and cgroup/v2.
    .IP

    .TP
    \fB\-W\fR, \fB\-\-wait\fR=<\fIseconds\fR>
    Specify how long to wait after the first task terminates before terminating
    all remaining tasks. A value of 0 indicates an unlimited wait (a warning will
    be issued after 60 seconds). The default value is set by the WaitTime
    parameter in the slurm configuration file (see \fBslurm.conf(5)\fR). This
    option can be useful to ensure that a job is terminated in a timely fashion
    in the event that one or more tasks terminate prematurely.
    This option is only enabled if Slurm was compiled with X11 support and
    PrologFlags=x11 is defined in the slurm.conf. Default is "all".
    .IP

    .PP
    .B srun
    will submit the job request to the slurm job controller, then initiate all
    processes on the remote nodes. If the request cannot be met immediately,
    .B srun
    will block until the resources are free to run the job. If the
    \fB\-I\fR (\fB\-\-immediate\fR) option is specified
    .B srun
    will terminate if resources are not immediately available.
    .PP
    When initiating remote processes
    .B srun
    will propagate the current working directory, unless
    \fB\-\-chdir\fR=<\fIpath\fR> is specified, in which case \fIpath\fR will
    become the working directory for the remote processes.
    .PP
    The \fB\-n\fB, \fB\-c\fR, and \fB\-N\fR options control how CPUs and
    nodes will be allocated to the job. When specifying only the number
    of processes to run with \fB\-n\fR, a default of one CPU per process
    is allocated. By specifying the number of CPUs required per task (\fB\-c\fR),
    more than one CPU may be allocated per process. If the number of nodes
    is specified with \fB\-N\fR,
    .B srun
    will attempt to allocate \fIat least\fR the number of nodes specified.
    .PP
    Combinations of the above three options may be used to change how
    processes are distributed across nodes and cpus. For instance, by specifying
    both the number of processes and number of nodes on which to run, the
    number of processes per node is implied. However, if the number of CPUs
    per process is more important then number of processes (\fB\-n\fR) and the
    number of CPUs per process (\fB\-c\fR) should be specified.
    .PP
    .B srun
    will refuse to allocate more than one process per CPU unless
    \fB\-\-overcommit\fR (\fB\-O\fR) is also specified.
    .PP
    .B srun
    will attempt to meet the above specifications "at a minimum." That is,
    if 16 nodes are requested for 32 processes, and some nodes do not have
    2 CPUs, the allocation of nodes will be increased in order to meet the
    demand for CPUs. In other words, a \fIminimum\fR of 16 nodes are being
    requested. However, if 16 nodes are requested for 15 processes,
    .B srun
    will consider this an error, as 15 processes cannot run across 16 nodes.

    .PP
    .B "IO Redirection"
    .PP
    stderr from the tasks.
    Valid format specifications for these options are

    .TP 10
    \fBall\fR
    stdout stderr is redirected from all tasks to srun.
    stdin is broadcast to all remote tasks.
    (This is the default behavior)
    .IP

    .TP
    \fBnone\fR
    stdout and stderr is not received from any task.
    stdin is not sent to any task (stdin is closed).
    .IP

    .TP
    \fBtaskid\fR
    stdout and/or stderr are redirected from only the task with relative
    id equal to \fItaskid\fR, where 0 <= \fItaskid\fR <= \fIntasks\fR,
    where \fIntasks\fR is the total number of tasks in the current job step.
    stdin is redirected from the stdin of \fBsrun\fR to this same task.
    This file will be written on the node executing the task.
    .IP

    .TP
    \fBfilename\fR
    \fBsrun\fR will redirect stdout and/or stderr to the named file from
    all tasks.
    stdin will be redirected from the named file and broadcast to all
    tasks in the job. \fIfilename\fR refers to a path on the host
    that runs \fBsrun\fR. Depending on the cluster's file system layout,
    this may result in the output appearing in different places depending
    on whether the job is run in batch mode.
    .IP

    .TP
    \fBfilename pattern\fR
    \fBsrun\fR allows for a filename pattern to be used to generate the
    named IO file
    described above. The following list of format specifiers may be
    used in the format string to generate a filename that will be
    unique to a given jobid, stepid, node, or task. In each case,
    the appropriate number of files are opened and associated with
    the corresponding tasks. Note that any format string containing
    %t, %n, and/or %N will be written on the node executing the task
    rather than the node where \fBsrun\fR executes.
    .IP
    .RS 10

    .TP
    \fB\\\\\fR
    \fB%a\fR
    Job array ID (index) number.
    .IP

    .TP
    \fB%J\fR
    jobid.stepid of the running job (e.g. "128.0"). The stepid is only expanded for
    regular steps, not for special steps like "batch" or "extern".
    .IP

    .TP
    \fB%j\fR
    jobid of the running job.
    .IP

    .TP
    \fB%S\fR
    SLUID of the running job.
    .IP

    .TP
    \fB%s\fR
    stepid of the running job.
    .IP

    .TP
    \fB%N\fR
    short hostname. This will create a separate IO file per node.
    .IP

    .TP
    \fB%n\fR
    Node identifier relative to current job (e.g. "0" is the first node of
    the running job) This will create a separate IO file per node.
    .IP

    .TP
    \fB%t\fR
    task identifier (rank) relative to current job. This will create a
    separate IO file per task.
    .IP

    .TP
    \fB%u\fR
    User name.
    .IP

    .TP
    \fB%x\fR
    Job name.
    .IP
    .PP
    job%4j.out
    job0128.out
    .IP

    .TP
    job%2j\-%2t.out
    job128\-00.out, job128\-01.out, ...
    .IP
    .PP
    .RS -10
    .PP

    .SH "PERFORMANCE"
    .PP
    Executing \fBsrun\fR sends a remote procedure call to \fBslurmctld\fR. If
    enough calls from \fBsrun\fR or other Slurm client commands that send remote
    procedure calls to the \fBslurmctld\fR daemon come in at once, it can result in
    a degradation of performance of the \fBslurmctld\fR daemon, possibly resulting
    in a denial of service.
    .PP
    Do not run \fBsrun\fR or other Slurm client commands that send remote procedure
    calls to \fBslurmctld\fR from loops in shell scripts or other programs. Ensure
    that programs limit calls to \fBsrun\fR to the minimum necessary for the
    information you are trying to gather.

    .SH "INPUT ENVIRONMENT VARIABLES"
    .PP
    Upon startup, srun will read and handle the options set in the following
    environment variables. The majority of these variables are set the same way
    the options are set, as defined above. For flag options that are defined to
    expect no argument, the option can be enabled by setting the environment
    variable without a value (empty or NULL string), the string 'yes', or a
    non-zero number. Any other value for the environment variable will result in
    the option not being set.
    There are a couple exceptions to these rules that are noted below.
    .br
    \fBNOTE\fR: Command line options always override environment variable settings.

    .TP 22
    \fBPMI_FANOUT\fR
    This is used exclusively with PMI (MPICH2 and MVAPICH2) and
    controls the fanout of data communications. The srun command
    sends messages to application programs (via the PMI library)
    and those applications may be called upon to forward that
    data to up to this number of additional tasks. Higher values
    offload work from the srun command to the applications and
    likely increase the vulnerability to failures.
    The default value is 32.
    .IP

    .TP
    \fBPMI_FANOUT_OFF_HOST\fR
    .IP

    .TP
    \fBPMI_TIME\fR
    This is used exclusively with PMI (MPICH2 and MVAPICH2) and
    controls how much the communications from the tasks to the
    srun are spread out in time in order to avoid overwhelming the
    srun command with work. The default value is 500 (microseconds)
    per task. On relatively slow processors or systems with very
    large processor counts (and large PMI data sets), higher values
    may be required.
    .IP

    .TP
    \fBSLURM_ACCOUNT\fR
    Same as \fB\-A, \-\-account\fR
    .IP

    .TP
    \fBSLURM_ACCTG_FREQ\fR
    Same as \fB\-\-acctg\-freq\fR
    .IP

    .TP
    \fBSLURM_BCAST\fR
    Same as \fB\-\-bcast\fR
    .IP

    .TP
    \fBSLURM_BCAST_EXCLUDE\fR
    Same as \fB\-\-bcast\-exclude\fR
    .IP

    .TP
    \fBSLURM_BURST_BUFFER\fR
    Same as \fB\-\-bb\fR
    .IP

    .TP
    \fBSLURM_CLUSTERS\fR
    Same as \fB\-M\fR, \fB\-\-clusters\fR
    .IP

    .TP
    \fBSLURM_COMPRESS\fR
    Same as \fB\-\-compress\fR
    .IP

    .TP
    \fBSLURM_CONF\fR
    The location of the Slurm configuration file.
    .IP
    .IP

    .TP
    \fBSLURM_CPU_FREQ_REQ\fR
    Same as \fB\-\-cpu\-freq\fR.
    .IP

    .TP
    \fBSLURM_CPUS_PER_GPU\fR
    Same as \fB\-\-cpus\-per\-gpu\fR
    .IP

    .TP
    \fBSLURM_CPUS_PER_TASK\fR
    Same as \fB\-c, \-\-cpus\-per\-task\fR or \fB\-\-tres\-per\-task=cpu=#\fR
    .IP

    .TP
    \fBSLURM_DEBUG\fR
    Same as \fB\-v, \-\-verbose\fR, when set to 1, when set to 2 gives -vv, etc.
    .IP

    .TP
    \fBSLURM_DEBUG_FLAGS\fR
    Specify debug flags for srun to use. See DebugFlags in the
    \fBslurm.conf\fR(5) man page for a full list of flags. The environment
    variable takes precedence over the setting in the slurm.conf.
    .IP

    .TP
    \fBSLURM_DELAY_BOOT\fR
    Same as \fB\-\-delay\-boot\fR
    .IP

    .TP
    \fBSLURM_DEPENDENCY\fR
    Same as \fB\-d, \-\-dependency\fR=<\fIjobid\fR>
    .IP

    .TP
    \fBSLURM_DISABLE_STATUS\fR
    Same as \fB\-X, \-\-disable\-status\fR
    .IP

    .TP
    \fBSLURM_DIST_PLANESIZE\fR
    Plane distribution size. Only used if \fB\-\-distribution=plane\fR,
    without \fI=<size>\fR, is set.
    .IP

    .TP
    \fBSLURM_DISTRIBUTION\fR
    \fBSLURM_EXCLUSIVE\fR
    Same as \fB\-\-exclusive\fR
    .IP

    .TP
    \fBSLURM_EXIT_ERROR\fR
    Specifies the exit code generated when a Slurm error occurs
    (e.g. invalid options).
    This can be used by a script to distinguish application exit codes from
    various Slurm error conditions.
    Also see \fBSLURM_EXIT_IMMEDIATE\fR.
    .IP

    .TP
    \fBSLURM_EXIT_IMMEDIATE\fR
    Specifies the exit code generated when the \fB\-\-immediate\fR option
    is used and resources are not currently available.
    This can be used by a script to distinguish application exit codes from
    various Slurm error conditions.
    Also see \fBSLURM_EXIT_ERROR\fR.
    .IP

    .TP
    \fBSLURM_EXPORT_ENV\fR
    Same as \fB\-\-export\fR
    .IP

    .TP
    \fBSLURM_GPU_BIND\fR
    Same as \fB\-\-gpu\-bind\fR
    .IP

    .TP
    \fBSLURM_GPU_FREQ\fR
    Same as \fB\-\-gpu\-freq\fR
    .IP

    .TP
    \fBSLURM_GPUS\fR
    Same as \fB\-G, \-\-gpus\fR
    .IP

    .TP
    \fBSLURM_GPUS_PER_NODE\fR
    Same as \fB\-\-gpus\-per\-node\fR except within an existing allocation, in which
    case it will be ignored if \fB\-\-gpus\fR is specified.
    .IP

    .TP
    \fBSLURM_GPUS_PER_TASK\fR
    Same as \fB\-\-gpus\-per\-task\fR
    .IP
    .IP

    .TP
    \fBSLURM_IMMEDIATE\fR
    Same as \fB\-I, \-\-immediate\fR
    .IP

    .TP
    \fBSLURM_JOB_ID\fR
    Same as \fB\-\-jobid\fR
    .IP

    .TP
    \fBSLURM_JOB_NAME\fR
    Same as \fB\-J, \-\-job\-name\fR except within an existing
    allocation, in which case it is ignored to avoid using the batch job's name
    as the name of each job step.
    .IP

    .TP
    \fBSLURM_JOB_NUM_NODES\fR
    Same as \fB\-N, \-\-nodes\fR.
    Total number of nodes in the job's resource allocation.
    .IP

    .TP
    \fBSLURM_KILL_BAD_EXIT\fR
    Same as \fB\-K, \-\-kill\-on\-bad\-exit\fR. Must be set to 0 or 1 to disable
    or enable the option.
    .IP

    .TP
    \fBSLURM_LABELIO\fR
    Same as \fB\-l, \-\-label\fR
    .IP

    .TP
    \fBSLURM_MEM_BIND\fR
    Same as \fB\-\-mem\-bind\fR
    .IP

    .TP
    \fBSLURM_MEM_PER_CPU\fR
    Same as \fB\-\-mem\-per\-cpu\fR
    .IP

    .TP
    \fBSLURM_MEM_PER_GPU\fR
    Same as \fB\-\-mem\-per\-gpu\fR
    .IP

    .TP
    .TP
    \fBSLURM_NNODES\fR
    Same as \fB\-N, \-\-nodes\fR. Total number of nodes in the job's resource
    allocation. See \fBSLURM_JOB_NUM_NODES\fR. Included for backwards
    compatibility.
    .IP

    .TP
    \fBSLURM_NO_KILL\fR
    Same as \fB\-k\fR, \fB\-\-no\-kill\fR
    .IP

    .TP
    \fBSLURM_NPROCS\fR
    Same as \fB\-n, \-\-ntasks\fR. See \fBSLURM_NTASKS\fR. Included for
    backwards compatibility.
    .IP

    .TP
    \fBSLURM_NTASKS\fR
    Same as \fB\-n, \-\-ntasks\fR
    .IP

    .TP
    \fBSLURM_NTASKS_PER_CORE\fR
    Same as \fB\-\-ntasks\-per\-core\fR
    .IP

    .TP
    \fBSLURM_NTASKS_PER_GPU\fR
    Same as \fB\-\-ntasks\-per\-gpu\fR
    .IP

    .TP
    \fBSLURM_NTASKS_PER_NODE\fR
    Same as \fB\-\-ntasks\-per\-node\fR
    .IP

    .TP
    \fBSLURM_NTASKS_PER_SOCKET\fR
    Same as \fB\-\-ntasks\-per\-socket\fR
    .IP

    .TP
    \fBSLURM_OOMKILLSTEP\fR
    Same as \fB\-\-oom\-kill\-step\fR
    .IP

    .TP
    \fBSLURM_OPEN_MODE\fR
    Same as \fB\-\-open\-mode\fR
    .IP
    .IP

    .TP
    \fBSLURM_PMI_KVS_NO_DUP_KEYS\fR
    If set, then PMI key\-pairs will contain no duplicate keys. MPI can use
    this variable to inform the PMI library that it will not use duplicate
    keys so PMI can skip the check for duplicate keys.
    This is the case for MPICH2 and reduces overhead in testing for duplicates
    for improved performance
    .IP

    .TP
    \fBSLURM_POWER\fR
    Same as \fB\-\-power\fR
    .IP

    .TP
    \fBSLURM_PROFILE\fR
    Same as \fB\-\-profile\fR
    .IP

    .TP
    \fBSLURM_PROLOG\fR
    Same as \fB\-\-prolog\fR
    .IP

    .TP
    \fBSLURM_QOS\fR
    Same as \fB\-\-qos\fR
    .IP

    .TP
    \fBSLURM_REMOTE_CWD\fR
    Same as \fB\-D, \-\-chdir=\fR
    .IP

    .TP
    \fBSLURM_REQ_SWITCH\fR
    When a tree topology is used, this defines the maximum count of switches
    desired for the job allocation and optionally the maximum time to wait
    for that number of switches. See \fB\-\-switches\fR
    .IP

    .TP
    \fBSLURM_RESERVATION\fR
    Same as \fB\-\-reservation\fR
    .IP

    .TP
    \fBSLURM_RESV_PORTS\fR
    Same as \fB\-\-resv\-ports\fR
    .IP
    .IP

    .TP
    \fBSLURM_SRUN_REDUCE_TASK_EXIT_MSG\fR
    if set and non\-zero, successive task exit messages with the same exit code will
    be printed only once.
    .IP

    .TP
    \fBSRUN_ERROR\fR
    Same as \fB\-e, \-\-error\fR
    .IP

    .TP
    \fBSRUN_INPUT\fR
    Same as \fB\-i, \-\-input\fR
    .IP

    .TP
    \fBSRUN_OUTPUT\fR
    Same as \fB\-o, \-\-output\fR
    .IP

    .TP
    \fBSLURM_STEP_GRES\fR
    Same as \fB\-\-gres\fR (only applies to job steps, not to job allocations).
    Also see \fBSLURM_GRES\fR
    .IP

    .TP
    \fBSLURM_STEP_KILLED_MSG_NODE_ID\fR=ID
    If set, only the specified node will log when the job or step are killed
    by a signal.
    .IP

    .TP
    \fBSLURM_TASK_EPILOG\fR
    Same as \fB\-\-task\-epilog\fR
    .IP

    .TP
    \fBSLURM_TASK_PROLOG\fR
    Same as \fB\-\-task\-prolog
    .IP

    .TP
    \fBSLURM_TEST_EXEC\fR
    If defined, srun will verify existence of the executable program along with user
    execute permission on the node where srun was called before attempting to
    launch it on nodes in the step.
    .IP

    .TP
    \fBSLURM_TIMELIMIT\fR
    Same as \fB\-t, \-\-time\fR
    .IP

    .TP
    \fBSLURM_TRES_BIND\fR
    Same as \fB\-\-tres\-bind\fR If \fB\-\-gpu\-bind\fR is specified, it is also set
    in \fBSLURM_TRES_BIND\fR as if it were specified in \fB\-\-tres\-bind\fR.
    .IP

    .TP
    \fBSLURM_TRES_PER_TASK\fR
    Same as \fB\-\-tres\-per\-task\fR.
    .IP

    .TP
    \fBSLURM_UMASK\fR
    If defined, Slurm will use the defined \fIumask\fR to set permissions when
    creating the output/error files for the job.
    .IP

    .TP
    \fBSLURM_UNBUFFEREDIO\fR
    Same as \fB\-u, \-\-unbuffered\fR
    .IP

    .TP
    \fBSLURM_USE_MIN_NODES\fR
    Same as \fB\-\-use\-min\-nodes\fR
    .IP

    .TP
    \fBSLURM_WAIT\fR
    Same as \fB\-W, \-\-wait\fR
    .IP

    .TP
    \fBSLURM_WAIT4SWITCH\fR
    Max time waiting for requested switches. See \fB\-\-switches\fR
    .IP

    .TP
    \fBSLURM_WCKEY\fR
    Same as \fB\-W, \-\-wckey\fR
    .IP

    .TP
    \fBSLURM_WORKING_DIR\fR
    \fB\-D, \-\-chdir\fR
    .IP
    .IP

    .TP
    \fBSRUN_EXPORT_ENV\fR
    Same as \fB\-\-export\fR, and will override any setting for
    \fBSLURM_EXPORT_ENV\fR.
    .IP

    .TP
    \fBSRUN_SEGMENT_SIZE\fR
    Same as \fB\-\-segment\fR
    .IP

    .SH "OUTPUT ENVIRONMENT VARIABLES"
    .PP
    srun will set some environment variables in the environment
    of the executing tasks on the remote compute nodes.
    These environment variables are:

    .TP 22
    \fBSLURM_*_HET_GROUP_#\fR
    For a heterogeneous job allocation, the environment variables are set separately
    for each component.
    .IP

    .TP
    \fBSLURM_CLUSTER_NAME\fR
    Name of the cluster on which the job is executing.
    .IP

    .TP
    \fBSLURM_CPU_BIND_LIST\fR
    \fB\-\-cpu\-bind\fR map or mask list (list of Slurm CPU IDs or masks for this
    node, CPU_ID = Board_ID x threads_per_board +
    Socket_ID x threads_per_socket +
    Core_ID x threads_per_core + Thread_ID).
    .IP

    .TP
    \fBSLURM_CPU_BIND_TYPE\fR
    \fB\-\-cpu\-bind\fR type (none,map_cpu:,mask_cpu:,rank_ldom,map_ldom:,mask_ldom:).
    .IP

    .TP
    \fBSLURM_CPU_BIND_VERBOSE\fR
    \fB\-\-cpu\-bind\fR verbosity (quiet,verbose).
    .IP

    .TP
    \fBSLURM_CPU_FREQ_REQ\fR
    Contains the value requested for cpu frequency on the srun command as
    a numerical frequency in kilohertz, or a coded value for a request of
    .TP
    \fBSLURM_CPUS_PER_TASK\fR
    Number of cpus requested per task.
    Only set if either the \fB\-\-cpus\-per\-task\fR option or the
    \fB\-\-tres\-per\-task=cpu=#\fR option is specified.
    .IP

    .TP
    \fBSLURM_DISTRIBUTION\fR
    Distribution type for the allocated jobs. Set the distribution
    with \fB\-m\fR, \fB\-\-distribution\fR.
    .IP

    .TP
    \fBSLURM_GPUS_ON_NODE\fR
    Number of GPUs available to the step on this node.
    .IP

    .TP
    \fBSLURM_GTIDS\fR
    Global task IDs running on this node.
    Zero origin and comma separated.
    It is read internally by pmi if Slurm was built with pmi support. Leaving
    the variable set may cause problems when using external packages from
    within the job (Abaqus and Ansys have been known to have problems when
    it is set \- consult the appropriate documentation for 3rd party software).
    .IP

    .TP
    \fBSLURM_HET_SIZE\fR
    Set to count of components in heterogeneous job.
    .IP

    .TP
    \fBSLURM_JOB_ACCOUNT\fR
    Account name associated of the job allocation.
    .IP

    .TP
    \fBSLURM_JOB_CPUS_PER_NODE\fR
    Count of CPUs available to the job on the nodes in the allocation, using the
    format \fICPU_count\fR[(x\fInumber_of_nodes\fR)][,\fICPU_count\fR
    [(x\fInumber_of_nodes\fR)] ...].
    For example: SLURM_JOB_CPUS_PER_NODE='72(x2),36' indicates that on the
    first and second nodes (as listed by SLURM_JOB_NODELIST) the allocation
    has 72 CPUs, while the third node has 36 CPUs.
    \fBNOTE\fR: The \fBselect/linear\fR plugin allocates entire nodes to jobs, so
    the value indicates the total count of CPUs on allocated nodes. The
    \fBselect/cons_tres\fR plugin allocates individual
    CPUs to jobs, so this number indicates the number of CPUs allocated to the job.
    .IP

    Only set in batch and interactive jobs.
    .IP

    .TP
    \fBSLURM_JOB_ID\fR
    Job id of the executing job.
    .IP

    .TP
    \fBSLURM_JOB_LICENSES\fR
    Name and count of any license(s) requested.
    .IP

    .TP
    \fBSLURM_JOB_NAME\fR
    Set to the value of the \fB\-\-job\-name\fR option or the command name when srun
    is used to create a new job allocation. Not set when srun is used only to
    create a job step (i.e. within an existing job allocation).
    .IP

    .TP
    \fBSLURM_JOB_NODELIST\fR
    List of nodes allocated to the job.
    .IP

    .TP
    \fBSLURM_JOB_NODES\fR
    Total number of nodes in the job's resource allocation.
    .IP

    .TP
    \fBSLURM_JOB_PARTITION\fR
    Name of the partition in which the job is running.
    .IP

    .TP
    \fBSLURM_JOB_QOS\fR
    Quality Of Service (QOS) of the job allocation.
    .IP

    .TP
    \fBSLURM_JOB_RESERVATION\fR
    Advanced reservation containing the job allocation, if any.
    .IP

    .TP
    \fBSLURM_JOB_SEGMENT_SIZE\fR
    The size of the segments that was used to create the job allocation.
    Only set if \-\-segment\fR is specified.
    .IP

    .TP
    .IP

    .TP
    \fBSLURM_LOCALID\fR
    Node local task ID for the process within a job.
    .IP

    .TP
    \fBSLURM_MEM_BIND_LIST\fR
    \fB\-\-mem\-bind\fR map or mask list (<list of IDs or masks for this node>).
    .IP

    .TP
    \fBSLURM_MEM_BIND_PREFER\fR
    \fB\-\-mem\-bind\fR prefer (prefer).
    .IP

    .TP
    \fBSLURM_MEM_BIND_TYPE\fR
    \fB\-\-mem\-bind\fR type (none,rank,map_mem:,mask_mem:,local).
    .IP

    .TP
    \fBSLURM_MEM_BIND_VERBOSE\fR
    \fB\-\-mem\-bind\fR verbosity (quiet,verbose).
    .IP

    .TP
    \fBSLURM_NETWORK\fR
    Set to the value of the \fB\-\-network\fR option, if specified.
    .IP

    .TP
    \fBSLURM_NODEID\fR
    The relative node ID of the current node.
    .IP

    .TP
    \fBSLURM_NPROCS\fR
    Total number of processes in the current job or job step. See
    \fBSLURM_NTASKS\fR. Included for backwards compatibility.
    .IP

    .TP
    \fBSLURM_NTASKS\fR
    Total number of processes in the current job or job step.
    .IP

    .TP
    \fBSLURM_OVERCOMMIT\fR
    Set to \fB1\fR if \fB\-\-overcommit\fR was specified.
    .IP
    IP address of srun communication host.
    .IP

    .TP
    \fBSLURM_SRUN_COMM_PORT\fR
    srun communication port.
    .IP

    .TP
    \fBSLURM_CONTAINER\fR
    OCI Bundle for job.
    Only set if \fB\-\-container\fR is specified.
    .IP

    .TP
    \fBSLURM_CONTAINER_ID\fR
    OCI id for job.
    Only set if \fB\-\-container_id\fR is specified.
    .IP

    .TP
    \fBSLURM_SHARDS_ON_NODE\fR
    Number of GPU Shards available to the step on this node.
    .IP

    .TP
    \fBSLURM_STEP_GPUS\fR
    The global GPU IDs of the GPUs allocated to this step (excluding batch and
    interactive steps). The GPU IDs are not relative to any device cgroup, even
    if devices are constrained with task/cgroup.
    .IP

    .TP
    \fBSLURM_STEP_ID\fR
    The step ID of the current job.
    .IP

    .TP
    \fBSLURM_STEP_LAUNCHER_PORT\fR
    Step launcher port.
    .IP

    .TP
    \fBSLURM_STEP_NODELIST\fR
    List of nodes allocated to the step.
    .IP

    .TP
    \fBSLURM_STEP_NUM_NODES\fR
    Number of nodes allocated to the step.
    .IP

    .IP

    .TP
    \fBSLURM_SUBMIT_DIR\fR
    The directory from which the allocation was invoked from.
    .IP

    .TP
    \fBSLURM_SUBMIT_HOST\fR
    The hostname of the computer from which the allocation was invoked from.
    .IP

    .TP
    \fBSLURM_TASK_PID\fR
    The process ID of the task being started.
    .IP

    .TP
    \fBSLURM_TASKS_PER_NODE\fR
    Number of tasks to be initiated on each node. Values are
    comma separated and in the same order as SLURM_JOB_NODELIST.
    If two or more consecutive nodes are to have the same task
    count, that count is followed by "(x#)" where "#" is the
    repetition count. For example, "SLURM_TASKS_PER_NODE=2(x3),1"
    indicates that the first three nodes will each execute two
    tasks and the fourth node will execute one task.
    .IP

    .TP
    \fBSLURM_TOPOLOGY_ADDR\fR
    This is set only if the system has the topology/tree plugin configured.
    The value will be set to the names network switches which may be involved in
    the job's communications from the system's top level switch down to the leaf
    switch and ending with node name. A period is used to separate each hardware
    component name.
    .IP

    .TP
    \fBSLURM_TOPOLOGY_ADDR_PATTERN\fR
    This is set only if the system has the topology/tree plugin configured.
    The value will be set component types listed in \fBSLURM_TOPOLOGY_ADDR\fR.
    Each component will be identified as either "switch" or "node".
    A period is used to separate each hardware component type.
    .IP

    .TP
    \fBSLURM_TRES_PER_TASK\fR
    Set to the value of \fB\-\-tres\-per\-task\fR. If \fB\-\-cpus\-per\-task\fR or
    \fB\-\-gpus\-per\-task\fR is specified, it is also set in
    \fBSLURM_TRES_PER_TASK\fR as if it were specified in \fB\-\-tres\-per\-task\fR.
    .IP

    Set to the logging level of the \fBsrun\fR command.
    Default value is 3 (info level).
    The value is incremented or decremented based upon the \fB\-\-verbose\fR and
    \fB\-\-quiet\fR options.
    .IP

    .SH "SIGNALS AND ESCAPE SEQUENCES"
    Signals sent to the \fBsrun\fR command are automatically forwarded to
    the tasks it is controlling with a few exceptions. The escape sequence
    \fB<control\-c>\fR will report the state of all tasks associated with
    the \fBsrun\fR command. If \fB<control\-c>\fR is entered twice within
    one second, then the associated SIGINT signal will be sent to all tasks
    and a termination sequence will be entered sending SIGCONT, SIGTERM,
    and SIGKILL to all spawned tasks.
    If a third \fB<control\-c>\fR is received, the srun program will be
    terminated without waiting for remote tasks to exit or their I/O to
    complete.

    The escape sequence \fB<control\-z>\fR is presently ignored.

    .SH "MPI SUPPORT"
    MPI use depends upon the type of MPI being used.
    There are three fundamentally different modes of operation used
    by these various MPI implementations.

    1. Slurm directly launches the tasks and performs initialization
    of communications through the PMI2 or PMIx APIs.
    For example: "srun \-n16 a.out".

    2. Slurm creates a resource allocation for the job and then
    mpirun launches tasks using Slurm's infrastructure (OpenMPI).

    3. Slurm creates a resource allocation for the job and then
    mpirun launches tasks using some mechanism other than Slurm,
    such as SSH or RSH.
    These tasks are initiated outside of Slurm's monitoring
    or control. Slurm's epilog should be configured to purge
    these tasks when the job's allocation is relinquished,
    or the use of pam_slurm_adopt is highly recommended.

    See \fIhttps://slurm.schedmd.com/mpi_guide.html\fR
    for more information on use of these various MPI implementations
    with Slurm.

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

    .TP
    Task rank
    One or more task ranks to use this configuration.
    .IP

    .TP
    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.
    Any arguments for the program entered on the command line will be added
    to the arguments specified in the configuration file.
    .PP
    For example:

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

    $ srun \-n8 \-l \-\-multi\-prog silly.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
    .fi

    .SH "EXAMPLES"
    .TP
    \fBExample 1:\fR
    This simple example demonstrates the execution of the command \fBhostname\fR
    in eight tasks. At least eight processors will be allocated to the job
    (the same as the task count) on however many nodes are required to satisfy
    the request. The output of each task will be proceeded with its task number.
    (The machine "dev" in the example below has a total of two CPUs per node)
    .IP
    .nf
    $ srun \-n8 \-l hostname
    0: dev0
    1: dev0
    2: dev1
    .nf
    $ cat test.sh
    #!/bin/sh
    echo $SLURM_JOB_NODELIST
    srun \-lN2 \-r2 hostname
    srun \-lN2 hostname

    $ salloc \-N4 test.sh
    dev[7\-10]
    0: dev9
    1: dev10
    0: dev7
    1: dev8
    .fi

    .TP
    \fBExample 3:\fR
    The following script runs two job steps in parallel
    within an allocated set of nodes.
    .IP
    .nf
    $ cat test.sh
    #!/bin/bash
    srun \-lN2 \-n4 \-r 2 sleep 60 &
    srun \-lN2 \-r 0 sleep 60 &
    sleep 1
    squeue
    squeue \-s
    wait

    $ salloc \-N4 test.sh
      JOBID PARTITION     NAME     USER  ST      TIME  NODES NODELIST
      65641     batch  test.sh   grondo   R      0:01      4 dev[7\-10]

    STEPID     PARTITION     USER      TIME NODELIST
    65641.0        batch   grondo      0:01 dev[7\-8]
    65641.1        batch   grondo      0:01 dev[9\-10]
    .fi

    .TP
    \fBExample 4:\fR
    This example demonstrates how one executes a simple MPI job.
    We use \fBsrun\fR to build a list of machines (nodes) to be used by
    \fBmpirun\fR in its required format. A sample command line and
    the script to be executed follow.
    .IP
    .nf
    $ cat test.sh
    #!/bin/sh
    MACHINEFILE="nodes.$SLURM_JOB_ID"

    # Generate Machinefile for mpi such that hosts are in the same
    This simple example demonstrates the execution of different jobs on different
    nodes in the same srun. You can do this for any number of nodes or any
    number of jobs. The executables are placed on the nodes sited by the
    SLURM_NODEID env var. Starting at 0 and going to the number specified on
    the srun command line.
    .IP
    .nf
    $ cat test.sh
    case $SLURM_NODEID in
        0) echo "I am running on "
           hostname ;;
        1) hostname
           echo "is where I am running" ;;
    esac

    $ srun \-N2 test.sh
    dev0
    is where I am running
    I am running on
    dev1
    .fi

    .TP
    \fBExample 6:\fR
    This example demonstrates use of multi\-core options to control layout
    of tasks.
    We request that four sockets per node and two cores per socket be
    dedicated to the job.
    .IP
    .nf
    $ srun \-N2 \-B 4\-4:2\-2 a.out
    .fi

    .TP
    \fBExample 7:\fR
    This example shows a script in which Slurm is used to provide resource
    management for a job by executing the various job steps as processors
    become available for their dedicated use.
    .IP
    .nf
    $ cat my.script
    #!/bin/bash
    srun \-n4 prog1 &
    srun \-n3 prog2 &
    srun \-n1 prog3 &
    srun \-n1 prog4 &
    wait
    .fi

    .TP
    \fBExample 8:\fR
    This example shows how to launch an application called "server" with one task,
    has finished.
    .IP
    .nf
    $ salloc  -n1
    salloc: Granted job allocation 9553
    salloc: Waiting for resource configuration
    salloc: Nodes node01 are ready for job

    $ date +%T; srun -n1 --overlap -l sleep 3 &
    $ srun -n1 --overlap -l date +%T &
    14:36:04
    [1] 144341
    [2] 144342
    0: 14:36:04
    [2]+  Done                    srun -n1 --overlap -l date +%T
    [1]+  Done                    srun -n1 --overlap -l sleep 3

    $ date +%T; srun -n1 --exclusive -l sleep 3 &
    $ srun -n1 --exclusive -l date +%T &
    14:36:17
    [1] 144429
    [2] 144430
    srun: Job 9553 step creation temporarily disabled, retrying (Requested nodes are busy)
    srun: Step created for job 9553
    0: 14:36:20
    [1]-  Done                    srun -n1 --exclusive -l sleep 3
    [2]+  Done                    srun -n1 --exclusive -l date +%T
    .fi

    .TP
    \fBExample 10:\fR
    This example demonstrates how jobs that are not evenly split among multiple
    nodes can run into problems of tasks not being able to start when there are
    enough CPUs free to run that task on a single node. This example shows a job
    that was allocated 2 CPUs on one node and 24 CPUs on the other node.
    .IP
    .nf
    $ echo $SLURM_NODELIST; echo $SLURM_JOB_CPUS_PER_NODE
    node[01-02]
    2,24
    .fi

    If a task is started that occupies the CPUs on the node with fewer CPUs,
    then a subsequent task that should be able to start on the other node will
    not start because it inherits the requirement for the number of nodes from
    the job allocation. The job step will stay pending until the first job step
    completes or until it is cancelled.

    .nf
    $ srun -n4 --exact sleep 1800 &
    [1] 151837

    This behavior can be changed by adding \fBSelectTypeParameters=CR_Pack_Nodes\fR
    to your slurm.conf. The logic to pack nodes will allow job steps to start on
    a single node without having to explicitly request a single node.

    .TP
    \fBExample 11:\fR
    This example demonstrates that adding the \fB\-\-exclusive\fR flag to job
    allocation requests can give different results based on whether you also
    request a certain number of tasks.

    Requesting exclusive access with no additional requirements will allow the
    process to access all the CPUs on the allocated node.
    .nf
    $ srun \-l \-\-exclusive  bash \-c 'grep Cpus_allowed_list /proc/self/status'
    0: Cpus_allowed_list:   0\-23
    .fi

    Adding a request for a certain number of tasks will cause each task to only
    have access to a single CPU.
    .nf
    $ srun \-l \-\-exclusive \-n2 bash \-c 'grep Cpus_allowed_list /proc/self/status'
    0: Cpus_allowed_list:   0
    1: Cpus_allowed_list:   12
    .fi

    You can define the number of CPUs per task if you want to give them access to
    more than one CPU.
    .nf
    $ srun \-l \-\-exclusive \-n2 \-\-cpus\-per\-task=12 bash \-c 'grep Cpus_allowed_list /proc/self/status'
    0: Cpus_allowed_list:   0\-5,12\-17
    1: Cpus_allowed_list:   6\-11,18\-23
    .fi

    .SH "COPYING"
    Copyright (C) 2006\-2007 The Regents of the University of California.
    Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
    .br
    Copyright (C) 2008\-2010 Lawrence Livermore National Security.
    .br
    Copyright (C) 2010\-2022 SchedMD LLC.
    .LP
    This file is part of Slurm, a resource management program.
    For details, see <https://slurm.schedmd.com/>.
    .LP
    Slurm is free software; you can redistribute it and/or modify it under
    the terms of the GNU General Public License as published by the Free
    Software Foundation; either version 2 of the License, or (at your option)
    any later version.
    .LP
    Slurm is distributed in the hope that it will be useful, but WITHOUT ANY
    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    FOR A PARTICULAR PURPOSE. See the GNU General Public License for more