Newsgroups: comp.parallel.mpi
From: dana@cscsun3.larc.nasa.gov (Dana Hammond)
Subject: Re: MPICH: use of dbx?
Organization: NASA Langley Research Center, Hampton, VA  USA
Date: 21 Sep 1995 16:19:54 GMT
Message-ID: <43s3ba$b0k@reznor.larc.nasa.gov>

In article <43rk70$3tb@reznor.larc.nasa.gov>, dana@cscsun3.larc.nasa.gov (Dana Hammond) writes:
 > 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?

Thanks to those who responsed.  The following seemed to work:

The mpi implementers give you the following for debugging using p4:
------------------------------------------------------------------
If your configuration of mpich used -device=ch_p4, then some of the p4
debugging capabilities are available to you. The most useful of these are
the command line arguments to the application program. Thus

mpirun -np 10 myprog -p4dbg 20 -p4rdbg 20

results in program tracing information at a level of 20 being written to
stdout during execution. For more information about what is printed at what
levels, see the p4 Users' Guide [1].

If one specifies -p4norem on the command line, mpirun will not actually
start the processes. The master process prints a message suggesting how the
user can do it. The point of this option is to enable the user to start
the remote processes under his favorite debugger, for instance. The option
only makes sense when processes are being started remotely, such as on a
workstation network. Note that this is an argument to the program, not
to mpirun. For example, to run myprog this way, use

mpirun -np 4 myprog -p4norem

--------------------------------------------------------------
The steps required actually translate to:

(0) Set "ignore USR1" in .dbxinit

(1) Compile whole program with -g option (Compiling only sections
    with -g results in kinky code-impossible to debug)

(2) On the host computer do "xdbx CFD_program"

(3) In the xdbx prompt area:
        (a) Set break point
        (b) "run -p4pg myprog.pg -p4norem < CFDinp_mod"

(4) Step over the MPI_Init call; the host will prompt you to 
    run CFD_program on the nodes.

(5) Do "xdbx CFD_program" on each target machine
        (a) Set break points in appropriate places.
        (b) type "run tab17 2409 -p4amslave < CFDinp_mod" 
        (c) Need the tab17 (host) and the number spewed out by host

(6) Start debugging!


