Open MPI logo

Open MPI User's Mailing List Archives

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

Subject: Re: [OMPI users] How to debug Open MPI programs with gdb
From: Jed Brown (jed_at_[hidden])
Date: 2010-04-22 12:33:23

On Thu, 22 Apr 2010 13:11:49 +0200, "=?utf-8?b?0J3QtdC80LDRmtCwINCY0LvQuNGb?= (Nemanja Ilic)" <nemanja.ilic.81_at_[hidden]> wrote:
> On the contrary when I debug with "mpirun -np 4 xterm -e gdb
> my_mpi_application" the four debugger windows are started with
> separate thread each, just as it should be. Since I will be using
> debugger on a remote computer I can only run gdb in console mode. Can
> anyone help me with this?

An alternative to opening xterms (e.g. if that host isn't running an X
server, you can't get X11 forwarding to work, or you just don't want
xterms) is to use GNU "screen". It's basically the same command line,
but it will open a screen terminal for each thread. When debugging
multiple threads with xterms or screens, I recommend gdb's -ex 'break
somewhere' -ex run --args ./app -args -for -your application to save you
from entering commands into each terminal separately.