Pittsburgh Supercomputing Center 

Advancing the state-of-the-art in high-performance computing, communications and informatics.

The TAU Portable Profiling Package

TAU (Tuning and Analysis Utilities) is a powerful, portable profiling and tracing tool. It can be used for performance analysis of parallel applications written in Fortran, C, C++, Java, and Python and is supported on almost all platforms.

TAU is capable of instrumenting a code automatically, manually, or at runtime. PSC's current version of TAU is configured with PAPI for hardware performance counters data. It can be configured with different options or tools such as KOJAK, SCALASCA to enhance capabilities such as generating tracing data or to instrument pthread and OpenMP threads codes.

Contact PSC User Services with questions or to request other TAU configurations.

There are three steps involved in using TAU: 1) instrument your code; 2) run the code in parallel; and 3) view the TAU profiling report.

Installed on: blacklight.

Usage

It is good practice to test your code to be sure it compiles and runs before adding TAU profiling. Once it does, you are ready to instrument the code.

  1. Instrument your code
      1. Load the TAU module. This will define some environment variables for you. To see what versions are available, type
        module avail tau
        Loading the latest version is recommended.
        To load the module you want, type:
        module load tau
        Type
        module show tau
        to show the variables that have been defined.

    See more about the module command.

    1. Decide what profiling option you want and select the appropriate Makefile stub for the options you want.

      On blacklight, the Makefiles are in $TAU_ROOT_DIR/x86_64/lib.

      The name of the Makefile stub indicates the situations where it should be used. For an openmp code, choose a Makefile which includes at least 'opari' and 'openmp' in the filename.

      For example:

      $TAU_ROOT_DIR/x86_64/lib/Makefile.tau-icpc-papi-mpi-pdt
         Use this Makefile stub for profiling MPI code using the Intel compilers and generating papi counters.

      $TAU_ROOT_DIR/x86_64/lib/Makefile.tau-icpc-pdt-openmp-opari
         Use this Makefile stub for automatic instrumentation of pure OpenMP code.

    2. Choose which (if any) compiler options to use. Type tau_compiler.sh --help to see the available options. For example:
          -optVerbose for verbose compilation.
         -optKeepFiles to keep the instrumented files after compilation
    3. Define the Makefile, define any compiler options, and compile your code. Exactly how to do this depends on whether or not you use a makefile to compile.

      If you use your own makefile for compilation, follow the next 2 steps:

      1. Edit your makefile and include the TAU defined Makefile at the top of yours. Precede the compiler and loader lines with TAU_COMPILER and TAU_OPTIONS.
        .....
        include TAU_MAKEFILE  $TAU_ROOT_DIR/x86_64/lib/selected_makefile
        ..
        TAU_OPTIONS = -optKeepFiles -optVerbose
        ..
        CCFLAGS=$(TAU_OPTIONS) -O3
        CCLFLAGS=$(CCFLAGS)
        CC= $(TAU_COMPILER) icc
        ..
        foo:foo.o
           $(CC)$(CCFLAGS) -o foo foo.o
        foo.o: foo.c
           $(CC) $(CCFLAGS) -c foo.
        clean:
           rm *.o foo *.inst.* *.pdb
        ....
      2. Compile your program.

      If you do not use your own makefile for compilation, follow the next three steps:

    4. Define TAU_MAKEFILE, depending on the shell you use:
      setenv TAU_MAKEFILE $TAU_ROOT_DIR/x86_64/lib/selected_makefile
      or
      export TAU_MAKEFILE=$TAU_ROOT_DIR/x86_64/lib/selected_makefile
    5. Set TAU_OPTIONS to be any desired compiler options, depending on your shell, e.g.:
      setenv TAU_OPTIONS '-optKeepFiles -optVerbose'
      or
      export TAU_OPTIONS='-optKeepFiles -optVerbose'
    6. Compile using one of tau_cc.sh, tau_cxx.sh, or tau_f90.sh
      tau_f90.sh -o foo foo.f


Run the code in parallel

Once the program compiles, create a batch script. This script should execute your code in parallel. For example, use mpirun for an MPI program.

Be sure to define OMP_NUM_THREADS for an openmp code.

Successful execution will produce profile.x.x.x.x files, where x is a numeral.

Submit the batch script using the qsub command.

View the profiling report

When the batch job has finished, view the TAU report. This can be done interactively. Load the TAU module (as above) and then launch either pprof or paraprof from the directory that contains the profile.x.x.x.x files.

For a text report, use pprof. To see the available options, type pprof -h .

To see a graphical report, use paraprof. Type paraprof -h for the available options.

X Authentication    Note that the recommended approach for obtaining the cookies required for xauth authentication is to log in to the remote machine using ssh -X or ssh -X -Y.

Stay Connected

Stay Connected with PSC!

facebook 32 twitter 32 google-Plus-icon