HelloWorld MPI: PGDBG shows only one process.

Hi,

I just installed PGI Fortran (11.10) in my Ubuntu 10.04 workstation, but I’m having trouble with the debugger.

The program in question is just a simple hello world:

program hello
include ‘mpif.h’
integer ierr, myproc
call mpi_init(ierr)
call mpi_comm_rank(MPI_COMM_WORLD, myproc, ierr)
print *, “Hello world! I’m node”, myproc
call mpi_finalize(ierr)
end

I compile it with:
pgf90 -Mmpi=mpich1 -o test -g test.f90

which gives no trouble and then I can run it OK outside the debugger:
$ mpirun -np 4 ./test
Hello world! I’m node 0
Hello world! I’m node 2
Hello world! I’m node 3
Hello world! I’m node 1

But if I try to run it with the debugger:
mpirun -np 4 -dbg=pgdbg ./test

I get the following in the Command window of the debugger, with the ERRORS at the end.

=========================
PGDBG 11.10-0 x86-64 (Workstation, 16 Process)
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2011, STMicroelectronics, Inc. All Rights Reserved.
Loaded: /home/angelv/Dropbox/ProgrammingGym/PPMPI/ppmpi_f/chap03/./test


pgdbg> ignore 10
Ignore signal SIGUSR1(10)

pgdbg> break main
(1)breakpoint set at: hello line: “test.f90”@4 address: 0x407406
1
pgdbg> run -p4pg /home/angelv/Dropbox/ProgrammingGym/PPMPI/ppmpi_f/chap03/PI20788 -p4wd /home/angelv/Dropbox/ProgrammingGym/PPMPI/ppmpi_f/chap03 -mpichtv
libpthread.so.0 loaded by ld-linux-x86-64.so.2.
librt.so.1 loaded by ld-linux-x86-64.so.2.
libm.so.6 loaded by ld-linux-x86-64.so.2.
libc.so.6 loaded by ld-linux-x86-64.so.2.
Breakpoint at 0x407406, function hello, file test.f90, line 4
#4: call mpi_init(ierr)

pgdbg> libnss_files.so.2 loaded by ld-linux-x86-64.so.2.
libnss_mdns4_minimal.so.2 loaded by ld-linux-x86-64.so.2.
libnss_dns.so.2 loaded by ld-linux-x86-64.so.2.
libresolv.so.2 loaded by ld-linux-x86-64.so.2.
libnss_compat.so.2 loaded by ld-linux-x86-64.so.2.
libnsl.so.1 loaded by ld-linux-x86-64.so.2.
libnss_nis.so.2 loaded by ld-linux-x86-64.so.2.
ERROR: New Process (PID 21688, HOST carro) ATTACH FAILED.
ERROR: New Process (PID 21688, HOST carro) IGNORED.
ERROR: Cannot read value at address 0x9E7300.
ERROR: Cannot read value at address 0x9E7308.
ERROR: Cannot read value at address 0x9E7310.
ERROR: New Process (PID 0, HOST unknown) IGNORED.
ERROR: Cannot read value at address 0x9E7318.
ERROR: Cannot read value at address 0x9E7320.
ERROR: Cannot read value at address 0x9E7328.
ERROR: New Process (PID 0, HOST unknown) IGNORED.
ERROR: Cannot read value at address 0x69EA08.
ERROR: Thread Running. Ignoring cont.
ERROR: Ignoring cont.



Has anybody encountered this? Any solutions?

Thanks a lot,
Ángel de Vicente

Sorry, it is Ubuntu 11.04 (x86_64)

Thanks,
Ángel

I have been experimenting with your test case here at PGI, and I have found that although it works on older systems, it fails on Ubuntu 11.10. We don’t have a workaround at this time. I have submitted a problem report and a fix should appear in an early 2012 release. It is probably too late for a fix in the upcoming 12.1.

Thanks for the report, and sorry this is not working for you.
–Don

I found that, as it turns out, the issue was related to a Ubuntu feature: https://wiki.ubuntu.com/Security/Features#ptrace

Disabling it temporarily
sudo sysctl -w kernel.yama.ptrace_scope=0

makes the program run without trouble with PGDBG.

Cheers,
Ángel de Vicente