For some tasks, such as debugging a job or self-installing software, you may require an interactive
job on a Baskerville compute node. This is done using the
srun command with the
--pty (pseudo-terminal) option.
You can use the following example command to start an interactive job:
srun --account <project_name> --qos <qos> --time 5 --export=USER,HOME,PATH,TERM --pty /bin/bash
--pty /bin/bash: this requests a
bashshell on the compute node. The
--ptyoption must be given at the end of the command
--export=USER,HOME,PATH,TERM: this exports a required subset of environment variables
--time 5: request a 5-minute job. (You will almost certainly want to change this!)
--qos <qos>: specifies the QoS for the job
--account <project_name>: optional defines the project account under which you want to run the job
--x11: optional allows X11 forwarding for GUI applications
The resource options for an interactive
srun command are the same as when assigning resources in a job script
and further information can also be found within the following Slurm documentation https://slurm.schedmd.com/srun.html.
Once you’ve executed the command and the underlying Slurm job has been allocated you will see your prompt’s hostname change to one of the Baskerville compute nodes. When you are connected to the compute node you should reset your environment to ensure you have not inherited settings from a login node. To do this run:
module purge; module load baskerville
If you have added anything to your
.bashrc file you should also run the command:
When you disconnect from the interactive job, by exiting the terminal, then the job will automatically be cancelled. If you use an interactive job then it is your responsibility to make sure that you make good use of the resources.
Please don’t leave the job idle, and remember to disconnect as soon as you’ve finished your work.