12 #ifndef _H_SST_CORE_STATISTICS_ENGINE
13 #define _H_SST_CORE_STATISTICS_ENGINE
15 #include <sst/core/sst_types.h>
16 #include <sst/core/statapi/statfieldinfo.h>
17 #include <sst/core/statapi/statgroup.h>
18 #include <sst/core/unitAlgebra.h>
19 #include <sst/core/clock.h>
20 #include <sst/core/oneshot.h>
21 #include <sst/core/threadsafe.h>
24 extern int main(
int argc,
char **argv);
25 extern void finalize_statEngineConfig(
void);
32 class ConfigStatGroup;
33 class ConfigStatOutput;
36 namespace Statistics {
38 template<
typename T>
class Statistic;
40 class StatisticOutput;
75 return dynamic_cast<Statistic<T>*
>(createStatistic(comp, type, statName, statSubId, params, fieldType));
82 if (
true == (ok = registerStatisticCore(stat)) ) {
84 addStatisticToCompStatMap(stat, fieldType);
90 StatisticBase* isStatisticRegisteredWithEngine(
const std::string& compName,
const ComponentId_t& compId, std::string& statName, std::string& statSubId)
93 return isStatisticInCompStatMap(compName, compId, statName, statSubId, fieldType);
97 const std::vector<StatisticOutput*>& getStatOutputs()
const {
return m_statOutputs; }
101 friend int ::main(
int argc,
char **argv);
102 friend void ::finalize_statEngineConfig(
void);
113 const std::string &statName,
const std::string &statSubId,
125 void finalizeInitialization();
126 void startOfSimulation();
127 void endOfSimulation();
130 void performStatisticOutputImpl(
StatisticBase* stat,
bool endOfSimFlag);
131 void performStatisticGroupOutputImpl(
StatisticGroup& group,
bool endOfSimFlag);
133 bool handleStatisticEngineClockEvent(Cycle_t CycleNum, SimTime_t timeFactor);
134 bool handleGroupClockEvent(Cycle_t CycleNum,
StatisticGroup* group);
135 void handleStatisticEngineStartTimeEvent(SimTime_t timeFactor);
136 void handleStatisticEngineStopTimeEvent(SimTime_t timeFactor);
141 typedef std::vector<StatisticBase*> StatArray_t;
142 typedef std::map<SimTime_t, StatArray_t*> StatMap_t;
143 typedef std::map<ComponentId_t, StatArray_t*> CompStatMap_t;
145 StatArray_t m_EventStatisticArray;
146 StatMap_t m_PeriodicStatisticMap;
147 StatMap_t m_StartTimeMap;
148 StatMap_t m_StopTimeMap;
149 CompStatMap_t m_CompStatMap;
150 bool m_SimulationStarted;
153 uint8_t m_statLoadLevel;
154 std::vector<StatisticOutput*> m_statOutputs;
156 std::vector<StatisticGroup> m_statGroups;
Output object provides consistent method for outputting data to stdout, stderr and/or sst debug file...
Definition: output.h:54
Main control class for a SST Simulation.
Definition: simulation.h:72
Forms the base class for statistics output generation within the SST core.
Definition: statoutput.h:47
A Configuration Graph A graph representing Components and Links.
Definition: configGraph.h:294
void performStatisticOutput(StatisticBase *stat, bool endOfSimFlag=false)
Called by the Components and Subcomponent to perform a statistic Output.
Definition: statengine.cc:405
Forms the base class for statistics gathering within SST.
Definition: statbase.h:61
Forms the template defined base class for statistics gathering within SST.
Definition: statbase.h:294
void setup()
Perform the setup() and run phases of the simulation.
Definition: simulation.cc:495
Main component object for the simulation.
Definition: baseComponent.h:104
Parameter store.
Definition: params.h:45
Definition: configGraph.h:170
void performGlobalStatisticOutput(bool endOfSimFlag=false)
Called by the Components and Subcomponent to perform a global statistic Output.
Definition: statengine.cc:469
An SST core component that handles timing and event processing informing all registered Statistics to...
Definition: statengine.h:49
Definition: statgroup.h:29
Performs Unit math in full precision.
Definition: unitAlgebra.h:104
Definition: threadsafe.h:45
fieldType_t
Supported Field Types.
Definition: statfieldinfo.h:36