Child pages
  • Using compute nodes interactively at Prince
Skip to end of metadata
Go to start of metadata

Some things require user interaction - debugging, and many uses of Matlab for example. And sometimes when preparing a job script it is helpful to work through it interactively first. However, the login nodes are not suitable for work requiring large amount of memory or computation. To support interactive use in a batch environment, Slurm allows for interactive batch jobs.

Options for running interactively on the compute nodes:

(Don't just submit the job, but also wait for it to start and connect stdoutstderr and stdin to the current terminal)

  • -nnum
    Specify the number of tasks to run, e.g. -n4. Default is one CPU core per task.
  • -ttime
    Request job running duration, e.g. -t1:30:00
  • --mem=MB
    Specify  the  real  memory  required  per  node in MegaBytes, e.g. --mem=4000
  • --pty
    Execute the first task in pseudo terminal mode, e.g. --pty /bin/bash, to start a bash command shell

  • --x11
    Enable X forwarding, so programs using a GUI can be used during the session (provided you have X forwarding to your workstation set up)
  • To leave an interactive batch session, type exit at the command prompt.

Certain tasks need user interaction - such as debugging and some GUI-based applications. However the HPC clusters rely on batch job scheduling to efficiently allocate resources. Interactive batch jobs allow these apparently conflicting requirements to be met.

When you start an interactive batch job the command prompt is not immediately returned. Instead, you wait until the resource is available when the prompt is returned and you are on a compute node and in a batch job - much like the process of logging in to a host with sshTo end the session, type 'exit', again just like the process of logging in and out with ssh.

To use any GUI-based program within the interactive batch session you will need to extend X forwarding with the --x11 option. This of course still relies on you having X forwarding at your login session - try running 'xterm' before starting the interactive to verify that this is working correctly.

You can request resources for an interactive batch session just as you would for any other job, for example to request 4 processors with 4GB memory for 2 hours:

If you do not request resources you will get the default settings. If after some directory navigation in your interactive session, you can jump back to the directory you submitted from with:


Start an interactive batch session with the --x11 option for X forwarding. NYU has a site license for Matlab, so find and load the Matlab module, and start the GUI. Tinker with it, if you wish.

(Don't forget to quit Matlab and exit the interactive batch session after you're done)

  • No labels