next up previous index
Next: Not Quite Interactive PBS Up: Specification of PBS Jobs Previous: Specification of PBS Jobs

   
Interactive PBS Jobs

Normally when you call qsub PBS grabs your script and goes away. You get the prompt returned to you almost immediately and whatever output is produced from your job goes into a designated file. But what if you want to run an interactive job, e.g., a matlab session? This is not, in general, the right way to use supercomputers, because interactive jobs waste enormous amount of CPU time, mostly because humans are so slow. Even if you could type 1000 characters per second, you would still waste enormous amount of CPU time, because computers can easily type 500,000,000 characters per second or more (and high end graphic displays, the so called frame buffers, can display the characters this fast, but only as pixels).

The way to run such an interactive job is to call qsub -I. The -I option will make PBS  arrange for an interactive login session on an available AVIDD node and your TTY will be reconnected to that session. On exiting the session you'll get back to the original TTY. Here is how it works:

[gustav@bh1 gustav]$ hostname
bh1
[gustav@bh1 gustav]$ pwd
/N/B/gustav
[gustav@bh1 gustav]$ qsub -I
qsub: waiting for job 12529.bh1.avidd.iu.edu to start
qsub: job 12529.bh1.avidd.iu.edu ready

[gustav@bc55 gustav]$ hostname
bc55
[gustav@bc55 gustav]$ pwd
/N/B/gustav
[gustav@bc55 gustav]$ exit
qsub: job 12529.bh1.avidd.iu.edu completed
[gustav@bh1 gustav]$
I start from the head node, bh1, and request an interactive session. PBS takes my request, assigns it a job ID of 12529.bh1, and then gives me a shell on bc55. On exiting the shell on bc55 the PBS job terminates and I get back to the head node, bh1.

The computational nodes of the AVIDD cluster are configured for computation only. They have no X11 installed on them. This means that you cannot run any X11 tools on those nodes and you cannot even run emacs there, which is a pity, because emacs can be used as a computational tool. It is, after all, a Lisp machine emulator. But you can compile and run your own X11 program on computational nodes, because they have the full X11 library installed, and you can compile and run your own emacs too. And you can copy an existing X11 binary from /usr/X11R6/bin to your $HOME/bin too.

When you run X11 tools on computational nodes, the traffic is routed through bh3.uits.indiana.edu (on avidd-b), so that you should either add bh3.uits.indiana.edu to the list of hosts allowed to display windows on your X11 server, or - a better practice - use Xauthority.

Here is a simple example that shows how to do this:

1.
On my desktop X11 server I allow access to bh3 with xhost +bh3.uits.indiana.edu.
2.
I copy xclock and xterm binary on the head node from /usr/X11R6/bin to my $HOME/bin.
3.
Now I enter the interactive PBS session:
[gustav@bh1 gustav]$ cp /usr/X11R6/bin/xclock bin/xclock
[gustav@bh1 gustav]$ cp /usr/X11R6/bin/xterm bin/xterm
[gustav@bh1 gustav]$ qsub -I
qsub: waiting for job 12546.bh1.avidd.iu.edu to start
qsub: job 12546.bh1.avidd.iu.edu ready

[gustav@bc55 gustav]$ export DISPLAY=woodlands.tqc.iu.edu:0.0
[gustav@bc55 gustav]$ xclock &
[1] 5709
[gustav@bc55 gustav]$ xterm &
[2] 5710
[gustav@bc55 gustav]$ exit
qsub: job 12546.bh1.avidd.iu.edu completed
[gustav@bh1 gustav]$
Exiting from bc55 kills both xclock and xterm.

Since you have copied xterm to your private bin already, you can get yourself a more functional interactive window on a computational node simply by submitting a script, which calls xterm, without the -I option. Here is the example of the script:

[gustav@bh1 PBS]$ cat xterm.sh
#!/bin/bash
xterm -display woodlands.tqc.iu.edu:0.0
exit 0
[gustav@bh1 PBS]$ qsub xterm.sh
12550.bh1.avidd.iu.edu
[gustav@bh1 PBS]$
Submitting the script to PBS  will produce, after a short while, an xterm window running on a PBS allocated node on your X11 server. Exiting the shell in the window terminates the job.


next up previous index
Next: Not Quite Interactive PBS Up: Specification of PBS Jobs Previous: Specification of PBS Jobs
Zdzislaw Meglicki
2004-04-29