14#ifndef SST_CORE_MODEL_CONFIGCOMPONENT_H
15#define SST_CORE_MODEL_CONFIGCOMPONENT_H
17#include "sst/core/model/configStatistic.h"
18#include "sst/core/params.h"
19#include "sst/core/rankInfo.h"
20#include "sst/core/serialization/serializable.h"
21#include "sst/core/sparseVectorMap.h"
22#include "sst/core/sst_types.h"
23#include "sst/core/statapi/statbase.h"
24#include "sst/core/statapi/statoutput.h"
25#include "sst/core/timeConverter.h"
26#include "sst/core/unitAlgebra.h"
39using namespace SST::Statistics;
54 uint8_t stat_load_level = STATISTICLOADLEVELUNINITIALIZED;
56 std::map<std::string, Params> per_stat_configs;
58 ConfigPortModule() =
default;
59 ConfigPortModule(
const std::string& type,
const Params& params) :
64 void addParameter(
const std::string& key,
const std::string& value);
65 void addSharedParamSet(
const std::string& set);
66 void setStatisticLoadLevel(
const uint8_t level);
67 void enableAllStatistics(
const SST::Params& params);
68 void enableStatistic(
const std::string& statistic_name,
const SST::Params& params);
74 SST_SER(stat_load_level);
76 SST_SER(per_stat_configs);
84 friend class ComponentInfo;
98 std::map<std::string, std::vector<ConfigPortModule>>
100 std::map<std::string, StatisticId_t>
106 std::vector<double> coords;
111 static constexpr ComponentId_t
null_id = std::numeric_limits<ComponentId_t>::max();
113 inline const ComponentId_t& key()
const {
return id; }
116 void print(std::ostream& os)
const;
118 void setConfigGraphPointer(
ConfigGraph* graph_ptr);
129 StatisticId_t getNextStatisticID();
131 ConfigComponent* getParent()
const;
132 std::string getFullName()
const;
134 void setRank(RankInfo r);
135 void setWeight(
double w);
136 void setCoordinates(
const std::vector<double>& c);
137 void addParameter(
const std::string& key,
const std::string& value,
bool overwrite);
138 ConfigComponent* addSubComponent(
const std::string&
name,
const std::string&
type,
int slot);
139 ConfigComponent* findSubComponent(ComponentId_t);
140 const ConfigComponent* findSubComponent(ComponentId_t)
const;
141 ConfigComponent* findSubComponentByName(
const std::string&
name);
142 ConfigStatistic* findStatistic(
const std::string&
name)
const;
143 ConfigStatistic* insertStatistic(StatisticId_t
id);
144 ConfigStatistic* findStatistic(StatisticId_t)
const;
145 ConfigStatistic* enableStatistic(
146 const std::string& statisticName,
const SST::Params&
params,
bool recursively =
false);
147 ConfigStatistic* createStatistic();
148 bool reuseStatistic(
const std::string& statisticName, StatisticId_t sid);
149 void addStatisticParameter(
150 const std::string& statisticName,
const std::string& param,
const std::string& value,
bool recursively =
false);
151 void setStatisticParameters(
const std::string& statisticName,
const Params&
params,
bool recursively =
false);
152 void setStatisticLoadLevel(uint8_t level,
bool recursively =
false);
154 void addSharedParamSet(
const std::string& set) {
params.addSharedParamSet(set); }
156 "addGlobalParamSet() has been deprecated and will be removed in SST 16. Please use addSharedParamSet()")]]
157 void addGlobalParamSet(
const std::string& set)
159 params.addSharedParamSet(set);
161 std::vector<std::string> getParamsLocalKeys()
const {
return params.getLocalKeys(); }
162 std::vector<std::string> getSubscribedSharedParamSets()
const {
return params.getSubscribedSharedParamSets(); }
164 [[deprecated(
"getSubscribedGlobalParamSets() has been deprecated and will be removed in SST 16. Please use "
165 "getSubscribedSharedParamSets()")]]
166 std::vector<std::string> getSubscribedGlobalParamSets()
const
168 return params.getSubscribedSharedParamSets();
177 std::vector<LinkId_t> allLinks()
const;
194 void serialize_order(SST::Core::Serialization::serializer& ser)
override;
196 ImplementSerializable(SST::ConfigComponent)
199 std::map<StatisticId_t, ConfigStatistic>
202 ComponentId_t getNextSubComponentID();
204 friend class ConfigGraph;
223 coords.resize(3, 0.0);
239 coords.resize(3, 0.0);
Represents the configuration of a generic component.
Definition configComponent.h:83
void replaceLinkId(LinkId_t old_id, LinkId_t new_id)
Update a Link that has had its ID changed.
Definition configComponent.cc:572
static constexpr ComponentId_t null_id
Definition configComponent.h:111
float weight
Definition configComponent.h:92
std::vector< LinkId_t > links
Definition configComponent.h:94
size_t addPortModule(const std::string &port, const std::string &type, const Params ¶ms)
Adds a PortModule on the port 'port' of the associated component.
Definition configComponent.cc:540
std::vector< ConfigComponent * > subComponents
Definition configComponent.h:105
bool enabledAllStats
Definition configComponent.h:102
int slot_num
Definition configComponent.h:90
std::string name
Definition configComponent.h:89
uint16_t nextSubID
Definition configComponent.h:107
std::string type
Definition configComponent.h:91
ConfigStatistic allStatConfig
Definition configComponent.h:103
ComponentId_t id
Definition configComponent.h:87
void print(std::ostream &os) const
Print Component information.
Definition configComponent.cc:144
std::map< std::string, std::vector< ConfigPortModule > > port_modules
Definition configComponent.h:99
Params params
Definition configComponent.h:95
ConfigGraph * graph
Definition configComponent.h:88
uint64_t next_stat_id
Definition configComponent.h:108
ConfigComponent(ComponentId_t id, ConfigGraph *graph, const std::string &name, const std::string &type, float weight, RankInfo rank)
Create a new Component.
Definition configComponent.h:210
void checkPorts() const
Checks to make sure port names are valid and that a port isn't used twice.
Definition configComponent.cc:611
std::map< std::string, StatisticId_t > enabledStatNames
Definition configComponent.h:101
uint8_t statLoadLevel
Definition configComponent.h:96
RankInfo rank
Definition configComponent.h:93
std::vector< LinkId_t > clearAllLinks()
Gets all the links to return, then clears links from self and all subcomponents.
Definition configComponent.cc:559
A Configuration Graph A graph representing Components and Links.
Definition configGraph.h:76
Represents the configuration of a generic Link.
Definition configLink.h:37
Params all_stat_config
Definition configComponent.h:55
Definition configStatistic.h:41
Definition serializable.h:25
This class is basically a wrapper for objects to declare the order in which their members should be s...
Definition serializer.h:43
Parameter store.
Definition params.h:65