SST  15.1.0
StructuralSimulationToolkit
SST::Statistics::AccumulatorStatistic< NumberBase > Class Template Reference

Allows the online gathering of statistical information about a single quantity. More...

#include <stataccumulator.h>

Inheritance diagram for SST::Statistics::AccumulatorStatistic< NumberBase >:
SST::Statistics::Statistic< NumberBase > SST::Statistics::StatisticBase SST::Statistics::StatisticCollector< NumberBase >

Public Member Functions

 SST_ELI_DECLARE_STATISTIC_TEMPLATE (AccumulatorStatistic, "sst", "AccumulatorStatistic", SST_ELI_ELEMENT_VERSION(1, 0, 0), "Accumulate all contributions to a statistic", "SST::Statistic<T>") AccumulatorStatistic(BaseComponent *comp
 
virtual const std::string & getStatTypeName () const override
 Return the Statistic type name.
 
void serialize_order (SST::Core::Serialization::serializer &ser) override
 Serialization.
 
NumberBase getSum ()
 Provides the sum of the values presented so far. More...
 
NumberBase getMax ()
 
Provides the maxmimum value presented so far. More...
 
NumberBase getMin ()
 
Provides the minimum value presented so far. More...
 
NumberBase getSumSquared ()
 Provides the sum of each value squared presented to the class so far. More...
 
NumberBase getArithmeticMean ()
 Get the arithmetic mean of the values presented so far. More...
 
NumberBase getVariance ()
 Get the variance of the values presented so far. More...
 
NumberBase getStandardDeviation ()
 Get the standard deviation of the values presented so far. More...
 
uint64_t getCount ()
 Get a count of the number of elements presented to the statistics collection so far. More...
 
void clearStatisticData () override
 Inform the Statistic to clear its data.
 
void registerOutputFields (StatisticFieldsOutput *statOutput) override
 Called by the system to tell the Statistic to register its output fields. More...
 
void outputStatisticFields (StatisticFieldsOutput *statOutput, bool UNUSED(EndOfSimFlag)) override
 
- Public Member Functions inherited from SST::Statistics::Statistic< NumberBase >
 SST_ELI_DECLARE_INFO (ELI::ProvidesInterface, ELI::ProvidesParams) SST_ELI_DOCUMENT_PARAMS(
 
void addData (InArgs &&... args)
 Add data to the Statistic This will call the addData_impl() routine in the derived Statistic.
 
void addDataNTimes (uint64_t N, InArgs &&... args)
 
- Public Member Functions inherited from SST::Statistics::StatisticBase
void enable ()
 Enable Statistic for collections.
 
void disable ()
 Disable Statistic for collections.
 
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. More...
 
void setFlagClearDataOnOutput (bool flag)
 Set the Clear Data On Output flag. More...
 
void setFlagOutputAtEndOfSim (bool flag)
 Set the Output At End Of Sim flag. More...
 
void setPortModName (std::string &port, size_t index)
 Set port name if stat is owned by a port module Temporary field until a common base class for elements with stats is created.
 
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.
 
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.
 
BaseComponentgetComponent () const
 Return a pointer to the parent Component.
 
bool isEnabled () const
 Return the enable status of the Statistic.
 
bool getStartAtFlag ()
 Return the rate at which the statistic should be output. More...
 
void setStartAtFlag ()
 
void unsetStartAtFlag ()
 
bool getStopAtFlag ()
 Manage StopAt flag.
 
void setStopAtFlag ()
 
void unsetStopAtFlag ()
 
bool getOutputRateFlag ()
 Manage OutputRate flag.
 
void setOutputRateFlag ()
 
void unsetOutputRateFlag ()
 
SimTime_t getStartAtFactor ()
 
SimTime_t getStopAtFactor ()
 
SimTime_t getOutputRateFactor ()
 
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.
 
bool isOutputPeriodic () const
 Return the collection mode that is registered.
 
bool isOutputEventBased () const
 
virtual bool isReady () const
 Indicate that the Statistic is Ready to be used.
 
virtual bool isNullStatistic () const
 Indicate if the Statistic is a NullStatistic.
 
void serializeStat (SST::Core::Serialization::serializer &ser)
 
BaseComponentdeserializeComponentPtr (SST::Core::Serialization::serializer &ser)
 

Data Fields

const std::string & statName
 
const std::string const std::string & statSubId
 
const std::string const std::string ParamsstatParams: Statistic<NumberBase>(comp
 
const std::string const std::string Params statName
 
const std::string const std::string Params statSubId
 
const std::string const std::string Params statParams
 
 m_sum_sq = static_cast<NumberBase>(0)
 
 m_min = std::numeric_limits<NumberBase>::max()
 
 m_max = std::numeric_limits<NumberBase>::min()
 

Protected Member Functions

void addData_impl (NumberBase value) override
 Present a new value to the class to be included in the statistics. More...
 
void addData_impl_Ntimes (uint64_t N, NumberBase value) override
 
- Protected Member Functions inherited from SST::Statistics::Statistic< NumberBase >
 Statistic (BaseComponent *comp, const std::string &stat_name, const std::string &stat_sub_id, Params &stat_params)
 Construct a Statistic. More...
 
- Protected Member Functions inherited from SST::Statistics::StatisticBase
 StatisticBase (BaseComponent *comp, const std::string &stat_name, const std::string &stat_sub_id, Params &stat_params)
 Construct a StatisticBase. More...
 
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)
 

Additional Inherited Members

- Static Public Member Functions inherited from SST::Statistics::Statistic< NumberBase >
static fieldType_t fieldId ()
 
- Static Public Member Functions inherited from SST::Statistics::StatisticBase
static const std::vector< ElementInfoParam > & ELI_getParams ()
 

Detailed Description

template<typename NumberBase>
class SST::Statistics::AccumulatorStatistic< NumberBase >

Allows the online gathering of statistical information about a single quantity.

The basic statistics are captured online removing the need to keep a copy of the values of interest.

Template Parameters
NumberBaseA template for the basic numerical type of values

Member Function Documentation

◆ addData_impl()

template<typename NumberBase >
void SST::Statistics::AccumulatorStatistic< NumberBase >::addData_impl ( NumberBase  value)
inlineoverrideprotected

Present a new value to the class to be included in the statistics.

Parameters
valueNew value to be presented

◆ getArithmeticMean()

template<typename NumberBase >
NumberBase SST::Statistics::AccumulatorStatistic< NumberBase >::getArithmeticMean ( )
inline

Get the arithmetic mean of the values presented so far.

Returns
The arithmetic mean of the values presented so far.

References SST::Statistics::AccumulatorStatistic< NumberBase >::getCount().

◆ getCount()

template<typename NumberBase >
uint64_t SST::Statistics::AccumulatorStatistic< NumberBase >::getCount ( )
inline

Get a count of the number of elements presented to the statistics collection so far.

Returns
Count the number of values presented to the class.

References SST::Statistics::StatisticBase::getCollectionCount().

Referenced by SST::Statistics::AccumulatorStatistic< NumberBase >::getArithmeticMean(), and SST::Statistics::AccumulatorStatistic< NumberBase >::getVariance().

◆ getMax()

template<typename NumberBase >
NumberBase SST::Statistics::AccumulatorStatistic< NumberBase >::getMax ( )
inline


Provides the maxmimum value presented so far.

Returns
The maximum of values presented to the class so far

◆ getMin()

template<typename NumberBase >
NumberBase SST::Statistics::AccumulatorStatistic< NumberBase >::getMin ( )
inline


Provides the minimum value presented so far.

Returns
The minimum of values presented to the class so far

◆ getStandardDeviation()

template<typename NumberBase >
NumberBase SST::Statistics::AccumulatorStatistic< NumberBase >::getStandardDeviation ( )
inline

Get the standard deviation of the values presented so far.

Returns
The standard deviation of the values presented so far

References SST::Statistics::AccumulatorStatistic< NumberBase >::getVariance().

◆ getSum()

template<typename NumberBase >
NumberBase SST::Statistics::AccumulatorStatistic< NumberBase >::getSum ( )
inline

Provides the sum of the values presented so far.

Returns
The sum of values presented to the class so far.

◆ getSumSquared()

template<typename NumberBase >
NumberBase SST::Statistics::AccumulatorStatistic< NumberBase >::getSumSquared ( )
inline

Provides the sum of each value squared presented to the class so far.

Returns
The sum of squared values presented to the class so far.

◆ getVariance()

template<typename NumberBase >
NumberBase SST::Statistics::AccumulatorStatistic< NumberBase >::getVariance ( )
inline

Get the variance of the values presented so far.

Returns
The variance of the values presented so far

References SST::Statistics::AccumulatorStatistic< NumberBase >::getCount().

Referenced by SST::Statistics::AccumulatorStatistic< NumberBase >::getStandardDeviation().

◆ registerOutputFields()

template<typename NumberBase >
void SST::Statistics::AccumulatorStatistic< NumberBase >::registerOutputFields ( StatisticFieldsOutput stat_output)
inlineoverridevirtual

Called by the system to tell the Statistic to register its output fields.

by calling statOutput->registerField(...)

Parameters
stat_output- Pointer to the statistic output

Implements SST::Statistics::StatisticBase.

References SST::Statistics::StatisticFieldsOutput::registerField().

Field Documentation

◆ statParams

template<typename NumberBase >
const std::string const std::string Params SST::Statistics::AccumulatorStatistic< NumberBase >::statParams
Initial value:
{
m_sum = static_cast<NumberBase>(0)

The documentation for this class was generated from the following file: