C-SAFE logo

 Home Summary People Teams Highlights Publications Collaborators Team Tools

  Back to Team Tools Page

Profiling sus with TAU

The current TAU installation will give you profiling information for EVERY function instead of every task. If this is too overwhelming let us know.

Step 1:

First, you need to have a valid TAU build for the architecture that you are running sus on.

Here are the locations of the latest TAU builds:

Linux:

/usr/sci/projects/Uintah/Thirdparty/1.0.0/Linux/gcc-3.2-lam-32bit/tau-2.14.6

SGI:

/usr/sci/projects/Uintah/Thirdparty/1.0.0/IRIX64/MIPSpro-7.3.1.1m-64bit/tau-2.12.9.1

Step 2:

Now you have to pick one of the TAU makefiles to use. I have made bold the TAU makefiles which use the simplest features.

Linux:

<Linux TAU dir>/i386_linux/lib/Makefile.tau-mpi-pdt
<Linux TAU dir>/i386_linux/lib/Makefile.tau-mpi-pdt-trace
<Linux TAU dir>/i386_linux/lib/Makefile.tau-linuxtimers-mpi-pdt
<Linux TAU dir>/i386_linux/lib/Makefile.tau-linuxtimers-mpi-pdt-trace
<Linux TAU dir>/i386_linux/lib/Makefile.tau-callpath-mpi-pdt
<Linux TAU dir>/i386_linux/lib/Makefile.tau-callpath-linuxtimers-mpi-pdt

SGI:

<SGI TAU dir>/sgi64/lib/Makefile.tau-sgitimers-mpi-pdt
<SGI TAU dir>/sgi64/lib/Makefile.tau-sgitimers-mpi-pdt-trace
<SGI TAU dir>/sgi64/lib/Makefile.tau-callpath-sgitimers-mpi-pdt

Step 3:

Now add the following line to your configure line:

--with-tau=<full path to TAU makefile>

Linux TAU configure line to copy and paste.

SGI TAU configure line to copy and paste.

Step 4:

Now you should be able to configure with TAU turned on.

The TAU configure currently produces the following error messages which need to be fixed, but they don't seem to affect the ability to profile, so for now ignore them.

Linux:

../src/configure: line 1: with_tau: command not found
../src/configure: line 1: TAU_CXX: command not found
../src/configure: line 1: TAU_DEFS: command not found
../src/configure: line 1: TAU_INC_LUDE: command not found
../src/configure: line 1: TAU_SHLIBS: command not found
../src/configure: line 1: TAU_MPI_LIBS: command not found
../src/configure: line 16663: 1: command not found

SGI:

../src/configure[16665]: 2: not found

Step 5:

After building sus, you can now run sus as you normally would. After sus has finished, TAU will output some files that look like this:

dump.0.0.0
profile.0.0.0

You will get one copy of each of these files for each processor that your job was run on.

Step 6:

In order to get useful information from the above TAU files, you will need to use a TAU utility called pprof. Here is it's location:

Linux:

<Linux TAU dir>/i386_linux/bin/pprof

SGI:

<SGI TAU dir>/sgi64/bin/pprof

You run pprof from the directory that contains the TAU output files and it will generate the profiling information.

Here is it's usage:

usage: pprof [-c|-b|-m|-t|-e|-i|-v] [-r] [-s] [-n num]
             [-f filename] [-l] [-d] [node numbers]
 -c : Sort according to number of Calls 
 -b : Sort according to number of suBroutines called by a function 
 -m : Sort according to Milliseconds (exclusive time total)
 -t : Sort according to Total milliseconds (inclusive time total)  (default)
 -e : Sort according to Exclusive time per call (msec/call)
 -i : Sort according to Inclusive time per call (total msec/call)
 -v : Sort according to Standard Deviation (excl usec)
 -r : Reverse sorting order
 -s : print only Summary profile information 
 -n  : print only first  number of functions 
 -f filename : specify full path and Filename without node ids
 -l : List all functions and exit
 -d : Dump output format (for Racy) [node numbers]
    : prints only info about all contexts/threads of given node numbers
	    

For example, If I wanted to generate profiling information that was sorted in exclusive time total order and save it to a file called profile.txt, I would type the following from a directory which contained TAU output files:

pprof -m > profile.txt

Step 7:

If you are interested in getting more detailed profiling information for a single function, you can add TAU timers to that function. This is how they work:

First, make sure to include the tau header for SCIRun:

#include <TauProfilerForSCIRun.h>

Now declare one or more timers at the top of your function:

TAU_PROFILE_TIMER(<timer>, "<timer name>", "", TAU_USER)

You start and stop the timer around the section of code that you are interested in profiling:

TAU_PROFILE_START(<timer>, "<timer name>", "", TAU_USER)
/* code */
TAU_PROFILE_STOP(<timer>, "<timer name>", "", TAU_USER)

Here is an example:

#include <TauProfilerForSCIRun.h>

void foo()
{
  TAU_PROFILE_TIMER(looptimer, "foo: loop" , "", TAU_USER);
  TAU_PROFILE_TIMER(sendtimer, "foo: send" , "", TAU_USER);

  TAU_PROFILE_START(looptimer);
  for (int i = 0; i < 100; i++)
  { 
    /* do something */
  }
  TAU_PROFILE_STOP(looptimer);

  TAU_PROFILE_START(sendtimer);
    /* send results to someone */
  TAU_PROFILE_STOP(sendtimer);  
}
            

If you don't stop a timer that has started, you will get strange TAU profiles!


1495 E 100 S Room 109*Salt Lake City, UT 84112-1114*(801) 581-7631 *Copyright 2001 University of Utah. All rights reserved.
Site Feedback*Disclaimer