Hi
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, run_gdb.sh 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 run_gdb.sh 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
  Jody

Reply via email to