Skip to content

Commit 1d58c3e

Browse files
committed
Merge remote-tracking branch 'sstcore/devel' into override
2 parents 45cf16b + 30c40ff commit 1d58c3e

Some content is hidden

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

87 files changed

+1133
-996
lines changed

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ esac
6262

6363
SST_CHECK_PICKY
6464
AS_IF([test "x$use_picky" = "xyes"],
65-
[WARNFLAGS="-Wall -Wextra -Wnon-virtual-dtor -Wsuggest-override"],
65+
[WARNFLAGS="-Wall -Wextra -Wvla -Wnon-virtual-dtor -Wsuggest-override"],
6666
[WARNFLAGS=""])
6767
CFLAGS="$CFLAGS $WARNFLAGS"
6868
CXXFLAGS="$CXXFLAGS $WARNFLAGS"

src/sst/core/activity.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,9 @@ class Activity : public SST::Core::MemPoolItem
213213
// inherit from it need to be serializable.
214214
void serialize_order(SST::Core::Serialization::serializer& ser) override
215215
{
216-
ser& delivery_time;
217-
ser& priority_order;
218-
ser& queue_order;
216+
SST_SER(delivery_time);
217+
SST_SER(priority_order);
218+
SST_SER(queue_order);
219219
}
220220

221221
ImplementVirtualSerializable(SST::Activity);

src/sst/core/baseComponent.cc

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -887,8 +887,8 @@ BaseComponent::initiateInteractive(const std::string& msg)
887887
void
888888
BaseComponent::serialize_order(SST::Core::Serialization::serializer& ser)
889889
{
890-
ser& my_info;
891-
ser& isExtension;
890+
SST_SER(my_info);
891+
SST_SER(isExtension);
892892

893893
switch ( ser.mode() ) {
894894
case SST::Core::Serialization::serializer::SIZER:
@@ -897,12 +897,12 @@ BaseComponent::serialize_order(SST::Core::Serialization::serializer& ser)
897897
// Need to serialize each handler
898898
std::pair<Clock::HandlerBase*, SimTime_t> p;
899899
size_t num_handlers = clock_handlers.size();
900-
ser& num_handlers;
900+
SST_SER(num_handlers);
901901
for ( auto* handler : clock_handlers ) {
902902
p.first = handler;
903903
// See if it's currently registered with a clock
904904
p.second = sim_->getClockForHandler(handler);
905-
ser& p;
905+
SST_SER(p);
906906
}
907907
break;
908908
}
@@ -911,9 +911,9 @@ BaseComponent::serialize_order(SST::Core::Serialization::serializer& ser)
911911
sim_ = Simulation_impl::getSimulation();
912912
std::pair<Clock::HandlerBase*, SimTime_t> p;
913913
size_t num_handlers;
914-
ser& num_handlers;
914+
SST_SER(num_handlers);
915915
for ( size_t i = 0; i < num_handlers; ++i ) {
916-
ser& p;
916+
SST_SER(p);
917917
// Add handler to clock_handlers list
918918
clock_handlers.push_back(p.first);
919919
// If it was previously registered, register it now
@@ -1077,19 +1077,18 @@ SerializeBaseComponentHelper::map_basecomponent(serializable_base*& s, serialize
10771077
// on slotname and slotnum
10781078
name_str += it->second.getSlotName() + "[" + std::to_string(it->second.getSlotNum()) + "]";
10791079
}
1080-
// sst_map_object(ser, it->second.component, it->second.getShortName().c_str());
1081-
sst_map_object(ser, it->second.component, name_str.c_str());
1080+
SST_SER_NAME(it->second.component, name_str.c_str());
10821081
it->second.serialize_comp(ser);
10831082
}
10841083

10851084
// Put in ComponentInfo data
10861085
ObjectMap* my_info_dir = new ObjectMapHierarchyOnly();
10871086
ser.mapper().map_hierarchy_start("my_info", my_info_dir);
1088-
ser.mapper().setNextObjectReadOnly();
1089-
sst_map_object(ser, const_cast<ComponentId_t&>(comp->my_info->id_), "id");
1090-
ser.mapper().setNextObjectReadOnly();
1091-
sst_map_object(ser, const_cast<std::string&>(comp->my_info->type), "type");
1092-
sst_map_object(ser, comp->my_info->defaultTimeBase, "defaultTimeBase");
1087+
1088+
SST_SER_NAME(const_cast<ComponentId_t&>(comp->my_info->id_), "id", SerOption::map_read_only);
1089+
SST_SER_NAME(const_cast<std::string&>(comp->my_info->type), "type", SerOption::map_read_only);
1090+
SST_SER_NAME(comp->my_info->defaultTimeBase, "defaultTimeBase");
1091+
10931092
ser.mapper().map_hierarchy_end(); // for my_info_dir
10941093

10951094
s->serialize_order(ser);

src/sst/core/baseComponent.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,9 +1156,7 @@ class SerializeBaseComponentHelper
11561156
template <class T>
11571157
class serialize_impl<T*, std::enable_if_t<std::is_base_of_v<SST::BaseComponent, T>>>
11581158
{
1159-
template <class A>
1160-
friend class serialize;
1161-
void operator()(T*& s, serializer& ser)
1159+
void operator()(T*& s, serializer& ser, ser_opt_t UNUSED(options))
11621160
{
11631161
serializable_base* sp = static_cast<serializable_base*>(s);
11641162
switch ( ser.mode() ) {
@@ -1177,6 +1175,8 @@ class serialize_impl<T*, std::enable_if_t<std::is_base_of_v<SST::BaseComponent,
11771175
}
11781176
s = static_cast<T*>(sp);
11791177
}
1178+
1179+
SST_FRIEND_SERIALZE();
11801180
};
11811181

11821182
} // namespace Core::Serialization

