Skip to content

Commit aa2a186

Browse files
committed
ORG make everything C++-17 and a few small fixes
1 parent 4e4410d commit aa2a186

File tree

8 files changed

+8
-7
lines changed

8 files changed

+8
-7
lines changed

module1/SIR.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// gamma: recovery rate
99
// dt: time step
1010
std::vector<float> take_step(std::vector<float> state, float beta, float gamma, float dt){
11+
std::vector<float> new_state;
1112
//todo: implement the SIR model
1213
return new_state;
1314
}

module2/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ OPT=-O1 -pg
1313
# Faster compilation time
1414
OPT=-O1
1515

16-
CXXFLAGS := $(OPT) -Wall -march=znver1 -g -std=c++14
16+
CXXFLAGS := $(OPT) -Wall -march=native -g -std=c++17
1717

1818
default: seq vec
1919

module3/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ CXX := mpic++
77
# Fastest executable (-ffast-math removes checking for NaNs and other things)
88
OPT=-O3
99

10-
CXXFLAGS := $(OPT) -Wall -Wno-unused-const-variable -std=c++14 -march=native
10+
CXXFLAGS := $(OPT) -Wall -Wno-unused-const-variable -std=c++17 -march=native
1111

1212
default: task_farm task_farm_HEP task_farm_HEP_seq
1313

module4/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ OPT=-O3 -ffast-math
1414
# Faster compilation time
1515
#OPT=-O1
1616

17-
CXXFLAGS := $(OPT) -Wall -march=native -g -std=c++14
17+
CXXFLAGS := $(OPT) -Wall -march=native -g -std=c++17
1818

1919
default: seq mp
2020

module4/seismogram_omp.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ DoubleVector propagator(std::vector<double> wave,
156156
long lc = std::lround(std::floor(nfreq*0.01)); // low-cut indices
157157
double mean_wave = 0.; // wave zero point
158158

159-
std::chrono::time_point<std::chrono::system_clock> tstart1,tstart2,tend1,tend2;
159+
std::chrono::time_point<std::chrono::high_resolution_clock> tstart1,tstart2,tend1,tend2;
160160

161161
auto tstart = std::chrono::high_resolution_clock::now(); // start time (nano-seconds)
162162

module4/seismogram_seq.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ std::vector<double> propagator(std::vector<double> wave,
9393
long lc = std::lround(std::floor(nfreq*0.01)); // low-cut indices
9494
double mean_wave = 0.; // wave zero point
9595

96-
std::chrono::time_point<std::chrono::system_clock> tstart1,tstart2,tend1,tend2;
96+
std::chrono::time_point<std::chrono::high_resolution_clock> tstart1,tstart2,tend1,tend2;
9797

9898
// Compute seismic impedance
9999
for (long i=0; i < nlayers; i++)

module5/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ OPT=-O3 -fast
1616

1717
INCLUDE := -I../include
1818

19-
CXXFLAGS := $(INCLUDE) $(OPT) -Wall -march=native -g -std=c++14
19+
CXXFLAGS := $(INCLUDE) $(OPT) -Wall -march=native -g -std=c++17
2020

2121
# use on CPU for testing and development
2222
ACC := -acc=multicore -Minfo=acc

module6/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
LIB = -L/opt/openmpi-4.1.6/lib -Wl,-rpath -Wl,/opt/openmpi-4.1.6/lib -Wl,--enable-new-dtags -lmpi
22
INC = -I/opt/openmpi-4.1.6/include
33

4-
FLAGS = -O3 -DNDEBUG -g -Wall
4+
FLAGS = -O3 -DNDEBUG -g -Wall -march=native -std=c++17
55

66
.PHONY: clean all
77

0 commit comments

Comments
 (0)