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;
36 namespace Statistics {
47 static const uint64_t SHARE_PORTS = 0x1;
48 static const uint64_t SHARE_STATS = 0x2;
49 static const uint64_t INSERT_STATS = 0x4;
51 static const uint64_t SHARE_NONE = 0x0;
56 static const uint64_t USER_FLAGS = 0x7;
70 const ComponentId_t id;
76 const std::string name;
81 const std::string type;
100 std::map<ComponentId_t, ComponentInfo> subComponents;
114 std::map<StatisticId_t, ConfigStatistic>* statConfigs;
115 std::map<std::string, StatisticId_t>* enabledStatNames;
116 bool enabledAllStats;
119 uint8_t statLoadLevel;
121 std::vector<double> coordinates;
131 const std::string slot_name;
144 uint64_t share_flags;
146 bool sharesPorts() {
return (share_flags & SHARE_PORTS) != 0; }
148 bool sharesStatistics() {
return (share_flags & SHARE_STATS) != 0; }
150 bool canInsertStatistics() {
return (share_flags & INSERT_STATS) != 0; }
152 inline void setComponent(BaseComponent* comp) { component = comp; }
157 void finalizeLinkConfiguration()
const;
158 void prepareForComplete()
const;
160 ComponentId_t addAnonymousSubComponent(
161 ComponentInfo* parent_info,
const std::string& type,
const std::string& slot_name,
int slot_num,
162 uint64_t share_flags);
181 ComponentId_t
id,
ComponentInfo* parent_info,
const std::string& type,
const std::string& slot_name,
182 int slot_num, uint64_t share_flags );
189 bool isAnonymous() {
return COMPDEFINED_SUBCOMPONENT_ID_MASK(
id); }
191 bool isUser() {
return !COMPDEFINED_SUBCOMPONENT_ID_MASK(
id); }
193 inline ComponentId_t getID()
const {
return id; }
195 inline const std::string& getName()
const 197 if ( name.empty() && parent_info )
return parent_info->getName();
201 inline const std::string& getParentComponentName()
const 206 while ( real_comp->parent_info !=
nullptr )
207 real_comp = real_comp->parent_info;
208 return real_comp->getName();
211 inline const std::string& getSlotName()
const {
return slot_name; }
213 inline int getSlotNum()
const {
return slot_num; }
215 inline const std::string& getType()
const {
return type; }
217 inline BaseComponent* getComponent()
const {
return component; }
219 LinkMap* getLinkMap();
221 inline const Params* getParams()
const {
return params; }
224 inline std::map<ComponentId_t, ComponentInfo>& getSubComponents() {
return subComponents; }
226 ComponentInfo* findSubComponent(
const std::string& slot,
int slot_num);
228 bool hasLinks()
const;
230 uint8_t getStatisticLoadLevel() {
return statLoadLevel; }
236 std::hash<std::string> hash;
237 return hash(info->name);
250 std::hash<ComponentId_t> hash;
251 return hash(info->id);
269 test_addSubComponentInfo(
const std::string& name,
const std::string& slot_name,
TimeConverter* tv =
nullptr);
271 void test_printComponentInfoHierarchy(
int index = 0);
277 std::unordered_set<ComponentInfo*, ComponentInfo::HashID, ComponentInfo::EqualsID> dataByID;
280 typedef std::unordered_set<ComponentInfo*, ComponentInfo::HashID, ComponentInfo::EqualsID>::const_iterator
283 const_iterator begin()
const {
return dataByID.begin(); }
285 const_iterator end()
const {
return dataByID.end(); }
294 auto value = dataByID.find(&infoKey);
295 if ( value == dataByID.end() )
return nullptr;
296 if ( SUBCOMPONENT_ID_MASK(key) != 0 ) {
298 return (*value)->findSubComponent(key);
303 bool empty() {
return dataByID.empty(); }
307 for (
auto i : dataByID ) {
313 size_t size() {
return dataByID.size(); }
318 #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:35
Maps port names to the Links that are connected to it.
Definition: linkMap.h:27
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:255
Definition: componentInfo.h:274
Definition: componentInfo.h:232
Main control class for a SST Simulation.
Definition: simulation_impl.h:70
std::vector< ConfigStatistic > statEnableList_t
Definition: componentInfo.h:44
Main component object for the simulation.
Definition: baseComponent.h:51
Definition: componentInfo.h:246
Definition: componentInfo.h:241
Parameter store.
Definition: params.h:55
ComponentInfo()
Constructor used only for serialization.
Definition: componentInfo.cc:43
Definition: componentInfo.h:40