Timing Class Reference

A timing and profiling class. More...

#include <Timing.h>

List of all members.

Public Types

enum  TimingAccounts {
  WHOLE, MISC, INITIALIZATION, FLAGGING,
  CLUSTERING, GATHERCFL, OUTPUT, EXAMINE1,
  EXAMINE2, EXAMINE3, EXAMINE4, PARTITION_INIT,
  PARTITION_CALC, COMPOSING_WHOLE, COMPOSING_GLOBALLISTS_MERGE, COMPOSING_GDBCREATE,
  COMPOSING_COMMSERVERS, RECOMPOSING_WHOLE, RECOMPOSING_INTERPOLATION, RECOMPOSING_DATASYNC,
  RECOMPOSING_BOXARRAYCOMM, RECOMPOSING_GRIDBOXCOMM, RECOMPOSING_COMMSERVERS, RECOMPOSING_GLOBALLISTS_NESTING,
  RECOMPOSING_GLOBALLISTS_REFINE, RECOMPOSING_GLOBALLISTS_MERGE, RECOMPOSING_GLOBALLISTS_GFLISTS, RECOMPOSING_GDBCREATE,
  MEMORY_RESTART_CHECKPOINT, MEMORY_RESTART_WHOLE, MEMORY_RESTART_GDBCREATE, MEMORY_RESTART_COMMSERVERS,
  RESTART_CHECKPOINT, RESTART_WHOLE, RESTART_GDBCREATE, RESTART_COMMSERVERS,
  BOUNDARIES_SYNC, BOUNDARIES_INTERPOLATION, BOUNDARIES_EXTERNAL, INTEGRATION_MAIN,
  INTEGRATION_ESTIMATE, INTEGRATION_SHADOW, SOURCE_INTEGRATION, EX_INIT,
  EX_SSEND, EX_SRECV, GFSYNC_GETINFO, GFSYNC_CHECKREADY,
  GFSYNC_IWAIT, GFSYNC_ITEST, GFSYNC_OWAIT, GFSYNC_OTEST,
  GFSYNC_READGHOSTS, GFSYNC_READGHOSTS_SELF, GFSYNC_WRITEGHOSTS, GFSYNC_READDATA,
  GFSYNC_WRITEDATA, UPDATE_PATCH, FIXUP_WHOLE, FIXUP_CORRECTION,
  FIXUP_SYNC, GFM_FINDING_CELLS, GFM_GEOMETRY, GFM_TRANSFORM,
  GFM_EXTRAPOLATION, GFM_SETBNDRY, GFM_AUXILIARY_VALUES, GFM_SETBNDRY_WHOLE,
  LS_SET_WHOLE, LS_SYNC, LS_CPT_TRANSFORM, LS_CPT_FLOODFILL,
  ELC_RECEIVEBOUNDARY, ELC_SENDPRESSURE, FLUID_CPL_RECEIVE_OVERHEAD, FLUID_CPL_SEND_OVERHEAD,
  FLUID_CPL_INTERPOLATE, FLUID_CPL_VELOCITY_SEARCH, FLUID_CPL_PRESSURE_CALCULATE, FLUID_CPL_ELC_GEOMETRY,
  _ACMAX
}
 

Definition of all available timing accounts.

More...
enum  CountingAccounts {
  GF_SYNC, GF_PATCHITERATOR, CS_TEST, CS_WAIT,
  _CCMAX
}
 

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
 Timing ()

Static Public Member Functions

static void collect (MPI_Comm Comm)
 compatibility function for calling report generator.
static void print (std::ostream &os)
static void print_local (std::ostream &os)

Protected Types

enum  { MAXRECURSIONS = 300 }

Protected Member Functions

void add_time ()
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, const char *name, enum TimingAccounts ac, bool opt=false)
 generate one report line.
void cl (std::ostream &OS, const char *name, enum CountingAccounts ac, bool opt=false)

Protected Attributes

std::vector< double > times
std::vector< unsigned int > calls
std::vector< int > counts
std::vector< double > timestack
double * tos
int ntos
bool print_local_times
 statistics
std::vector< double > stat_times_max
std::vector< double > stat_times_min
std::vector< double > stat_times_avg
double start_time

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

anonymous enum [protected]
Enumerator:
MAXRECURSIONS 

Definition of all available counting accounts.

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

Enumerator:
GF_SYNC 
GF_PATCHITERATOR 
CS_TEST 
CS_WAIT 
_CCMAX 

Definition of all available timing accounts.

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

