A timing and profiling class. More...
#include <Timing.h>
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.
Definition of all available timing accounts.
_ACMAX is used internally and must not be used as account.
Timing::Timing | ( | ) | [inline] |
void Timing::add_time | ( | ) | [inline, protected] |
References start_time, and tos.
T Timing::calcsum | ( | typename std::vector< T > & | data, | |
int | start, | |||
int | end, | |||
T | 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] |
void Timing::count | ( | enum CountingAccounts | account, | |
int | i = 1 | |||
) | [inline] |
Counting frequency of certain events.
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] |
References print_local_times, and print_timing().
static void Timing::print_local | ( | std::ostream & | os | ) | [inline, static] |
References print_local_times, and print_timing().
void Timing::print_timing | ( | std::ostream & | os | ) | [inline] |
report generator
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.
account | where to add elapsed time |
References add_time(), calls, ntos, times, and tos.
std::vector<unsigned int> Timing::calls [protected] |
Referenced by collect_timing(), pl(), stop(), and Timing().
std::vector<int> Timing::counts [protected] |
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().