Interactive Batch Jobs
Categories: Running Jobs
Print this article
Batch scripts are useful for submitting a group of commands, allowing them to run through the queue, then viewing the results at a later time. However, it is sometimes necessary to run tasks within a job interactively.
Users are not permitted to access compute nodes nor run
aprun directly from login nodes. Instead, users must use an interactive batch job to allocate and gain access to compute resources interactively. This is done by using the
-I option to
Interactive Batch Example
For interactive batch jobs, PBS options are passed through
qsub on the command line.
$ qsub -I -A pjt000 -q debug -X -l nodes=3,walltime=30:00
This request will:
||Start an interactive session|
||Charge to the “pjt000” project|
||Enables X11 forwarding. The DISPLAY environment variable must be set.|
||Run in the debug queue|
||Request 3 compute nodes for 30 minutes (you get all cores per node)|
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 be given an interactive prompt on the head node of your allocated resource. From here commands may be executed directly instead of through a batch script.
Debugging via Interactive Jobs
A common use of interactive batch is to aid in debugging efforts. Interactive access to compute resources allows the ability to run a process to the point of failure; however, unlike a batch job, the process can be restarted after brief changes are made without loosing the compute resource allocation. This may help speed the debugging effort because a user does not have to wait in the queue in between each run attempts.
-XPBS option should be used to enable X11 forwarding.
Choosing an Interactive Job’s
Because interactive jobs must sit in the queue until enough resources become available to allocate, to shorten the queue wait time, it is useful to base
nodes selection on the number of unallocated nodes. The
showbf command (i.e “show backfill”) to see resource limits that would allow your job to be immediately back-filled (and thus started) by the scheduler. For example, the snapshot below shows that 802 nodes are currently free.
$ showbf Partition Tasks Nodes StartOffset Duration StartDate --------- ----- ----- ------------ ------------ -------------- ALL 4744 802 INFINITY 00:00:00 HH:MM:SS_MM/DD
showbf –help for additional options.