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"
32extern int main(
int argc,
char** argv);
33extern void finalize_statEngineConfig();
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*>
Main component object for the simulation.
Definition baseComponent.h:67
A Configuration Graph A graph representing Components and Links.
Definition configGraph.h:76
Definition configStatistic.h:82
Definition configStatistic.h:121
Definition serializable.h:25
This class is basically a wrapper for objects to declare the order in which their members should be s...
Definition serializer.h:43
Output object provides consistent method for outputting data to stdout, stderr and/or sst debug file.
Definition output.h:58
Parameter store.
Definition params.h:65
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:334
Main control class for a SST Simulation.
Definition simulation.h:121
Forms the base class for statistics gathering within SST.
Definition statbase.h:51
Definition statgroup.h:32
Forms the base class for statistics output generation within the SST core.
Definition statoutput.h:54
An SST core component that handles timing and event processing informing all registered Statistics to...
Definition statengine.h:55
uint8_t stat_load_level_
Definition statengine.h:213
bool simulation_started_
Definition statengine.h:210
static std::vector< StatisticOutput * > stat_outputs_
Definition statengine.h:219
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
void serialize_order(SST::Core::Serialization::serializer &ser) override
Serialization support for the engine.
Definition statengine.cc:595
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
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
void performGlobalStatisticOutput(bool end_of_sim_flag=false)
Called by the Components and Subcomponent to perform a global statistic Output.
Definition statengine.cc:534
static void stat_outputs_simulation_start()
Called to notify StatOutputs that simulation has started.
Definition statengine.cc:56
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
std::vector< StatisticGroup > stat_groups_
Definition statengine.h:216
uint8_t getStatLoadLevel() const
Return global statistic load level.
Definition statengine.h:118
static void stat_outputs_simulation_end()
Called to notify StatOutputs that simulation has ended.
Definition statengine.cc:64
Statistic< T > * createDisabledStatistic()
Called to create a disabled (null) statistic of the requested type.
Definition statengine.h:84
StatMap_t stop_time_map_
Definition statengine.h:209
StatisticProcessingEngine()
Constructor.
Definition statengine.cc:37
SimTime_t getStatisticStopTimeFactor(StatisticBase *stat)
Get the stop time factor belonging to 'stat'.
Definition statengine.cc:465
std::map< SimTime_t, StatArray_t * > StatMap_t
Definition statengine.h:196
static const std::vector< StatisticOutput * > & getStatOutputs()
Return the statistic output objects - static as they are per-MPI rank.
Definition statengine.h:121
~StatisticProcessingEngine()
Destructor.
Definition statengine.cc:100
std::vector< StatisticBase * > StatArray_t
Definition statengine.h:195
StatMap_t start_time_map_
Definition statengine.h:208
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
Forms the template defined base class for statistics gathering within SST.
Definition statbase.h:369
Performs Unit math in full precision.
Definition unitAlgebra.h:107
Definition configStatistic.h:143