Sometimes users need more computational power to run commands from the command line. As a general rule, it is NOT a good idea to launch these commands from the login node, because the login node is a server designed to manage user sessions, it has limited resources and it does not behave well with CPU extensive sessions. Additionally, intensive CPU usage on the login node could reduce session speed and performance for the rest of the users.
To solve this need, users can request an interactive job on a computing node with the "salloc" command.
[test@ohpc ~]$ salloc -w node020 --partition=high --mem=16G salloc: Granted job allocation 416534 salloc: Waiting for resource configuration salloc: Nodes node020 are ready for job [test@node020 ~]$
[test@node020 ~]$ squeue -u test JOBID PARTITION NAME USER ST TIME NODES NODELIST(REASON) 416535 high interact test R 0:07 1 node020
These are the options of salloc command:
If we ask for a resource that is not available at that time, slurm will indicate that it is waiting for free resources
test@node009:~$ salloc --partition=high --nodes=2 --time=00:30:00 --gres=gpu:1 salloc: Pending job allocation 76162 salloc: job 76162 queued and waiting for resources
Another way to create an interactive sesion is using "srun"
test@node009:~# srun --nodes=1 --gres=gpu:1 --pty bash -i test@node024:~# squeue JOBID PARTITION NAME USER ST TIME NODES NODELIST(REASON) 21271 high GPU_burn test PD 0:00 1 (Resources)