DDT Parallel Debugger

Using Linaro DDT Parallel Debugger, MAP profiler and Performance Reports

Introduction

 

DDT is a parallel debugger from Linaro. It has a graphical user interface and can be used for debugging Fortran, C, and C++ programs that have been parallelized with MPI and OpenMP, as well as UPC programs. Additional information can be found at https://www.linaroforge.com/about/

This company was formally known as Allinea, some references to Allinea may necessarily remain in this documentation.  Older versions of the software are available as allinea or arm modules ("module load allinea or module load arm" to use). In 2016 Allinea software was acquired by Arm, and in 2023 Linaro acquired Arm Forge.

MAP is a low-overhead profiler from Linaro for both scalar and MPI programs.

Both tools share a common environment.

In most cases it is much faster and easier to find an error in the code or the ways to optimize the performance using a debugger and a profiler than through the use of numerous print statements.

Note that even though DDT and MAP support GPU languages, such as HMPP, OpenMP Accelerators, CUDA and CUDA Fortran, we don't have a license to use DDT and MAP on the GPUs.

Linaro Performance Reports is a low-overhead tool that produces one-page text and HTML reports  summarizing and characterizing both scalar and MPI application performance. 

The Linaro DDT, MAP and Performance Reports user guides and  tutorials can be found at https://www.linaroforge.com/documentation/

Notes:

  • The program should run for a minimum of a few seconds in order for reports to be generated.

Starting DDT and MAP

First start an Interactive Desktop Session using OnDemand at Nova OnDemand and open a terminal.

  • To use DDT and MAP load arm module: 

    module load linaro
  • To provide debugger with the information about the program, the program should be compiled with a debug flag. For the compilers installed on Nova cluster, this is "-g". To start DDT type the following:

    	
    ddt [program_name [arguments] ]
    
  • The Linaro DDT and MAP User Guide explains in more details how to debug and profile programs. You can also use the following example to get acquainted with DDT.

Example

This example shows how to compile an MPI C program and to run it under DDT debugger on two compute nodes. The provided example does not have an error. After running it as explained below, try to introduce errors in the code (for example, declare array name to be of size 10) and run again.

  • Test with the following Hello World program:

    #include <mpi.h> 
    #include <stdio.h> 
    
    int main(int argc, char** argv) { 
    	MPI_Init(&argc, &argv);
    	int world_size; 
    	MPI_Comm_size(MPI_COMM_WORLD, &world_size); 
    	int world_rank;
    	MPI_Comm_rank(MPI_COMM_WORLD, &world_rank); 
    	printf("Hello World from rank %d out of %d processors\n", world_rank, world_size); 
    	MPI_Finalize(); 
    	return 0; 
    }
  • 	module load intel mpi
  • Compile the program using the debug compiler flag "-g":

    	mpiicc -g mpihello.c 
    
  • Start DDT debugger:

    	ddt &
    

    First a small windows saying "Linaro FORGE" will open, then it will be replaced by a larger window.

  • Click on RUN to run and debug a program.
  • In the application field enter the full path of the executable that you would like to debug.  You can also search for executable by clicking on the yellow folder button on the right of the application field.
  • Select checkboxes by "MPI" 

DDT Reference

The following is the list of important functions allowed by DDT:

  • Stepping through the program one statement at a time and displaying all variable values.
  • Running the program to a selected statement where a breakpoint has been set and then displaying variable values.
  • Stepping into and out from functions/subprograms.
  • Running a program and having the program stop execution where a problem occurs. Then one knows where the program stopped execution and values of variables at that point.
  • Stepping can be done with all MPI processes stepping together or selected MPI processes stepping independently.

The following summarizes the most useful items from the toolbars at the top of the DDT window:

  • File: restart and exit sessions, configure DDT
  • Edit/Go to Line: allows one to easily go to any line of the program displayed in the middle window and to search for strings.
  • Window: allows one turn on and off viewing of various items.
  • Help: allows one to view and print the DDT User Guide and displays a FAQ.
  • Control/Focus on current: Allows one to select group, process or thread for stepping through the program.
  • Play: starts program execution from where it was stopped and runs to the next breakpoint or until the program stops.
  • Pause: pauses program execution on all MPI processes.
  • Step Into: execution proceeds into the function/subroutine if stopped at a function or subroutine; otherwise, execution continues to the next statement.
  • Step Over: execution continues to the next statement and not into a function/subroutine.
  • Step Out: allows one to step out from a function/subroutine.

Values of local variables are displayed in the right center window for the MPI process selected for the place where execution has stopped. Multi-dimensional array values can be viewed by selecting Multi-Dimensional Array Viewer listed under View.