[mpich-discuss] working on a process using gdb

Darius Buntinas buntinas at mcs.anl.gov
Wed Aug 27 10:01:52 CDT 2008



On 08/27/2008 05:30 AM, Calin Iaru wrote:
> I notice that "show env" command when starting mpiexec -gdb reports some 
> false values; for instance, the HOSTNAME is set always to one machine, 
> instead of the machines that are running the processes. On the other 
> hand, MPD_JRANK varies as it should. This scenario occurs with Linux and 
> mpd as process manager.

mpiexec copies the local environment for each process.  So if you set 
FOO locally when you run mpiexec, it will be set for each process of you 
mpi job.  The MPD_ variables, however, are set by individually for each 
process by each process's mpd process manager.

> I am interested when debugging to execute some debugging commands only 
> on one process. For instance, printing the stack iterator is done like 
> this:
> 
> 0,3-8,10:  (gdb) print i
> 0:  $2 = 3
> 3-8:  $2 = 0
> 0,3-8:  (gdb) 10:  $2 = 2
> 
> Is there a way to specify the process on which I would like to run the 
> command?

I believe the syntax is something like:
(gdb) 0: print i
(gdb) 3-8: print j

-d




More information about the mpich-discuss mailing list