DDT Debugging Guide
Debugging with DDT
DDT is a symbolic, parallel debugger that allows graphical debugging of MPI, OpenMP, and Pthreads applications.
Code Preparation
Before running with any debugger, go to your application directory and re-compile your code with the '-g' and '-O0' options. For example:
login1% mpif90 -g -O0 debug_code.f90
System Preparation
On Ranger, Lonestar, or Longhorn, please follow these steps to set up your environment:
-
You will need X11 to use the DDT gui. Please ensure that X11 forwarding is enabled when you ssh to the TACC system. Use the '
-X' option on the ssh command line if X11 forwarding is not enabled in your ssh client by default. For example, here is the command to login to Ranger from a UNIX/Linux system with X11 forwarding enabled:login1% ssh -X ranger.tacc.utexas.edu
-
While logged in, load the ddt module file as follows:
login1% module load ddt
Configuring DDT
-
With the DDT module loaded in addition to all other modules needed to run your program (a.out in the example below), start the DDT debugger as follows:
login1% ddt ./a.out
If this error message appears:
ddt: cannot connect to X server
you may not have logged in with X11 forwarding enabled or your system may not have local X11 support. If logging in with the '
-X' flag doesn't fix the problem, please contact the help desk for assistance. - Click the "Run and Debug a Program" button in the "DDT - Welcome" window.
- This displays the "DDT-Run" window, where you specify the executable path, command-line arguments, and processor count. Once set, they remain from one session to the next.
- Select each of the "Change" buttons in this window, and adjust the job parameters, as follows:
- For the "Options" change button, set the MPI Implementation to either "mvapich 1", "mvapich 2", or "openmpi", depending on which MPI software stack you used to compile your program. Click OK.
- For the "Queue Submission Parameters" window, fill in the following fields:
Queue default queue is 'development' queue Time (hh:mm:ss) Project Allocation to charge the batch job to Cores per node Actually, this is MPI tasks/node You must set the Project field to a valid project id. When you login, a list of the projects associated with your account and the corresponding balance should appear. The "Cores per node" setting controls how many MPI tasks will run on each node. For example, if you wanted to run with 4 MPI tasks per node and 4 OpenMP threads per task, this would be set to "4way". Click OK, and you will return to the "DDT-Run" window.
- For the "Options" change button, set the MPI Implementation to either "mvapich 1", "mvapich 2", or "openmpi", depending on which MPI software stack you used to compile your program. Click OK.
- Back in the "DDT-Run" window, set the number of tasks you will need in the "Number of processes" box. If you are debugging an OpenMP program, set the number of OpenMP threads also.
- Finally, click "Submit". A "DDT-Job Submitted" status box will appear.
Running DDT
When your job is launched by the SGE scheduler, the DDT GUI will fill up with a code listing, stack trace, local variables and a project file list. Double click on line numbers to set break points, and then click on the play symbol (>) in the upper left corner to start the run.
When running DDT, the user guide is available under the "Help" menu item