src/sst/core/bootsst.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
#include "sst/core/configShared.h"
1616

1717
#include <cstdlib>
18-
#include <string.h>
18+
#include <cstring>
19+
#include <memory>
1920
#include <unistd.h> // for opterr
2021

2122
int
@@ -31,14 +32,14 @@ main(int argc, char* argv[])
3132
SST::ConfigShared cfg(true, true, true, true);
3233

3334
// Make a copy of the argv array (shallow)
34-
char* argv_copy[argc + 1];
35+
auto argv_copy = std::make_unique<char*[]>(argc + 1);
3536
for ( int i = 0; i < argc; ++i ) {
3637
argv_copy[i] = argv[i];
3738
}
3839
argv[argc] = nullptr;
3940

4041
// All ranks parse the command line
41-
cfg.parseCmdLine(argc, argv_copy);
42+
cfg.parseCmdLine(argc, argv_copy.get());
4243

4344
if ( cfg.no_env_config() ) config_env = 0;
4445
if ( cfg.verbose() ) verbose = 1;

src/sst/core/bootsstinfo.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
#include "sst/core/bootshared.h"
1515
#include "sst/core/configShared.h"
1616

17+
#include <cstdio>
18+
#include <memory>
19+
1720
int
1821
main(int argc, char* argv[])
1922
{
@@ -26,13 +29,13 @@ main(int argc, char* argv[])
2629
SST::ConfigShared cfg(true, true, true, true);
2730

2831
// Make a copy of the argv array (shallow)
29-
char* argv_copy[argc + 1];
32+
auto argv_copy = std::make_unique<char*[]>(argc + 1);
3033
for ( int i = 0; i < argc; ++i ) {
3134
argv_copy[i] = argv[i];
3235
}
3336
argv[argc] = nullptr;
3437

35-
cfg.parseCmdLine(argc, argv_copy, true);
38+
cfg.parseCmdLine(argc, argv_copy.get(), true);
3639

3740
if ( cfg.no_env_config() ) config_env = false;
3841

src/sst/core/clock.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,10 @@ Clock::serialize_order(SST::Core::Serialization::serializer& ser)
157157

158158
// Won't serialize the handlers; they'll be re-registered at
159159
// restart
160-
ser& currentCycle;
161-
ser& period;
162-
ser& next;
163-
ser& scheduled;
160+
SST_SER(currentCycle);
161+
SST_SER(period);
162+
SST_SER(next);
163+
SST_SER(scheduled);
164164
}
165165

166166

src/sst/core/componentInfo.cc

