diff --git a/CarpetX/src/io_openpmd.cxx b/CarpetX/src/io_openpmd.cxx index acdbf9f7f..864c68af4 100644 --- a/CarpetX/src/io_openpmd.cxx +++ b/CarpetX/src/io_openpmd.cxx @@ -16,6 +16,10 @@ #include +#ifdef HAVE_CAPABILITY_ADIOS2 +#include +#endif + #if defined _OPENMP #include #elif defined __HIPCC__ @@ -116,6 +120,7 @@ constexpr openPMD::IterationEncoding iterationEncoding = openPMD::IterationEncoding::fileBased; // TODO: Set number of threads? +#ifdef ADIOS2_HAVE_BLOSC2 const std::string options = R"EOS( { "adios2": { @@ -133,6 +138,18 @@ const std::string options = R"EOS( } } )EOS"; +#else +const std::string options = R"EOS( + { + "adios2": { + "dataset": { + "operators": [ + ] + } + } + } +)EOS"; +#endif constexpr bool input_ghosts = false; constexpr bool output_ghosts = false; diff --git a/CarpetX/src/schedule.cxx b/CarpetX/src/schedule.cxx index 5f2bdd893..9d3138a8a 100644 --- a/CarpetX/src/schedule.cxx +++ b/CarpetX/src/schedule.cxx @@ -1369,12 +1369,6 @@ int Initialise(tFleshConfig *config) { bool EvolutionIsDone(cGH *restrict const cctkGH) { DECLARE_CCTK_PARAMETERS; - if (terminate_next || CCTK_TerminationReached(cctkGH)) - return true; - - if (CCTK_Equals(terminate, "never")) - return false; - const bool max_iteration_reached = cctkGH->cctk_iteration >= cctk_itlast; const bool max_simulation_time_reached = @@ -1382,28 +1376,38 @@ bool EvolutionIsDone(cGH *restrict const cctkGH) { ? cctkGH->cctk_time >= cctk_final_time : cctkGH->cctk_time <= cctk_final_time; - int runtime = CCTK_RunTime(); - MPI_Bcast(&runtime, 1, MPI_INT, 0, MPI_COMM_WORLD); + const int runtime = CCTK_RunTime(); const bool max_runtime_reached = runtime >= 60 * max_runtime; - if (CCTK_Equals(terminate, "iteration")) - return max_iteration_reached; - if (CCTK_Equals(terminate, "time")) - return max_simulation_time_reached; - if (CCTK_Equals(terminate, "runtime")) - return max_runtime_reached; - if (CCTK_Equals(terminate, "any")) - return max_iteration_reached || max_simulation_time_reached || - max_runtime_reached; - if (CCTK_Equals(terminate, "all")) - return max_iteration_reached && max_simulation_time_reached && - max_runtime_reached; - if (CCTK_Equals(terminate, "either")) - return max_iteration_reached || max_simulation_time_reached; - if (CCTK_Equals(terminate, "both")) - return max_iteration_reached && max_simulation_time_reached; - - assert(0); + bool we_are_done; + if (terminate_next || CCTK_TerminationReached(cctkGH)) + we_are_done = true; + else if (CCTK_Equals(terminate, "never")) + we_are_done = false; + else if (CCTK_Equals(terminate, "iteration")) + we_are_done = max_iteration_reached; + else if (CCTK_Equals(terminate, "time")) + we_are_done = max_simulation_time_reached; + else if (CCTK_Equals(terminate, "runtime")) + we_are_done = max_runtime_reached; + else if (CCTK_Equals(terminate, "any")) + we_are_done = max_iteration_reached || max_simulation_time_reached || + max_runtime_reached; + else if (CCTK_Equals(terminate, "all")) + we_are_done = max_iteration_reached && max_simulation_time_reached && + max_runtime_reached; + else if (CCTK_Equals(terminate, "either")) + we_are_done = max_iteration_reached || max_simulation_time_reached; + else if (CCTK_Equals(terminate, "both")) + we_are_done = max_iteration_reached && max_simulation_time_reached; + else + CCTK_ERROR("internal error"); + + // Ensure all processes make the same decision + MPI_Allreduce(MPI_IN_PLACE, &we_are_done, 1, MPI_CXX_BOOL, MPI_LOR, + MPI_COMM_WORLD); + + return we_are_done; } void InvalidateTimelevels(cGH *restrict const cctkGH) { diff --git a/Loop/src/loop.hxx b/Loop/src/loop.hxx index 0aaa290c9..e1a600bbe 100644 --- a/Loop/src/loop.hxx +++ b/Loop/src/loop.hxx @@ -187,8 +187,9 @@ public: // Outward boundary normal (if on outermost interior point), else 0 const vect BI = vect(I == bnd_max - 1) - vect(I == bnd_min); + const vect CI1{CI, CJ, CK}; const PointDesc p = - point_desc({CI, CJ, CK}, I, iter, NI, I0, BI, bnd_min, bnd_max, + point_desc(CI1, I, iter, NI, I0, BI, bnd_min, bnd_max, loop_min, loop_max); f(p); }