12 #ifndef SST_CORE_STATAPI_STATENGINE_H 13 #define SST_CORE_STATAPI_STATENGINE_H 15 #include "sst/core/clock.h" 16 #include "sst/core/factory.h" 17 #include "sst/core/oneshot.h" 18 #include "sst/core/sst_types.h" 19 #include "sst/core/statapi/statbase.h" 20 #include "sst/core/statapi/statfieldinfo.h" 21 #include "sst/core/statapi/statgroup.h" 22 #include "sst/core/statapi/statnull.h" 23 #include "sst/core/threadsafe.h" 24 #include "sst/core/unitAlgebra.h" 27 extern int main(
int argc,
char** argv);
28 extern void finalize_statEngineConfig(
void);
32 class Simulation_impl;
34 class ConfigStatGroup;
35 class ConfigStatOutput;
38 namespace Statistics {
42 class StatisticOutput;
70 BaseComponent* comp,
const std::string& type,
const std::string& statName,
const std::string& statSubId,
74 return Factory::getFactory()->CreateWithParams<
Statistic<T>>(type, params, comp, statName, statSubId, params);
77 bool registerStatisticWithEngine(
StatisticBase* stat) {
return registerStatisticCore(stat); }
79 uint8_t statLoadLevel()
const {
return m_statLoadLevel; }
82 static const std::vector<StatisticOutput*>& getStatOutputs() {
return m_statOutputs; }
99 friend int ::main(
int argc,
char** argv);
100 friend void ::finalize_statEngineConfig(
void);
119 void finalizeInitialization();
120 void startOfSimulation();
121 void endOfSimulation();
123 void performStatisticOutputImpl(
StatisticBase* stat,
bool endOfSimFlag);
124 void performStatisticGroupOutputImpl(
StatisticGroup& group,
bool endOfSimFlag);
126 bool handleStatisticEngineClockEvent(Cycle_t CycleNum, SimTime_t timeFactor);
127 bool handleGroupClockEvent(Cycle_t CycleNum,
StatisticGroup* group);
128 void handleStatisticEngineStartTimeEvent(SimTime_t timeFactor);
129 void handleStatisticEngineStopTimeEvent(SimTime_t timeFactor);
131 const std::string& compName,
const ComponentId_t& compId,
const std::string& statName,
132 const std::string& statSubId, StatisticFieldInfo::fieldType_t fieldType);
133 void addStatisticToCompStatMap(
StatisticBase* Stat, StatisticFieldInfo::fieldType_t fieldType);
134 void castError(
const std::string& type,
const std::string& statName,
const std::string& fieldName);
137 typedef std::vector<StatisticBase*> StatArray_t;
138 typedef std::map<SimTime_t, StatArray_t*> StatMap_t;
139 typedef std::map<ComponentId_t, StatArray_t*> CompStatMap_t;
141 StatArray_t m_EventStatisticArray;
142 StatMap_t m_PeriodicStatisticMap;
143 StatMap_t m_StartTimeMap;
144 StatMap_t m_StopTimeMap;
145 CompStatMap_t m_CompStatMap;
146 bool m_SimulationStarted;
150 uint8_t m_statLoadLevel;
152 std::vector<StatisticGroup> m_statGroups;
155 static std::vector<StatisticOutput*> m_statOutputs;
161 #endif // SST_CORE_STATAPI_STATENGINE_H Output object provides consistent method for outputting data to stdout, stderr and/or sst debug file...
Definition: output.h:53
static void static_setup(ConfigGraph *graph)
Called to setup the StatOutputs, which are shared across all the StatEngines on the same MPI rank...
Definition: statengine.cc:40
static void stat_outputs_simulation_start()
Called to nofiy StatOutputs that simulation has started.
Definition: statengine.cc:49
Forms the base class for statistics output generation within the SST core.
Definition: statoutput.h:49
A Configuration Graph A graph representing Components and Links.
Definition: configGraph.h:389
void performStatisticOutput(StatisticBase *stat, bool endOfSimFlag=false)
Called by the Components and Subcomponent to perform a statistic Output.
Definition: statengine.cc:431
Forms the base class for statistics gathering within SST.
Definition: statbase.h:64
void setup()
Perform the setup() and run phases of the simulation.
Definition: simulation.cc:607
Forms the template defined base class for statistics gathering within SST.
Definition: elementinfo.h:44
Main control class for a SST Simulation.
Definition: simulation_impl.h:70
Main component object for the simulation.
Definition: baseComponent.h:51
static void stat_outputs_simulation_end()
Called to nofiy StatOutputs that simulation has ended.
Definition: statengine.cc:57
Parameter store.
Definition: params.h:55
Definition: configGraph.h:194
void performGlobalStatisticOutput(bool endOfSimFlag=false)
Called by the Components and Subcomponent to perform a global statistic Output.
Definition: statengine.cc:484
An SST core component that handles timing and event processing informing all registered Statistics to...
Definition: statengine.h:51
Definition: statgroup.h:28
Performs Unit math in full precision.
Definition: unitAlgebra.h:106