vtf-logo

Timing Class Reference

A timing and profiling class. More...

#include <Timing.h>

List of all members.

Public Types

enum  TimingAccounts
 Definition of all available timing accounts. More...
enum  CountingAccounts
 Definition of all available counting accounts. More...

Public Member Functions

void count (enum CountingAccounts account, int i=1)
 Counting frequency of certain events.
void start_timing ()
 Function to be called first, initializing the timers.
void start ()
 Enter a new timer frame.
void stop (enum TimingAccounts account)
 Leave timer frame.
void collect_timing (MPI_Comm Comm, enum TimingAccounts ac, double *stat_times)
 collect specific timing data of all nodes
void collect_timing (MPI_Comm Comm)
 collect timing data of all nodes
void print_timing (std::ostream &os)
 report generator

Static Public Member Functions

static void collect (MPI_Comm Comm)
 compatibility function for calling report generator.

Protected Member Functions

template<typename T>
calcsum (typename std::vector< T > &data, int start, int end, T sum)
 calculate sum over values of an array.
void pl (std::ostream &OS, char *name, enum TimingAccounts ac, bool opt=false)
 generate one report line.

Protected Attributes

bool print_local_times
 statistics


Detailed Description

A timing and profiling class.

The times are added to accounts. Use start() to enter a new frame and stop(account) to leave it, adding spent time to the account and go back to the previous frame (therefore recursion is allowed). The MISC account is used starting and stopping the overall timing process and WHOLE is used for storing the summed up total runtime.


Member Enumeration Documentation

Definition of all available counting accounts.

_CCMAX is used internally and must not be used as account.

Definition of all available timing accounts.

_ACMAX is used internally and must not be used as account.


Member Function Documentation

template<typename T>
T Timing::calcsum ( typename std::vector< T > &  data,
int  start,
int  end,
sum 
) [inline, protected]

calculate sum over values of an array.

The sum is calculated from account start till end (including).

void Timing::count ( enum CountingAccounts  account,
int  i = 1 
) [inline]

Counting frequency of certain events.

Parameters:
account where to count
i frequency to add. Can be negative too. (default=1)

void Timing::print_timing ( std::ostream &  os  )  [inline]

report generator

Parameters:
os the output stream to write the report to

void Timing::stop ( enum TimingAccounts  account  )  [inline]

Leave timer frame.

Parameters:
account where to add elapsed time


The documentation for this class was generated from the following file:
Generated on Fri Aug 24 13:00:29 2007 for AMROC's Hierachical Data Structures - by  doxygen 1.4.7