Using SALLOC to Submit Jobs
salloc
is a so-called blocking command, as in it will not let you execute other commands until this command is finished (not necessarily the job, just the allocation). For example, if you run salloc srun /bin/hostname
and resources are available right away it will print the hostname of the node allocated. If resources are not available, you will be stuck in the command while you are pending in the queue. Ctrl+C
will cancel the request. Note it takes two Ctrl+C
within one second to cancel the job once it is started.
sbatch
salloc
, since sbatch
allows you to specify parameters in the file, and is non-blocking.Please note that like sbatch
, you can run a batch file using salloc
.
The command syntax is salloc <options> srun [executable] <args>
Options is where you can specify the resources you want for the executable, or define. The following are some of the options available; to see all available parameters run man salloc
.
-c <num>
Number of CPUs (threads) to allocate to the job per task-n <num>
The number of tasks to allocate (for MPI)-G <num>
Number of GPUs to allocate to the job--mem <num>[K|M|G|T]
Memory to allocate to the job (in MB by default)-p <partition>
Partition to submit the job to
To run an interactive job with your default shell, just pass the resources required to salloc
and do not specify a command:
salloc -c 6 -p cpu
To run an application on the cluster that uses a GUI, you must use an interactive job, in addition to the --x11
argument:
salloc -c 6 -p cpu --x11 xclock
sbatch
command, you must use salloc
.