Interactive jobs¶
The salloc command can be used to schedule an interactive job. This accepts
the same arguments as sbatch (e.g. for requesting runtime) but without the
leading #SBATCH you would put into a job script file. Instead of running a
script, an salloc presents a shell which can be used to run interactive
commands on the node.
Interactive sessions should be used sparingly (for interactive debugging, etc.)
since they use resources which could be used by batch jobs. You must have an
active connection to the cluster throughout the entirety of an interactive job.
If your connection drops, the session will end and you may lose your results.
Batch jobs submitted with sbatch do not require an active connection and will
continue to run whilst you are not connected to the cluster.
At busy times you may not be able to get an interactive session as there may be
no spare resources to immediately service your request. However, you will
increase your chances considerably if you submit to the computeshort
partition, requesting a maximum of 1 hour runtime.
For example, to request 2 tasks (cores) and 1GB RAM per task/core for a total of 2GB RAM, for 1 hour:
salloc -n 2 --mem-per-cpu=1G -t 1:0:0
If resources are not available at the time of starting the interactive session, the job will still queue pending resources. You will see a similar message to the following:
salloc: Pending job allocation 1234
salloc: job 1234 queued and waiting for resources
If your connection to the cluster drops, or if the shell which the salloc
command was launched from exits, the job will be cancelled.