Interactive Sessions

While submitting a single script to Slurm can be useful, sometimes it's useful to quickly tests programs in the command line. How can you do that while still taking advantage of the compute nodes' processing power?

Slurm has a built-in utility for doing just this, srun. To run an interactive session, run:

srun --pty bash

This will assign you to a compute node, then start a bash shell session on that node. You can now run programs interactively on the command line, just as if you were on the head node. This is often useful when you are compiling, debugging, or testing a program, and the program does not take long to finish.

Remember to exit cleanly from interactive sessions when done; otherwise it will be killed without your notice.

Last updated