GettingStarted

From Tau Wiki
Revision as of 19:05, 21 September 2007 by Scottb (talk | contribs) (Getting started with TAU)
Jump to: navigation, search

Getting started with TAU

This is a short guide to using TAU. Download both PDT and TAU.

%> tar -xzf pdtoolkit-3.11
%> cd pdtoolkit
%> ./configure
%> make all install
%> cd ..
%> tar -xzf tau2.16.5
%> cd tau2

Before configuring TAU we need to decide which MPI implementation we have and to insure that TAU is build with the same compiler, if for example your MPI was compiled with Intel, type: (for different compiler change the -cc=, -c++= and fortran= options.)

%> ./configure -pdt=[PDT directory] -mpiinc=[MPI include] -mpilib=[MPI library] \
   -cc=icc -c++=icpc -fortran=intel
%> make clean install

This a basic configuration of TAU, there are many more options. TAU executables are placed in a directory based on your platform like x86_64 (replace this with your own platform). Let us add the bin directory to our path.

%> export PATH=[path to tau2]/tau2/x86_64/bin:$PATH

We can use TAU's compiler scripts (tau_cc.sh, tau_cxx.sh, and tau_f90.sh) to build our application. These scripts automatically link-in TAU's instrumentation libraries as well as the MPI libraries. But first we need to tell TAU which instrumentation library to use, we do this by setting the TAU_MAKEFILE environment variable. If you would like to set some options you can use the TAU_OPTIONS environment variable.

Each Makefile is labeled with the options used when configuring TAU; for our example we want Makefile.tau-icpc-mpi-pdt.

%> export TAU_MAKEFILE=[path to tau2]/tau2/x86_64/lib/Makefile.tau-icpc-mpi-pdt
%> tau_cxx.sh -c foo.cpp -o foo.o
%> tau_cxx.sh foo.o -o foo
%> mpirun -np 4 ./foo

Afterwards we have successfully build and run our application we can view the performance data by using pprof:

%> pprof