Charades
statistics.h
Go to the documentation of this file.
1 
30 #ifndef STATISTICS_H_
31 #define STATISTICS_H_
32 
33 #include "typedefs.h"
34 
35 #include <charm++.h>
36 
38 #define PE_STATS(x) get_statistics()->x
39 
49 class Statistics {
50  public:
52  double total_time;
53 
56  uint64_t events_executed;
57  uint64_t events_committed;
58  uint64_t events_rolled_back;
59 
63  uint64_t ts_rollback_calls;
65 
68  uint64_t self_sends;
69  uint64_t local_sends;
70  uint64_t remote_sends;
71  uint64_t remote_holds;
72  uint64_t remote_cancels;
73  uint64_t anti_sends;
74  uint64_t anti_cancels;
76 
80  uint64_t total_gvts;
81 
84  uint64_t max_events_used;
85  uint64_t new_event_calls;
86  uint64_t del_event_calls;
87 
90  Statistics();
91 
93  void clear();
95  void add(const Statistics*);
97  void reduce(const Statistics*);
98 
102  void print_section(const char*) const;
103  void print_int(const char*, uint64_t) const;
104  void print_double(const char*, double) const;
105  void print() const;
107 
108 #if CMK_TRACE_ENABLED
109 
112  int EVENTS_EXECUTED;
113  int EVENTS_COMMITTED;
114  int EVENTS_ROLLED_BACK;
115 
116  int EFFICIENCY;
117 
118  int SELF_SENDS;
119  int LOCAL_SENDS;
120  int REMOTE_SENDS;
121  int ANTI_SENDS;
122 
123  int MAX_EVENTS_USED;
124  int NEW_EVENT_CALLS;
125  int DEL_EVENT_CALLS;
126 
127  void init_tracing();
128  void log_tracing(int) const;
130 #endif
131 };
132 
136 CkReductionMsg *statsReduction(int nMsg, CkReductionMsg **msgs);
140 extern CkReduction::reducerType statsReductionType;
141 
142 #endif
uint64_t ts_rollback_calls
number of rollbacks to a certain timestamp
Definition: statistics.h:63
void print_section(const char *) const
Print a section title and border.
Definition: statistics.C:140
void print_double(const char *, double) const
Print a formatted and labeled double value.
Definition: statistics.C:150
uint64_t anti_sends
anti events sent
Definition: statistics.h:73
void registerStatsReduction()
Called during node init to register the stats reduction type.
Definition: statistics.C:16
uint64_t new_event_calls
number of events allocated for an empty buffer
Definition: statistics.h:85
double total_time
execution time these stats were collected during
Definition: statistics.h:52
uint64_t total_rollback_calls
total number of times a rollback is called
Definition: statistics.h:62
CkReductionMsg * statsReduction(int nMsg, CkReductionMsg **msgs)
Reducer function used by the Charm++ runtime when doing a stats reduction.
Definition: statistics.C:25
void print_int(const char *, uint64_t) const
Print a formatted and labeled integer value.
Definition: statistics.C:145
uint64_t event_rollback_calls
number of rollbacks to a specific event
Definition: statistics.h:64
Statistics()
Calls clear() to 0 out stats on creation.
Definition: statistics.C:38
uint64_t del_event_calls
number of events deleted for a full buffer
Definition: statistics.h:86
uint64_t self_sends
events sent to ourselves
Definition: statistics.h:68
void print() const
Print out the entire stats class at the end of a simulation.
Definition: statistics.C:155
void clear()
Sets all stats to their "0" values.
Definition: statistics.C:42
uint64_t remote_sends
events sent to different chares
Definition: statistics.h:70
void add(const Statistics *)
Adds the passed in statistics object to this one.
Definition: statistics.C:78
uint64_t local_sends
events sent to different LPs in the same chare
Definition: statistics.h:69
uint64_t total_gvts
total number of GVT calculations
Definition: statistics.h:80
void reduce(const Statistics *)
Reduces the passed in statistics object with this one.
Definition: statistics.C:111
Statistics * get_statistics()
Helper function for accessing the local Statistics object.
Definition: statistics.C:11
uint64_t max_events_used
max number of events allocated from buffer
Definition: statistics.h:84
uint64_t events_rolled_back
number of rolled back events
Definition: statistics.h:58
uint64_t events_executed
total number of events executed
Definition: statistics.h:56
Declares most types used within the simulator and by models.
uint64_t events_committed
number of committed events
Definition: statistics.h:57
CkReduction::reducerType statsReductionType
The type of the stats reduction used by the Charm++ runtime.
Definition: statistics.C:15
Class for holding all PE level statistics for a given simulation run.
Definition: statistics.h:49