Open MPI logo

Open MPI User's Mailing List Archives

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

Subject: Re: [OMPI users] Debugging OpenMPI calls
From: Aniruddha Marathe (marathe.aniruddha_at_[hidden])
Date: 2009-09-28 14:28:35

Hi Jeff,

Thanks for the pointers. I tried with both CFLAGS=-g3 and --enable-debug
(separately), however, I am still unable to jump into the MPI source. It
seems I am missing a small step(s) somewhere.

I compiled my MPI application with the new library built with above flags,
ran it and attached gdb to one of the processes. Following are the steps
that I performed with gdb:

0x00110416 in __kernel_vsyscall ()
Missing separate debuginfos, use: debuginfo-install glibc.i686
(gdb) dir /home/amarathe/mpi/svn_openmpi/ompi-trunk/ompi/mpi/c
Source directories searched:
(gdb) break MPI_Barrier
Breakpoint 1 at 0x155596

When gdb hits breakpoint 1, it jumps at the address but cannot find the
source file for 'MPI_Barrier' definition.

Breakpoint 1, 0x00155596 in PMPI_Barrier () from
(gdb) s
Single stepping until exit from function PMPI_Barrier,
which has no line number information.
main (argc=1, argv=0xbf9a1484) at smg2000.c:114
114 P = num_procs;

Is this the right approach?


On Mon, Sep 28, 2009 at 8:40 AM, Jeff Squyres <jsquyres_at_[hidden]> wrote:

> You might want to just configure Open MPI with:
> ./configure CFLAGS=-g3 ...
> That will pass "-g3" to every Makefile in Open MPI.
> FWIW: I do variants on this technique and gdb is always able to jump to the
> right source location if I "break MPI_Barrier" (for example). We actually
> have a "--enable-debug" option to OMPI's configure, but it does turn on a
> bunch of other debugging code that will definitely result in performance
> degradation at run-time (one of its side effects is to add "-g" to every
> Makefile).
> On Sep 28, 2009, at 5:57 AM, Aniruddha Marathe wrote:
> Hello,
>> I am new to OpenMPI library and I am trying to step through common MPI
>> communication calls using gdb. I attach gdb to one of the processes
>> (using the steps mentioned on the OpenMPI Debugging FAQ page) and set
>> a breakpoint on 'MPI_Barrier' and expect gdb to jump into the
>> definition of MPI_Barrier function.
>> I've manually added -g3 compilation flag to the Makefiles in some of
>> the directories that I thought relevant ({ROOT}/ompi/mpi/c etc). I
>> also specified the source file paths in gdb using the 'dir' command.
>> However, gdb is unable to jump into the appropriate source location
>> when it hits the breakpoint.
>> Could anyone please let me know if I am missing something here?
>> Thanks for looking into my post.
>> Regards,
>> Aniruddha
>> _______________________________________________
>> users mailing list
>> users_at_[hidden]
> --
> Jeff Squyres
> jsquyres_at_[hidden]
> _______________________________________________
> users mailing list
> users_at_[hidden]