12 #ifndef SST_CORE_COMPONENTINFO_H 13 #define SST_CORE_COMPONENTINFO_H 15 #include "sst/core/params.h" 16 #include "sst/core/sst_types.h" 21 #include <unordered_set> 26 class ComponentInfoMap;
29 class ConfigComponent;
30 class ConfigStatistic;
32 class Simulation_impl;
35 namespace Statistics {
46 static const uint64_t SHARE_PORTS = 0x1;
47 static const uint64_t SHARE_STATS = 0x2;
48 static const uint64_t INSERT_STATS = 0x4;
50 static const uint64_t SHARE_NONE = 0x0;
55 static const uint64_t USER_FLAGS = 0x7;
69 const ComponentId_t id;
75 const std::string name;
80 const std::string type;
99 std::map<ComponentId_t, ComponentInfo> subComponents;
113 std::map<StatisticId_t, ConfigStatistic>* statConfigs;
114 std::map<std::string, StatisticId_t>* enabledStatNames;
115 bool enabledAllStats;
118 uint8_t statLoadLevel;
120 std::vector<double> coordinates;
130 const std::string slot_name;
143 uint64_t share_flags;
145 bool sharesPorts() {
return (share_flags & SHARE_PORTS) != 0; }
147 bool sharesStatistics() {
return (share_flags & SHARE_STATS) != 0; }
149 bool canInsertStatistics() {
return (share_flags & INSERT_STATS) != 0; }
151 inline void setComponent(BaseComponent* comp) { component = comp; }
155 ComponentInfo(ComponentId_t
id,
const std::string& name);
156 void finalizeLinkConfiguration()
const;
157 void prepareForComplete()
const;
159 ComponentId_t addAnonymousSubComponent(
160 ComponentInfo* parent_info,
const std::string& type,
const std::string& slot_name,
int slot_num,
161 uint64_t share_flags);
165 ComponentInfo(
const std::string& type,
const Params* params,
const ComponentInfo* parent_info);
169 ComponentId_t
id, ComponentInfo* parent_info,
const std::string& type,
const std::string& slot_name,
170 int slot_num, uint64_t share_flags );
173 ComponentInfo(ConfigComponent* ccomp,
const std::string& name, ComponentInfo* parent_info, LinkMap* link_map);
174 ComponentInfo(ComponentInfo&& o);
177 bool isAnonymous() {
return COMPDEFINED_SUBCOMPONENT_ID_MASK(
id); }
179 bool isUser() {
return !COMPDEFINED_SUBCOMPONENT_ID_MASK(
id); }
181 inline ComponentId_t getID()
const {
return id; }
183 inline const std::string& getName()
const 185 if ( name.empty() && parent_info )
return parent_info->getName();
189 inline const std::string& getParentComponentName()
const 193 const ComponentInfo* real_comp =
this;
194 while ( real_comp->parent_info !=
nullptr )
195 real_comp = real_comp->parent_info;
196 return real_comp->getName();
199 inline const std::string& getSlotName()
const {
return slot_name; }
201 inline int getSlotNum()
const {
return slot_num; }
203 inline const std::string& getType()
const {
return type; }
205 inline BaseComponent* getComponent()
const {
return component; }
207 LinkMap* getLinkMap();
209 inline const Params* getParams()
const {
return params; }
212 inline std::map<ComponentId_t, ComponentInfo>& getSubComponents() {
return subComponents; }
214 ComponentInfo* findSubComponent(
const std::string& slot,
int slot_num);
215 ComponentInfo* findSubComponent(ComponentId_t
id);
216 bool hasLinks()
const;
218 uint8_t getStatisticLoadLevel() {
return statLoadLevel; }
224 std::hash<std::string> hash;
225 return hash(info->name);
238 std::hash<ComponentId_t> hash;
239 return hash(info->id);
252 std::unordered_set<ComponentInfo*, ComponentInfo::HashID, ComponentInfo::EqualsID> dataByID;
255 typedef std::unordered_set<ComponentInfo*, ComponentInfo::HashID, ComponentInfo::EqualsID>::const_iterator
258 const_iterator begin()
const {
return dataByID.begin(); }
260 const_iterator end()
const {
return dataByID.end(); }
269 auto value = dataByID.find(&infoKey);
270 if ( value == dataByID.end() )
return nullptr;
271 if ( SUBCOMPONENT_ID_MASK(key) != 0 ) {
273 return (*value)->findSubComponent(key);
278 bool empty() {
return dataByID.empty(); }
282 for (
auto i : dataByID ) {
291 #endif // SST_CORE_COMPONENTINFO_H 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:26
Definition: configGraph.h:125
Definition: componentInfo.h:243
Definition: componentInfo.h:249
Definition: componentInfo.h:220
Main control class for a SST Simulation.
Definition: simulation_impl.h:73
std::vector< ConfigStatistic > statEnableList_t
Definition: componentInfo.h:43
Main component object for the simulation.
Definition: baseComponent.h:51
Definition: componentInfo.h:234
Definition: componentInfo.h:229
Parameter store.
Definition: params.h:55
Definition: componentInfo.h:39