salloc(1)

NAME

salloc - Obtain a SLURM job allocation (a set of nodes), execute a command, and then release the allocation when the command is finished.

SYNOPSIS

salloc [options] <command> [command args]

DESCRIPTION

salloc is used to allocate a SLURM job allocation, which is a set of resources (nodes), possibly with some set of constraints (e.g. number of processors per node). When salloc successfully obtains the requested allocation, it then runs the command specified by the user. Finally, when the user specified command is complete, salloc relinquishes the job allocation. The command may be any program the user wishes. Some typical commands are xterm, a shell script containing slaunch commands, and slaunch (see the EXAMPLES section).

OPTIONS

-N, --nodes[=]<number|[min]-[max]>
    Specify the number of nodes to be used by this job step. This option accepts either a single number, or a range of possible node counts. If a single number is used, such as "-N 4", then the allocation is asking for four and ONLY four nodes. If a range is specified, such as "-N 2-6", SLURM controller may grant salloc anywhere from 2 to 6 nodes. When using a range, either of the min or max options may be omitted. For instance, "-N 10-" means "no fewer than 10 nodes", and "-N -20" means "no more than 20 nodes". The default value of this option is one node, but other options may require more than one node to be allocated.

-D, --dependency[=]<jobid>
    Defer the start of this job until the specified jobid has completed. Many jobs can share the same dependency and these jobs may even belong to different users. The value may be changed after job submission using the scontrol command.

-I,--immediate
    Do not wait for the resources need to grant this allocation. Normally salloc will wait for the resources necessary to satisfy the requested job allocation, but when --immediate is specified it will exit immediately without running the command parameter.

-W, --wait[=]<seconds>
    If the resources needed to satisy a job allocation are not immediately available, the job allocation is enqueued and is said to be PENDING. This option tells salloc how long (in seconds) to wait for the allocation to be granted before giving up. When the wait limit has been reached, salloc will exit without running the command parameter. By default, salloc will wait indefinitely. (The --immediate option makes --wait moot.)

-p, --partition[=]<partition name>
    Request a specific partition for the resource allocation. If not specified, the default behaviour is to allow the slurm controller to select the default partition as designated by the system administrator.

-c, --cpus-per-task=<ncpus>

-K, --kill-command[=signal]
    salloc always runs a user-specified command once the allocation is granted. salloc will wait indefinitely for that command to exit. If you specify the --kill-command option salloc will send a signal to your command any time that the SLURM controller tells salloc that its job allocation has been revoked. The job allocation can be revoked for a couple of reasons: someone used scancel to revoke the allocation, or the allocation reached its time limit. If you do not specify a signal name or number, the default signal is SIGTERM.

--bell
    Force salloc to ring the terminal bell when the job allocation is granted. By default, salloc only rings the bell if the allocation is pending for more than ten seconds.

--no-bell
    Silence salloc's use of the terminal bell.

--help
    Output help information and exit.

-V, --version
    Output version information and exit.

ENVIRONMENT VARIABLES

SALLOC_BELL
    Same as --bell.

SALLOC_NO_BELL
    Same as --no-bell.

EXAMPLES

To get an allocation, and open a new xterm in which slaunch commands may be typed interactively:

    $ salloc -N16 xterm
    salloc: Granted job allocation 65537
    (at this point the xterm appears, and salloc waits for xterm to exit)
    salloc: Relinquishing job allocation 65537

To grab an allocation of nodes and launch a parallel application on one command line (See the salloc man page for more examples):

    salloc -N5 slaunch -n10 myprogram

SEE ALSO

sinfo(1), slaunch(1), sbatch(1), squeue(1), scancel(1), scontrol(1), slurm.conf(5), sched_setaffinity(2), numa(3)