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/statapi/statbase.h>
19 #include <sst/core/statapi/statnull.h>
20 #include <sst/core/unitAlgebra.h>
21 #include <sst/core/clock.h>
22 #include <sst/core/oneshot.h>
23 #include <sst/core/threadsafe.h>
24 #include <sst/core/factory.h>
27 extern int main(
int argc,
char **argv);
28 extern void finalize_statEngineConfig(
void);
35 class ConfigStatGroup;
36 class ConfigStatOutput;
39 namespace Statistics {
43 class StatisticOutput;
75 const std::string &statName,
const std::string &statSubId,
79 return Factory::getFactory()->Create<
Statistic<T>>(type, params, comp, statName, statSubId, params);
82 bool registerStatisticWithEngine(
StatisticBase* stat, fieldType_t fieldType)
85 if ((ok = registerStatisticCore(stat))) {
86 addStatisticToCompStatMap(stat, fieldType);
91 StatisticBase* isStatisticRegisteredWithEngine(
const std::string& compName,
const ComponentId_t& compId,
92 const std::string& statName,
const std::string& statSubId,
95 return isStatisticInCompStatMap(compName, compId, statName, statSubId, fieldId);
98 const std::vector<StatisticOutput*>& getStatOutputs()
const {
return m_statOutputs; }
102 friend int ::main(
int argc,
char **argv);
103 friend void ::finalize_statEngineConfig(
void);
123 void finalizeInitialization();
124 void startOfSimulation();
125 void endOfSimulation();
128 void performStatisticOutputImpl(
StatisticBase* stat,
bool endOfSimFlag);
129 void performStatisticGroupOutputImpl(
StatisticGroup& group,
bool endOfSimFlag);
131 bool handleStatisticEngineClockEvent(Cycle_t CycleNum, SimTime_t timeFactor);
132 bool handleGroupClockEvent(Cycle_t CycleNum,
StatisticGroup* group);
133 void handleStatisticEngineStartTimeEvent(SimTime_t timeFactor);
134 void handleStatisticEngineStopTimeEvent(SimTime_t timeFactor);
135 StatisticBase* isStatisticInCompStatMap(
const std::string& compName,
const ComponentId_t& compId,
136 const std::string& statName,
const std::string& statSubId,
137 StatisticFieldInfo::fieldType_t fieldType);
138 void addStatisticToCompStatMap(
StatisticBase* Stat, StatisticFieldInfo::fieldType_t fieldType);
139 void castError(
const std::string& type,
const std::string& statName,
const std::string& fieldName);
142 typedef std::vector<StatisticBase*> StatArray_t;
143 typedef std::map<SimTime_t, StatArray_t*> StatMap_t;
144 typedef std::map<ComponentId_t, StatArray_t*> CompStatMap_t;
146 StatArray_t m_EventStatisticArray;
147 StatMap_t m_PeriodicStatisticMap;
148 StatMap_t m_StartTimeMap;
149 StatMap_t m_StopTimeMap;
150 CompStatMap_t m_CompStatMap;
151 bool m_SimulationStarted;
154 uint8_t m_statLoadLevel;
155 std::vector<StatisticOutput*> m_statOutputs;
157 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:48
A Configuration Graph A graph representing Components and Links.
Definition: configGraph.h:298
void performStatisticOutput(StatisticBase *stat, bool endOfSimFlag=false)
Called by the Components and Subcomponent to perform a statistic Output.
Definition: statengine.cc:411
Forms the base class for statistics gathering within SST.
Definition: statbase.h:63
Forms the template defined base class for statistics gathering within SST.
Definition: elementinfo.h:43
void setup()
Perform the setup() and run phases of the simulation.
Definition: simulation.cc:496
Main component object for the simulation.
Definition: baseComponent.h:52
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:475
An SST core component that handles timing and event processing informing all registered Statistics to...
Definition: statengine.h:52
Definition: statgroup.h:29
Performs Unit math in full precision.
Definition: unitAlgebra.h:104
Definition: threadsafe.h:45