12 #ifndef SST_CORE_COMPONENTINFO_H    13 #define SST_CORE_COMPONENTINFO_H    15 #include "sst/core/params.h"    16 #include "sst/core/serialization/serializer_fwd.h"    17 #include "sst/core/sst_types.h"    22 #include <unordered_set>    27 class ComponentInfoMap;
    30 class ConfigComponent;
    31 class ConfigStatistic;
    33 class Simulation_impl;
    37 namespace Serialization {
    39 class SerializeBaseComponentHelper;
    51     static const uint64_t SHARE_PORTS  = 0x1;
    52     static const uint64_t SHARE_STATS  = 0x2;
    53     static const uint64_t INSERT_STATS = 0x4;
    55     static const uint64_t SHARE_NONE = 0x0;
    60     static const uint64_t USER_FLAGS = 0x7;
    75     const ComponentId_t id;
    81     const std::string name;
    86     const std::string type;
   105     std::map<ComponentId_t, ComponentInfo> subComponents;
   119     std::map<StatisticId_t, ConfigStatistic>* statConfigs;
   120     std::map<std::string, StatisticId_t>*     enabledStatNames;
   121     bool                                      enabledAllStats;
   124     uint8_t statLoadLevel;
   126     std::vector<double> coordinates;
   136     const std::string slot_name;
   149     uint64_t share_flags;
   151     bool sharesPorts() { 
return (share_flags & SHARE_PORTS) != 0; }
   153     bool sharesStatistics() { 
return (share_flags & SHARE_STATS) != 0; }
   155     bool canInsertStatistics() { 
return (share_flags & INSERT_STATS) != 0; }
   157     inline void setComponent(BaseComponent* comp) { component = comp; }
   162     void finalizeLinkConfiguration() 
const;
   163     void prepareForComplete() 
const;
   165     ComponentId_t addAnonymousSubComponent(
   166         ComponentInfo* parent_info, 
const std::string& type, 
const std::string& slot_name, 
int slot_num,
   167         uint64_t share_flags);
   186         ComponentId_t 
id, 
ComponentInfo* parent_info, 
const std::string& type, 
const std::string& slot_name,
   187         int slot_num, uint64_t share_flags );
   194     bool isAnonymous() { 
return COMPDEFINED_SUBCOMPONENT_ID_MASK(
id); }
   196     bool isUser() { 
return !COMPDEFINED_SUBCOMPONENT_ID_MASK(
id); }
   198     inline ComponentId_t getID()
 const { 
return id; }
   200     inline const std::string& getName()
 const   202         if ( name.empty() && parent_info ) 
return parent_info->getName();
   206     inline const std::string& getParentComponentName()
 const   211         while ( real_comp->parent_info != 
nullptr )
   212             real_comp = real_comp->parent_info;
   213         return real_comp->getName();
   220     inline std::string 
getShortName()
 const { 
return name.substr(name.find_last_of(
':') + 1); }
   222     inline const std::string& getSlotName()
 const { 
return slot_name; }
   224     inline int getSlotNum()
 const { 
return slot_num; }
   226     inline const std::string& getType()
 const { 
return type; }
   228     inline BaseComponent* getComponent()
 const { 
return component; }
   230     LinkMap* getLinkMap();
   232     inline const Params* getParams()
 const { 
return params; }
   235     inline std::map<ComponentId_t, ComponentInfo>& getSubComponents() { 
return subComponents; }
   237     ComponentInfo* findSubComponent(
const std::string& slot, 
int slot_num);
   239     bool           hasLinks() 
const;
   241     uint8_t getStatisticLoadLevel() { 
return statLoadLevel; }
   247             std::hash<std::string> hash;
   248             return hash(info->name);
   261             std::hash<ComponentId_t> hash;
   262             return hash(info->id);
   280     test_addSubComponentInfo(
const std::string& name, 
const std::string& slot_name, 
TimeConverter* tv = 
nullptr);
   282     void test_printComponentInfoHierarchy(
int index = 0);
   288     std::unordered_set<ComponentInfo*, ComponentInfo::HashID, ComponentInfo::EqualsID> dataByID;
   291     typedef std::unordered_set<ComponentInfo*, ComponentInfo::HashID, ComponentInfo::EqualsID>::const_iterator
   294     const_iterator begin()
 const { 
return dataByID.begin(); }
   296     const_iterator end()
 const { 
return dataByID.end(); }
   305         auto          value = dataByID.find(&infoKey);
   306         if ( value == dataByID.end() ) 
return nullptr;
   307         if ( SUBCOMPONENT_ID_MASK(key) != 0 ) {
   309             return (*value)->findSubComponent(key);
   314     bool empty() { 
return dataByID.empty(); }
   318         for ( 
auto i : dataByID ) {
   324     size_t size() { 
return dataByID.size(); }
   329 #endif // SST_CORE_COMPONENTINFO_H This class is basically a wrapper for objects to declare the order in which their members should be s...
Definition: serializer.h:43
 
Maps port names to the Links that are connected to it. 
Definition: linkMap.h:27
 
Definition: baseComponent.h:1111
 
std::string getShortName() const
Get the short name for this SubComponent (name not including any parents, so just slot_name[index]) ...
Definition: componentInfo.h:220
 
A class to convert between a component's view of time and the core's view of time. 
Definition: timeConverter.h:27
 
void serialize_order(SST::Core::Serialization::serializer &ser)
Function used to serialize the class. 
Definition: componentInfo.cc:195
 
Definition: configGraph.h:125
 
Definition: componentInfo.h:266
 
Definition: componentInfo.h:285
 
Definition: componentInfo.h:243
 
Main control class for a SST Simulation. 
Definition: simulation_impl.h:76
 
std::vector< ConfigStatistic > statEnableList_t
Definition: componentInfo.h:48
 
Main component object for the simulation. 
Definition: baseComponent.h:62
 
Definition: componentInfo.h:257
 
Definition: componentInfo.h:252
 
Parameter store. 
Definition: params.h:55
 
ComponentInfo()
Constructor used only for serialization. 
Definition: componentInfo.cc:43
 
Definition: componentInfo.h:44