- Infos im HLRS Wiki sind nicht rechtsverbindlich und ohne Gewähr -
- Information contained in the HLRS Wiki is not legally binding and HLRS is not responsible for any damages that might result from its use -
GDB: Difference between revisions
(Add description how to obtain MPI program crash backtraces) |
|||
(One intermediate revision by the same user not shown) | |||
Line 32: | Line 32: | ||
To get a backtrace of a crashing program start it via gdb as follows: | To get a backtrace of a crashing program start it via gdb as follows: | ||
{{Command|command=mpirun -n 2 gdb -batch -ex "run" -ex "bt" <program>}} | {{Command|command=mpirun -n 2 gdb -batch -ex "run" -ex "bt" <program>}} | ||
{{Note|text=To get the rank of the crashing process for Open MPI the <tt>--tag-output<tt> option can be used.}} | |||
=== HAWK/MPT special === | |||
To use gdb with [[MPT]] on HAWK one has to run with <tt>MPI_SHEPHERD=true<tt> and provide the absolute path to gdb: | |||
{{Command|command=MPI_SHEPHERD=true mpirun -n 2 $(which gdb) <program>}} | |||
== See also == | == See also == |
Latest revision as of 14:24, 1 April 2022
GDB is the debugger of the GNU Project |
|
The GNU debugger (GDB) can be used to inspect problems in programs. It allows to trace and alter the execution of running programs as well as to create and inspect coredumps.
Usage
The gdb debugger is available on HLRS systems without the need to load a module.
Obtaining coredumps of crashing programs
GDB can be used to obtain a coredump of a program crash. To do so start gdb with the program and its arguments
Then start program execution and run until it crashes. When the program crashed save a corefile of the crashed process via the generate-core-file command - optionally providing an output file name:
(gdb) generate-core-file [file]
Obtaining a backtrace of a crashing MPI program
To get a backtrace of a crashing program start it via gdb as follows:
HAWK/MPT special
To use gdb with MPT on HAWK one has to run with MPI_SHEPHERD=true and provide the absolute path to gdb: