Skip to content

Commit fde95bc

Browse files
committed
FIX setup for new OS on ERDA MODI
1 parent 337ee8a commit fde95bc

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

module6/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
LIB = -lm -L/usr/lib -pthread -L/usr/lib/x86_64-linux-gnu/openmpi/lib -lmpi_cxx -lmpi
2-
INC = -I/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi -I/usr/lib/x86_64-linux-gnu/openmpi/include -pthread
1+
LIB = -L/opt/openmpi-4.1.6/lib -Wl,-rpath -Wl,/opt/openmpi-4.1.6/lib -Wl,--enable-new-dtags -lmpi
2+
INC = -I/opt/openmpi-4.1.6/include
33

44
FLAGS = -O3 -DNDEBUG -g -Wall
55

module6/fwc_parallel.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ void simulate(uint64_t num_of_iterations, const std::string& model_filename, con
280280
}
281281
auto end = std::chrono::steady_clock::now();
282282

283+
stat(world);
283284
std::cout << "checksum : " << checksum(world) << std::endl;
284285
std::cout << "elapsed time : " << (end - begin).count() / 1000000000.0 << " sec" << std::endl;
285286
}

module6/fwc_sequential.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -250,21 +250,21 @@ void simulate(uint64_t num_of_iterations, const std::string& model_filename, con
250250
integrate(world);
251251

252252
// remove ghostzones and construct global data from local data
253-
for (uint64_t i = 1; i < latitude-1; ++i)
254-
for (uint64_t j = 1; j < longitude-1; ++j) {
255-
uint64_t k_global = (i + offset_latitude) * global_world.longitude
256-
+ (j + offset_longitude);
257-
global_world.data[k_global] = world.data[i * longitude + j];
258-
}
259-
260253
if (!output_filename.empty()) {
254+
for (uint64_t i = 1; i < latitude-1; ++i)
255+
for (uint64_t j = 1; j < longitude-1; ++j) {
256+
uint64_t k_global = (i + offset_latitude) * global_world.longitude
257+
+ (j + offset_longitude);
258+
global_world.data[k_global] = world.data[i * longitude + j];
259+
}
261260
write_hdf5(global_world, output_filename, iteration);
262261
std::cout << iteration << " -- ";
263262
stat(world);
264263
}
265264
}
266265
auto end = std::chrono::steady_clock::now();
267266

267+
stat(world);
268268
std::cout << "checksum : " << checksum(world) << std::endl;
269269
std::cout << "elapsed time : " << (end - begin).count() / 1000000000.0 << " sec" << std::endl;
270270
}

0 commit comments

Comments
 (0)