Interactive Batch Jobs

Batch scripts are useful for submiting a group of commands, allowing them to run through the queue, then viewing the results. It is also often useful to run a job interactively. However, users are not allowed to access compute nodes or run mpirun directly from a login session on Lens. Instead, users must use a batch-interactive PBS job. This is done by using the -I option to qsub.

Interactive Batch Example

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

qsub -I -A XXXYYY -V -lnodes=2:ppn=4,walltime=30:00

This request will

-I
Start an interactive session
-A
Charge to the XXXYYY project
-V
Import the submitting user’s environment
-lnodes=2:ppn=4,walltime=30:00
Request 8 cores (4 cores on 2 nodes) for 30 minutes

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, you will have an interactive prompt on the head node of your allocated resource. From here commands may be executed directly instead of through a batch script.

Using to Debug

A common use of interactive batch is debugging. Below are points that may be useful while interactively debugging a 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 resource limits that would allow your job to be immediately backfilled (and thus started) by the scheduler. For example, the snapshot below shows that a job requesting seven compute nodes would run immediately.

$ showbf
Partition     Tasks  Nodes   StartOffset      Duration       StartDate
---------     -----  -----  ------------  ------------  --------------
ALL               4      4      00:00:00      INFINITY  12:43:19_03/30

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

qsub -I -lnodes=1:ppn=4

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