diff --git a/src/outputs/output_attr.hpp b/src/outputs/output_attr.hpp index 20e471c4c415..8607157e09a2 100644 --- a/src/outputs/output_attr.hpp +++ b/src/outputs/output_attr.hpp @@ -18,6 +18,8 @@ #ifndef OUTPUTS_OUTPUT_ATTR_HPP_ #define OUTPUTS_OUTPUT_ATTR_HPP_ +#include + // JMM: This could probably be done with template magic but I think // using a macro is honestly the simplest and cleanest solution here. // Template solution would be to define a variatic class to conain the @@ -42,4 +44,4 @@ PARTHENON_ATTR_APPLY(Kokkos::View); \ PARTHENON_ATTR_APPLY(device_view_t) -#endif // OUTPUTS_OUTPUT_ATTR_HPP_ \ No newline at end of file +#endif // OUTPUTS_OUTPUT_ATTR_HPP_ diff --git a/src/outputs/parthenon_opmd.cpp b/src/outputs/parthenon_opmd.cpp index 201ae74f9fec..c0ee2aa434b2 100644 --- a/src/outputs/parthenon_opmd.cpp +++ b/src/outputs/parthenon_opmd.cpp @@ -614,10 +614,10 @@ void OpenPMDOutput::WriteOutputFile(Mesh *pm, ParameterInput *pin, SimTime *tm, } } } // loop over components - } // out_var->IsAllocated() - } // loop over blocks + } // out_var->IsAllocated() + } // loop over blocks it.seriesFlush(); - } // loop over vars + } // loop over vars Kokkos::Profiling::popRegion(); // write all variable data // -------------------------------------------------------------------------------- // @@ -660,11 +660,13 @@ void OpenPMDOutput::WriteOutputFile(Mesh *pm, ParameterInput *pin, SimTime *tm, series.close(); #endif // ifndef PARTHENON_ENABLE_OPENPMD - // advance output parameters - output_params.file_number++; - output_params.next_time += output_params.dt; - pin->SetInteger(output_params.block_name, "file_number", output_params.file_number); - pin->SetReal(output_params.block_name, "next_time", output_params.next_time); + // advance output parameters if this is not a triggered (now or final) output + if (signal == SignalHandler::OutputSignal::none) { + output_params.file_number++; + output_params.next_time += output_params.dt; + pin->SetInteger(output_params.block_name, "file_number", output_params.file_number); + pin->SetReal(output_params.block_name, "next_time", output_params.next_time); + } } } // namespace parthenon diff --git a/tst/unit/test_unit_params.cpp b/tst/unit/test_unit_params.cpp index 994f17727387..aae19bd1916c 100644 --- a/tst/unit/test_unit_params.cpp +++ b/tst/unit/test_unit_params.cpp @@ -264,9 +264,9 @@ TEMPLATE_LIST_TEST_CASE("A set of params can be dumped to file", "[params][outpu auto &in_hostarr2d_v = in_hostarr2d.KokkosView(); resfile.RestoreViewAttribute(groupname + delim + prefix + delim + "hostarr2d", in_hostarr2d_v); - // TODO(pgrete) make this work and also add checks for correctness below + // TODO(pgrete) make this work and also add checks for correctness below // resfile.RestoreViewAttribute(groupname + delim + prefix + delim + "bool1d", - // in_bool1d); + // in_bool1d); } REQUIRE(scalar == in_scalar);