1

I just do not know the command to run multiple processes using GDB. The following does not work.

r -np 64 ./a.out -gdb

Sorry this may seem quite simple. But I did not find much useful document about debugging in MPI using gdb from the Internet.

Taitai
  • 584
  • 2
  • 7
  • 18
  • What is "r"? You need to use mpirun/mpiexec with most implementations. Try reading the OpenMPI FAQ entry on GDB. – Jeff Hammond Dec 28 '15 at 04:52
  • Possible duplicate of [How do I debug an MPI program?](http://stackoverflow.com/questions/329259/how-do-i-debug-an-mpi-program) – Wesley Bland Jan 05 '16 at 02:32

1 Answers1

6

As stated in the OpenMPI documentation, you can start xterm through mpirun/mpiexec which then starts your program:

mpirun -np 64 xterm -e gdb ./a.out

This will open 64 windows, each containing a gdb session. As it will be quite cumbersome to enter run in each terminal, you could try

mpirun -np 64 xterm -e gdb ./a.out -ex run

However, I strongly recommend to reduce the number of processes used to, say, four.

Alexander Vogt
  • 17,879
  • 13
  • 52
  • 68