OD IUM
OD IUM

Reputation: 1624

how to hold xterm during debugging an mpi program?

I run the debugger via

mpirun -n 4 xterm -e gdb -x commands.gdb ./my_mpi_programm

where the file "commands.gdb" just contains the commands

start
continue

The problem is that my 4 xterm immediately close before I get a chance to inspect the error message or do any debugging.

I'm using the latest ubuntu distribution. However, on my friend's old Suse-distribution, xterm is held open.

How can I force the xterms to stay?

EDIT: the "-hold" option doesnt work as well as mpirun -n 4 xterm -e "gdb -x commands.gdb ./my_mpi_programm;bash"

Upvotes: 0

Views: 629

Answers (2)

Ned Bingham
Ned Bingham

Reputation: 2769

Use the --continuous flag in mpirun:

mpirun -n 4 --continuous xterm -e gdb -x commands.gdb ./my_mpi_programm
mpirun (Open MPI) 4.1.2

Usage: mpirun [OPTION]...  [PROGRAM]...
Start the given program using Open RTE

   -continuous|--continuous 
                         Job is to run until explicitly terminated

Upvotes: 0

Employed Russian
Employed Russian

Reputation: 213829

Try

mpirun -n 4 xterm -e bash -c 'gdb -x commands.gdb ./my_mpi_programm; sleep 60'

Upvotes: 1

Related Questions