diff options
author | Erik Schnetter <schnetter@cct.lsu.edu> | 2008-08-03 22:04:20 -0500 |
---|---|---|
committer | Erik Schnetter <schnetter@cct.lsu.edu> | 2008-08-03 22:04:20 -0500 |
commit | 7e9e70198a20e543493e70d3231236bc60f05899 (patch) | |
tree | 1b708bf7d269e5647f9a90667a4e10a5e19aa760 /Carpet/CarpetIOBasic | |
parent | a5e612a3d2f646d896a7075cdc7348cf6be1c588 (diff) |
CarpetIOBasic: Correct problem with IO::out_dt
Correct a multi-processor synchronisation problem when using IO::out_dt.
Diffstat (limited to 'Carpet/CarpetIOBasic')
-rw-r--r-- | Carpet/CarpetIOBasic/src/iobasic.cc | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/Carpet/CarpetIOBasic/src/iobasic.cc b/Carpet/CarpetIOBasic/src/iobasic.cc index 126792795..8e8d1ce82 100644 --- a/Carpet/CarpetIOBasic/src/iobasic.cc +++ b/Carpet/CarpetIOBasic/src/iobasic.cc @@ -554,15 +554,20 @@ namespace CarpetIOBasic { } else if (cctk_iteration == *this_iteration) { // we already decided to output this iteration output_this_iteration = true; - } else if (cctk_time / cctk_delta_time - >= (*last_output_time + myoutdt) / cctk_delta_time - 1.0e-12) { - // it is time for the next output - output_this_iteration = true; - *last_output_time = cctk_time; - *this_iteration = cctk_iteration; } else { - // we want no output at this iteration - output_this_iteration = false; + int do_output = + (cctk_time / cctk_delta_time >= + (*last_output_time + myoutdt) / cctk_delta_time - 1.0e-12); + MPI_Bcast (&do_output, 1, MPI_INT, 0, dist::comm()); + if (do_output) { + // it is time for the next output + output_this_iteration = true; + *last_output_time = cctk_time; + *this_iteration = cctk_iteration; + } else { + // we want no output at this iteration + output_this_iteration = false; + } } } else { |