Slurm: Running an interactive job🔗

Prev: Slurm: Viewing the Slurm job queue

This guide requires that you have completed: How to login

This job runs the same script as the batch job example, but interactively. An interactive job allows you to run a shell on a compute node. This is useful for development, debugging and other forms of iterative work.

$ srun --account=C3SE-staff --gpus-per-node=A40:4 --time=01:00:00 --pty=/bin/bash
[lnilss@alvis5-12 ~]$ module load pytorch
[lnilss@alvis5-12 ~]$ ./my_ml_pytorch_script.py --debug

Explanation:

The srun command schedules a job on a compute node.

  • --account=C3SE-staff: Specifies the NAISS compute project (in this case, the staff project) responsible for billing.
  • --gpus-per-node=A40:4: Requests four (4) A40 GPUs for this job.
  • --time=01:00:00: Requests a runtime of 1 hour.
  • --pty=/bin/bash: We want to run a bash shell as our terminal.

The last two lines in the example is typed by the user on the compute host alvis5-12.

  • module load pytorch: Loads the pytorch module from the module system.
  • ./my_ml_pytorch_script --debug: Starts an application.

Next: Introducing the module system