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;
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);
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);}
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)
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());
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;
386 void outputXML(
int Index, TiXmlNode* XMLParentElement)
override;
405 m_ParamArray = convertFromELI<SSTInfoElement_ParamInfo>(elm->
params);
410 m_ParamArray = convertFromDB<SSTInfoElement_ParamInfo>(elm->getValidParams());
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());
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;
524 void outputXML(
int Index, TiXmlNode* XMLParentElement)
override;
553 void outputXML(
int Index, TiXmlNode* XMLParentElement)
override;
574 populateLibraryInfo();
643 void outputXML(
int LibIndex, TiXmlNode* XMLParentElement)
override;
646 void populateLibraryInfo();
647 template<
typename T>
void addInfoComponent(
const T* eic) {m_ComponentArray.emplace_back(const_cast<T*>(eic));}
648 template<
typename T>
void addInfoEvent(
const T* eie) {m_EventArray.emplace_back(const_cast<T*>(eie));}
649 template<
typename T>
void addInfoModule(
const T* eim) {m_ModuleArray.emplace_back(const_cast<T*>(eim));}
650 template<
typename T>
void addInfoSubComponent(
const T* eisc) {m_SubComponentArray.emplace_back(const_cast<T*>(eisc));}
651 template<
typename T>
void addInfoPartitioner(
const T* eip) {m_PartitionerArray.emplace_back(const_cast<T*>(eip));}
652 template<
typename T>
void addInfoGenerator(
const T* eig) {m_GeneratorArray.emplace_back(const_cast<T*>(eig));}
654 const ElementLibraryInfo* m_eli;
655 std::vector<SSTInfoElement_ComponentInfo> m_ComponentArray;
656 std::vector<SSTInfoElement_EventInfo> m_EventArray;
657 std::vector<SSTInfoElement_ModuleInfo> m_ModuleArray;
658 std::vector<SSTInfoElement_SubComponentInfo> m_SubComponentArray;
659 std::vector<SSTInfoElement_PartitionerInfo> m_PartitionerArray;
660 std::vector<SSTInfoElement_GeneratorInfo> m_GeneratorArray;
SSTInfoElement_GeneratorInfo * getInfoGenerator(int Index)
Return a specific SSTInfoElement_GeneratorInfo object.
Definition: sstinfo.h:632
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:617
std::string getCategoryString() const
Return the name of the Category of the Component.
Definition: sstinfo.cc:763
void outputHumanReadable(int index) override
Output the Parameter Information.
Definition: sstinfo.cc:627
Describes an Event.
Definition: element.h:73
int getNumberOfLibraryComponents()
Return the number of Components within the Library.
Definition: sstinfo.h:584
SSTInfoElement_PartitionerInfo * getInfoPartitioner(int Index)
Return a specific SSTInfoElement_PartitionerInfo object.
Definition: sstinfo.h:627
void outputHumanReadable(int LibIndex) override
Output the Library Information.
Definition: sstinfo.cc:476
virtual void outputHumanReadable(int index)=0
Output the Parameter Information.
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:612
void outputHumanReadable(int index) override
Output the Component Information.
Definition: sstinfo.cc:705
const char * defaultValue
Definition: elibase.h:43
std::string getLibraryDescription()
Return the Description of the Library.
Definition: sstinfo.h:581
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:593
void outputXML(int Index, TiXmlNode *XMLParentElement) override
Create the formatted XML data of the Generator.
Definition: sstinfo.cc:907
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:622
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
const char * name
Definition: element.h:133
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
void outputHumanReadable(int index) override
Output the Partitioner Information.
Definition: sstinfo.cc:885
SSTInfoElement_ComponentInfo * getInfoComponent(int Index)
Return a specific SSTInfoElement_ComponentInfo object.
Definition: sstinfo.h:607
void outputXML(int Index, TiXmlNode *XMLParentElement) override
Create the formatted XML data of the Module.
Definition: sstinfo.cc:821
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
void outputXML(int LibIndex, TiXmlNode *XMLParentElement) override
Create the formatted XML data of the Library.
Definition: sstinfo.cc:561
virtual void outputXML(int Index, TiXmlNode *XMLParentElement)=0
Create the formatted XML data of the Parameter.
void outputHumanReadable(int index) override
Output the Generator Information.
Definition: sstinfo.cc:902
void outputXML(int Index, TiXmlNode *XMLParentElement) override
Create the formatted XML data of the Statistic.
Definition: sstinfo.cc:689
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:599
Describes a Generator.
Definition: element.h:115
void outputXML(int Index, TiXmlNode *XMLParentElement) override
Create the formatted XML data of the Parameter.
Definition: sstinfo.cc:632
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
void outputHumanReadable(int index) override
Output the Port Information.
Definition: sstinfo.cc:645
bool debugEnabled() const
Is debugging output enabled?
Definition: sstinfo.h:69
std::string & getXMLFilePath()
Return the user defined path the XML File.
Definition: sstinfo.h:66
void outputXML(int Index, TiXmlNode *XMLParentElement) override
Create the formatted XML data of the Component.
Definition: sstinfo.cc:729
const ElementLibraryInfo * getLibraryInfo()
Return the ElementLibraryInfo object.
Definition: sstinfo.h:602
SSTInfoConfig()
Create a new SSTInfo configuration and parse the Command Line.
Definition: sstinfo.cc:256
const std::string & getDefault()
Return the Default value of the Parameter.
Definition: sstinfo.h:179
SSTInfoElement_LibraryInfo(const ElementLibraryInfo *eli)
Create a new SSTInfoElement_LibraryInfo object.
Definition: sstinfo.h:571
void outputXML(int Index, TiXmlNode *XMLParentElement) override
Create the formatted XML data of the Port.
Definition: sstinfo.cc:655
void outputHumanReadable(int Index) override
Output the Statistic Information.
Definition: sstinfo.cc:684
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:587
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:590
int parseCmdLine(int argc, char *argv[])
Parse the Command Line.
Definition: sstinfo.cc:285
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
void outputXML(int Index, TiXmlNode *XMLParentElement) override
Create the formatted XML data of the Component.
Definition: sstinfo.cc:859
SSTInfoElement_ParamInfo * getParamInfo(int index)
Return a Parameter Info Object.
Definition: sstinfo.h:419
Describes a Module.
Definition: element.h:82
void outputXML(int Index, TiXmlNode *XMLParentElement) override
Create the formatted XML data of the Partitioner.
Definition: sstinfo.cc:890
SSTInfoElement_ParamInfo * getParamInfo(int index)
Return a Parameter Info Object.
Definition: sstinfo.h:467
void outputXML(int Index, TiXmlNode *XMLParentElement) override
Create the formatted XML data of the Event.
Definition: sstinfo.cc:798
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
void outputHumanReadable(int index) override
Output the Module Information.
Definition: sstinfo.cc:810
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:596
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 char * description
Definition: element.h:134
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:578
The SSTInfo representation of ElementInfoSubComponent object.
Definition: sstinfo.h:443
void outputHumanReadable(int index) override
Output the SubComponent Information.
Definition: sstinfo.cc:841
FilterMap_t & getFilterMap()
Return the filter map.
Definition: sstinfo.h:60
void outputHumanReadable(int index) override
Output the Event Information.
Definition: sstinfo.cc:793