Skip to content

Commit 3f92d5b

Browse files
leekilloughKenneth Griesser
authored andcommitted
Remove compiler warnings; move all MPI stuff into sst_mpi.h (sstsimulator#1224)
* Remove compiler warnings; move all MPI stuff into sst_mpi.h * Use rule-of-5 with = default declarations to remove -Wdeprecated-copy warning * Add sst_mpi.h to sst_core_sources
1 parent 5587244 commit 3f92d5b

21 files changed

+66
-114
lines changed

src/sst/core/Makefile.am

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,8 @@ sst_core_sources = \
247247
iouse.cc \
248248
objectComms.h \
249249
objectSerialization.h \
250-
simulation_impl.h
250+
simulation_impl.h \
251+
sst_mpi.h
251252

252253
bin_PROGRAMS = sst sst-info sst-config sst-register
253254
libexec_PROGRAMS = sstsim.x sstinfo.x

src/sst/core/checkpointAction.cc

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,14 @@
1717
#include "sst/core/mempoolAccessor.h"
1818
#include "sst/core/objectComms.h"
1919
#include "sst/core/simulation_impl.h"
20+
#include "sst/core/sst_mpi.h"
2021
#include "sst/core/stringize.h"
2122
#include "sst/core/timeConverter.h"
22-
#include "sst/core/warnmacros.h"
2323

2424
// #include <filesystem>
2525
#include <sys/stat.h>
2626
#include <unistd.h>
2727

28-
29-
#ifdef SST_CONFIG_HAVE_MPI
30-
DISABLE_WARN_MISSING_OVERRIDE
31-
#include <mpi.h>
32-
REENABLE_WARNING
33-
#endif
34-
3528
namespace SST {
3629

3730
CheckpointAction::CheckpointAction(

src/sst/core/config.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@ Config::Config(uint32_t num_ranks, bool first_rank) : ConfigShared(!first_rank,
804804
heartbeat_wall_period_ = 0;
805805

806806
char* wd_buf = (char*)malloc(sizeof(char) * PATH_MAX);
807-
getcwd(wd_buf, PATH_MAX);
807+
(void)!getcwd(wd_buf, PATH_MAX);
808808

809809
output_directory_ = "";
810810
if ( nullptr != wd_buf ) {

src/sst/core/configGraph.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,11 @@ class ConfigStatistic : public SST::Core::Serialization::serializable
138138

139139
ConfigStatistic() : id(stat_null_id) {}
140140

141-
ConfigStatistic(const ConfigStatistic& o) : id(o.id), params(o.params), shared(o.shared), name(o.name) {}
141+
ConfigStatistic(const ConfigStatistic&) = default;
142+
ConfigStatistic(ConfigStatistic&&) = default;
143+
ConfigStatistic& operator=(const ConfigStatistic&) = default;
144+
ConfigStatistic& operator=(ConfigStatistic&&) = default;
145+
~ConfigStatistic() override = default;
142146

143147
inline const StatisticId_t& getId() const { return id; }
144148

src/sst/core/exit.cc

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,9 @@
1313

1414
#include "sst/core/exit.h"
1515

16-
#include "sst/core/warnmacros.h"
17-
#ifdef SST_CONFIG_HAVE_MPI
18-
DISABLE_WARN_MISSING_OVERRIDE
19-
#include <mpi.h>
20-
REENABLE_WARNING
21-
#endif
22-
2316
#include "sst/core/component.h"
2417
#include "sst/core/simulation_impl.h"
18+
#include "sst/core/sst_mpi.h"
2519
#include "sst/core/stopAction.h"
2620

2721
using SST::Core::ThreadSafe::Spinlock;

src/sst/core/heartbeat.cc

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,9 @@
1616
#include "sst/core/component.h"
1717
#include "sst/core/mempoolAccessor.h"
1818
#include "sst/core/simulation_impl.h"
19+
#include "sst/core/sst_mpi.h"
1920
#include "sst/core/stringize.h"
2021
#include "sst/core/timeConverter.h"
21-
#include "sst/core/warnmacros.h"
22-
23-
#ifdef SST_CONFIG_HAVE_MPI
24-
DISABLE_WARN_MISSING_OVERRIDE
25-
#include <mpi.h>
26-
REENABLE_WARNING
27-
#endif
2822

2923
namespace SST {
3024

src/sst/core/iouse.cc

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,9 @@
1313

1414
#include "sst/core/iouse.h"
1515

16-
#include "sst/core/warnmacros.h"
16+
#include "sst/core/sst_mpi.h"
1717

1818
#include <sys/resource.h>
19-
#ifdef SST_CONFIG_HAVE_MPI
20-
DISABLE_WARN_MISSING_OVERRIDE
21-
#include <mpi.h>
22-
REENABLE_WARNING
23-
#endif
2419

2520
using namespace SST::Core;
2621

src/sst/core/main.cc

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@ DISABLE_WARN_DEPRECATED_REGISTER
2222
#include <Python.h>
2323
REENABLE_WARNING
2424

25-
#ifdef SST_CONFIG_HAVE_MPI
26-
DISABLE_WARN_MISSING_OVERRIDE
27-
#include <mpi.h>
28-
REENABLE_WARNING
29-
#endif
30-
3125
#include "sst/core/activity.h"
3226
#include "sst/core/checkpointAction.h"
3327
#include "sst/core/config.h"
@@ -45,6 +39,7 @@ REENABLE_WARNING
4539
#include "sst/core/rankInfo.h"
4640
#include "sst/core/realtime.h"
4741
#include "sst/core/simulation_impl.h"
42+
#include "sst/core/sst_mpi.h"
4843
#include "sst/core/statapi/statengine.h"
4944
#include "sst/core/stringize.h"
5045
#include "sst/core/threadsafe.h"

src/sst/core/memuse.cc

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,10 @@
1313

1414
#include "sst/core/memuse.h"
1515

16-
#include "sst/core/warnmacros.h"
16+
#include "sst/core/sst_mpi.h"
1717

1818
#include <sys/resource.h>
1919

20-
#ifdef SST_CONFIG_HAVE_MPI
21-
DISABLE_WARN_MISSING_OVERRIDE
22-
#include <mpi.h>
23-
REENABLE_WARNING
24-
#endif
25-
2620
using namespace SST::Core;
2721

2822
uint64_t

src/sst/core/model/python/pymodel.cc

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,7 @@ DISABLE_WARN_DEPRECATED_REGISTER
3636
#include <Python.h>
3737
REENABLE_WARNING
3838

39-
#ifdef SST_CONFIG_HAVE_MPI
40-
DISABLE_WARN_MISSING_OVERRIDE
41-
#include <mpi.h>
42-
REENABLE_WARNING
43-
#endif
39+
#include "sst/core/sst_mpi.h"
4440

4541
#include <string>
4642

0 commit comments

Comments
 (0)