Skip to content

Commit 6eb12f9

Browse files
Merge pull request #1226 from sstsimulator/devel
Automatically Merged using SST Master Branch Merger
2 parents 07ad23f + 55e0541 commit 6eb12f9

File tree

229 files changed

+1564
-1942
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

229 files changed

+1564
-1942
lines changed

src/sst/core/activity.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ class Activity : public SST::Core::MemPoolItem
136136

137137

138138
/** Function which will be called when the time for this Activity comes to pass. */
139-
virtual void execute(void) = 0;
139+
virtual void execute() = 0;
140140

141141
/** Set the time for which this Activity should be delivered */
142142
inline void setDeliveryTime(SimTime_t time) { delivery_time = time; }

src/sst/core/baseComponent.cc

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ BaseComponent::~BaseComponent()
8282
my_info->component = nullptr;
8383
if ( my_info->parent_info ) {
8484
std::map<ComponentId_t, ComponentInfo>& parent_subcomps = my_info->parent_info->getSubComponents();
85-
size_t deleted = parent_subcomps.erase(my_info->id);
85+
size_t deleted = parent_subcomps.erase(my_info->id_);
8686
if ( deleted != 1 ) {
8787
// Should never happen, but issue warning just in case
8888
sim_->getSimulationOutput().output(
@@ -288,6 +288,7 @@ BaseComponent::configureLink(const std::string& name, TimeConverter* time_base,
288288
tmp = my_info->parent_info->component->getLinkFromParentSharedPort(name, port_modules);
289289
// If I got a link from my parent, I need to put it in my
290290
// link map
291+
291292
if ( nullptr != tmp ) {
292293
if ( nullptr == myLinks ) {
293294
myLinks = new LinkMap();
@@ -299,8 +300,11 @@ BaseComponent::configureLink(const std::string& name, TimeConverter* time_base,
299300

300301
// Need to see if I got any port_modules, if so, need
301302
// to add them to my_info->portModules
303+
302304
if ( port_modules.size() > 0 ) {
303305
if ( nullptr == my_info->portModules ) {
306+
// This memory is currently leaked as portModules is otherwise a pointer to ConfigComponent
307+
// ConfigComponent does not exist for anonymous subcomponents
304308
my_info->portModules = new std::map<std::string, std::vector<ConfigPortModule>>();
305309
}
306310
(*my_info->portModules)[name].swap(port_modules);
@@ -331,7 +335,9 @@ BaseComponent::configureLink(const std::string& name, TimeConverter* time_base,
331335
}
332336

333337
// Check for PortModules
334-
if ( my_info->portModules != nullptr ) {
338+
// portModules pointer may be invalid after wire up
339+
// Only SelfLinks can be initialized after wire up and SelfLinks do not support PortModules
340+
if ( !sim_->isWireUpFinished() && my_info->portModules != nullptr ) {
335341
auto it = my_info->portModules->find(name);
336342
if ( it != my_info->portModules->end() ) {
337343
EventHandlerMetaData mdata(my_info->getID(), getName(), getType(), name);
@@ -683,13 +689,11 @@ BaseComponent::getComponentInfoStatisticEnableLevel(const std::string& statistic
683689
}
684690

685691
void
686-
BaseComponent::configureCollectionMode(
687-
Statistics::StatisticBase* statistic, const SST::Params& params, const std::string& name)
692+
BaseComponent::configureCollectionMode(Statistics::StatisticBase* statistic, const std::string& name)
688693
{
689694
StatisticBase::StatMode_t statCollectionMode = StatisticBase::STAT_MODE_COUNT;
690695
Output& out = Simulation_impl::getSimulationOutput();
691-
std::string statRateParam = params.find<std::string>("rate", "0ns");
692-
UnitAlgebra collectionRate(statRateParam);
696+
UnitAlgebra collectionRate = statistic->getCollectionRate();
693697

694698
// make sure we have a valid collection rate
695699
// Check that the Collection Rate is a valid unit type that we can use
@@ -766,7 +770,7 @@ BaseComponent::createStatistic(
766770
cpp_params.insert(python_params);
767771
std::string type = cpp_params.find<std::string>("type", "sst.AccumulatorStatistic");
768772
auto* stat = fxn(this, engine, type, name, subId, cpp_params);
769-
configureCollectionMode(stat, cpp_params, name);
773+
configureCollectionMode(stat, name);
770774
engine->registerStatisticWithEngine(stat);
771775
return stat;
772776
}
@@ -775,16 +779,16 @@ Statistics::StatisticBase*
775779
BaseComponent::createEnabledAllStatistic(
776780
Params& params, const std::string& name, const std::string& statSubId, StatCreateFunction fxn)
777781
{
778-
auto iter = m_enabledAllStats.find(name);
779-
if ( iter != m_enabledAllStats.end() ) {
782+
auto iter = m_enabled_all_stats_.find(name);
783+
if ( iter != m_enabled_all_stats_.end() ) {
780784
auto& submap = iter->second;
781785
auto subiter = submap.find(statSubId);
782786
if ( subiter != submap.end() ) { return subiter->second; }
783787
}
784788

785789
// a matching statistic was not found
786-
auto* stat = createStatistic(params, my_info->allStatConfig->params, name, statSubId, true, std::move(fxn));
787-
m_enabledAllStats[name][statSubId] = stat;
790+
auto* stat = createStatistic(params, my_info->all_stat_config_->params, name, statSubId, true, std::move(fxn));
791+
if ( !stat->isNullStatistic() ) { m_enabled_all_stats_[name][statSubId] = stat; }
788792
return stat;
789793
}
790794

@@ -799,8 +803,8 @@ BaseComponent::createExplicitlyEnabledStatistic(
799803
name.c_str());
800804
}
801805

802-
auto piter = my_info->statConfigs->find(id);
803-
if ( piter == my_info->statConfigs->end() ) {
806+
auto piter = my_info->stat_configs_->find(id);
807+
if ( piter == my_info->stat_configs_->end() ) {
804808
out.fatal(
805809
CALL_INFO, 1, "Explicitly enabled statistic '%s' does not have parameters mapped to its ID", name.c_str());
806810
}
@@ -919,9 +923,7 @@ BaseComponent::serialize_order(SST::Core::Serialization::serializer& ser)
919923
}
920924
}
921925

922-
namespace Core {
923-
namespace Serialization {
924-
namespace pvt {
926+
namespace Core::Serialization::pvt {
925927

926928
static const long null_ptr_id = -1;
927929

@@ -987,7 +989,7 @@ SerializeBaseComponentHelper::map_basecomponent(serializable_base*& s, serialize
987989
ObjectMap* my_info_dir = new ObjectMapHierarchyOnly();
988990
ser.mapper().map_hierarchy_start("my_info", my_info_dir);
989991
ser.mapper().setNextObjectReadOnly();
990-
sst_map_object(ser, const_cast<ComponentId_t&>(comp->my_info->id), "id");
992+
sst_map_object(ser, const_cast<ComponentId_t&>(comp->my_info->id_), "id");
991993
ser.mapper().setNextObjectReadOnly();
992994
sst_map_object(ser, const_cast<std::string&>(comp->my_info->type), "type");
993995
sst_map_object(ser, comp->my_info->defaultTimeBase, "defaultTimeBase");
@@ -997,9 +999,6 @@ SerializeBaseComponentHelper::map_basecomponent(serializable_base*& s, serialize
997999
ser.mapper().map_hierarchy_end(); // obj_map
9981000
}
9991001

1000-
} // namespace pvt
1001-
} // namespace Serialization
1002-
} // namespace Core
1003-
1002+
} // namespace Core::Serialization::pvt
10041003

10051004
} // namespace SST

src/sst/core/baseComponent.h

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,9 @@ class TimeConverter;
4949
class UnitAlgebra;
5050

5151

52-
namespace Core {
53-
namespace Serialization {
54-
namespace pvt {
52+
namespace Core::Serialization::pvt {
5553
class SerializeBaseComponentHelper;
56-
} // namespace pvt
57-
} // namespace Serialization
58-
} // namespace Core
54+
}
5955

6056
/**
6157
* Main component object for the simulation.
@@ -84,15 +80,15 @@ class BaseComponent : public SST::Core::Serialization::serializable_base
8480
const std::string& getType() const { return my_info->getType(); }
8581

8682
/** Returns unique component ID */
87-
inline ComponentId_t getId() const { return my_info->id; }
83+
inline ComponentId_t getId() const { return my_info->id_; }
8884

8985
/** Returns Component Statistic load level */
9086
inline uint8_t getStatisticLoadLevel() const { return my_info->statLoadLevel; }
9187

9288
/** Called when SIGINT or SIGTERM has been seen.
9389
* Allows components opportunity to clean up external state.
9490
*/
95-
virtual void emergencyShutdown(void) {}
91+
virtual void emergencyShutdown() {}
9692

9793
/** Returns Component/SubComponent Name */
9894
inline const std::string& getName() const { return my_info->getName(); }
@@ -441,9 +437,9 @@ class BaseComponent : public SST::Core::Serialization::serializable_base
441437
Statistics::Statistic<T>*
442438
registerStatistic(SST::Params& params, const std::string& statName, const std::string& statSubId, bool inserting)
443439
{
444-
if ( my_info->enabledStatNames ) {
445-
auto iter = my_info->enabledStatNames->find(statName);
446-
if ( iter != my_info->enabledStatNames->end() ) {
440+
if ( my_info->enabled_stat_names_ ) {
441+
auto iter = my_info->enabled_stat_names_->find(statName);
442+
if ( iter != my_info->enabled_stat_names_->end() ) {
447443
// valid, enabled statistic
448444
// During initialization, the component should have assigned a mapping between
449445
// the local name and globally unique stat ID
@@ -455,7 +451,7 @@ class BaseComponent : public SST::Core::Serialization::serializable_base
455451
// if we got here, this is not a stat we explicitly enabled
456452
if ( inserting || doesComponentInfoStatisticExist(statName) ) {
457453
// this is a statistic that I registered
458-
if ( my_info->enabledAllStats ) { return createStatistic<T>(params, STATALL_ID, statName, statSubId); }
454+
if ( my_info->enabled_all_stats_ ) { return createStatistic<T>(params, STATALL_ID, statName, statSubId); }
459455
else if ( my_info->parent_info && my_info->canInsertStatistics() ) {
460456
// I did not explicitly enable nor enable all
461457
// but I can insert statistics into my parent
@@ -595,7 +591,7 @@ class BaseComponent : public SST::Core::Serialization::serializable_base
595591
template <class T, class... ARGS>
596592
T* loadComponentExtension(ARGS... args)
597593
{
598-
ComponentExtension* ret = new T(my_info->id, args...);
594+
ComponentExtension* ret = new T(my_info->id_, args...);
599595
return static_cast<T*>(ret);
600596
}
601597

@@ -678,7 +674,7 @@ class BaseComponent : public SST::Core::Serialization::serializable_base
678674

679675
// Check to see if this can be loaded with new API or if we have to fallback to old
680676
if ( isSubComponentLoadableUsingAPI<T>(type) ) {
681-
auto ret = Factory::getFactory()->CreateWithParams<T>(type, params, sub_info->id, params, args...);
677+
auto ret = Factory::getFactory()->CreateWithParams<T>(type, params, sub_info->id_, params, args...);
682678
return ret;
683679
}
684680
return nullptr;
@@ -795,8 +791,7 @@ class BaseComponent : public SST::Core::Serialization::serializable_base
795791
private:
796792
SimTime_t processCurrentTimeWithUnderflowedBase(const std::string& base) const;
797793

798-
void
799-
configureCollectionMode(Statistics::StatisticBase* statistic, const SST::Params& params, const std::string& name);
794+
void configureCollectionMode(Statistics::StatisticBase* statistic, const std::string& name);
800795

801796
/**
802797
* @brief findExplicitlyEnabledStatistic
@@ -846,7 +841,7 @@ class BaseComponent : public SST::Core::Serialization::serializable_base
846841

847842
if ( isSubComponentLoadableUsingAPI<T>(sub_info->type) ) {
848843
auto ret = Factory::getFactory()->CreateWithParams<T>(
849-
sub_info->type, *sub_info->params, sub_info->id, *sub_info->params, args...);
844+
sub_info->type, *sub_info->params, sub_info->id_, *sub_info->params, args...);
850845
return ret;
851846
}
852847
return nullptr;
@@ -921,7 +916,7 @@ class BaseComponent : public SST::Core::Serialization::serializable_base
921916
std::vector<PortModule*> portModules;
922917
std::map<StatisticId_t, Statistics::StatisticBase*> m_explicitlyEnabledSharedStats;
923918
std::map<StatisticId_t, StatNameMap> m_explicitlyEnabledUniqueStats;
924-
StatNameMap m_enabledAllStats;
919+
StatNameMap m_enabled_all_stats_;
925920

926921
BaseComponent* getParentComponent()
927922
{
@@ -1117,11 +1112,9 @@ class SubComponentSlotInfo
11171112
}
11181113
};
11191114

1120-
namespace Core {
1121-
namespace Serialization {
1115+
namespace Core::Serialization {
11221116

11231117
namespace pvt {
1124-
11251118
class SerializeBaseComponentHelper
11261119
{
11271120
public:
@@ -1138,7 +1131,7 @@ class SerializeBaseComponentHelper
11381131

11391132

11401133
template <class T>
1141-
class serialize_impl<T*, typename std::enable_if<std::is_base_of<SST::BaseComponent, T>::value>::type>
1134+
class serialize_impl<T*, std::enable_if_t<std::is_base_of_v<SST::BaseComponent, T>>>
11421135
{
11431136
template <class A>
11441137
friend class serialize;
@@ -1169,8 +1162,7 @@ class serialize_impl<T*, typename std::enable_if<std::is_base_of<SST::BaseCompon
11691162
}
11701163
};
11711164

1172-
} // namespace Serialization
1173-
} // namespace Core
1165+
} // namespace Core::Serialization
11741166

11751167
} // namespace SST
11761168

src/sst/core/cfgoutput/dotConfigOutput.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
#include "sst/core/configGraph.h"
1717
#include "sst/core/configGraphOutput.h"
1818

19-
namespace SST {
20-
namespace Core {
19+
namespace SST::Core {
2120

2221
class DotConfigGraphOutput : public ConfigGraphOutput
2322
{
@@ -33,7 +32,6 @@ class DotConfigGraphOutput : public ConfigGraphOutput
3332
void generateDot(const ConfigLink* link, const uint32_t dot_verbosity) const;
3433
};
3534

36-
} // namespace Core
37-
} // namespace SST
35+
} // namespace SST::Core
3836

3937
#endif // SST_CORE_DOT_CONFIG_OUTPUT_H

src/sst/core/cfgoutput/jsonConfigOutput.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
#include "sst/core/configGraph.h"
1717
#include "sst/core/configGraphOutput.h"
1818

19-
namespace SST {
20-
namespace Core {
19+
namespace SST::Core {
2120

2221
class JSONConfigGraphOutput : public ConfigGraphOutput
2322
{
@@ -27,7 +26,6 @@ class JSONConfigGraphOutput : public ConfigGraphOutput
2726
virtual void generate(const Config* cfg, ConfigGraph* graph) override;
2827
};
2928

30-
} // namespace Core
31-
} // namespace SST
29+
} // namespace SST::Core
3230

3331
#endif // SST_CORE_JSON_CONFIG_OUTPUT_H

src/sst/core/cfgoutput/pythonConfigOutput.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818

1919
#include <map>
2020

21-
namespace SST {
22-
namespace Core {
21+
namespace SST::Core {
2322

2423
class PythonConfigGraphOutput : public ConfigGraphOutput
2524
{
@@ -51,7 +50,6 @@ class PythonConfigGraphOutput : public ConfigGraphOutput
5150
std::map<LinkId_t, std::string> linkMap;
5251
};
5352

54-
} // namespace Core
55-
} // namespace SST
53+
} // namespace SST::Core
5654

5755
#endif // SST_CORE_PYTHON_CONFIG_OUTPUT_H

src/sst/core/cfgoutput/xmlConfigOutput.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
#include "sst/core/configGraph.h"
1717
#include "sst/core/configGraphOutput.h"
1818

19-
namespace SST {
20-
namespace Core {
19+
namespace SST::Core {
2120

2221
class XMLConfigGraphOutput : public ConfigGraphOutput
2322
{
@@ -30,7 +29,6 @@ class XMLConfigGraphOutput : public ConfigGraphOutput
3029
void generateXML(const std::string& indent, const ConfigLink* link, const ConfigComponentMap_t& compMap) const;
3130
};
3231

33-
} // namespace Core
34-
} // namespace SST
32+
} // namespace SST::Core
3533

3634
#endif // SST_CORE_XML_CONFIG_OUTPUT_H

src/sst/core/checkpointAction.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ CheckpointAction::~CheckpointAction() {}
7373

7474
// Generate checkpoint on simulation time period
7575
void
76-
CheckpointAction::execute(void)
76+
CheckpointAction::execute()
7777
{
7878
Simulation_impl* sim = Simulation_impl::getSimulation();
7979
createCheckpoint(sim);

src/sst/core/checkpointAction.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class CheckpointAction : public Action
7070
void setCheckpoint();
7171

7272
/** Called by TimeVortex to trigger checkpoint on simulation clock interval - not used in parallel simulation */
73-
void execute(void) override;
73+
void execute() override;
7474

7575
/** Called by SyncManager to check whether a checkpoint should be generated */
7676
SimTime_t check(SimTime_t current_time);

src/sst/core/clock.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Clock::getNextCycle()
8282
}
8383

8484
void
85-
Clock::execute(void)
85+
Clock::execute()
8686
{
8787
Simulation_impl* sim = Simulation_impl::getSimulation();
8888

0 commit comments

Comments
 (0)