[cig-commits] [commit] master: Move parallel HDF5 check (f4817d6)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Mon Jan 5 10:55:39 PST 2015
Repository : https://github.com/geodynamics/vq
On branch : master
Link : https://github.com/geodynamics/vq/compare/a77e0124f38a909b20a374ec686149d65dbca5b1...f26b7fa26e56a9309aa9658f7441dfd63922dee6
>---------------------------------------------------------------
commit f4817d690b12bd0d84d225d562237e0089f837ba
Author: Eric Heien <emheien at ucdavis.edu>
Date: Mon Jan 5 10:54:46 2015 -0800
Move parallel HDF5 check
>---------------------------------------------------------------
f4817d690b12bd0d84d225d562237e0089f837ba
quakelib/src/QuakeLibIO.cpp | 3 +++
src/io/GreensFileOutput.cpp | 12 +++++++-----
src/mesher.cpp | 0
3 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/quakelib/src/QuakeLibIO.cpp b/quakelib/src/QuakeLibIO.cpp
index 53954ef..b8f507a 100644
--- a/quakelib/src/QuakeLibIO.cpp
+++ b/quakelib/src/QuakeLibIO.cpp
@@ -488,6 +488,7 @@ void quakelib::ModelWorld::create_section(std::vector<unsigned int> &unused_trac
while (cur_t < 1) {
next_t = spline.advance_element(cur_t, cur_elem_size_guess);
+
if (next_t < 1) {
sum_t += next_t-cur_t;
elem_count++;
@@ -503,12 +504,14 @@ void quakelib::ModelWorld::create_section(std::vector<unsigned int> &unused_trac
best_elem_count = elem_count;
break;
}
+
// Record which element size got us closest to the end of the trace
if (cur_t > best_t) {
best_t = cur_t;
best_step = cur_elem_size_guess;
best_elem_count = elem_count;
}
+
cur_elem_size_guess -= step_size;
}
diff --git a/src/io/GreensFileOutput.cpp b/src/io/GreensFileOutput.cpp
index 3f9374a..3deecf2 100644
--- a/src/io/GreensFileOutput.cpp
+++ b/src/io/GreensFileOutput.cpp
@@ -25,6 +25,13 @@ void GreensFileOutput::initDesc(const SimFramework *_sim) const {
const Simulation *sim = static_cast<const Simulation *>(_sim);
#ifdef HDF5_FOUND
+#ifndef HDF5_IS_PARALLEL
+
+ if (sim->getWorldSize() > 1) {
+ assertThrow(false, "# ERROR: Greens HDF5 output in parallel only allowed if using HDF5 parallel library.");
+ }
+
+#endif
sim->console() << "# Greens output file: " << sim->getGreensOutfile() << std::endl;
#else
sim->console() << "# ERROR: Greens output file requires HDF5, will not be generated" << std::endl;
@@ -39,11 +46,6 @@ void GreensFileOutput::initDesc(const SimFramework *_sim) const {
void GreensFileOutput::init(SimFramework *_sim) {
#ifdef HDF5_FOUND
Simulation *sim = static_cast<Simulation *>(_sim);
-#ifndef HDF5_IS_PARALLEL
- if (sim->getWorldSize() > 1) {
- assertThrow(false, "HDF5 output in parallel only allowed if using HDF5 parallel library.");
- }
-#endif
std::string file_name = sim->getGreensOutfile();
unsigned int green_dim;
BlockID row, col, global_row;
More information about the CIG-COMMITS
mailing list