Program visualization with XPVM
The tool XPVM, developed at Oak Ridge National Laboratory, allows for
viewing trace information generated by PVM programs. (Note that PVMe
programs do not generate trace information which can be used with XPVM.)
XPVM can be used on the interactive nodes, or in the batch environment.
A sample view of the XPVM console window:
(click to enlarge)
Requirements
To use XPVM, your program must spawn processes with the "PvmTaskTrace"
option. Further, if your program has any input requirements,
or if you want to monitor a job running in batch under the
system pvm.script file, you will need to include a subroutine call in your
program to enable it to attach to a pre-established XPVM session at run-time.
(This is due to limitations of XPVM, which cannot spawn programs with input
requirements and which makes assumptions on the executable directory where
your program resides.)
Programs with no input requirements may be spawned from within an XPVM session
on the interactive nodes, and do not require this extra subroutine call.
To cover the most general case, we will assume that the program to be monitored cannot
be spawned from with XPVM.
Tutorial example: Matrix transposition
The tutorial included in the directory /usr/local/doc/Examples/transp demonstrates the use of XPVM to monitor
a SPMD program running in the batch environment.
The SPMD program setup.c generates a 3-D matrix
distributed across the nodes, and calls a Fortran routine (in transp.f)
to perform a matrix transposition. Since both C and Fortran are used,
this example also serves to demonstrate how to link multi-language
programs. A simple timer is also included, and can be used to
get an estimate of elasped wallclock time.
Note the following:
- Your DISPLAY variable must be set on the node running the batch job.
The easiest way to do this is to include your DISPLAY
setting in your .cshrc file.
- The "grand" node running your batch process must have permission to display
on your console. Since it can be difficult to anticipate
which specific node will run a batch job (particularly in the case of TEST
classes), you may want to add all "grand" nodes to your xhost list on
your workstation console.
- Use extreme care when submitting a job to the batch system with
the XPVM monitoring option. Interaction is required to properly
terminate the XPVM session. If you are not at your console when the job is run,
the XPVM will remain open for the maximum time permitted for the batch
class which it is running under.
XPVM on the interactive node pool
To run this tutorial, copy the source and README files listed above to your
own area and build the executable program (setup) just as you would for the
batch tutorial. Note the arguments required for the exectuable program.
(See README.pvm for details.)
To use XPVM on the interactive node pool, first follow the intructions
for setting up an interactive PVM session, since it is probably easiest to
start XPVM after you've successfully started PVM.
To proceed with XPVM:
- Open two shell sessions (windows) running on one of the interactive nodes.
- Check to ensure your DISPLAY is set and that the interactive grand node
has permission to open on your console.
- Then, in one of the interactive shell sessions (windows),
execute /usr/local/bin/xpvm. You need not specify a hostfile, since the
job which is being traced will add hosts to XPVM as processes are spawned.
After XPVM successfully starts, and you've selected a tracefile (or accepted
the default tracefile), switch to the second window.
It may seem like a more natural approach to start XPVM as a background process,
but pecularities in the XPVM environment (and the fact that it generates its own shell)
typically cause this approach to fail.
- In the second interactive shell session (window), execute the program
by typing its name and arguments. The included call to xpvm_connect() will cause
its trace information to be displayed in the XPVM display area.
When the program finishes, you may switch to "playback" mode, and replay
the trace file and examine various "views" of the collected information.
- When finished, you may choose to "quit" XPVM, which leaves the PVM
virtual machine intact, or "halt" XPVM, which "halts" the PVM daemon
as XPVM is exited. You should choose "quit" if you intend to continue
using PVM after leaving XPVM, and "halt" if you are finished
with your PVM session.