Slurm - Interactive Shell
Overview
Normally, compute nodes are only accessible to programs or jobs submitted as sbatch scripts to the scheduler. This mode of operation is ideal for well-understood research computing pipelines but may need to be approached more piecemeal through interactive sessions on compute nodes. This page documents how to obtain interactive shell sessions on our compute nodes, but please note that interactive graphical sessions are available through the webapp.
Obtaining an Interactive Shell
From a login node, to launch an interactive compute session, simply run the following command:
interactive
This will launch an interactive compute session on one of the compute nodes. If no options are specified, then the system will default to the htc
partition, public
QoS, 1 CPU core with a 4 hour wall time
Once the session launches, you can begin using the system. You know you are on a compute node when your bash prompt no longer says “login”
Example,
[jeburks2@login01:~]$ <-- Bash prompt shows the name of the login node
[jeburks2@login01:~]$ interactive
salloc: Granted job allocation 11255207
salloc: Nodes c001 are ready for job
[jeburks2@c001:~]$ <-- Bash prompt shows the name of the compute node
Interactive Session Options
The interactive
command will work with many of the same options and switches as other slurm job-launching commands. Interactive is a wrapper script for salloc
, which is the Slurm program for requesting allocations. It is similar to sbatch but runs a single command instead of a script. This single command is oftentimes a bash shell, enabling interactive shells on the supercomputers
For all possible options, see the Official Slurm Documentation
You can also specify how long you would like your session to run with the -t days-hours:minutes option.
An example of using these options to launch an interactive session that uses 8 CPU cores on one node, runs for 4 hours
interactive -c 8 -t 0-4:00
More Examples
X11 Forwarding
There is no special switch or option needed for X11 forwarding to work for jobs, it is always enabled.
If you need to run an X11 base program, just launch an interactive session and run the program from within it.
However, this will only work if you are logged through an SSH client that supports X11 forwarding, such as MobaXTerm on Windows or XQuarz on Mac. Make sure you connect to the supercomputer with the -X option
X11 Forwarding is not always a smooth experience, if you need to use a GUI application it is recommended to use the web portal instead ##TODO Add link here