Newsgroups: comp.parallel.mpi
From: wmagro@msc.cornell.edu (William Magro)
Subject: Re: MPICH: use of dbx?
Organization: Cornell University
Date: 21 Sep 1995 16:52:00 GMT
Message-ID: <43s57g$c8@newsstand.cit.cornell.edu>

Dana Hammond (dana@cscsun3.larc.nasa.gov) wrote:
: I am particularly interested in "the -dbx option to mpirun causes 
: processes to be run under the control of the dbx debugger."  See URL
: "http://www.mcs.anl.gov/mpi/mpiuserguide/node30.html#Node30".

: What are the necessary conditions (i.e., certain version number of MPICH, 
: must be using p4, etc.)?  Has anyone had success with this approach, or
: can recommend an alternative?

I didn't have too much luck with the built in debugging options.  Here is what
worked well for me.  First, my preferred debugger is gdb.  I first ran my program
with 'mpirun -np 2 pupi'.  'pupi' is a master/worker composite executable.
I then looked at the procgroup file that p4 created.  It looked something like:

=========================
aglet 0 /home/wmagro/work/code/pupi9o.wm/parallel/test/pupi
aglet 1 /home/wmagro/work/code/pupi9o.wm/parallel/test/pupi
=========================

I changed it to read:

=========================
aglet 0 /home/wmagro/work/code/pupi9o.wm/parallel/test/pupi
aglet 1 /home/wmagro/work/code/pupi9o.wm/parallel/test/dpupi
=========================

Next, I made a script, called 'dpupi', which starts 'pupi' under the debugger.
'dpupi' reads:

=========================
#!/bin/sh
cd work/code/pupi9o.wm/parallel/test

# set a breakpoint for the main program
echo b MAIN_ > myargs.$$
# tell gdb to use the p4 arguments
echo r $* >> myargs.$$

#bring up an xterm with the worker running in an xterm
xterm -d :0 -e gdb pupi -x myargs.$$
=========================


To get all programs running in debugger windows, just edit the procgroup file
to have more entries calling 'dpupi' instead of 'pupi'.  To get it going,
type:

mpirun -pgfile procgroup

Good luck!

Bill Magro
Cornell Theory Center

