[cig-commits] [commit] master: Should fix HDF5 multiproc output bug (7bf928f)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Mon Oct 20 15:13:50 PDT 2014


Repository : https://github.com/geodynamics/vc

On branch  : master
Link       : https://github.com/geodynamics/vc/compare/e91e7f3a67d22391a31bcfa9ff881ef8097ad787...64c223c129f70f3916341f1ebdf52f6d2ae1deae

>---------------------------------------------------------------

commit 7bf928f77983ccd02f7b7919fa8512afee73cdf6
Author: Eric Heien <emheien at ucdavis.edu>
Date:   Mon Oct 20 14:27:17 2014 -0700

    Should fix HDF5 multiproc output bug


>---------------------------------------------------------------

7bf928f77983ccd02f7b7919fa8512afee73cdf6
 src/io/EventOutput.cpp | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/src/io/EventOutput.cpp b/src/io/EventOutput.cpp
index 0163b1b..8e63c14 100644
--- a/src/io/EventOutput.cpp
+++ b/src/io/EventOutput.cpp
@@ -143,18 +143,20 @@ SimRequest EventOutput::run(SimFramework *_sim) {
     sim->getCurrentEvent().setStartEndSweep(sweep_count, sweep_count+num_sweeps);
     sweep_count += num_sweeps;
 
-    if (sim->getEventOutfileType() == "hdf5") {
+    if (sim->isRootNode()) {
+        if (sim->getEventOutfileType() == "hdf5") {
 #ifdef HDF5_FOUND
-        sim->getCurrentEvent().append_event_hdf5(data_file);
+            sim->getCurrentEvent().append_event_hdf5(data_file);
 #endif
-    } else if (sim->getEventOutfileType() == "text") {
-        // Write the event details
-        sim->getCurrentEvent().write_ascii(event_outfile);
-        event_outfile.flush();
+        } else if (sim->getEventOutfileType() == "text") {
+            // Write the event details
+            sim->getCurrentEvent().write_ascii(event_outfile);
+            event_outfile.flush();
             
-        // Write the sweep details
-        sim->getCurrentEvent().getSweeps().write_ascii(sweep_outfile);
-        sweep_outfile.flush();
+            // Write the sweep details
+            sim->getCurrentEvent().getSweeps().write_ascii(sweep_outfile);
+            sweep_outfile.flush();
+        }
     }
 
     // Check if the pause file exists each second



More information about the CIG-COMMITS mailing list