SST 15.0
Structural Simulation Toolkit
|
Forms the base class for statistics gathering within SST. More...
#include <statbase.h>
Public Types | |
enum | StatMode_t { STAT_MODE_UNDEFINED , STAT_MODE_COUNT , STAT_MODE_PERIODIC , STAT_MODE_DUMP_AT_END } |
Statistic collection mode STAT_MODE_UNDEFINED - unknown mode STAT_MODE_COUNT - generating statistic output when the statistic has been added to a certain number of times STAT_MODE_PERIODIC - generating statistic output on a periodic time basis STAT_MODE_DUMP_AT_END - generating statistic output only at end of simulation. | |
Public Member Functions | |
void | enable () |
Enable Statistic for collections. | |
void | disable () |
Disable Statistic for collections. | |
virtual void | clearStatisticData () |
Inform the Statistic to clear its data. | |
virtual void | resetCollectionCount () |
Set the current collection count to 0. | |
virtual void | incrementCollectionCount (uint64_t increment) |
Increment current collection count. | |
virtual void | setCollectionCount (uint64_t new_count) |
Set the current collection count to a defined value. | |
virtual void | setCollectionCountLimit (uint64_t new_limit) |
Set the collection count limit to a defined value. | |
void | setFlagResetCountOnOutput (bool flag) |
Set the Reset Count On Output flag. | |
void | setFlagClearDataOnOutput (bool flag) |
Set the Clear Data On Output flag. | |
void | setFlagOutputAtEndOfSim (bool flag) |
Set the Output At End Of Sim flag. | |
const std::string & | getCompName () const |
Return the Component Name. | |
const std::string & | getStatName () const |
Return the Statistic Name. | |
const std::string & | getStatSubId () const |
Return the Statistic SubId. | |
const std::string & | getFullStatName () const |
Return the full Statistic name of component.stat_name.sub_id. | |
virtual std::string | getELIName () const =0 |
Return the ELI type of the statistic The ELI registration macro creates this function automatically for child classes. | |
virtual const std::string & | getStatTypeName () const |
Return the Statistic type name. | |
const StatisticFieldInfo::fieldType_t & | getStatDataType () const |
Return the Statistic data type. | |
const char * | getStatDataTypeShortName () const |
Return the Statistic data type. | |
const char * | getStatDataTypeFullName () const |
Return the Statistic data type. | |
BaseComponent * | getComponent () const |
Return a pointer to the parent Component. | |
bool | isEnabled () const |
Return the enable status of the Statistic. | |
bool | isOutputEnabled () const |
Return the enable status of the Statistic's ability to output data. | |
UnitAlgebra & | getCollectionRate () const |
Return the rate at which the statistic should be output. | |
UnitAlgebra & | getStartAtTime () const |
Return the time at which the statistic should be enabled. | |
UnitAlgebra & | getStopAtTime () const |
Return the time at which the statistic should be disabled. | |
uint64_t | getCollectionCountLimit () const |
Return the collection count limit. | |
uint64_t | getCollectionCount () const |
Return the current collection count. | |
bool | getFlagResetCountOnOutput () const |
Return the ResetCountOnOutput flag value. | |
bool | getFlagClearDataOnOutput () const |
Return the ClearDataOnOutput flag value. | |
bool | getFlagOutputAtEndOfSim () const |
Return the OutputAtEndOfSim flag value. | |
StatMode_t | getRegisteredCollectionMode () const |
Return the collection mode that is registered. | |
virtual bool | isReady () const |
Indicate that the Statistic is Ready to be used. | |
virtual bool | isNullStatistic () const |
Indicate if the Statistic is a NullStatistic. | |
virtual void | serialize_order (SST::Core::Serialization::serializer &ser) |
Serialization. | |
Static Public Member Functions | |
static const std::vector< ElementInfoParam > & | ELI_getParams () |
Protected Member Functions | |
StatisticBase (BaseComponent *comp, const std::string &stat_name, const std::string &stat_sub_id, Params &stat_params, bool null_stat) | |
Construct a StatisticBase. | |
void | setStatisticDataType (const StatisticFieldInfo::fieldType_t data_type) |
Set the Statistic Data Type. | |
void | setStatisticTypeName (const char *type_name) |
Set an optional Statistic Type Name (for output) | |
Forms the base class for statistics gathering within SST.
Statistics are gathered and processed into various (extensible) output forms. Statistics are expected to be named so that they can be located in the simulation output files.
|
protected |
Construct a StatisticBase.
comp | - Pointer to the parent constructor. |
stat_name | - Name of the statistic to be registered. This name must match the name in the ElementInfoStatistic. |
stat_sub_id | - Additional name of the statistic |
stat_params | - The parameters for this statistic |
null_stat | - True if the statistic is null (not enabled). Defaults to False. |
References SST::Output::fatal(), SST::Params::find(), getCompName(), getFullStatName(), SST::Simulation_impl::getSimulation(), SST::Simulation_impl::getSimulationOutput(), SST::UnitAlgebra::hasUnits(), StatisticBase(), and SST::UnitAlgebra::toStringBestSI().
Referenced by SST::Statistics::Statistic< std::tuple< Args... > >::Statistic(), and StatisticBase().
|
inlinevirtual |
Inform the Statistic to clear its data.
Reimplemented in SST::Statistics::AccumulatorStatistic< NumberBase >.
|
inlinevirtual |
Return the Statistic type name.
Reimplemented in SST::Statistics::AccumulatorStatistic< NumberBase >, SST::Statistics::HistogramStatistic< BinDataType >, SST::Statistics::NullStatisticBase< std::tuple< Args... >, false >, SST::Statistics::NullStatisticBase< T, false >, SST::Statistics::NullStatisticBase< T, true >, and SST::Statistics::UniqueCountStatistic< T >.
Referenced by SST::Statistics::StatisticOutputCSV::implStartOutputEntries(), SST::Statistics::StatisticOutputJSON::implStartOutputEntries(), and SST::Statistics::StatisticOutputTextBase::implStartOutputEntries().
|
virtual |
Serialization.
Reimplemented in SST::Statistics::AccumulatorStatistic< NumberBase >, SST::Statistics::HistogramStatistic< BinDataType >, SST::Statistics::Statistic< T >, SST::Statistics::Statistic< BinDataType >, SST::Statistics::Statistic< double >, SST::Statistics::Statistic< float >, SST::Statistics::Statistic< int >, SST::Statistics::Statistic< int32_t >, SST::Statistics::Statistic< int64_t >, SST::Statistics::Statistic< NumberBase >, SST::Statistics::Statistic< std::tuple< Args... > >, SST::Statistics::Statistic< std::tuple< Args... > >, SST::Statistics::Statistic< uint32_t >, SST::Statistics::Statistic< uint64_t >, and SST::Statistics::UniqueCountStatistic< T >.
References isNullStatistic().
Referenced by SST::Statistics::Statistic< std::tuple< Args... > >::serialize_order().
|
inline |
Set the Clear Data On Output flag.
If Set, the data in the statistic will be cleared by calling clearStatisticData().
|
inline |
Set the Output At End Of Sim flag.
If Set, the statistic will perform an output at the end of simulation.
|
inline |
Set the Reset Count On Output flag.
If Set, the collection count will be reset when statistic is output.