12 #ifndef _H_SST_CORE_STATISTICS_OUTPUT
13 #define _H_SST_CORE_STATISTICS_OUTPUT
15 #include "sst/core/sst_types.h"
16 #include <sst/core/module.h>
17 #include <sst/core/params.h>
18 #include <sst/core/statapi/statfieldinfo.h>
19 #include <sst/core/statapi/statbase.h>
20 #include <unordered_map>
25 #define STATISTICSDEFAULTOUTPUTNAME "sst.statOutputConsole"
26 #define STATISTICSDEFAULTLOADLEVEL 0
28 extern int main(
int argc,
char **argv);
33 namespace Statistics {
34 class StatisticProcessingEngine;
51 typedef StatisticFieldInfo::fieldHandle_t fieldHandle_t;
52 typedef std::vector<StatisticFieldInfo*> FieldInfoArray_t;
53 typedef std::unordered_map<std::string, fieldHandle_t> FieldNameMap_t;
137 FieldNameMap_t::const_iterator found = m_outputFieldNameMap.find(NewStatFieldInfo->
getFieldUniqueName());
138 if (found != m_outputFieldNameMap.end()) {
141 ExistingStatFieldInfo = m_outputFieldInfoArray[found->second];
142 delete NewStatFieldInfo;
143 return ExistingStatFieldInfo;
146 delete NewStatFieldInfo;
160 void outputField(fieldHandle_t fieldHandle, int32_t data);
161 void outputField(fieldHandle_t fieldHandle, uint32_t data);
162 void outputField(fieldHandle_t fieldHandle, int64_t data);
163 void outputField(fieldHandle_t fieldHandle, uint64_t data);
164 void outputField(fieldHandle_t fieldHandle,
float data);
165 void outputField(fieldHandle_t fieldHandle,
double data);
174 friend int ::main(
int argc,
char **argv);
210 virtual void implOutputField(fieldHandle_t fieldHandle, int32_t data) = 0;
211 virtual void implOutputField(fieldHandle_t fieldHandle, uint32_t data) = 0;
212 virtual void implOutputField(fieldHandle_t fieldHandle, int64_t data) = 0;
213 virtual void implOutputField(fieldHandle_t fieldHandle, uint64_t data) = 0;
214 virtual void implOutputField(fieldHandle_t fieldHandle,
float data) = 0;
215 virtual void implOutputField(fieldHandle_t fieldHandle,
double data) = 0;
219 void startRegisterFields(
const char* componentName,
const char* statisticName);
220 void stopRegisterFields();
223 void setStatisticLoadLevel(uint8_t loadLevel) {m_statLoadLevel = loadLevel;}
226 void startOutputEntries(StatisticBase* statistic);
227 void stopOutputEntries();
230 StatisticFieldInfo* addFieldToLists(
const char* fieldName, fieldType_t fieldType);
231 fieldHandle_t generateFileHandle(StatisticFieldInfo* FieldInfo);
235 StatisticOutput() {;}
236 void setStatisticOutputName(std::string name) {m_statOutputName = name;}
238 void lock() { m_lock.lock(); }
239 void unlock() { m_lock.unlock(); }
242 std::string m_statOutputName;
243 Params m_outputParameters;
244 FieldInfoArray_t m_outputFieldInfoArray;
245 FieldNameMap_t m_outputFieldNameMap;
246 fieldHandle_t m_highestFieldHandle;
247 std::string m_currentFieldCompName;
248 std::string m_currentFieldStatName;
249 uint8_t m_statLoadLevel;
250 std::recursive_mutex m_lock;
virtual void implStartOutputEntries(StatisticBase *statistic)=0
Indicate to Statistic Output that a statistic is about to send data to be output Allows object to per...
Main control class for a SST Simulation.
Definition: simulation.h:75
std::string & getStatisticOutputName()
Return the Statistic Output name.
Definition: statoutput.h:63
The class for representing Statistic Output Fields
Definition: statfieldinfo.h:32
Forms the base class for statistics output generation within the SST core.
Definition: statoutput.h:47
Definition: statfieldinfo.h:22
fieldHandle_t registerField(const char *fieldName)
Register a field to be output (templated function)
Definition: statoutput.h:84
Main component object for the simulation.
Definition: component.h:56
Forms the base class for statistics gathering within SST.
Definition: statbase.h:36
virtual bool checkOutputParameters()=0
Have the Statistic Output check its parameters.
Module is a tag class used with the loadModule function.
Definition: module.h:20
virtual void startOfSimulation()=0
Indicate to Statistic Output that simulation has started.
virtual void printUsage()=0
Have Statistic Object print out its usage and parameter info.
StatisticFieldInfo * getRegisteredField(const char *statisticName, const char *fieldName)
Return the information on a registered field via known names.
Definition: statoutput.h:120
Params & getOutputParameters()
Return the parameters for the StatisticOutput.
Definition: statoutput.h:69
Parameter store.
Definition: params.h:46
const char * getFieldTypeShortName(fieldType_t type)
Output field data.
Definition: statoutput.cc:153
StatisticFieldInfo * getRegisteredField(fieldHandle_t fieldHandle)
Adjust the heirarchy of the fields (FUTURE SUPPORT)
Definition: statoutput.cc:93
virtual void implStopOutputEntries()=0
Indicate to Statistic Output that a statistic is finished sending data to be output Allows object to ...
virtual void implOutputField(fieldHandle_t fieldHandle, int32_t data)=0
Implementation of outputField() for derived classes.
FieldInfoArray_t & getFieldInfoArray()
Return the array of registered field infos.
Definition: statoutput.h:151
An SST core component that handles timing and event processing informing all registered Statistics to...
Definition: statengine.h:33
std::string getFieldUniqueName() const
Return the field type related to this field info.
Definition: statfieldinfo.cc:35
void outputField(fieldHandle_t fieldHandle, int32_t data)
Output field data.
Definition: statoutput.cc:117
fieldType_t
Supported Field Types.
Definition: statfieldinfo.h:36
uint8_t getStatisticLoadLevel()
Return the statistics load level for the system.
Definition: statoutput.h:66
virtual void endOfSimulation()=0
Indicate to Statistic Output that simulation has ended.