Interactive Jobs

Often times it is prudent to test that a smaller version of your slurm job works correctly before submitting the whole thing and to be able to debug your code more interactively.

You may also want to perform benchmarking or work through a tutorial for new software, but without disrupting the experience of other users by running resource intensive commands on the login node.

Interactive jobs can be used to create an instance for this kind of work on a compute node. 


Interactive Jobs with Slurm

Submitting an Interactive Job

Submitting an interactive job is similar to submitting a batch job, except you use the srun command instead of sbatch. For example:

srun -n1 -t02:00:00 --pty bash

Will prompt the scheduler to start a job on a cluster node with 1 `task` (or `core`, -n1) for 2 hours wall clock time (-t02:00:00), and in terminal mode.

When the interactive job starts, you will notice that you are no longer on a login node, but rather one of the compute nodes.

[fangping@login0a ~]$ srun -n1 -t02:00:00 --pty bash
[fangping@n409 ~]$


Interactive jobs draw service units from the slurm allocation that your CRC user is associated with. 

If your user account is associated with multiple PI compute resource allocations, you can specify which one your interactive session will charge with the '-A' or '--account' arguments, followed by the group name. To check which account your user charges by default, use the command.

sacctmgr show assoc onlydefaults | grep USERNAME

Where USERNAME is your username. 


Interactive jobs with x11 forwarding

If you would like to run an application that has a GUI interface, X11 forwarding is required. 

You should allocate a job to a node with your parameters, then SSH authenticated X11 session from the login node to your interactive session on that compute node. You can follow the following steps:

Allocate a job 

salloc -n1 -t02:00:00
salloc: Granted job allocation 874773
salloc: Waiting for resource configuration
salloc: Nodes htc-n1 are ready for job

Then use ssh to connect to the node that is ready for you.

ssh -X htc-n1

Once in your interactive session you can load software that provide GUI with the module system and launch them from the command line.


Open Ondemand

We have implemented Open Ondemand to run common GUI tools, such as RStudio, Jupyter Notebook, Jupyter Lab and Matlab. This interface is often easier to use if you are unfamiliar with slurm and submitting jobs via the command line. This is also the best method for launching an interactive session with a GUI desktop.


Quality of Service

All jobs submitted to Slurm must be assigned a Quality of Service (QoS). QoS levels define resource limitations. The default QoS is normal.

Quality of Service Max Walltime Priority factor
short 12:00:00 1.0
normal 3-00:00:00 0.75
long 6-00:00:00 0.5
  • Walltime is specified in days-hh:mm:ss

If your job does not meet these requirements it will be not be accepted.