20 #include <sst/core/element.h> 21 #include <sst/core/elementinfo.h> 28 #define CFG_OUTPUTHUMAN 0x00000001 29 #define CFG_OUTPUTXML 0x00000002 30 #define CFG_VERBOSE 0x00000004 40 typedef std::multimap<std::string, std::string> FilterMap_t;
54 std::set<std::string> res;
55 for (
auto &i : m_filters )
71 bool processAllElements()
const {
return m_filters.empty(); }
72 bool doVerbose()
const {
return m_optionBits & CFG_VERBOSE; }
77 void addFilter(std::string name);
81 std::vector<std::string> m_elementsToProcess;
82 unsigned int m_optionBits;
83 std::string m_XMLFilePath;
85 FilterMap_t m_filters;
94 virtual void outputHumanReadable(
int index) = 0;
100 virtual void outputXML(
int Index, TiXmlNode* XMLParentElement) = 0;
103 void xmlComment(TiXmlNode* owner,
const char* fmt...);
109 template <
typename T>
111 m_name(eli->name), m_desc(fs(eli->description))
115 m_name(eli.getName()), m_desc(eli.getDescription())
120 m_name(eli.getName()), m_desc(eli.getDescription())
131 template<
typename TO,
typename FROM>
132 std::vector<TO> convertFromELI(
const FROM *ptr) {
135 while ( ptr->name ) {
136 res.emplace_back(ptr);
143 template<
typename TO,
typename FROM>
144 std::vector<TO> convertFromDB(
const std::vector<FROM> &input) {
146 for (
auto &i : input ) {
147 res.emplace_back(&i);
152 std::string fs(
const char* x) {
153 if ( x == NULL )
return "";
154 return std::string(x);
186 void outputHumanReadable(
int index)
override;
192 void outputXML(
int Index, TiXmlNode* XMLParentElement)
override;
195 std::string m_defaultValue;
214 while ( arrayPtr && *arrayPtr ) {
215 m_validEvents.emplace_back(*arrayPtr);
234 const std::string&
getValidEvent(
unsigned int index) {
return m_validEvents.at(index);}
239 void outputHumanReadable(
int index)
override;
245 void outputXML(
int Index, TiXmlNode* XMLParentElement)
override;
248 void analyzeValidEventsArray();
250 std::vector<std::string> m_validEvents;
268 m_units(els->units), m_enableLevel(els->enableLevel)
280 void outputHumanReadable(
int Index)
override;
286 void outputXML(
int Index, TiXmlNode* XMLParentElement)
override;
290 uint8_t m_enableLevel;
304 m_interface(els->superclass)
313 void outputHumanReadable(
int Index)
override;
319 void outputXML(
int Index, TiXmlNode* XMLParentElement)
override;
322 std::string m_interface;
341 m_ParamArray = convertFromELI<SSTInfoElement_ParamInfo>(elc->
params);
342 m_PortArray = convertFromELI<SSTInfoElement_PortInfo>(elc->
ports);
343 m_StatisticArray = convertFromELI<SSTInfoElement_StatisticInfo>(elc->
stats);
344 m_SubCompSlotArray = convertFromELI<SSTInfoElement_SubCompSlotInfo>(elc->subComponents);
350 m_ParamArray = convertFromDB<SSTInfoElement_ParamInfo>(elc->getValidParams());
351 m_PortArray = convertFromDB<SSTInfoElement_PortInfo>(elc->getValidPorts());
352 m_StatisticArray = convertFromDB<SSTInfoElement_StatisticInfo>(elc->getValidStats());
353 m_SubCompSlotArray = convertFromDB<SSTInfoElement_SubCompSlotInfo>(elc->getSubComponentSlots());
375 std::string getCategoryString()
const;
380 void outputHumanReadable(
int index)
override;
386 void outputXML(
int Index, TiXmlNode* XMLParentElement)
override;
390 std::vector<SSTInfoElement_ParamInfo> m_ParamArray;
391 std::vector<SSTInfoElement_PortInfo> m_PortArray;
392 std::vector<SSTInfoElement_StatisticInfo> m_StatisticArray;
393 std::vector<SSTInfoElement_SubCompSlotInfo> m_SubCompSlotArray;
416 void outputHumanReadable(
int index)
override;
422 void outputXML(
int Index, TiXmlNode* XMLParentElement)
override;
441 m_ParamArray = convertFromELI<SSTInfoElement_ParamInfo>(elm->
params);
446 m_ParamArray = convertFromDB<SSTInfoElement_ParamInfo>(elm->getValidParams());
460 void outputHumanReadable(
int index)
override;
466 void outputXML(
int Index, TiXmlNode* XMLParentElement)
override;
469 std::string m_provides;
470 std::vector<SSTInfoElement_ParamInfo> m_ParamArray;
487 m_ParamArray = convertFromELI<SSTInfoElement_ParamInfo>(elsc->
params);
488 m_PortArray = convertFromELI<SSTInfoElement_PortInfo>(elsc->
ports);
489 m_StatisticArray = convertFromELI<SSTInfoElement_StatisticInfo>(elsc->
stats);
490 m_SubCompSlotArray = convertFromELI<SSTInfoElement_SubCompSlotInfo>(elsc->subComponents);
496 m_ParamArray = convertFromDB<SSTInfoElement_ParamInfo>(elc->getValidParams());
497 m_PortArray = convertFromDB<SSTInfoElement_PortInfo>(elc->getValidPorts());
498 m_StatisticArray = convertFromDB<SSTInfoElement_StatisticInfo>(elc->getValidStats());
499 m_SubCompSlotArray = convertFromDB<SSTInfoElement_SubCompSlotInfo>(elc->getSubComponentSlots());
520 void outputHumanReadable(
int index)
override;
526 void outputXML(
int Index, TiXmlNode* XMLParentElement)
override;
528 const std::string& getProvides()
const {
return m_Provides; }
531 std::vector<SSTInfoElement_ParamInfo> m_ParamArray;
532 std::vector<SSTInfoElement_PortInfo> m_PortArray;
533 std::vector<SSTInfoElement_StatisticInfo> m_StatisticArray;
534 std::vector<SSTInfoElement_SubCompSlotInfo> m_SubCompSlotArray;
535 std::string m_Provides;
560 void outputHumanReadable(
int index)
override;
566 void outputXML(
int Index, TiXmlNode* XMLParentElement)
override;
589 void outputHumanReadable(
int index)
override;
595 void outputXML(
int Index, TiXmlNode* XMLParentElement)
override;
617 populateLibraryInfo();
681 void outputHumanReadable(
int LibIndex)
override;
687 void outputXML(
int LibIndex, TiXmlNode* XMLParentElement)
override;
690 void populateLibraryInfo();
691 template<
typename T>
void addInfoComponent(
const T* eic) {m_ComponentArray.emplace_back(const_cast<T*>(eic));}
692 template<
typename T>
void addInfoEvent(
const T* eie) {m_EventArray.emplace_back(const_cast<T*>(eie));}
693 template<
typename T>
void addInfoModule(
const T* eim) {m_ModuleArray.emplace_back(const_cast<T*>(eim));}
694 template<
typename T>
void addInfoSubComponent(
const T* eisc) {m_SubComponentArray.emplace_back(const_cast<T*>(eisc));}
695 template<
typename T>
void addInfoPartitioner(
const T* eip) {m_PartitionerArray.emplace_back(const_cast<T*>(eip));}
696 template<
typename T>
void addInfoGenerator(
const T* eig) {m_GeneratorArray.emplace_back(const_cast<T*>(eig));}
699 const std::string m_name;
700 std::vector<SSTInfoElement_ComponentInfo> m_ComponentArray;
701 std::vector<SSTInfoElement_EventInfo> m_EventArray;
702 std::vector<SSTInfoElement_ModuleInfo> m_ModuleArray;
703 std::vector<SSTInfoElement_SubComponentInfo> m_SubComponentArray;
704 std::vector<SSTInfoElement_PartitionerInfo> m_PartitionerArray;
705 std::vector<SSTInfoElement_GeneratorInfo> m_GeneratorArray;
SSTInfoElement_GeneratorInfo * getInfoGenerator(int Index)
Return a specific SSTInfoElement_GeneratorInfo object.
Definition: sstinfo.h:676
SSTInfoElement_PartitionerInfo(const ElementInfoPartitioner *elp)
Create a new SSTInfoElement_PartitionerInfo object.
Definition: sstinfo.h:549
const ElementInfoStatistic * stats
Definition: element.h:98
SSTInfoElement_ModuleInfo * getInfoModule(int Index)
Return a specific SSTInfoElement_ModuleInfo object.
Definition: sstinfo.h:661
Describes an Event.
Definition: element.h:73
int getNumberOfLibraryComponents()
Return the number of Components within the Library.
Definition: sstinfo.h:628
SSTInfoElement_PartitionerInfo * getInfoPartitioner(int Index)
Return a specific SSTInfoElement_PartitionerInfo object.
Definition: sstinfo.h:671
Describes a Component and its associated information.
Definition: element.h:49
The SSTInfo representation of ElementLibraryInfo object.
Definition: sstinfo.h:607
Describes a Partitioner.
Definition: element.h:106
SSTInfoElement_EventInfo * getInfoEvent(int Index)
Return a specific SSTInfoElement_EventInfo object.
Definition: sstinfo.h:656
const std::string & getInterface()
Return the Interface which is requires.
Definition: sstinfo.h:308
const char * defaultValue
Definition: elibase.h:43
std::string getLibraryDescription()
Return the Description of the Library.
Definition: sstinfo.h:625
The SSTInfo representation of ElementInfoGenerator object.
Definition: sstinfo.h:577
const char ** validEvents
Definition: elibase.h:51
Definition: elementinfo.h:40
The SSTInfo representation of ElementInfoModule object.
Definition: sstinfo.h:433
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:637
Definition: elementinfo.h:120
The SSTInfo representation of ElementInfoEvent object.
Definition: sstinfo.h:403
const std::string & getProvides()
Return what class the Module provides.
Definition: sstinfo.h:450
SSTInfoElement_PortInfo * getPortInfo(int index)
Return a Port Info Object.
Definition: sstinfo.h:364
SSTInfoElement_SubComponentInfo * getInfoSubComponent(int Index)
Return a specific SSTInfoElement_SubComponentInfo object.
Definition: sstinfo.h:666
SSTInfoElement_ParamInfo(const ElementInfoParam *elparam)
Create a new SSTInfoElement_ParamInfo object.
Definition: sstinfo.h:173
Definition: sstinfo.h:106
The SSTInfo representation of ElementInfoComponent object.
Definition: sstinfo.h:333
SSTInfoElement_ModuleInfo(const ElementInfoModule *elm)
Create a new SSTInfoElement_ModuleInfo object.
Definition: sstinfo.h:438
bool debugEnabled() const
Is debugging output enabled?
Definition: sstinfo.h:70
Describes Ports that the Component can use.
Definition: elibase.h:56
const std::string & getDesc()
Return the Description of the Parameter.
Definition: sstinfo.h:128
SSTInfoElement_ComponentInfo * getInfoComponent(int Index)
Return a specific SSTInfoElement_ComponentInfo object.
Definition: sstinfo.h:651
SSTInfoElement_PortInfo * getPortInfo(int index)
Return a Port Info Object.
Definition: sstinfo.h:515
The SSTInfo representation of SubComponentSlotINfo object.
Definition: sstinfo.h:297
const ElementInfoStatistic * stats
Definition: element.h:57
SSTInfoElement_GeneratorInfo(const ElementInfoGenerator *elg)
Create a new SSTInfoElement_GeneratorInfo object.
Definition: sstinfo.h:582
Definition: elementinfo.h:97
SSTInfoElement_SubComponentInfo(const ElementInfoSubComponent *elsc)
Create a new SSTInfoElement_SubComponentInfo object.
Definition: sstinfo.h:484
SSTInfoElement_StatisticInfo * getStatisticInfo(int index)
Return a Statistic Enable Info Object.
Definition: sstinfo.h:369
The SSTInfo Configuration class.
Definition: sstinfo.h:38
SSTInfoElement_StatisticInfo(const ElementInfoStatistic *els)
Create a new SSTInfoElement_StatisticInfo object.
Definition: sstinfo.h:266
Describes Statistics used by a Component.
Definition: elibase.h:31
int getNumberOfLibraryGenerators()
Return the number of Generators within the Library.
Definition: sstinfo.h:643
Describes a Generator.
Definition: element.h:115
The SSTInfo representation of ElementInfoParam object.
Definition: sstinfo.h:168
Definition: elementinfo.h:133
SSTInfoElement_StatisticInfo * getStatisticInfo(int index)
Return a Statistic Enable Info Object.
Definition: sstinfo.h:510
The SSTInfo representation of ElementInfoPort object.
Definition: sstinfo.h:205
std::string & getXMLFilePath()
Return the user defined path the XML File.
Definition: sstinfo.h:67
const ElementLibraryInfo * getLibraryInfo()
Return the ElementLibraryInfo object.
Definition: sstinfo.h:646
SSTInfoConfig()
Create a new SSTInfo configuration and parse the Command Line.
Definition: sstinfo.cc:279
const std::string & getDefault()
Return the Default value of the Parameter.
Definition: sstinfo.h:181
SSTInfoElement_EventInfo(const ElementInfoEvent *ele)
Create a new SSTInfoElement_EventInfo object.
Definition: sstinfo.h:408
const ElementInfoParam * params
Definition: element.h:97
const std::string & getUnits()
Return the Units of the Statistic.
Definition: sstinfo.h:272
Describes Parameters to a Component.
Definition: elibase.h:40
int getNumberOfLibraryEvents()
Return the number of Events within the Library.
Definition: sstinfo.h:631
Definition: elementinfo.h:109
int getNumberOfValidEvents()
Return the number of Valid Events related to the Port.
Definition: sstinfo.h:229
int getNumberOfLibraryModules()
Return the number of Modules within the Library.
Definition: sstinfo.h:634
int parseCmdLine(int argc, char *argv[])
Parse the Command Line.
Definition: sstinfo.cc:308
const std::string & getName()
Return the Name of the Element.
Definition: sstinfo.h:125
unsigned int getOptionBits()
Return the bit field of various command line options enabled.
Definition: sstinfo.h:64
SSTInfoElement_LibraryInfo(const std::string &name, const ElementLibraryInfo *eli)
Create a new SSTInfoElement_LibraryInfo object.
Definition: sstinfo.h:613
SSTInfoElement_ParamInfo * getParamInfo(int index)
Return a Parameter Info Object.
Definition: sstinfo.h:455
Describes a Module.
Definition: element.h:82
SSTInfoElement_ParamInfo * getParamInfo(int index)
Return a Parameter Info Object.
Definition: sstinfo.h:505
const std::string & getValidEvent(unsigned int index)
Return the a specific Valid Events.
Definition: sstinfo.h:234
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:359
const std::vector< std::string > & getValidEvents()
Return the array of Valid Events related to the Port.
Definition: sstinfo.h:226
int getNumberOfLibraryPartitioners()
Return the number of Partitioners within the Library.
Definition: sstinfo.h:640
std::set< std::string > getElementsToProcessArray()
Return the list of elements to be processed.
Definition: sstinfo.h:52
uint32_t getCategoryValue()
Return the Category value of the Component.
Definition: sstinfo.h:372
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:544
SSTInfoElement_PortInfo(const ElementInfoPort *elport)
Create a new SSTInfoElement_PortInfo object.
Definition: sstinfo.h:210
const std::vector< std::string > validEvents
Definition: elibase.h:59
uint8_t getEnableLevel()
Return the enable level of the Statistic.
Definition: sstinfo.h:275
The SSTInfo representation of StatisticInfo object.
Definition: sstinfo.h:261
SSTInfoElement_ComponentInfo(const ElementInfoComponent *elc)
Create a new SSTInfoElement_ComponentInfo object.
Definition: sstinfo.h:338
std::string getLibraryName()
Return the Name of the Library.
Definition: sstinfo.h:622
SSTInfoElement_SubCompSlotInfo(const ElementInfoSubComponentSlot *els)
Create a new SSTInfoElement_StatisticInfo object.
Definition: sstinfo.h:302
The SSTInfo representation of ElementInfoSubComponent object.
Definition: sstinfo.h:479
FilterMap_t & getFilterMap()
Return the filter map.
Definition: sstinfo.h:61