Interactive Jobs (srun, srun-x11)
The following commands will log you in to a compute node for interactive usage.
Starting an Interactive Session
Please note that the maximum wallclock time for interactive jobs is 1 hour. You must specify the wallclock time limit for your interactive session!
Command-line apps
The srun command should be run on the login node:
Serial (1-core) interactive session on AMD Genoa lasting 1 hour (0 days, 1 hour)
srun -p interactive -t 0-1 --pty bash
Multicore interactive session on AMD Genoa lasting 1 hour (0 days, 1 hour). Use the -n flag if running MPI applications. The $SLURM_NTASKS environment variable will be set to the number of cores requested.
srun -p interactive -n 4 -t 0-1 --pty bash
Note, if running OpenMP code or python code that uses os.sched_getaffinity(0) to determine the number of available cores, you should use -c rather than -n to specify the number of cores. The $SLURM_CPUS_PER_TASK environment variable will be set to the number of cores requested.
srun -p interactive -c 4 -t 0-1 --pty bash
Also note, that if you need to run an interactive session on Intel CPUs, then you also have the option to use the serial partition by typing:
srun -p serial -t 0-1 --pty bash
To return to the login node
exit 0
If you receive an error containing the message:
# Error when trying to open a GUI app ERROR: cannot open display: # Return to the login node exit
then you should try srun-x11 below instead of srun.
GUI apps
The srun-x11 command should be run on the login node to allow GUI apps to be run on the compute node and have them display on your screen. Note that this is NO --pty bash used with this command:
Serial (1-core) interactive session on AMD Genoa with remote display, lasting 1 hour (0 days, 1 hour):
srun-x11 -p interactive -t 0-1 # NO '--pty bash' required
Multicore interactive session on AMD Genoa with remote display, lasting 1 hour (0 days, 1 hour):
srun-x11 -p interactive -n 4 -t 0-1 # NO '--pty bash' required
Example: Now do the following to open the xnedit text editor on the node
module load apps/binapps/xnedit xnedit
Note that by default the above commands will inherit any environment variables you have already loaded on the login node.
If you require a clean environment on the compute node (once the srun/srun-x11 command has logged you in to a compute node), run the following command:
module purge
You can load modulefiles on the compute node as normal using the module load command.
When finished with your session, return to the login node using:
exit 0
