Interactive Jobs

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 _projectname_ --qos _qos_ --gpus _count_ --time 5 --export=USER,HOME,PATH,TERM --pty /bin/bash

srun options

  • --pty /bin/bash: this requests a bash shell on the compute node. The --pty option 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
  • --gpus _count_: specifies the number of GPUs for the job
  • --account _projectname_: 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

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:

source ~/.bashrc

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.

Idle Jobs

Please don’t leave the job idle, and remember to disconnect as soon as you’ve finished your work.