mwestphal
(Mathieu Westphal (Kitware))
December 12, 2019, 2:53pm
1
A simple yet very practical way to debug pvserver with mpi and gdb.
mpirun -np 4 xterm -e gdb ./bin/pvserver -ex 'run'
This will open 4 xterm windows, one for each process and start the pvserver inside gdb. You can then place breakpoints as needed.
This does not allows to create breakpoints on all instance with a single command, they need to be repeated.
You can then connect to the pvserver as usual.
5 Likes
jfausty
(Julien Fausty)
June 7, 2023, 2:03pm
2
A great tool for performing this kind of operation is tmpi
(GitHub - Azrael3000/tmpi: Run a parallel command inside a split tmux window ).
By prefixing your debug command with tmpi
as such:
tmpi 4 gdb ./bin/pvserver -ex 'run'
your parallel processes get attached to split tmux terminals and commands for controlling your debugger can be invoked on all processes at the same time.
I highly recommend it!
4 Likes
mwestphal
(Mathieu Westphal (Kitware))
April 11, 2025, 1:23pm
3
Side note: How to run gdb with a single server and run the other without it:
mpirun -bynode -np 1 xterm -e gdb ./bin/pvserver : -np 2 xterm -e ./bin/pvserver
1 Like