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/serialization/serializable.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" 32 extern int main(
int argc,
char** argv);
33 extern void finalize_statEngineConfig();
37 class Simulation_impl;
39 class ConfigStatGroup;
40 class ConfigStatOutput;
44 namespace Statistics {
46 class StatisticOutput;
68 BaseComponent* comp,
const std::string& stat_name,
const std::string& stat_sub_id,
Params& params)
71 std::string type = params.
find<std::string>(
"type",
"sst.AccumulatorStatistic");
73 Factory::getFactory()->CreateWithParams<
Statistic<T>>(type, params, comp, stat_name, stat_sub_id, params);
88 Factory::getFactory()->CreateWithParams<
Statistic<T>>(
"sst.NullStatistic", empty,
nullptr,
"",
"", empty);
102 StatisticBase* stat, SimTime_t start_at_time, SimTime_t stop_at_time, SimTime_t output_factor);
154 friend int ::main(
int argc,
char** argv);
155 friend void ::finalize_statEngineConfig();
175 bool addPeriodicBasedStatistic(SimTime_t factor,
StatisticBase* stat);
177 void setStatisticStartTime(
StatisticBase* stat, SimTime_t factor);
178 void setStatisticStopTime(
StatisticBase* stat, SimTime_t factor);
180 void finalizeInitialization();
181 void startOfSimulation();
182 void endOfSimulation();
184 void performStatisticOutputImpl(
StatisticBase* stat,
bool end_of_sim_flag);
185 void performStatisticGroupOutputImpl(
StatisticGroup& group,
bool end_of_sim_flag);
187 bool handleStatisticEngineClockEvent(Cycle_t cycle_num, SimTime_t time_factor);
188 bool handleGroupClockEvent(Cycle_t cycle_num,
StatisticGroup* group);
189 void handleStatisticEngineStartTimeEvent(SimTime_t time_factor);
190 void handleStatisticEngineStopTimeEvent(SimTime_t time_factor);
193 void castError(
const std::string& type,
const std::string& stat_name,
const std::string& field_name);
214 std::map<SimTime_t, StatisticGroup>
218 static std::vector<StatisticOutput*>
225 #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:57
static std::vector< StatisticOutput * > stat_outputs_
Definition: statengine.h:219
This class is basically a wrapper for objects to declare the order in which their members should be s...
Definition: serializer.h:42
Statistic< T > * createStatistic(BaseComponent *comp, const std::string &stat_name, const std::string &stat_sub_id, Params ¶ms)
Called to create an enabled (non-null) statistic of the requested type This function also registers t...
Definition: statengine.h:67
uint8_t getStatLoadLevel() const
Return global statistic load level.
Definition: statengine.h:118
static void stat_outputs_simulation_start()
Called to notify StatOutputs that simulation has started.
Definition: statengine.cc:56
std::map< SimTime_t, StatArray_t * > StatMap_t
Definition: statengine.h:196
Forms the base class for statistics output generation within the SST core.
Definition: statoutput.h:52
void serialize_order(SST::Core::Serialization::serializer &ser) override
Serialization support for the engine.
Definition: statengine.cc:595
bool simulation_started_
Definition: statengine.h:210
Definition: configGraph.h:568
Forms the base class for statistics gathering within SST.
Definition: statbase.h:49
void setup()
Perform the setup() and run phases of the simulation.
Definition: simulation.cc:885
Forms the template defined base class for statistics gathering within SST.
Definition: elementinfo.h:46
SimTime_t getStatisticStopTimeFactor(StatisticBase *stat)
Get the stop time factor belonging to 'stat'.
Definition: statengine.cc:465
StatMap_t stop_time_map_
Definition: statengine.h:209
static const std::vector< StatisticOutput * > & getStatOutputs()
Return the statistic output objects - static as they are per-MPI rank.
Definition: statengine.h:121
std::vector< StatisticGroup > stat_groups_
Definition: statengine.h:216
Definition: serializable.h:23
~StatisticProcessingEngine()
Destructor.
Definition: statengine.cc:100
bool reregisterStatisticWithEngine(StatisticBase *stat, SimTime_t start_at_time, SimTime_t stop_at_time, SimTime_t output_factor)
Re-registers a statistic with the engine during a restart run.
Definition: statengine.cc:210
SimTime_t getStatisticStartTimeFactor(StatisticBase *stat)
Get the start time factor belonging to 'stat'.
Definition: statengine.cc:425
std::map< SimTime_t, StatisticGroup > stat_default_groups_
Definition: statengine.h:215
static void static_setup(StatsConfig *stats_config)
Called to setup the StatOutputs, which are shared across all the StatEngines on the same MPI rank...
Definition: statengine.cc:47
uint8_t stat_load_level_
Definition: statengine.h:213
Statistic< T > * createDisabledStatistic()
Called to create a disabled (null) statistic of the requested type.
Definition: statengine.h:84
Main control class for a SST Simulation.
Definition: simulation_impl.h:122
StatMap_t start_time_map_
Definition: statengine.h:208
Main component object for the simulation.
Definition: baseComponent.h:64
std::vector< StatisticBase * > StatArray_t
Definition: statengine.h:195
std::enable_if_t<!std::is_same_v< std::string, T >, T > find(const std::string &k, T default_value, bool &found) const
Find a Parameter value in the set, and return its value as a type T.
Definition: params.h:333
static void stat_outputs_simulation_end()
Called to notify StatOutputs that simulation has ended.
Definition: statengine.cc:64
Parameter store.
Definition: params.h:63
Definition: configGraph.h:321
void performStatisticOutput(StatisticBase *stat, bool end_of_sim_flag=false)
Called by the Components and Subcomponent to perform a statistic Output.
Definition: statengine.cc:476
StatisticProcessingEngine()
Constructor.
Definition: statengine.cc:37
void performGlobalStatisticOutput(bool end_of_sim_flag=false)
Called by the Components and Subcomponent to perform a global statistic Output.
Definition: statengine.cc:534
bool registerStatisticWithEngine(StatisticBase *stat, Params ¶ms)
Registers a newly-created statistic with the engine Statistics created during a restart run should us...
Definition: statengine.cc:108
An SST core component that handles timing and event processing informing all registered Statistics to...
Definition: statengine.h:54
Definition: statgroup.h:31
Performs Unit math in full precision.
Definition: unitAlgebra.h:105