• National Institute for Computational Sciences is a UT/ORNL Partnership

Interactive Batch Jobs

Batch scripts are useful for submitting a group of commands, allowing them to run through the queue, and then viewing the results. It is also often used to run a job interactively. However, users are not allowed to directly run on compute resources from the login module. Instead, users must use a batch-interactive PBS job. This is done by using the -I option with qsub.

Interactive Batch Example

For interactive batch jobs, PBS options are passed through qsub on the command line.

qsub -I -A XXXYYY -l size=12,walltime=1:00:00

Options:

-I
Start an interactive session

-A
Charge to the “XXXYYY” project

-X
Enables X11 forwarding which is necessary for interactive GUIs. Note that you must have X11 forwarding enabled when you log in to Kraken.

-l size=12,walltime=1:00:00
Request 12 compute cores for one hour



After running this command, you will have to wait until enough compute nodes are available, just as in any other batch job. However, once the job starts, the std input and std output of this terminal will be linked directly to the head node of our allocated resource. Issuing the exit command will end the interactive job. From here commands may be executed directly instead of through a batch script.

Using Interactive Batch Jobs to Debug

A common use of interactive batch is debugging (also see: debugging and optimization) Below are points that may be useful while interactively debugging code through PBS.

Quick Turnaround

The tips below may be used to help a job run quickly rather than sit in the queue.

Choosing a Job Size

You can use the showbf command (for “show back fill) to see immediately available resources that would allow your job to be backfilled (and thus started) by the scheduler. There are 30 (unavailable) service nodes that will need to be subtracted from the available nodes returned. For example, the snapshot below shows that there are (91 - 30) =61 nodes available, so a job requesting four compute nodes would run immediately.

% showbf

Partition     Tasks  Nodes   StartOffset      Duration       StartDate
---------     -----  -----  ------------  ------------  --------------
ALL            3488     91      00:00:00    6:17:26:42  14:33:18_04/01
ALL            3000     30      00:00:00      INFINITY  14:33:18_04/01
xt5            3488     91      00:00:00    6:17:26:42  14:33:18_04/01
xt5            3000     30      00:00:00      INFINITY  14:33:18_04/01

The following command would then take advantage of this window for an interactive session:

qsub -I -A XXXYYY -q debug -V -X -l size=12,walltime=1:00:00

See showbf -help for additional options. For more information, see the online user guide for the Moab Workload Manager.