UC San Diego SearchMenu

Debugging on TSCC

The following describes a basic setup of a DDT debugging session. The procedure diverges between steps 9 & 10, where the option to start a job from the queue using the debugger or to attach to an already running process is presented.

Step-by-Step Tutorial

Follow this procedure to learn debugging on TSCC using DDT

  1. Login to TSCC with X11 forwarding turned on (-X option to ssh command)
  2. Run this command to set up your environment:

    module load ddt

    This is equivalent to putting this line in your .bash_profile file:

    export DDT_LICENSE_FILE=/opt/ddt/License.client

    and then running this command to reload the current shell environment:

    . ~/.bash_profile
  3. Make sure your code is compiled with optimization turned off by compiling with -O0 (that is capital letter "O" followed by number zero), and symbol table information enabled by compiling with the -g option
  4. Run this command to start the DDT client:

    /opt/ddt/bin/ddt
  5. To start a debugging session, from the "Session" menu select "New Session" and then "Run" from the submenu.
    Screenshot of New Session->Run menu selection
  6. In the "Run" window, enter the full path to the executable in the "Application" field and any command line arguments in the "Arguments" field.
    Screenshot of Application Path selection
  7. In the "Run" window, click the "Change" button to bring up the Options window. On the "System Settings" tab, select the proper "MPI Implementation", or select "generic" if you encounter a problem while debugging. Select "none" to debug a serial or non-mpi code.
    Screenshot of Options->System tab edit
  8. If you are running an interactive debugging job or plan to attach to a running job, specify a hosts file in the "Attach hosts file" field and add host names to that file, one line per host.
  9. To submit a job for debugging through the queue:
    1. Still in the "Options" window, click on the "Job Submission" tab.
      Screenshot of Options->Job Submission tab edit
    2. Check "Submit job through queue or configure own 'mpirun' command".
    3. To use the predefined template for a PBS (TORQUE) job, click browse (the folder icon) and select the /opt/ddt/templates/pbs.qtf file.
    4. In the "Submit command" field, enter qsub. Leave the "Regexp for job id" field blank. In the "Cancel command" field, enter qdel. In the "Display command" field, enter qstat.
    5. Check the "NUM_NODES_TAG and PROCS_PER_NODE" box, and enter "8" in the "PROC_PER_NODE_TAG" field (standard for the batch queue).
    6. Click on the "Edit Queue Submission Parameters..." button to bring up the "Queue Submission Parameters" window.
      Screenshot of Options->Queue Submission Parameters edit
    7. Enter the wall clock time limit (in HH:MM:SS format) and the queue name. If you are using mpi, enter the full path to mpirun.
    8. Click "OK" to return to the Options window, then click OK in the Options window to return to the Run window.
    9. In the Run window, select the number of nodes you want to allocate and the select the "Submit" button.
      Screenshot of Run->Number of Nodes edit
    10. Wait for the jobs to start...
      Screenshot of submitted job wait dialog
    11. Enjoy!
      Screenshot of running debug session
  10. To attach to a running job:
    1. from the "Session" menu, select "New session" and then "Attach" from the submenu.
    2. In the field "Filter for process names containing" enter the name of the executable (just the name is sufficient, do not enter the full path).
    3. Based on the the host names in the host file (see step 9), DDT will scan the specified hosts for processes with the given name and attempt to attach to them. If you have submitted a job to the queue, obtain the host list from (for example) checkjob <job number>.

Note:

You can download the DDT User Guide from the Allinea web site.