Lines changed: 27 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ ComponentInfo::~ComponentInfo()
199199
void
200200
ComponentInfo::serialize_comp(SST::Core::Serialization::serializer& ser)
201201
{
202-
ser& component;
203-
ser& link_map;
202+
SST_SER(component);
203+
SST_SER(link_map);
204204
for ( auto it = subComponents.begin(); it != subComponents.end(); ++it ) {
205205
it->second.serialize_comp(ser);
206206
}
@@ -219,21 +219,21 @@ ComponentInfo::serialize_order(SST::Core::Serialization::serializer& ser)
219219

220220
// Serialize all my data except the component and link_map
221221

222-
ser& const_cast<ComponentId_t&>(id_);
223-
ser& parent_info;
224-
ser& const_cast<std::string&>(name);
225-
ser& const_cast<std::string&>(type);
222+
SST_SER(const_cast<ComponentId_t&>(id_));
223+
SST_SER(parent_info);
224+
SST_SER(const_cast<std::string&>(name));
225+
SST_SER(const_cast<std::string&>(type));
226226

227227
// Not used after construction, no need to serialize
228-
// ser& params;
228+
// SST_SER(params);
229229

230-
ser& defaultTimeBase;
230+
SST_SER(defaultTimeBase);
231231

232-
// ser& coordinates;
233-
ser& subIDIndex;
234-
ser& const_cast<std::string&>(slot_name);
235-
ser& slot_num;
236-
ser& share_flags;
232+
// SST_SER(coordinates);
233+
SST_SER(subIDIndex);
234+
SST_SER(const_cast<std::string&>(slot_name));
235+
SST_SER(slot_num);
236+
SST_SER(share_flags);
237237

238238
// Serialize statistic data structures - only needed for late stat registration
239239
// No one else has these pointers so serialize the data structure & reallocate on UNPACK
@@ -243,39 +243,39 @@ ComponentInfo::serialize_order(SST::Core::Serialization::serializer& ser)
243243
std::map<std::string, StatisticId_t> enabled_stat_names;
244244
bool is_null = true;
245245

246-
ser& is_null;
246+
SST_SER(is_null);
247247
if ( !is_null ) {
248-
ser& stat_configs;
248+
SST_SER(stat_configs);
249249
stat_configs_ = new std::map<StatisticId_t, ConfigStatistic>(stat_configs);
250250
}
251251

252-
ser& is_null;
252+
SST_SER(is_null);
253253
if ( !is_null ) {
254-
ser& all_stat_config;
254+
SST_SER(all_stat_config);
255255
all_stat_config_ = new ConfigStatistic(all_stat_config);
256256
}
257257

258-
ser& is_null;
258+
SST_SER(is_null);
259259
if ( !is_null ) {
260-
ser& enabled_stat_names;
260+
SST_SER(enabled_stat_names);
261261
enabled_stat_names_ = new std::map<std::string, StatisticId_t>(enabled_stat_names);
262262
}
263263
}
264264
else {
265265
bool is_null = stat_configs_ == nullptr;
266-
ser& is_null;
267-
if ( !is_null ) ser&(*stat_configs_);
266+
SST_SER(is_null);
267+
if ( !is_null ) SST_SER(*stat_configs_);
268268

269269
is_null = all_stat_config_ == nullptr;
270-
ser& is_null;
271-
if ( !is_null ) ser&(*all_stat_config_);
270+
SST_SER(is_null);
271+
if ( !is_null ) SST_SER(*all_stat_config_);
272272

273273
is_null = enabled_stat_names_ == nullptr;
274-
ser& is_null;
275-
if ( !is_null ) ser&(*enabled_stat_names_);
274+
SST_SER(is_null);
275+
if ( !is_null ) SST_SER(*enabled_stat_names_);
276276
}
277277

278-
ser& statLoadLevel; // Potentially needed for late stat registration
278+
SST_SER(statLoadLevel); // Potentially needed for late stat registration
279279

280280
// For SubComponents map, need to serialize map by hand since we
281281
// we will need to use the track non-pointer as pointer feature in
@@ -284,48 +284,7 @@ ComponentInfo::serialize_order(SST::Core::Serialization::serializer& ser)
284284
// own SubCompenents that will need to point to the data location
285285
// in the map.
286286

287-
// ser& subComponents;
288-
switch ( ser.mode() ) {
289-
case SST::Core::Serialization::serializer::SIZER:
290-
{
291-
size_t size = subComponents.size();
292-
ser& size;
293-
for ( auto it = subComponents.begin(); it != subComponents.end(); ++it ) {
294-
// keys are const values - annoyingly
295-
ser& const_cast<ComponentId_t&>(it->first);
296-
ser | it->second;
297-
}
298-
break;
299-
}
300-
case SST::Core::Serialization::serializer::PACK:
301-
{
302-
size_t size = subComponents.size();
303-
ser& size;
304-
for ( auto it = subComponents.begin(); it != subComponents.end(); ++it ) {
305-
// keys are const values - annoyingly
306-
ser& const_cast<ComponentId_t&>(it->first);
307-
ser | it->second;
308-
}
309-
break;
310-
}
311-
case SST::Core::Serialization::serializer::UNPACK:
312-
{
313-
size_t size;
314-
ser& size;
315-
for ( size_t i = 0; i < size; ++i ) {
316-
ComponentId_t key;
317-
ser& key;
318-
319-
auto p = subComponents.emplace(key, ComponentInfo {});
320-
321-
ser | p.first->second;
322-
}
323-
break;
324-
}
325-
case SST::Core::Serialization::serializer::MAP:
326-
// Add your code here
327-
break;
328-
}
287+
SST_SER(subComponents, SerOption::as_ptr_elem);
329288

330289
// Only the parent Component will call serialize_comp directly.
331290
// This function will walk the hierarchy and call it on all of its

0 commit comments

Comments
 (0)