debug_quickstart

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
debug_quickstart [2013/09/24 11:45]
ulges
debug_quickstart [2013/10/02 10:44] (current)
ulges [Quick start - Debugging MPI programs on Mogon]
Line 1: Line 1:
-====== Quick startDebugging MPI programs on Mogon ======+====== Quick start Debugging MPI programs on Mogon ======
 This is a greatly shortened version of how to use our debug wrapper [[selective-debug|selective-debug]].\\ This is a greatly shortened version of how to use our debug wrapper [[selective-debug|selective-debug]].\\
-If you aren't familiar with the basics of using a debugger like gdb, you should follow our "[[debug_tutorial|Tutorial: Debugging MPI programs at Mogon]]".+If you aren't familiar with the basics of using a debugger like [[http://en.wikipedia.org/wiki/Gdb|gdb]], you should follow our [[debug_tutorial|Tutorial: Debugging MPI programs at Mogon]]
 + 
 +===== How to use "selective-debug" with gdb ===== 
 +This is the procedure for debugging //one// node from the amount of nodes you've chosen for running your program.\\  
 +If you want to debug multiple nodes, you should read the section "[[debug_tutorial#debugging_multiple_nodes_at_once|Debugging multiple nodes at once]]" of our tutorial.\\ 
 +In this tutorial you can also find information about how you can use the other debugging utilities ''[[http://en.wikipedia.org/wiki/Ltrace|ltrace]]'' and ''[[http://en.wikipedia.org/wiki/Strace|strace]]''\\ \\
  
-===== How to use ===== 
  
   - Make the libraries available which are needed for compilation and execution, e.g. <code bash>$ module purge    - Make the libraries available which are needed for compilation and execution, e.g. <code bash>$ module purge 
 $ module add gcc/4.7.0  $ module add gcc/4.7.0 
 $ module add mpi/openmpi/1.6.1/gcc_4.7.0</code> $ module add mpi/openmpi/1.6.1/gcc_4.7.0</code>
-  - Modify your program by including the “[[selective-debug|selective-debug]]” ((In case "selective-debug" is not available in your $PATH environment, you can view and download the current version here.)) wrapper and use the **BREAKPOINT_AND_SLEEP()** macro to halt where appropriate. <code c>#include “selective-debug.h”+  - Modify your program by including the “[[selective-debug|selective-debug]]” ((In case "selective-debug" is not available in your $PATH environment, you can view and download the current version [[selective-debug|here]].)) wrapper and use the **BREAKPOINT_AND_SLEEP()** macro to halt where appropriate. <code c>#include “selective-debug.h”
    
 if(my_rank == <rank on which the problem exists>) { if(my_rank == <rank on which the problem exists>) {
  BREAKPOINT_AND_SLEEP(10); //delay of 10 seconds, allowing gdb to start up and halt the program  BREAKPOINT_AND_SLEEP(10); //delay of 10 seconds, allowing gdb to start up and halt the program
 }</code> }</code>
-  - Compile your program with the switch **''-g''** ((Generate debugging information. This information is stored in the object file and copied from there to the final executable file by the linker, where it can be read by the debugger. You must use the -g switch if you plan on using the debugger.)), e.g. <code bash>$ mpicc <your program> -g -o <executable program></code> +  - Compile your program with the switch **''-g''** ((Generates debugging information. This information is stored in the object file and copied from there to the final executable file by the linker, where it can be read by the debugger. You must use the -g switch if you plan on using the debugger.)), e.g. <code bash>$ mpicc <your program> -g -o <executable program></code> 
-  - Enqueue your job. E.g. <code bash>bsub -I -n <amount of processes> -q short -a openmpi mpirun ./selective-debug <your program></code>+  - Enqueue your job to LSF by adding your program as a parameter of "[[selective-debug|selective-debug]]". E.g. <code bash>bsub -I -n <amount of processes> -q short -a openmpi mpirun ./selective-debug <your program></code>
  • debug_quickstart.1380015916.txt.gz
  • Last modified: 2013/09/24 11:45
  • by ulges