Scientific Computing & Visualization
Help Contact
About Accounts Computation Visualization Documentation Services

Interactive Batch Jobs

During code development and debugging, it is often desirable to run single or multiprocessor jobs interactively. When an interactive batch job is in progress, the node (or nodes) that is committed to your job remains at your disposal until you terminate it. Furthermore, the window (shell) from which you submit the interactive batch job changes to the assigned batch node's shell (window). This is especially convenient when you are debugging or testing a code in the multiprocessor environment. That is because since you have exclusive use of the assigned nodes, you can run jobs and editing and compiling codes alternately without losing the assigned nodes. On a highly loaded system, this is very desirable for the user.

As a matter of fact, MATLAB users are encouraged to conduct all their computations through interactive batch to avoid burdening cootie which is reserved for non compute-intensive tasks such as code editing and development.

To submit a batch job as interactive, you need to add the switch "-I" upon submission. If resources are available, the interactive batch job will start immediately and the current window is taken over by a system assigned batch node. Note that even if you request multiple nodes, only one interactive node will appear. From this point on, you can proceed to run serial or multiprocessor jobs interactively (just like on twister). When you are finished with the batch job, type "exit" to get back to the original window. This also effectively terminates the interactive batch job.

The following example requests 2 interactive nodes (4 processors)

cootie:~/batch-examples % qsub -I -l nodes=2:ppn=2
qsub: waiting for job 13784.hn003.nerf.bu.edu to start
qsub: job 13784.hn003.nerf.bu.edu ready

----------------------------------------
Begin PBS Prologue Thu Oct 16 11:00:15 EDT 2003
Job ID:         13784.hn003.nerf.bu.edu
Username:       kadin
Group:          scv
Nodes:          nodem031 nodem032
End PBS Prologue Thu Oct 16 11:00:16 EDT 2003
----------------------------------------
node032:~ %

Note in the above example that, once the interactive job is in effect, the system prompt changes from cootie to node032.

Tips:

  1. To request a single node for serial jobs
    cootie% qsub -I
  2. If ppn is not specified, PBS defaults it to 1 and hence only 2 processors would be available to you - one on each node.
    cootie% qsub -I -l nodes=2

In the interactive mode, to run an MPI job necessitates a file containing the list of all participating nodes. These nodes are assigned by the system and are not known until the interactive batch job is in effect. In the interactive batch window, a script, mpijob, developed by SCV staff, automatically extracts the list of assigned nodes, then runs your executable via mpirun. This script is available system-wide, there is no need for you to download if you are using SCV-maintained supercomputer systems. To demonstrate the usage of this script, we continue with the preceeding 4-processor interactive batch example. Once you are in the interactive batch window, node032 ...

node032% mpijob /usr1/scv/kadin/batch-examples/a.out -np 2
Although the interactive batch job is assigned 4 processors, only 2 are used for this run. On the other hand, if 8 processors are requested, since only 4 physical processors are available, each physical processor will have to process 2 tasks. The 2 tasks will be processed sequentially. .
node032% mpijob /usr1/scv/kadin/batch-examples/a.out
This job does not specify number of processors and hence 4 processors will be used.

Caution: The mpijob script uses the system's current default mpirun to run MPI jobs. If you used non-default MPI compiler, be sure to use matching runtime system via module or select the desired mpirun by prepending it with the appropriate absolute path.

To run MATLAB or your own executable serially via interactive batch, all you need do is

cootie % qsub -I  
node032 % cd wherever  
node032 % executable-name  (or matlab)
Boston University
Boston University
 
OIT | CCS | September 15, 2009  
Scientific Computing & Visualization Boston University home page Boston University home page