Enumerator:
WHOLE 
MISC 
INITIALIZATION 
FLAGGING 
CLUSTERING 
GATHERCFL 
OUTPUT 
EXAMINE1 
EXAMINE2 
EXAMINE3 
EXAMINE4 
PARTITION_INIT 
PARTITION_CALC 
COMPOSING_WHOLE 
COMPOSING_GLOBALLISTS_MERGE 
COMPOSING_GDBCREATE 
COMPOSING_COMMSERVERS 
RECOMPOSING_WHOLE 
RECOMPOSING_INTERPOLATION 
RECOMPOSING_DATASYNC 
RECOMPOSING_BOXARRAYCOMM 
RECOMPOSING_GRIDBOXCOMM 
RECOMPOSING_COMMSERVERS 
RECOMPOSING_GLOBALLISTS_NESTING 
RECOMPOSING_GLOBALLISTS_REFINE 
RECOMPOSING_GLOBALLISTS_MERGE 
RECOMPOSING_GLOBALLISTS_GFLISTS 
RECOMPOSING_GDBCREATE 
MEMORY_RESTART_CHECKPOINT 
MEMORY_RESTART_WHOLE 
MEMORY_RESTART_GDBCREATE 
MEMORY_RESTART_COMMSERVERS 
RESTART_CHECKPOINT 
RESTART_WHOLE 
RESTART_GDBCREATE 
RESTART_COMMSERVERS 
BOUNDARIES_SYNC 
BOUNDARIES_INTERPOLATION 
BOUNDARIES_EXTERNAL 
INTEGRATION_MAIN 
INTEGRATION_ESTIMATE 
INTEGRATION_SHADOW 
SOURCE_INTEGRATION 
EX_INIT 
EX_SSEND 
EX_SRECV 
GFSYNC_GETINFO 
GFSYNC_CHECKREADY 
GFSYNC_IWAIT 
GFSYNC_ITEST 
GFSYNC_OWAIT 
GFSYNC_OTEST 
GFSYNC_READGHOSTS 
GFSYNC_READGHOSTS_SELF 
GFSYNC_WRITEGHOSTS 
GFSYNC_READDATA 
GFSYNC_WRITEDATA 
UPDATE_PATCH 
FIXUP_WHOLE 
FIXUP_CORRECTION 
FIXUP_SYNC 
GFM_FINDING_CELLS 
GFM_GEOMETRY 
GFM_TRANSFORM 
GFM_EXTRAPOLATION 
GFM_SETBNDRY 
GFM_AUXILIARY_VALUES 
GFM_SETBNDRY_WHOLE 
LS_SET_WHOLE 
LS_SYNC 
LS_CPT_TRANSFORM 
LS_CPT_FLOODFILL 
ELC_RECEIVEBOUNDARY 
ELC_SENDPRESSURE 
FLUID_CPL_RECEIVE_OVERHEAD 
FLUID_CPL_SEND_OVERHEAD 
FLUID_CPL_INTERPOLATE 
FLUID_CPL_VELOCITY_SEARCH 
FLUID_CPL_PRESSURE_CALCULATE 
FLUID_CPL_ELC_GEOMETRY 
_ACMAX 

Constructor & Destructor Documentation

Timing::Timing (  )  [inline]

Member Function Documentation

void Timing::add_time (  )  [inline, protected]

References start_time, and tos.

Referenced by start(), and stop().

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).

Referenced by collect_timing().

void Timing::cl ( std::ostream &  OS,
const char *  name,
enum CountingAccounts  ac,
bool  opt = false 
) [inline, protected]

References counts.

Referenced by print_timing().

static void Timing::collect ( MPI_Comm  Comm  )  [inline, static]

compatibility function for calling report generator.

References collect_timing().

void Timing::collect_timing ( MPI_Comm  Comm  )  [inline]

collect timing data of all nodes

References _ACMAX, calcsum(), calls, MISC, stat_times_avg, stat_times_max, stat_times_min, times, and WHOLE.

void Timing::collect_timing ( MPI_Comm  Comm,
enum TimingAccounts  ac,
double *  stat_times 
) [inline]

collect specific timing data of all nodes

References times.

Referenced by collect().

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)

References counts.

void Timing::pl ( std::ostream &  OS,
const char *  name,
enum TimingAccounts  ac,
bool  opt = false 
) [inline, protected]

generate one report line.

References calls, print_local_times, stat_times_avg, stat_times_max, stat_times_min, times, and WHOLE.

Referenced by print_timing().

static void Timing::print ( std::ostream &  os  )  [inline, static]
static void Timing::print_local ( std::ostream &  os  )  [inline, static]
void Timing::print_timing ( std::ostream &  os  )  [inline]

report generator

Parameters:
os the output stream to write the report to

