SST 15.0
Structural Simulation Toolkit
configGraph.h
1// -*- c++ -*-
2
3// Copyright 2009-2025 NTESS. Under the terms
4// of Contract DE-NA0003525 with NTESS, the U.S.
5// Government retains certain rights in this software.
6//
7// Copyright (c) 2009-2025, NTESS
8// All rights reserved.
9//
10// This file is part of the SST software package. For license
11// information, see the LICENSE file in the top level directory of the
12// distribution.
13
14#ifndef SST_CORE_CONFIGGRAPH_H
15#define SST_CORE_CONFIGGRAPH_H
16
17#include "sst/core/params.h"
18#include "sst/core/rankInfo.h"
19#include "sst/core/serialization/serializable.h"
20#include "sst/core/sparseVectorMap.h"
21#include "sst/core/sst_types.h"
22#include "sst/core/statapi/statbase.h"
23#include "sst/core/statapi/statoutput.h"
24#include "sst/core/unitAlgebra.h"
25
26#include <climits>
27#include <cstddef>
28#include <cstdint>
29#include <map>
30#include <ostream>
31#include <set>
32#include <string>
33#include <vector>
34
35using namespace SST::Statistics;
36
37namespace SST {
38
39class Simulation_impl;
40
41class Config;
42class TimeLord;
43class ConfigGraph;
44
45using ComponentIdMap_t = SparseVectorMap<ComponentId_t>;
46using LinkIdMap_t = std::vector<LinkId_t>;
47
48/** Represents the configuration of a generic Link */
50{
51public:
52 LinkId_t id; /*!< ID of this link */
53 std::string name; /*!< Name of this link */
54 ComponentId_t component[2]; /*!< IDs of the connected components */
55 std::string port[2]; /*!< Names of the connected ports */
56 SimTime_t latency[2]; /*!< Latency from each side */
57 std::string latency_str[2]; /*!< Temp string holding latency */
58
59 LinkId_t order; /*!< Number of components currently referring to this Link. After graph construction, it will
60 be repurposed to hold the enforce_order value */
61 bool no_cut; /*!< If set to true, partitioner will not make a cut through this Link */
62
63 // inline const std::string& key() const { return name; }
64 inline LinkId_t key() const { return id; }
65
66 /** Return the minimum latency of this link (from both sides) */
67 SimTime_t getMinLatency() const
68 {
69 if ( latency[0] < latency[1] ) return latency[0];
70 return latency[1];
71 }
72
73 /** Print the Link information */
74 void print(std::ostream& os) const
75 {
76 os << "Link " << name << " (id = " << id << ")" << std::endl;
77 os << " component[0] = " << component[0] << std::endl;
78 os << " port[0] = " << port[0] << std::endl;
79 os << " latency[0] = " << latency[0] << std::endl;
80 os << " component[1] = " << component[1] << std::endl;
81 os << " port[1] = " << port[1] << std::endl;
82 os << " latency[1] = " << latency[1] << std::endl;
83 }
84
85 /* Do not use. For serialization only */
86 ConfigLink() {}
87
88 void serialize_order(SST::Core::Serialization::serializer& ser) override
89 {
90 SST_SER(id);
91 SST_SER(name);
92 SST_SER(component[0]);
93 SST_SER(component[1]);
94 SST_SER(port[0]);
95 SST_SER(port[1]);
96 SST_SER(latency[0]);
97 SST_SER(latency[1]);
98 SST_SER(latency_str[0]);
99 SST_SER(latency_str[1]);
100 SST_SER(order);
101 }
102
103 ImplementSerializable(SST::ConfigLink)
104
105private:
106 friend class ConfigGraph;
107 explicit ConfigLink(LinkId_t id) :
108 id(id),
109 no_cut(false)
110 {
111 order = 0;
112
113 // Initialize the component data items
114 component[0] = ULONG_MAX;
115 component[1] = ULONG_MAX;
116 }
117
118 ConfigLink(LinkId_t id, const std::string& n) :
119 id(id),
120 no_cut(false)
121 {
122 order = 0;
123 name = n;
124
125 // Initialize the component data items
126 component[0] = ULONG_MAX;
127 component[1] = ULONG_MAX;
128 }
129
130 void updateLatencies(TimeLord*);
131};
132
133class ConfigStatistic : public SST::Core::Serialization::serializable
134{
135public:
136 StatisticId_t id; /*!< Unique ID of this statistic */
137 Params params;
138 bool shared = false;
139 std::string name;
140
141 ConfigStatistic(StatisticId_t _id, bool _shared = false, std::string _name = "") :
142 id(_id),
143 shared(_shared),
144 name(_name)
145 {}
146
148 id(stat_null_id)
149 {}
150
151 ConfigStatistic(const ConfigStatistic&) = default;
152 ConfigStatistic(ConfigStatistic&&) = default;
153 ConfigStatistic& operator=(const ConfigStatistic&) = default;
154 ConfigStatistic& operator=(ConfigStatistic&&) = default;
155 ~ConfigStatistic() override = default;
156
157 inline const StatisticId_t& getId() const { return id; }
158
159 void addParameter(const std::string& key, const std::string& value, bool overwrite);
160
161 void serialize_order(SST::Core::Serialization::serializer& ser) override
162 {
163 SST_SER(id);
164 SST_SER(shared);
165 SST_SER(name);
166 SST_SER(params);
167 }
168
169 ImplementSerializable(ConfigStatistic)
170
171 static constexpr StatisticId_t stat_null_id = std::numeric_limits<StatisticId_t>::max();
172};
173
174class ConfigStatGroup : public SST::Core::Serialization::serializable
175{
176public:
177 std::string name;
178 std::map<std::string, Params> statMap;
179 std::vector<ComponentId_t> components;
180 size_t outputID;
181 UnitAlgebra outputFrequency;
182
183 explicit ConfigStatGroup(const std::string& name) :
184 name(name),
185 outputID(0)
186 {}
187 ConfigStatGroup() {} /* Do not use */
188
189 bool addComponent(ComponentId_t id);
190 bool addStatistic(const std::string& name, Params& p);
191 bool setOutput(size_t id);
192 bool setFrequency(const std::string& freq);
193
194 /**
195 * Checks to make sure that all components in the group support all
196 * of the statistics as configured in the group.
197 * @return pair of: bool for OK, string for error message (if any)
198 */
199 std::pair<bool, std::string> verifyStatsAndComponents(const ConfigGraph* graph);
200
201 void serialize_order(SST::Core::Serialization::serializer& ser) override
202 {
203 SST_SER(name);
204 SST_SER(statMap);
205 SST_SER(components);
206 SST_SER(outputID);
207 SST_SER(outputFrequency);
208 }
209
210 ImplementSerializable(SST::ConfigStatGroup)
211};
212
213class ConfigStatOutput : public SST::Core::Serialization::serializable
214{
215public:
216 std::string type;
217 Params params;
218
219 explicit ConfigStatOutput(const std::string& type) :
220 type(type)
221 {}
222 ConfigStatOutput() {}
223
224 void addParameter(const std::string& key, const std::string& val) { params.insert(key, val); }
225
226 void serialize_order(SST::Core::Serialization::serializer& ser) override
227 {
228 SST_SER(type);
229 SST_SER(params);
230 }
231
232 ImplementSerializable(SST::ConfigStatOutput)
233};
234
235using ConfigLinkMap_t = SparseVectorMap<LinkId_t, ConfigLink*>;
236
237/**
238 Class that represents a PortModule in ConfigGraph
239 */
240class ConfigPortModule : public SST::Core::Serialization::serializable
241{
242public:
243 std::string type;
244 Params params;
245
246 ConfigPortModule() = default;
247 ConfigPortModule(const std::string& type, const Params& params) :
248 type(type),
249 params(params)
250 {}
251
252 void serialize_order(SST::Core::Serialization::serializer& ser) override
253 {
254 SST_SER(type);
255 SST_SER(params);
256 }
257 ImplementSerializable(SST::ConfigPortModule)
258};
259
260
261/** Represents the configuration of a generic component */
262class ConfigComponent : public SST::Core::Serialization::serializable
263{
264 friend class ComponentInfo;
265
266public:
267 ComponentId_t id; /*!< Unique ID of this component */
268 ConfigGraph* graph; /*!< Graph that this component belongs to */
269 std::string name; /*!< Name of this component, or slot name for subcomp */
270 int slot_num; /*!< Slot number. Only valid for subcomponents */
271 std::string type; /*!< Type of this component */
272 float weight; /*!< Partitioning weight for this component */
273 RankInfo rank; /*!< Parallel Rank for this component */
274 std::vector<LinkId_t> links; /*!< List of links connected */
275 Params params; /*!< Set of Parameters */
276 uint8_t statLoadLevel; /*!< Statistic load level for this component */
277
278 std::map<std::string, std::vector<ConfigPortModule>> portModules;
279 std::map<std::string, StatisticId_t>
280 enabledStatNames; /*!< Map of explicitly enabled statistic names to unique IDs */
281 bool enabledAllStats; /*!< Whether all stats in this (sub)component have been enabled */
282 ConfigStatistic allStatConfig; /*!< If all stats are enabled, the config information for the stats */
283
284 std::vector<ConfigComponent*> subComponents; /*!< List of subcomponents */
285 std::vector<double> coords;
286 uint16_t nextSubID; /*!< Next subID to use for children, if component, if subcomponent, subid of parent */
287 uint16_t nextStatID; /*!< Next statID to use for children */
288 bool visited; /*! Used when traversing graph to indicate component was visited already */
289
290 static constexpr ComponentId_t null_id = std::numeric_limits<ComponentId_t>::max();
291
292 inline const ComponentId_t& key() const { return id; }
293
294 /** Print Component information */
295 void print(std::ostream& os) const;
296
297 ConfigComponent* cloneWithoutLinks(ConfigGraph* new_graph) const;
298 ConfigComponent* cloneWithoutLinksOrParams(ConfigGraph* new_graph) const;
299 void setConfigGraphPointer(ConfigGraph* graph_ptr);
300
303 id(null_id),
304 statLoadLevel(STATISTICLOADLEVELUNINITIALIZED),
305 enabledAllStats(false),
306 nextSubID(1),
307 visited(false)
308 {}
309
310 StatisticId_t getNextStatisticID();
311
312 ConfigComponent* getParent() const;
313 std::string getFullName() const;
314
315 void setRank(RankInfo r);
316 void setWeight(double w);
317 void setCoordinates(const std::vector<double>& c);
318 void addParameter(const std::string& key, const std::string& value, bool overwrite);
319 ConfigComponent* addSubComponent(const std::string& name, const std::string& type, int slot);
320 ConfigComponent* findSubComponent(ComponentId_t);
321 const ConfigComponent* findSubComponent(ComponentId_t) const;
322 ConfigComponent* findSubComponentByName(const std::string& name);
323 ConfigStatistic* findStatistic(const std::string& name) const;
324 ConfigStatistic* insertStatistic(StatisticId_t id);
325 ConfigStatistic* findStatistic(StatisticId_t) const;
326 ConfigStatistic* enableStatistic(
327 const std::string& statisticName, const SST::Params& params, bool recursively = false);
328 ConfigStatistic* createStatistic();
329 bool reuseStatistic(const std::string& statisticName, StatisticId_t sid);
330 void addStatisticParameter(
331 const std::string& statisticName, const std::string& param, const std::string& value, bool recursively = false);
332 void setStatisticParameters(const std::string& statisticName, const Params& params, bool recursively = false);
333 void setStatisticLoadLevel(uint8_t level, bool recursively = false);
334
335 void addSharedParamSet(const std::string& set) { params.addSharedParamSet(set); }
336 [[deprecated(
337 "addGlobalParamSet() has been deprecated and will be removed in SST 16. Please use addSharedParamSet()")]]
338 void addGlobalParamSet(const std::string& set)
339 {
340 params.addSharedParamSet(set);
341 }
342 std::vector<std::string> getParamsLocalKeys() const { return params.getLocalKeys(); }
343 std::vector<std::string> getSubscribedSharedParamSets() const { return params.getSubscribedSharedParamSets(); }
344
345 [[deprecated("getSubscribedGlobalParamSets() has been deprecated and will be removed in SST 16. Please use "
346 "getSubscribedSharedParamSets()")]]
347 std::vector<std::string> getSubscribedGlobalParamSets() const
348 {
349 return params.getSubscribedSharedParamSets();
350 }
351
352 void addPortModule(const std::string& port, const std::string& type, const Params& params);
353
354 std::vector<LinkId_t> allLinks() const;
355
356 // Gets all the links to return, then clears links from self and
357 // all subcomponents. Used when splitting graphs.
358 std::vector<LinkId_t> clearAllLinks();
359
360 void serialize_order(SST::Core::Serialization::serializer& ser) override
361 {
362 SST_SER(id);
363 SST_SER(name);
364 SST_SER(slot_num);
365 SST_SER(type);
366 SST_SER(weight);
367 SST_SER(rank.rank);
368 SST_SER(rank.thread);
369 SST_SER(links);
370 SST_SER(params);
371 SST_SER(statLoadLevel);
372 SST_SER(portModules);
373 SST_SER(enabledStatNames);
374 SST_SER(enabledAllStats);
375 SST_SER(statistics_);
376 SST_SER(allStatConfig);
377 SST_SER(subComponents);
378 SST_SER(coords);
379 SST_SER(nextSubID);
380 SST_SER(nextStatID);
381 }
382
383 ImplementSerializable(SST::ConfigComponent)
384
385private:
386 std::map<StatisticId_t, ConfigStatistic>
387 statistics_; /* Map of explicitly enabled stat IDs to config info for each stat */
388
389 ComponentId_t getNextSubComponentID();
390
391 friend class ConfigGraph;
392 /** Checks to make sure port names are valid and that a port isn't used twice
393 */
394 void checkPorts() const;
395
396 /** Create a new Component */
397 ConfigComponent(ComponentId_t id, ConfigGraph* graph, const std::string& name, const std::string& type,
398 float weight, RankInfo rank) :
399 id(id),
400 graph(graph),
401 name(name),
402 slot_num(0),
403 type(type),
404 weight(weight),
405 rank(rank),
406 statLoadLevel(STATISTICLOADLEVELUNINITIALIZED),
407 enabledAllStats(false),
408 nextSubID(1),
409 nextStatID(1)
410 {
411 coords.resize(3, 0.0);
412 }
413
414 ConfigComponent(ComponentId_t id, ConfigGraph* graph, uint16_t parent_subid, const std::string& name, int slot_num,
415 const std::string& type, float weight, RankInfo rank) :
416 id(id),
417 graph(graph),
418 name(name),
420 type(type),
421 weight(weight),
422 rank(rank),
423 statLoadLevel(STATISTICLOADLEVELUNINITIALIZED),
424 enabledAllStats(false),
425 nextSubID(parent_subid),
426 nextStatID(parent_subid)
427 {
428 coords.resize(3, 0.0);
429 }
430};
431
432/** Map names to Links */
433// using ConfigLinkMap_t = std::map<std::string,ConfigLink>;
434// using ConfigLinkMap_t = SparseVectorMap<std::string,ConfigLink>;
435/** Map IDs to Components */
436using ConfigComponentMap_t = SparseVectorMap<ComponentId_t, ConfigComponent*>;
437/** Map names to Components */
438using ConfigComponentNameMap_t = std::map<std::string, ComponentId_t>;
439/** Map names to Parameter Sets: XML only */
440using ParamsMap_t = std::map<std::string, Params*>;
441/** Map names to variable values: XML only */
442using VariableMap_t = std::map<std::string, std::string>;
443
444class PartitionGraph;
445
446/** A Configuration Graph
447 * A graph representing Components and Links
448 */
450{
451public:
452 /** Print the configuration graph */
453 void print(std::ostream& os) const
454 {
455 os << "Printing graph" << std::endl;
456 for ( ConfigComponentMap_t::const_iterator i = comps_.begin(); i != comps_.end(); ++i ) {
457 (*i)->print(os);
458 }
459 }
460
461 ConfigGraph() :
462 nextComponentId(0)
463 {
464 links_.clear();
465 comps_.clear();
466 // Init the statistic output settings
467 stat_load_level_ = STATISTICSDEFAULTLOADLEVEL;
468 stat_outputs_.emplace_back(STATISTICSDEFAULTOUTPUTNAME);
469 // Output is only used for warnings or fatal that should go to stderr
470 Output& o = Output::getDefaultObject();
472 }
473
475 {
476 for ( auto comp : comps_ ) {
477 delete comp;
478 }
479 }
480
481 size_t getNumComponents() { return comps_.data.size(); }
482
483 size_t getNumComponentsInMPIRank(uint32_t rank);
484
485 /** Helper function to set all the ranks to the same value */
486 void setComponentRanks(RankInfo rank);
487 /** Checks to see if rank contains at least one component */
488 bool containsComponentInRank(RankInfo rank);
489 /** Verify that all components have valid Ranks assigned */
490 bool checkRanks(RankInfo ranks);
491
492 // API for programmatic initialization
493 /** Create a new component */
494 ComponentId_t addComponent(const std::string& name, const std::string& type);
495
496 /** Add a parameter to a shared param set */
497 void addSharedParam(const std::string& shared_set, const std::string& key, const std::string& value);
498
499 [[deprecated("addGlobalParam() has been deprecated and will be removed in SST 16. Please use addSharedParam()")]]
500 void addGlobalParam(const std::string& shared_set, const std::string& key, const std::string& value);
501
502 /** Set the statistic output module */
503 void setStatisticOutput(const std::string& name);
504
505 /** Add parameter to the statistic output module */
506 void addStatisticOutputParameter(const std::string& param, const std::string& value);
507
508 /** Set a set of parameter to the statistic output module */
509 void setStatisticOutputParams(const Params& p);
510
511 /** Set the statistic system load level */
512 void setStatisticLoadLevel(uint8_t loadLevel);
513
514 std::vector<ConfigStatOutput>& getStatOutputs() { return stat_outputs_; }
515
516 const ConfigStatOutput& getStatOutput(size_t index = 0) const { return stat_outputs_[index]; }
517
518 long getStatLoadLevel() const { return stat_load_level_; }
519
520 /** Add a Link to a Component on a given Port */
521 void addLink(ComponentId_t comp_id, const std::string& link_name, const std::string& port,
522 const std::string& latency_str, bool no_cut = false);
523
524 /** Set a Link to be no-cut */
525 void setLinkNoCut(const std::string& link_name);
526
527 /** Perform any post-creation cleanup processes */
528 void postCreationCleanup();
529
530 /** Check the graph for Structural errors */
532
533 // Temporary until we have a better API
534 /** Return the map of components */
535 ConfigComponentMap_t& getComponentMap() { return comps_; }
536
537 const std::map<std::string, ConfigStatGroup>& getStatGroups() const { return stat_groups_; }
538 ConfigStatGroup* getStatGroup(const std::string& name)
539 {
540 auto found = stat_groups_.find(name);
541 if ( found == stat_groups_.end() ) {
542 bool ok;
543 std::tie(found, ok) = stat_groups_.emplace(name, name);
544 }
545 return &(found->second);
546 }
547
548 bool containsComponent(ComponentId_t id) const;
549 ConfigComponent* findComponent(ComponentId_t);
550 ConfigComponent* findComponentByName(const std::string& name);
551 const ConfigComponent* findComponent(ComponentId_t) const;
552
553 bool containsStatistic(StatisticId_t id) const;
554 ConfigStatistic* findStatistic(StatisticId_t) const;
555
556 /** Return the map of links */
557 ConfigLinkMap_t& getLinkMap() { return links_; }
558
559 ConfigGraph* getSubGraph(uint32_t start_rank, uint32_t end_rank);
560 ConfigGraph* getSubGraph(const std::set<uint32_t>& rank_set);
561
562 ConfigGraph* splitGraph(const std::set<uint32_t>& orig_rank_set, const std::set<uint32_t>& new_rank_set);
563
564 PartitionGraph* getPartitionGraph();
565 PartitionGraph* getCollapsedPartitionGraph();
566 void annotateRanks(PartitionGraph* graph);
567 void getConnectedNoCutComps(ComponentId_t start, std::set<ComponentId_t>& group);
568
569 void setComponentConfigGraphPointers();
570 void serialize_order(SST::Core::Serialization::serializer& ser) override
571 {
572 SST_SER(links_);
573 SST_SER(comps_);
574 SST_SER(stat_outputs_);
575 SST_SER(stat_load_level_);
576 SST_SER(stat_groups_);
577 if ( ser.mode() == SST::Core::Serialization::serializer::UNPACK ) {
578 // Need to reintialize the ConfigGraph ptrs in the
579 // ConfigComponents
580 setComponentConfigGraphPointers();
581 }
582 }
583
584private:
585 friend class Simulation_impl;
586 friend class SSTSDLModelDefinition;
587
588 Output output;
589
590 ComponentId_t nextComponentId;
591
592 ConfigLinkMap_t links_; // SparseVectorMap
593 ConfigComponentMap_t comps_; // SparseVectorMap
594 ConfigComponentNameMap_t comps_by_name_; // std::map
595 std::map<std::string, ConfigStatGroup> stat_groups_;
596
597 std::map<std::string, LinkId_t> link_names_;
598
599 std::vector<ConfigStatOutput> stat_outputs_; // [0] is default
600 uint8_t stat_load_level_;
601
602 ImplementSerializable(SST::ConfigGraph)
603
604 // Filter class
605 class GraphFilter
606 {
607 ConfigGraph* ograph_;
608 ConfigGraph* ngraph_;
609 const std::set<uint32_t>& oset_;
610 const std::set<uint32_t>& nset_;
611
612 public:
613 GraphFilter(ConfigGraph* original_graph, ConfigGraph* new_graph, const std::set<uint32_t>& original_rank_set,
614 const std::set<uint32_t>& new_rank_set);
615
616 ConfigLink* operator()(ConfigLink* link);
617 ConfigComponent* operator()(ConfigComponent* comp);
618 };
619};
620
621class PartitionComponent
622{
623public:
624 ComponentId_t id;
625 float weight;
626 RankInfo rank;
627 LinkIdMap_t links;
628
629 ComponentIdMap_t group;
630
631 explicit PartitionComponent(const ConfigComponent* cc)
632 {
633 id = cc->id;
634 weight = cc->weight;
635 rank = cc->rank;
636 }
637
638 explicit PartitionComponent(LinkId_t id) :
639 id(id),
640 weight(0),
641 rank(RankInfo(RankInfo::UNASSIGNED, 0))
642 {}
643
644 // PartitionComponent(ComponentId_t id, ConfigGraph* graph, const ComponentIdMap_t& group);
645 void print(std::ostream& os, const PartitionGraph* graph) const;
646
647 inline ComponentId_t key() const { return id; }
648};
649
650class PartitionLink
651{
652public:
653 LinkId_t id;
654 ComponentId_t component[2];
655 SimTime_t latency[2];
656 bool no_cut;
657
658 PartitionLink(const ConfigLink& cl)
659 {
660 id = cl.id;
661 component[0] = cl.component[0];
662 component[1] = cl.component[1];
663 latency[0] = cl.latency[0];
664 latency[1] = cl.latency[1];
665 no_cut = cl.no_cut;
666 }
667
668 inline LinkId_t key() const { return id; }
669
670 /** Return the minimum latency of this link (from both sides) */
671 SimTime_t getMinLatency() const
672 {
673 if ( latency[0] < latency[1] ) return latency[0];
674 return latency[1];
675 }
676
677 /** Print the Link information */
678 void print(std::ostream& os) const
679 {
680 os << " Link " << id << std::endl;
681 os << " component[0] = " << component[0] << std::endl;
682 os << " latency[0] = " << latency[0] << std::endl;
683 os << " component[1] = " << component[1] << std::endl;
684 os << " latency[1] = " << latency[1] << std::endl;
685 }
686};
687
688using PartitionComponentMap_t = SparseVectorMap<ComponentId_t, PartitionComponent*>;
689using PartitionLinkMap_t = SparseVectorMap<LinkId_t, PartitionLink>;
690
692{
693private:
694 PartitionComponentMap_t comps_;
695 PartitionLinkMap_t links_;
696
697public:
698 /** Print the configuration graph */
699 void print(std::ostream& os) const
700 {
701 os << "Printing graph" << std::endl;
702 for ( PartitionComponentMap_t::const_iterator i = comps_.begin(); i != comps_.end(); ++i ) {
703 (*i)->print(os, this);
704 }
705 }
706
707 PartitionComponentMap_t& getComponentMap() { return comps_; }
708 PartitionLinkMap_t& getLinkMap() { return links_; }
709
710 const PartitionLink& getLink(LinkId_t id) const { return links_[id]; }
711
712 size_t getNumComponents() { return comps_.size(); }
713};
714
715} // namespace SST
716
717#endif // SST_CORE_CONFIGGRAPH_H
Represents the configuration of a generic component.
Definition configGraph.h:263
static constexpr ComponentId_t null_id
Definition configGraph.h:290
float weight
Definition configGraph.h:272
std::vector< LinkId_t > links
Definition configGraph.h:274
std::vector< ConfigComponent * > subComponents
Definition configGraph.h:284
bool enabledAllStats
Definition configGraph.h:281
int slot_num
Definition configGraph.h:270
std::string name
Definition configGraph.h:269
uint16_t nextSubID
Definition configGraph.h:286
std::string type
Definition configGraph.h:271
uint16_t nextStatID
Definition configGraph.h:287
ConfigStatistic allStatConfig
Definition configGraph.h:282
ComponentId_t id
Definition configGraph.h:267
void print(std::ostream &os) const
Print Component information.
Definition configGraph.cc:174
Params params
Definition configGraph.h:275
ConfigGraph * graph
Definition configGraph.h:268
ConfigComponent(ComponentId_t id, ConfigGraph *graph, const std::string &name, const std::string &type, float weight, RankInfo rank)
Create a new Component.
Definition configGraph.h:397
void checkPorts() const
Checks to make sure port names are valid and that a port isn't used twice.
Definition configGraph.cc:646
std::map< std::string, StatisticId_t > enabledStatNames
Definition configGraph.h:280
uint8_t statLoadLevel
Definition configGraph.h:276
RankInfo rank
Definition configGraph.h:273
A Configuration Graph A graph representing Components and Links.
Definition configGraph.h:450
void setStatisticLoadLevel(uint8_t loadLevel)
Set the statistic system load level.
Definition configGraph.cc:834
ComponentId_t addComponent(const std::string &name, const std::string &type)
Create a new component.
Definition configGraph.cc:795
void setLinkNoCut(const std::string &link_name)
Set a Link to be no-cut.
Definition configGraph.cc:884
ConfigComponentMap_t & getComponentMap()
Return the map of components.
Definition configGraph.h:535
bool checkForStructuralErrors()
Check the graph for Structural errors.
Definition configGraph.cc:759
void postCreationCleanup()
Perform any post-creation cleanup processes.
Definition configGraph.cc:729
void addSharedParam(const std::string &shared_set, const std::string &key, const std::string &value)
Add a parameter to a shared param set.
Definition configGraph.cc:810
bool checkRanks(RankInfo ranks)
Verify that all components have valid Ranks assigned.
Definition configGraph.cc:717
bool containsComponentInRank(RankInfo rank)
Checks to see if rank contains at least one component.
Definition configGraph.cc:708
void setStatisticOutputParams(const Params &p)
Set a set of parameter to the statistic output module.
Definition configGraph.cc:822
void addStatisticOutputParameter(const std::string &param, const std::string &value)
Add parameter to the statistic output module.
Definition configGraph.cc:828
void addLink(ComponentId_t comp_id, const std::string &link_name, const std::string &port, const std::string &latency_str, bool no_cut=false)
Add a Link to a Component on a given Port.
Definition configGraph.cc:840
ConfigLinkMap_t & getLinkMap()
Return the map of links.
Definition configGraph.h:557
void setComponentRanks(RankInfo rank)
Helper function to set all the ranks to the same value.
Definition configGraph.cc:700
void print(std::ostream &os) const
Print the configuration graph.
Definition configGraph.h:453
void setStatisticOutput(const std::string &name)
Set the statistic output module.
Definition configGraph.cc:816
Class that represents a PortModule in ConfigGraph.
Definition configGraph.h:241
Definition configGraph.h:175
std::pair< bool, std::string > verifyStatsAndComponents(const ConfigGraph *graph)
Checks to make sure that all components in the group support all of the statistics as configured in t...
Definition configGraph.cc:149
Definition configGraph.h:214
Definition configGraph.h:134
StatisticId_t id
Definition configGraph.h:136
Class to contain SST Simulation Configuration variables.
Definition config.h:41
Definition serializable.h:24
This class is basically a wrapper for objects to declare the order in which their members should be s...
Definition serializer.h:45
Output object provides consistent method for outputting data to stdout, stderr and/or sst debug file.
Definition output.h:54
uint32_t getVerboseLevel() const
Returns object verbose level.
Definition output.cc:107
std::string getPrefix() const
Returns object prefix.
Definition output.cc:131
@ STDERR
Definition output.h:61
void init(const std::string &prefix, uint32_t verbose_level, uint32_t verbose_mask, output_location_t location, const std::string &localoutputfilename="")
Initialize the object after construction.
Definition output.cc:71
uint32_t getVerboseMask() const
Returns object verbose mask.
Definition output.cc:119
Parameter store.
Definition params.h:58
Definition configGraph.h:692
void print(std::ostream &os) const
Print the configuration graph.
Definition configGraph.h:699
Definition rankInfo.h:24
Main control class for a SST Simulation.
Definition simulation_impl.h:87
Class that stores data in a vector, but can access the data similar to a map.
Definition sparseVectorMap.h:45
void clear()
Clears the contents of the SparseVectorMap.
Definition sparseVectorMap.h:259
size_t size()
Returns the number of items in the SparseVectorMap.
Definition sparseVectorMap.h:266
Class for creating and managing TimeConverter objects.
Definition timeLord.h:40
Performs Unit math in full precision.
Definition unitAlgebra.h:107