Cluster jobs are usually submitted as scripts, performing one or more tasks in the background.
If, however, you need to have access to the cluster resources for interactive work, be it compute work or administrative, you can allocate resources for your interactive work, and then submit separate steps for each task you wish to perform. This section will attempt to explain the basic principles behind interactive work on slurm nodes, but designing the best setup for each case may require some more in-depth reading of the slurm documentation.
If you plan on performing multiple tasks in parallel, for instance - performing houskeeping tasks as well as backing up to a cloud account and doing some result analysis, you wouldn't want the tasks to be blocking each other. One option is to treat each such task as a separate job, and running them independently.
Another option is to allocate resources for the various jobs at once, optionally allowing for overlap between them (sharing CPUs, ram, etc) using the --overlap
flag. Assuming not all tasks will be utilizing the full resources at once, this creates a more natural working environment, and resources aren't wasted on idle time.
While the sbatch
and srun
commands will request resource allocation if none exist already, using the salloc
command allows us to separate the allocation and submission processes.