20 #include <sst/core/element.h> 21 #include <sst/core/elementinfo.h> 28 #define CFG_OUTPUTHUMAN 0x00000001 29 #define CFG_OUTPUTXML 0x00000002 39 typedef std::multimap<std::string, std::string> FilterMap_t;
53 std::set<std::string> res;
54 for (
auto &i : m_filters )
70 bool processAllElements()
const {
return m_filters.empty(); }
75 void addFilter(std::string name);
79 std::vector<std::string> m_elementsToProcess;
80 unsigned int m_optionBits;
81 std::string m_XMLFilePath;
83 FilterMap_t m_filters;
92 virtual void outputHumanReadable(
int index) = 0;
98 virtual void outputXML(
int Index, TiXmlNode* XMLParentElement) = 0;
101 void xmlComment(TiXmlNode* owner,
const char* fmt...);
107 template <
typename T>
109 m_name(eli->name), m_desc(fs(eli->description))
113 m_name(eli.getName()), m_desc(eli.getDescription())
118 m_name(eli.getName()), m_desc(eli.getDescription())
129 template<
typename TO,
typename FROM>
130 std::vector<TO> convertFromELI(
const FROM *ptr) {
133 while ( ptr->name ) {
134 res.emplace_back(ptr);
141 template<
typename TO,
typename FROM>
142 std::vector<TO> convertFromDB(
const std::vector<FROM> &input) {
144 for (
auto &i : input ) {
145 res.emplace_back(&i);
150 std::string fs(
const char* x) {
151 if ( x == NULL )
return "";
152 return std::string(x);
184 void outputHumanReadable(
int index)
override;
190 void outputXML(
int Index, TiXmlNode* XMLParentElement)
override;
193 std::string m_defaultValue;
212 while ( arrayPtr && *arrayPtr ) {
213 m_validEvents.emplace_back(*arrayPtr);
232 const std::string&
getValidEvent(
unsigned int index) {
return m_validEvents.at(index);}
237 void outputHumanReadable(
int index)
override;
243 void outputXML(
int Index, TiXmlNode* XMLParentElement)
override;
246 void analyzeValidEventsArray();
248 std::vector<std::string> m_validEvents;
266 m_units(els->units), m_enableLevel(els->enableLevel)
278 void outputHumanReadable(
int Index)
override;
284 void outputXML(
int Index, TiXmlNode* XMLParentElement)
override;
288 uint8_t m_enableLevel;
308 m_ParamArray = convertFromELI<SSTInfoElement_ParamInfo>(elc->
params);
309 m_PortArray = convertFromELI<SSTInfoElement_PortInfo>(elc->
ports);
310 m_StatisticArray = convertFromELI<SSTInfoElement_StatisticInfo>(elc->
stats);
316 m_ParamArray = convertFromDB<SSTInfoElement_ParamInfo>(elc->getValidParams());
317 m_PortArray = convertFromDB<SSTInfoElement_PortInfo>(elc->getValidPorts());
318 m_StatisticArray = convertFromDB<SSTInfoElement_StatisticInfo>(elc->getValidStats());
340 std::string getCategoryString()
const;
345 void outputHumanReadable(
int index)
override;
351 void outputXML(
int Index, TiXmlNode* XMLParentElement)
override;
355 std::vector<SSTInfoElement_ParamInfo> m_ParamArray;
356 std::vector<SSTInfoElement_PortInfo> m_PortArray;
357 std::vector<SSTInfoElement_StatisticInfo> m_StatisticArray;
380 void outputHumanReadable(
int index)
override;
386 void outputXML(
int Index, TiXmlNode* XMLParentElement)
override;
405 m_ParamArray = convertFromELI<SSTInfoElement_ParamInfo>(elm->
params);
410 m_ParamArray = convertFromDB<SSTInfoElement_ParamInfo>(elm->getValidParams());
424 void outputHumanReadable(
int index)
override;
430 void outputXML(
int Index, TiXmlNode* XMLParentElement)
override;
433 std::string m_provides;
434 std::vector<SSTInfoElement_ParamInfo> m_ParamArray;
451 m_ParamArray = convertFromELI<SSTInfoElement_ParamInfo>(elsc->
params);
452 m_PortArray = convertFromELI<SSTInfoElement_PortInfo>(elsc->
ports);
453 m_StatisticArray = convertFromELI<SSTInfoElement_StatisticInfo>(elsc->
stats);
459 m_ParamArray = convertFromDB<SSTInfoElement_ParamInfo>(elc->getValidParams());
460 m_PortArray = convertFromDB<SSTInfoElement_PortInfo>(elc->getValidPorts());
461 m_StatisticArray = convertFromDB<SSTInfoElement_StatisticInfo>(elc->getValidStats());
482 void outputHumanReadable(
int index)
override;
488 void outputXML(
int Index, TiXmlNode* XMLParentElement)
override;
491 std::vector<SSTInfoElement_ParamInfo> m_ParamArray;
492 std::vector<SSTInfoElement_PortInfo> m_PortArray;
493 std::vector<SSTInfoElement_StatisticInfo> m_StatisticArray;
518 void outputHumanReadable(
int index)
override;
524 void outputXML(
int Index, TiXmlNode* XMLParentElement)
override;
547 void outputHumanReadable(
int index)
override;
553 void outputXML(
int Index, TiXmlNode* XMLParentElement)
override;
575 populateLibraryInfo();
639 void outputHumanReadable(
int LibIndex)
override;
645 void outputXML(
int LibIndex, TiXmlNode* XMLParentElement)
override;
648 void populateLibraryInfo();
649 template<
typename T>
void addInfoComponent(
const T* eic) {m_ComponentArray.emplace_back(const_cast<T*>(eic));}
650 template<
typename T>
void addInfoEvent(
const T* eie) {m_EventArray.emplace_back(const_cast<T*>(eie));}
651 template<
typename T>
void addInfoModule(
const T* eim) {m_ModuleArray.emplace_back(const_cast<T*>(eim));}
652 template<
typename T>
void addInfoSubComponent(
const T* eisc) {m_SubComponentArray.emplace_back(const_cast<T*>(eisc));}
653 template<
typename T>
void addInfoPartitioner(
const T* eip) {m_PartitionerArray.emplace_back(const_cast<T*>(eip));}
654 template<
typename T>
void addInfoGenerator(
const T* eig) {m_GeneratorArray.emplace_back(const_cast<T*>(eig));}
657 const std::string m_name;
658 std::vector<SSTInfoElement_ComponentInfo> m_ComponentArray;
659 std::vector<SSTInfoElement_EventInfo> m_EventArray;
660 std::vector<SSTInfoElement_ModuleInfo> m_ModuleArray;
661 std::vector<SSTInfoElement_SubComponentInfo> m_SubComponentArray;
662 std::vector<SSTInfoElement_PartitionerInfo> m_PartitionerArray;
663 std::vector<SSTInfoElement_GeneratorInfo> m_GeneratorArray;
SSTInfoElement_GeneratorInfo * getInfoGenerator(int Index)
Return a specific SSTInfoElement_GeneratorInfo object.
Definition: sstinfo.h:634
SSTInfoElement_PartitionerInfo(const ElementInfoPartitioner *elp)
Create a new SSTInfoElement_PartitionerInfo object.
Definition: sstinfo.h:507
const ElementInfoStatistic * stats
Definition: element.h:98
SSTInfoElement_ModuleInfo * getInfoModule(int Index)
Return a specific SSTInfoElement_ModuleInfo object.
Definition: sstinfo.h:619
Describes an Event.
Definition: element.h:73
int getNumberOfLibraryComponents()
Return the number of Components within the Library.
Definition: sstinfo.h:586
SSTInfoElement_PartitionerInfo * getInfoPartitioner(int Index)
Return a specific SSTInfoElement_PartitionerInfo object.
Definition: sstinfo.h:629
Describes a Component and its associated information.
Definition: element.h:49
The SSTInfo representation of ElementLibraryInfo object.
Definition: sstinfo.h:565
Describes a Partitioner.
Definition: element.h:106
SSTInfoElement_EventInfo * getInfoEvent(int Index)
Return a specific SSTInfoElement_EventInfo object.
Definition: sstinfo.h:614
const char * defaultValue
Definition: elibase.h:43
std::string getLibraryDescription()
Return the Description of the Library.
Definition: sstinfo.h:583
The SSTInfo representation of ElementInfoGenerator object.
Definition: sstinfo.h:535
const char ** validEvents
Definition: elibase.h:51
Definition: elementinfo.h:40
The SSTInfo representation of ElementInfoModule object.
Definition: sstinfo.h:397
Describes all the parts of the Element Library.
Definition: element.h:130
int getNumberOfLibrarySubComponents()
Return the number of SubComponents within the Library.
Definition: sstinfo.h:595
Definition: elementinfo.h:120
The SSTInfo representation of ElementInfoEvent object.
Definition: sstinfo.h:367
const std::string & getProvides()
Return what class the Module provides.
Definition: sstinfo.h:414
SSTInfoElement_PortInfo * getPortInfo(int index)
Return a Port Info Object.
Definition: sstinfo.h:329
SSTInfoElement_SubComponentInfo * getInfoSubComponent(int Index)
Return a specific SSTInfoElement_SubComponentInfo object.
Definition: sstinfo.h:624
SSTInfoElement_ParamInfo(const ElementInfoParam *elparam)
Create a new SSTInfoElement_ParamInfo object.
Definition: sstinfo.h:171
Definition: sstinfo.h:104
The SSTInfo representation of ElementInfoComponent object.
Definition: sstinfo.h:300
SSTInfoElement_ModuleInfo(const ElementInfoModule *elm)
Create a new SSTInfoElement_ModuleInfo object.
Definition: sstinfo.h:402
bool debugEnabled() const
Is debugging output enabled?
Definition: sstinfo.h:69
Describes Ports that the Component can use.
Definition: elibase.h:56
const std::string & getDesc()
Return the Description of the Parameter.
Definition: sstinfo.h:126
SSTInfoElement_ComponentInfo * getInfoComponent(int Index)
Return a specific SSTInfoElement_ComponentInfo object.
Definition: sstinfo.h:609
SSTInfoElement_PortInfo * getPortInfo(int index)
Return a Port Info Object.
Definition: sstinfo.h:477
const ElementInfoStatistic * stats
Definition: element.h:57
SSTInfoElement_GeneratorInfo(const ElementInfoGenerator *elg)
Create a new SSTInfoElement_GeneratorInfo object.
Definition: sstinfo.h:540
Definition: elementinfo.h:97
SSTInfoElement_SubComponentInfo(const ElementInfoSubComponent *elsc)
Create a new SSTInfoElement_SubComponentInfo object.
Definition: sstinfo.h:448
SSTInfoElement_StatisticInfo * getStatisticInfo(int index)
Return a Statistic Enable Info Object.
Definition: sstinfo.h:334
The SSTInfo Configuration class.
Definition: sstinfo.h:37
SSTInfoElement_StatisticInfo(const ElementInfoStatistic *els)
Create a new SSTInfoElement_StatisticInfo object.
Definition: sstinfo.h:264
Describes Statistics used by a Component.
Definition: elibase.h:31
int getNumberOfLibraryGenerators()
Return the number of Generators within the Library.
Definition: sstinfo.h:601
Describes a Generator.
Definition: element.h:115
The SSTInfo representation of ElementInfoParam object.
Definition: sstinfo.h:166
Definition: elementinfo.h:133
SSTInfoElement_StatisticInfo * getStatisticInfo(int index)
Return a Statistic Enable Info Object.
Definition: sstinfo.h:472
The SSTInfo representation of ElementInfoPort object.
Definition: sstinfo.h:203
std::string & getXMLFilePath()
Return the user defined path the XML File.
Definition: sstinfo.h:66
const ElementLibraryInfo * getLibraryInfo()
Return the ElementLibraryInfo object.
Definition: sstinfo.h:604
SSTInfoConfig()
Create a new SSTInfo configuration and parse the Command Line.
Definition: sstinfo.cc:277
const std::string & getDefault()
Return the Default value of the Parameter.
Definition: sstinfo.h:179
SSTInfoElement_EventInfo(const ElementInfoEvent *ele)
Create a new SSTInfoElement_EventInfo object.
Definition: sstinfo.h:372
const ElementInfoParam * params
Definition: element.h:97
const std::string & getUnits()
Return the Units of the Statistic.
Definition: sstinfo.h:270
Describes Parameters to a Component.
Definition: elibase.h:40
int getNumberOfLibraryEvents()
Return the number of Events within the Library.
Definition: sstinfo.h:589
Definition: elementinfo.h:109
int getNumberOfValidEvents()
Return the number of Valid Events related to the Port.
Definition: sstinfo.h:227
int getNumberOfLibraryModules()
Return the number of Modules within the Library.
Definition: sstinfo.h:592
int parseCmdLine(int argc, char *argv[])
Parse the Command Line.
Definition: sstinfo.cc:306
const std::string & getName()
Return the Name of the Element.
Definition: sstinfo.h:123
unsigned int getOptionBits()
Return the bit field of various command line options enabled.
Definition: sstinfo.h:63
SSTInfoElement_LibraryInfo(const std::string &name, const ElementLibraryInfo *eli)
Create a new SSTInfoElement_LibraryInfo object.
Definition: sstinfo.h:571
SSTInfoElement_ParamInfo * getParamInfo(int index)
Return a Parameter Info Object.
Definition: sstinfo.h:419
Describes a Module.
Definition: element.h:82
SSTInfoElement_ParamInfo * getParamInfo(int index)
Return a Parameter Info Object.
Definition: sstinfo.h:467
const std::string & getValidEvent(unsigned int index)
Return the a specific Valid Events.
Definition: sstinfo.h:232
const ElementInfoPort * ports
Definition: element.h:55
const ElementInfoPort * ports
Definition: element.h:100
SSTInfoElement_ParamInfo * getParamInfo(int index)
Return a Parameter Info Object.
Definition: sstinfo.h:324
const std::vector< std::string > & getValidEvents()
Return the array of Valid Events related to the Port.
Definition: sstinfo.h:224
int getNumberOfLibraryPartitioners()
Return the number of Partitioners within the Library.
Definition: sstinfo.h:598
std::set< std::string > getElementsToProcessArray()
Return the list of elements to be processed.
Definition: sstinfo.h:51
uint32_t getCategoryValue()
Return the Category value of the Component.
Definition: sstinfo.h:337
const ElementInfoParam * params
Definition: element.h:88
const ElementInfoParam * params
Definition: element.h:54
Describes Ports that the Component can use.
Definition: elibase.h:48
The SSTInfo representation of ElementInfoPartitioner object.
Definition: sstinfo.h:502
SSTInfoElement_PortInfo(const ElementInfoPort *elport)
Create a new SSTInfoElement_PortInfo object.
Definition: sstinfo.h:208
const std::vector< std::string > validEvents
Definition: elibase.h:59
uint8_t getEnableLevel()
Return the enable level of the Statistic.
Definition: sstinfo.h:273
The SSTInfo representation of ElementInfoPort object.
Definition: sstinfo.h:259
SSTInfoElement_ComponentInfo(const ElementInfoComponent *elc)
Create a new SSTInfoElement_ComponentInfo object.
Definition: sstinfo.h:305
std::string getLibraryName()
Return the Name of the Library.
Definition: sstinfo.h:580
The SSTInfo representation of ElementInfoSubComponent object.
Definition: sstinfo.h:443
FilterMap_t & getFilterMap()
Return the filter map.
Definition: sstinfo.h:60