References BOUNDARIES_EXTERNAL, BOUNDARIES_INTERPOLATION, BOUNDARIES_SYNC, cl(), CLUSTERING, COMPOSING_COMMSERVERS, COMPOSING_GDBCREATE, COMPOSING_GLOBALLISTS_MERGE, COMPOSING_WHOLE, CS_TEST, CS_WAIT, ELC_RECEIVEBOUNDARY, ELC_SENDPRESSURE, EX_INIT, EX_SRECV, EX_SSEND, EXAMINE1, EXAMINE2, EXAMINE3, EXAMINE4, FIXUP_CORRECTION, FIXUP_SYNC, FIXUP_WHOLE, FLAGGING, FLUID_CPL_ELC_GEOMETRY, FLUID_CPL_INTERPOLATE, FLUID_CPL_PRESSURE_CALCULATE, FLUID_CPL_RECEIVE_OVERHEAD, FLUID_CPL_SEND_OVERHEAD, FLUID_CPL_VELOCITY_SEARCH, GATHERCFL, GF_PATCHITERATOR, GF_SYNC, GFM_AUXILIARY_VALUES, GFM_EXTRAPOLATION, GFM_FINDING_CELLS, GFM_GEOMETRY, GFM_SETBNDRY, GFM_SETBNDRY_WHOLE, GFM_TRANSFORM, GFSYNC_CHECKREADY, GFSYNC_GETINFO, GFSYNC_ITEST, GFSYNC_IWAIT, GFSYNC_OTEST, GFSYNC_OWAIT, GFSYNC_READDATA, GFSYNC_READGHOSTS, GFSYNC_READGHOSTS_SELF, GFSYNC_WRITEGHOSTS, INITIALIZATION, INTEGRATION_ESTIMATE, INTEGRATION_MAIN, INTEGRATION_SHADOW, LS_CPT_FLOODFILL, LS_CPT_TRANSFORM, LS_SET_WHOLE, LS_SYNC, MEMORY_RESTART_CHECKPOINT, MEMORY_RESTART_COMMSERVERS, MEMORY_RESTART_GDBCREATE, MEMORY_RESTART_WHOLE, MISC, OUTPUT, PARTITION_CALC, PARTITION_INIT, pl(), RECOMPOSING_BOXARRAYCOMM, RECOMPOSING_COMMSERVERS, RECOMPOSING_DATASYNC, RECOMPOSING_GDBCREATE, RECOMPOSING_GLOBALLISTS_GFLISTS, RECOMPOSING_GLOBALLISTS_MERGE, RECOMPOSING_GLOBALLISTS_NESTING, RECOMPOSING_GLOBALLISTS_REFINE, RECOMPOSING_GRIDBOXCOMM, RECOMPOSING_INTERPOLATION, RECOMPOSING_WHOLE, RESTART_CHECKPOINT, RESTART_COMMSERVERS, RESTART_GDBCREATE, RESTART_WHOLE, SOURCE_INTEGRATION, UPDATE_PATCH, and WHOLE.

Referenced by print(), and print_local().

void Timing::start (  )  [inline]

Enter a new timer frame.

References add_time(), MAXRECURSIONS, ntos, and tos.

void Timing::start_timing (  )  [inline]

Function to be called first, initializing the timers.

References ntos, start_time, timestack, and tos.

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

Leave timer frame.

Parameters:
account where to add elapsed time

References add_time(), calls, ntos, times, and tos.


Member Data Documentation

std::vector<unsigned int> Timing::calls [protected]

Referenced by collect_timing(), pl(), stop(), and Timing().

std::vector<int> Timing::counts [protected]

Referenced by cl(), count(), and Timing().

int Timing::ntos [protected]

Referenced by start(), start_timing(), and stop().

bool Timing::print_local_times [protected]

statistics

Referenced by pl(), print(), and print_local().

double Timing::start_time [protected]

Referenced by add_time(), and start_timing().

std::vector<double> Timing::stat_times_avg [protected]

Referenced by collect_timing(), and pl().

std::vector<double> Timing::stat_times_max [protected]

Referenced by collect_timing(), and pl().

std::vector<double> Timing::stat_times_min [protected]

Referenced by collect_timing(), and pl().

std::vector<double> Timing::times [protected]

Referenced by collect_timing(), pl(), stop(), and Timing().

std::vector<double> Timing::timestack [protected]

Referenced by start_timing(), and Timing().

double* Timing::tos [protected]

Referenced by add_time(), start(), start_timing(), and stop().


The documentation for this class was generated from the following file:
Generated on Thu Jun 30 02:19:00 2016 for AMROC's Hierachical Data Structures by  doxygen 1.6.3