PETSC debugger

Ryan Yan vyan2000 at gmail.com
Mon Jul 20 12:50:21 CDT 2009


Hi Jed,
My X server set up may be messed up somehow. Same error as before.

After I creat a new session using,
vyan2000 at vyan2000-linux:~/local/PPETSc/petsc-2.3.3-p15/src/ksp/ksp/examples/tutorials/ttt2$
screen -S sdebug

Still errors.

vyan2000 at vyan2000-linux:~/local/PPETSc/petsc-2.3.3-p15/src/ksp/ksp/examples/tutorials/ttt2$
mpirun -n 4 ./rpisolve -start_in_debugger -debug_terminal "screen -S sdebug
-X screen"
[0]PETSC ERROR: PETSC: Attaching gdb to ./rpisolve on pid 9758 on
vyan2000-linux
[1]PETSC ERROR: PETSC: Attaching gdb to ./rpisolve on pid 9755 on
vyan2000-linux
[3]PETSC ERROR: PETSC: Attaching gdb to ./rpisolve on pid 9757 on
vyan2000-linux
[2]PETSC ERROR: PETSC: Attaching gdb to ./rpisolve on pid 9756 on
vyan2000-linux

The number of the screen for gdb is not equal to the number of
processes.(Mostly, less than), as you can see in the following "bottom
margin" of my screen session.

vyan2000-linux | 0.11 0.09 0.08 | 07-20 13:46 |0-$ shell  1$ gdb  2$ gdb
3$* gdb

And I use backtrace as the first command in the survived gdb session, I
get:

Loaded symbols for /usr/lib/libX11.so.6
Reading symbols from /usr/lib/libstdc++.so.6...done.
Loaded symbols for /usr/lib/libstdc++.so.6
Reading symbols from /usr/lib/liblapack.so.3gf...done.
Loaded symbols for /usr/lib/liblapack.so.3gf
Reading symbols from /usr/lib/libblas.so.3gf...done.
Loaded symbols for /usr/lib/libblas.so.3gf
Reading symbols from /lib/tls/i686/cmov/libdl.so.2...done.
Loaded symbols for /lib/tls/i686/cmov/libdl.so.2
Reading symbols from /lib/tls/i686/cmov/libpthread.so.0...done.
[Thread debugging using libthread_db enabled]
[New Thread 0xb739c6c0 (LWP 10213)]
Loaded symbols for /lib/tls/i686/cmov/libpthread.so.0
Reading symbols from /lib/tls/i686/cmov/librt.so.1...done.
Loaded symbols for /lib/tls/i686/cmov/librt.so.1
Reading symbols from /lib/libgcc_s.so.1...done.
Loaded symbols for /lib/libgcc_s.so.1
Reading symbols from /usr/lib/libgfortran.so.2...done.
Loaded symbols for /usr/lib/libgfortran.so.2
Reading symbols from /lib/tls/i686/cmov/libm.so.6...done.
Loaded symbols for /lib/tls/i686/cmov/libm.so.6
Reading symbols from /lib/tls/i686/cmov/libc.so.6...done.
Loaded symbols for /lib/tls/i686/cmov/libc.so.6
Reading symbols from /usr/lib/libxcb-xlib.so.0...done.
Loaded symbols for /usr/lib/libxcb-xlib.so.0
Reading symbols from /usr/lib/libxcb.so.1...done.
Loaded symbols for /usr/lib/libxcb.so.1
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /usr/lib/libXau.so.6...done.
Loaded symbols for /usr/lib/libXau.so.6
Reading symbols from /usr/lib/libXdmcp.so.6...done.
Loaded symbols for /usr/lib/libXdmcp.so.6
Reading symbols from /lib/tls/i686/cmov/libnss_compat.so.2...done.
Loaded symbols for /lib/tls/i686/cmov/libnss_compat.so.2
Reading symbols from /lib/tls/i686/cmov/libnsl.so.1...done.
Loaded symbols for /lib/tls/i686/cmov/libnsl.so.1
Reading symbols from /lib/tls/i686/cmov/libnss_nis.so.2...done.
Loaded symbols for /lib/tls/i686/cmov/libnss_nis.so.2
Reading symbols from /lib/tls/i686/cmov/libnss_files.so.2...done.
Loaded symbols for /lib/tls/i686/cmov/libnss_files.so.2
0xb7f5b410 in __kernel_vsyscall ()
(gdb) backtrace
#0  0xb7f5b410 in __kernel_vsyscall ()
#1  0xb7456c90 in nanosleep () from /lib/tls/i686/cmov/libc.so.6
#2  0xb7456ac7 in sleep () from /lib/tls/i686/cmov/libc.so.6
#3  0x085cd836 in PetscSleep (s=10) at psleep.c:40
#4  0x0860976f in PetscAttachDebugger () at adebug.c:412
#5  0x085b87ee in PetscOptionsCheckInitial_Private () at init.c:378
#6  0x085bd223 in PetscInitialize (argc=0xbfacffe0, args=0xbfacffe4,
file=0x0,
    help=0x89cbac0 "output the matrix A, rhs b.\n   exact solution x : check
\n", ' ' <repeats 21 times>, "\n\n") at pinit.c:573
#7  0x0804bf43 in main (argc=9, args=0x3a0001c6) at rpisolve.c:71

I have no idea how to debug this.

Yan




On Mon, Jul 20, 2009 at 5:47 AM, Jed Brown <jed at 59a2.org> wrote:

> Ryan Yan wrote:
> > Only debugging one processes is a way to go for my current bug(s).
>
> There is another option for debugging multiple processes using screen
> instead of X.  For the sake of cleanliness, start a new terminal and
> open a special screen session for debugging
>
> $ screen -S sdebug
>
> Now in your original terminal, run the program like
>
> $ mpirun -n 4 ./myapp -start_in_debugger -debug_terminal "screen -S sdebug
> -X screen"
>
> (the quotes are important)
>
> This opens four new windows within the screen session named "sdebug".
>
>
> Recent versions of MPICH2 have a -gdb option which is a lightweight skin
> for gdb that sends commands to all processes and collates the results,
> but also allows you to drop to per-process debugging.  I had trouble
> with it prior to release 1.1.
>
>
> Jed
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20090720/eb10fbcf/attachment.htm>


More information about the petsc-users mailing list