101: Interactive jobs with Slurm
You can use salloc to allocate resources in real-time to run an interactive batch job. Typically this is used to allocate resources and spawn a shell. The shell is then used to execute srun commands to launch parallel tasks. Interactive job is useful for tasks including data exploration, development, or (with X11 forwarding) visualization activities. The maximum walltime depends on the QoS you have used.
For worker nodes with CPU and GPU:
salloc --qos=cu_hpc --partition=cpugpuFor worker nodes with CPU-only:
salloc --qos=cu_hpc --partition=cpuAfter connection, you will get the message like
salloc: Granted job allocation 82025
salloc: Waiting for resource configuration
salloc: Nodes cpu-bladeh-01 are ready for joband with squeue -u your_user_name, you will see
JOBID PARTITION NAME USER ST TIME NODES NODELIST(REASON)
82025 cpu interact your_user_name R 1:59 1 cpu-bladeh-01To run, you can use srun, e.g.
[your_user_name@frontend-02 ~]$ srun hostname
cpu-bladeh-01.stgTo exit the interactive mode, you can use the command exit
[your_user_name@frontend-02 ~]$ exit
exit
salloc: Relinquishing job allocation 82025Last updated
Was this helpful?