Starting Interactive Jobs

NOTE:  There are some changes to this document for Grid 2.5.  Please see below in context.  Please contact RCS with any questions.

Though batch submission is the best way to take full advantage of the compute power of the Grid, foreground, interactive jobs can also be run. These can be useful for things like:

  • RAM intensive graphical applications like MATLAB or SAS
  • Iterative data exploration at the command line
  • Interactive "console tools" like R and iPython
  • Significant code development and compiling efforts

An interactive job differs from a batch job in two important aspects:

1) the queue to be used is interactive (this is specified by short_int in Grid 2.5) and,

2) jobs should be initiated with the bsub command, but need to include the -Is option to indicate an interactive shell (-Ip in Grid 2.5). This command:

    bsub -q interactive -Is -W 6:00 -R "rusage[mem=500]" -M 500 /bin/bash

Grid 2.5 changes:

    bsub -q short_int -Ip -W 6:00 -R "rusage[mem=500]" -M 500 /bin/bash

will start a command line shell (/bin/bash) on the interactive queue with 500 MB RAM for 6 hours; 1 core (CPU) on 1 node is assumed as these parameters (-n 1) were left out. When the interactive session starts, you will notice that you are no longer on a login node, but rather one of the compute nodes dedicated to this queue. The -Is option (-Ip in Grid 2.5) allows the session to act like a standard terminal. In a pinch, you can also run an application directly though this is discouraged due to problems setting up bash environment variables.  After setting the PATH for MATLAB, you can start the application with the following command:

    bsub -q interactive -Is -W 6:00 -R "rusage[mem=4000]" -M 4000 matlab

Grid 2.5 changes:

    bsub -q short_int -Ip -W 6:00 -R "rusage[mem=500]" -M 4000 matlab

In this case, we've asked for more memory because of the larger MATLAB footprint. The interactive queue requires that you actually interact with the session. If you have interactive tasks that must stretch over days, you can use NoMachine, or you may be able to use the GNU Screen or tmux utility to prevent the termination of a session when you disconnect (e.g. closing your terminal or closing your laptop). Both are already installed on the compute grid, and brief tutorials of screen and tmux are easily found by Google.

Grid 2.5 changes:

If your interactive job stretches over a day please consider using our new offering of long-interactive sessions in Grid 2.5 instead.  An example command for the long interactive session could be:

    bsub -q long_int -Ip  -R "rusage[mem=2000]" -M 2000 matlab

Ending interactive sessions: It is best practice to explicitly end your interactive sessions by issues the exit or quit command (shell sessions), or pressing Ctrl-d (GUI sessions). This not only exits your sessions but also free up the reserved resources for other people to use.

Last Updated 10/5/2018