HPC High Performance Computing: 5.5. Submitting interactive jobs

Submitting interactive jobs

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
            416535      high interact   test  R       0:07      1 node020

These are the options of salloc command: 

 -A: account (non-default account)
 -p: partition (default: )
 -n: number of tasks (default: 1)
 -c: number of CPU cores (default: 2)
 -m: amount of memory (GB) per core (default: 2 [GB])
 -r: specify a reservation name
 -w: target node
 -J: job name
 -x: binary that you want to run interactively


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
             21271      high GPU_burn  test PD       0:00      1 (Resources)