Open MPI logo

Open MPI User's Mailing List Archives

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

From: Adrian Knoth (adi_at_[hidden])
Date: 2007-01-08 15:52:08


On Mon, Jan 08, 2007 at 03:07:57PM -0500, Jeff Squyres wrote:

> if you're running in an ssh environment, you generally have 2 choices to
> attach serial debuggers:
>
> 1. Put a loop in your app that pauses until you can attach a
> debugger. Perhaps something like this:
>
> { int i = 0; printf("pid %d ready\n", getpid()); while (0 == i) sleep
> (5); }
>
> Kludgey and horrible, but it works.
>
> 2. mpirun an xterm with gdb.

If one of the participating hosts is the localhost and it's
sufficient to debug only one process, it's even possible to
call gdb directly:

adi_at_ipc654~$ mpirun -np 2 -host ipc654,dana \
   sh -c 'if [[ $(hostname) == "ipc654" ]]; then gdb test/vm/ring; \
          else test/vm/ring ; fi '

(also works great with ddd).

-- 
Cluster and Metacomputing Working Group
Friedrich-Schiller-Universität Jena, Germany
private: http://adi.thur.de