Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: [OMPI users] Debugging spawned processes
From: jody (jody.xha_at_[hidden])
Date: 2009-12-16 06:06:53

Until now i always wrote applications for which the number of processes
was given on the command line with -np.
To debug these applications i wrote a script, which basically
open a xterm and starts gdb in it for my application.
This allowed me to have a window for each of the processes being debugged.

Now, however, i write my first application in which additional processes are
being spawned. My question is now: how can i open xterm windows in which
gdb runs for the spawned processes?

The only way i can think of is to pass my script into the argv
parameters of MPI_Spawn.
Would this be correct?
If yes, what about other parameters passed to the spawning process, such as
environment variables passed via -x? Are they being passed to the spawned
processes as well? In my case this would be necessary so that processes
on other machine will get the $DISPLAY environment variable in order to
display their xterms with gdb on my workstation.

Another negative point would be the need to change the argv parameters
every time one switches between debugging and normal running.

Has anybody got some hints on how to debug spawned processes?

Thank You