Log In | Users | Register
Edit | Attach | New | Raw | Diff | Print | | Tools
You are here: Data » DocTools » ToolsDbg » DbgTotalview

Totalview

Helps you debug your sequential and even parallel code. Here, the use of totalview at CSCS is shortly described with the example of the COSMO code. For further informaion see the Documentation at CSCS or the Totalview documentation.

First, make sure that your executable can be compiled with debugging options. For the PGI compiler suite, use options such as
-Kieee -O0 -C -g -gopt -Mbounds -Mchkfpstk -Ktrap=fp -traceback -Minform=inform to compile. Then follow the instructions for either sequenctial or parallel debuggin below...

Sequential

  1. Compile COSMO for the service nodes (pgf90 compiler) with debugging options (at least -g option). Ask osm how to do this if you don't know. Make sure that you have the netcdf module loaded. Make also sure that you use the src_output.f90 without optimizations by CSCS.
  2. Extend your LD_LIBRARY_PATH environment variable with the netcdf path, e.g.
    setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/apps/netcdf/4.0.1_sn/pgi_806_sn/lib
  3. Load the totalview module, e.g.
    module load totalview-support/1.0.6
  4. Start totalview
    totalview lm_f90
    Totalview opens two windows, stdout is displayed in your shell
  5. Hit the "GO" button to run your code.

Parallel

  1. Compile your code for the compute nodes (ftn compiler) with debugging options (at least -g option). Make sure that you have the netcdf module loaded.
  2. Load the xt-totalview module, e.g.
    module load xt-totalview/8.9.2
  3. Start an interactive session on the machine with
    salloc --ntasks=8 --time=00:15:00
    adjust the number of cores and the needed walltime according to your needs. Be sure that you do not use too much resources, since the machine is blocked during your debugging session !!
  4. Adapt the namelists INPUT_ORG (nprocx, nprocy, nprocio) and INPUT_DYN (rlwidth) accordingly to the number of processors specified above (mppwidth=8)
  5. Go to your working directory:
    cd $SLURM_SUBMIT_DIR
  6. Remove the YU* files
    rm -f YU*
  7. Start totalview using
    totalview aprun -a -n 8 ./lm_f90
    adjust the number of cores according to the settings in your qsub command. Totalview opens two windows, stdout is displayed in your shell
  8. Hit the "GO" button to start the code.

-- DanielLeuenberger - 2010-01-22 spacer

This site is managed by the Center for Climate Systems Modeling (C2SM).
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors. Ideas, requests, problems? Send feedback!