Running Interactive Jobs

Submit an Interactive Job

Interactive sessions allow you to connect to a compute node and work on that node directly. This allows you to develop how your jobs might run (i.e. test that commands run as expected before putting them in a script) and do heavy development tasks that cannot be done on the login nodes (i.e. use many cores)

To launch an interactive job on MASSIVE, here is the command. Please note it will launch the job with the following defaults: you default project account; ntask=1 (1 cpu core); memory=1G; time-24hours and no other resources such as GPU and Phi card.



We suggest that users put the project account so Slurm can know where it charge from:

sinteractive --account=monash001 


If you want to change default time to 2 days:

sinteractive --account=monash001 --time=2-00:00:00


If you need multi-core:

sinteractive --account=monash001 --ntasks=12


If you need one GPU card:

sinteractive --account=monash001 --ntasks=2 --gres=gpu:2


Interactive Jobs will remain active until "exit" or the job is canceled

The mechanisum behind the interactive job is:

  1. User runs the 'sinteractive' command
  2. sinteractive schedules a Slurm batch job to start a screen session on a compute node
  3. Slurm grants the user ssh access to the node
  4. sinteractive connects the user to the node and attaches to the screen session
  5. the job is completed whenever the screen session ends or the job is canceled

Therefore, an interactive job will not be automatically terminate unless user manually quit the session. To quit it,

Option 1: Run


on the compute node. Once you come back to the login node, it means the sinteractive session is terminated.


Option 2: Cancel the job directly (from compute nodes or login nodes)

scancel [JOBID]


Reconnect/Disconnect to an Active Interactive Job

Since an interactive job is a screen session, you can reconnect/disconnect to it anytime. Here is a real-world scenario.

I am in office and have an interactive job running (ID#158985). Now I plan to go home but I want to leave this job running so I can reconnect to it when I am home. The steps are:

1) Disconnect the screen session for the existing interactive job:

[kaixi@m2113 ~]$ screen -d
[15495.slurm158985 detached.]

2) Now 'show_job' to see if the job is still running:

158985 _interact   pmosp   comp_m2   Running   1:27    1-00:00    1     m2113

3) Once I am home, ssh to the node:

[kaixi@m2-login2 ~]$ ssh m2113
[kaixi@m2113 ~]$ screen -ls
There is a screen on:
15495.slurm158985 (Detached)
1 Socket in /var/run/screen/S-kaixi

4) Reconnect to the screen session:

[kaixi@m2113 ~]$ screen -r 15495.slurm158985


Copyright © 2016 MASSIVE. All Rights Reserved.