[Pooma Logo]


Profiling API

  • TAU_PROFILE(char *func_name, char *type_info, uint profile_group);
    Inserted in each function that is to be profiled. e.g.,
    	TAU_PROFILE("main()", "int (int, char **)", TAU_DEFAULT);
    
  • TAU_TYPE_STRING(string_varname, string& str);
  • TAU_PROFILE(char *func_name, string_varname, uint profile_group);
  • CT(object);
    For profiling templated member functions. Use CT to find the runtime type info of an object. Construct a string and pass the unique string as type parameter to TAU_PROFILE.
    
    	// member template of a class template
    	template < class Dim>
    	T SetDataTemplMem (Dim dimen, T dat) {
    
    	  TAU_TYPE_STRING(p1, CT(Data) + " (" + CT(dimen) + ", " + CT(dat) + ")");
      	  // produces a string like "int (int, double)" at runtime
    	  TAU_PROFILE("TemplClass::SetDataTemplMem()", p1, TAU_USER2);
    
    	  Data = dat * dimen;
    	  return Data;
     	}
    
  • TAU_PROFILE_TIMER(var, name, type, group);
  • TAU_PROFILE_START(var);
  • TAU_PROFILE_STOP(var);
    To start and stop a timer. To time one or more statements in the code.
     TAU_PROFILE_TIMER(timer1,"main-loop1", "int (int, char **)", TAU_USER);
    	...
    	  TAU_PROFILE_START(timer1);
    	  for(i=0; i < N; i++)  { // loop1 profiled using timer1 var }
    	  TAU_PROFILE_STOP(timer1);
    
  • TAU_REGISTER_EVENT(varname, char * event_name);
    Registers a user defined event and varname is used subsequently to refer to this event.
  • TAU_EVENT(varname, double value);
    Associates 'value' with the event varname registered earlier. When the event is triggered with the value, it is stored and later numsamples, max, min, mean and std. dev. of the value is calculated. This is threadsafe.
  • TAU_REPORT_STATISTICS();
    Prints out the aggregate statistics of user events across all threads in each node. Typically this should be called just before the main thread exits.
  • TAU_REPORT_THREAD_STATISTICS();
    Prints out the aggregate as well as per thread user event statistics. Typically, this should be called just before the main thread exits.
  • TAU_PROFILE_STMT(stmt);
    To declare a variable that is used only during profiling.
  • TAU_REGISTER_THREAD();
    To register a thread. This routine should be invoked in the run method of the thread prior to executing any profiling code. It sets up thread ids that are later used by the profiling system.
  • TAU_PROFILE_INIT(argc, argv);
  • TAU_PROFILE_SET_NODE(myNode);
  • TAU_PROFILE_SET_CONTEXT(myContext);
    To initialize profile groups and to set the current node id and context ids respectively.
  • TAU_PROFILE_EXIT(const char *message);
    To abort the program, and dump profiling data to disk.
  • TAU_TRACE_SENDMSG(type, destination, length);
  • TAU_TRACE_RECVMSG(type, source, length);
    For tracing send and receive calls.