12 #ifndef SST_CORE_COMPONENTINFO_H
13 #define SST_CORE_COMPONENTINFO_H
15 #include "sst/core/sst_types.h"
16 #include "sst/core/params.h"
18 #include <unordered_set>
28 class ConfigComponent;
29 class ComponentInfoMap;
32 namespace Statistics {
43 static const uint64_t SHARE_PORTS = 0x1;
44 static const uint64_t SHARE_STATS = 0x2;
45 static const uint64_t INSERT_STATS = 0x4;
48 static const uint64_t SHARE_NONE = 0x0;
54 static const uint64_t USER_FLAGS = 0x7;
69 const ComponentId_t id;
76 const std::string name;
81 const std::string type;
100 std::map<ComponentId_t,ComponentInfo> subComponents;
116 uint8_t statLoadLevel;
118 std::vector<double> coordinates;
129 const std::string slot_name;
142 uint64_t share_flags;
146 return (share_flags & SHARE_PORTS) != 0;
149 bool sharesStatistics() {
150 return (share_flags & SHARE_STATS) != 0;
153 bool canInsertStatistics() {
154 return (share_flags & INSERT_STATS) != 0;
157 inline void setComponent(BaseComponent* comp) { component = comp; }
161 ComponentInfo(ComponentId_t
id,
const std::string& name);
162 void finalizeLinkConfiguration()
const;
163 void prepareForComplete()
const;
165 ComponentId_t addAnonymousSubComponent(ComponentInfo* parent_info,
const std::string& type,
166 const std::string& slot_name,
int slot_num,
167 uint64_t share_flags);
172 ComponentInfo(
const std::string& type,
const Params *params,
const ComponentInfo *parent_info);
175 ComponentInfo(ComponentId_t
id, ComponentInfo* parent_info,
const std::string& type,
const std::string& slot_name,
176 int slot_num, uint64_t share_flags);
179 ComponentInfo(ConfigComponent *ccomp,
const std::string& name, ComponentInfo* parent_info, LinkMap* link_map);
180 ComponentInfo(ComponentInfo &&o);
184 return COMPDEFINED_SUBCOMPONENT_ID_MASK(
id);
188 return !COMPDEFINED_SUBCOMPONENT_ID_MASK(
id);
191 inline ComponentId_t getID()
const {
return id; }
193 inline const std::string& getName()
const {
194 if ( name.empty() && parent_info )
return parent_info->getName();
198 inline const std::string& getSlotName()
const {
return slot_name; }
200 inline int getSlotNum()
const {
return slot_num; }
202 inline const std::string& getType()
const {
return type; }
204 inline BaseComponent* getComponent()
const {
return component; }
206 LinkMap* getLinkMap();
208 inline const Params* getParams()
const {
return params; }
211 inline std::map<ComponentId_t,ComponentInfo>& getSubComponents() {
return subComponents; }
213 ComponentInfo* findSubComponent(
const std::string& slot,
int slot_num);
214 ComponentInfo* findSubComponent(ComponentId_t
id);
215 std::vector<LinkId_t> getAllLinkIds()
const;
217 uint8_t getStatisticLoadLevel() {
return statLoadLevel; }
223 std::hash<std::string> hash;
224 return hash(info->name);
230 return lhs->name == rhs->name;
236 std::hash<ComponentId_t> hash;
237 return hash(info->id);
243 return lhs->id == rhs->id;
252 std::unordered_set<ComponentInfo*, ComponentInfo::HashID, ComponentInfo::EqualsID> dataByID;
255 typedef std::unordered_set<ComponentInfo*, ComponentInfo::HashID, ComponentInfo::EqualsID>::const_iterator const_iterator;
257 const_iterator begin()
const {
258 return dataByID.begin();
261 const_iterator end()
const {
262 return dataByID.end();
268 dataByID.insert(info);
273 auto value = dataByID.find(&infoKey);
274 if ( value == dataByID.end() )
return nullptr;
275 if ( SUBCOMPONENT_ID_MASK(key) != 0 ) {
277 return (*value)->findSubComponent(key);
283 return dataByID.empty();
287 for (
auto i : dataByID ) {
296 #endif // SST_CORE_COMPONENTINFO_H
Main control class for a SST Simulation.
Definition: simulation.h:73
std::vector< Statistics::StatisticInfo > statEnableList_t
Definition: componentInfo.h:39
Maps port names to the Links that are connected to it.
Definition: linkMap.h:28
A class to convert between a component's view of time and the core's view of time.
Definition: timeConverter.h:25
Definition: componentInfo.h:241
Definition: componentInfo.h:250
Definition: componentInfo.h:221
Main component object for the simulation.
Definition: baseComponent.h:52
Definition: componentInfo.h:234
Definition: componentInfo.h:228
Parameter store.
Definition: params.h:44
Definition: componentInfo.h:36