Skip to main content

Interactive Sessions

Slurm allow interactive sessions into the workernodes, using ssh, but within a valid job allocation, normal ssh are disabled.

Starting srun Session

The most simple way to start an interactive session is:

[user@cirrus01 ~]$ srun -p inter -q inter --job-name "my_interactive" --pty bash -i
srun: job 72791 queued and waiting for resources
srun: job 72791 has been allocated resources
[user@hpc059 ~]$

You will have an ssh session on a worker node were other users are running jobs or interactive sessions as well, try not bother them with unsolicitated interactions, and exit the session when you are finished.

The srun command have the same restrictions as a normal job and will be aborted or refused to run when the system limits are axceeded. If you run the squeue you will see your interactive job listed as any other job:

[user@hpc059 ~]$ squeue 
JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON) 
72818     inter my_inter     user  R       2:03      1 hpc059 

Starting salloc Session

The salloc is setup to behave like the srun command, for example:

[user@cirrus01 ~]$ salloc -p inter -q inter --job-name "my_interactive" 
salloc: Pending job allocation 72818
salloc: job 72818 queued and waiting for resources
salloc: job 72818 has been allocated resources
salloc: Granted job allocation 72818
salloc: Waiting for resource configuration
salloc: Nodes hpc059 are ready for job
[user@hpc059 ~]$