The National Institute for Computational Sciences

TAU

TAU

Tuning and Analysis Utilities, or TAU, is a performance analysis tool available from the University of Oregon. There are a number of procedures for instrumenting, tracing, and profiling code using TAU—one common method is illustrated here. For other methods, see the documentation on the TAU website. The local TAU software page.

  1. Load Modules: Type module load tau to load the TAU module. You can view results with the command line utility, pprof. If you prefer a graphical viewer, you may use paraprof, but you will first need to configure your SSH client to enable X11 forwarding. Also, Paraprof uses Java, so you will need to enter module load java-jre. If another java module, such as the Java Development Kit (module load java), is already loaded, you need not load both.
  2. TAU Makefiles: TAU accepts "TAU-Makefiles," which contain the parameters to be used. A generic makefile is generally chosen for you, you may want to use a more appropriate one. Sample TAU-Makefiles, may be found in the ${TAUROOT}/lib/ directory on Kraken. If you have very specific things you would like your profile to do, you may want to copy the most similar makefile in ${TAUROOT}/lib/ to your home director and edit that file to your liking.
  3. More Configuration: Set the path to your makefile in the environmental variable TAU_MAKEFILE. For example,
    % export TAU_MAKEFILE=${HOME}/mytau/tau_makefile
    If there are any options you would like to set (see tau_cc.sh --help (or corresponding script) or the web documentation for a list of options), this may be set by export TAU_OPTIONS="<your-options>".
  4. Now, to compile a single C source file, you could write tau_cc.sh <file.c>. For fortran, use tau_f90.sh. Thus, to profile a group of source files, edit your (make) Makefile to use the TAU wrapper rather than the standard wrapper. For instance, to compile a C program, you might replace CC = cc with CC = tau_cc.sh. Likewise, CC would be replaced with tau_cxx.sh, and ftn would be replaced with tau_f90.sh. When using tau_cxx.sh, you may see the error that SEEK_SET is defined twice. This error may be solved by defining the following:
    % tau_cxx.sh -DMPICH_IGNORE_CXX_SEEK test.cpp
  5. By default, TAU outputs a profile file for each thread. These will be saved to the current directory unless the PROFILEDIR environmental variable is set. For example, you might use the following organization:
    % mkdir ${HOME}/tauprofiles/<program>/<date>
    % export PROFILEDIR=${HOME}/tauprofiles/<program>/<date>
  6. To view your profile, navigate to the directory containing the output files (eg, profile.0.0.0) (if multiple counters are used, instead navigate to the directory containing the __Multi/ directories), and type paraprof. For a command line output, simply replace paraprof with pprof.