Interactive Batch Jobs

One way to run a command or set of commands on the compute nodes through the batch system is by placing the commands in a batch script and submitting the script to the batch system. The batch system will run the commands(s) contained in the script and place the output in a file.This method is useful for most cases. However, there are cases, such as debugging, in which it is useful to run the job interactively on a set of compute nodes. Running a job interactively allows the allocation of compute resources and direct access to these resources.

For example,

srun -A -n4

will allocate two nodes (four processors) and return a prompt. Once allocated, srun commands will run on the allocated resources. To release the allocated resources (canceling the SLURM job), simply type “exit.”

For example,

usrid:hawk0 124> srun -A -n2 -N2
usrid:hawk0 101> srun hostname
 hawk3
 hawk4
usrid:hawk0 102> squeue
    JOBID PARTITION     NAME     USER  ST       TIME  NODES NODELIST(REASON)
     2272  parallel             usrid   R       0:10      2 hawk[3-4]
usrid:hawk0 103> exit
usrid:hawk0 125>