From d4b8622ace2121bac34c76c35c9cc291bc597afb Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Fri, 26 Jul 2024 11:50:54 -0400 Subject: [PATCH] if we have USE_GPU_PRINTF = TRUE, then fflush the output after burn this will catch the prints from the burner that were added to Microphysics --- Source/reactions/Castro_react.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Source/reactions/Castro_react.cpp b/Source/reactions/Castro_react.cpp index 7fc8e069b9..13d522db7d 100644 --- a/Source/reactions/Castro_react.cpp +++ b/Source/reactions/Castro_react.cpp @@ -415,8 +415,13 @@ Castro::react_state(MultiFab& s, MultiFab& r, Real time, Real dt, const int stra }); #if defined(AMREX_USE_HIP) - Gpu::streamSynchronize(); // otherwise HIP may fail to allocate the necessary resources. + Gpu::streamSynchronize(); // otherwise HIP may fail to allocate the necessary resources. +#endif + +#ifdef ALLOW_GPU_PRINTF + std::fflush(nullptr); #endif + } #if defined(AMREX_USE_GPU) @@ -812,6 +817,11 @@ Castro::react_state(Real time, Real dt) #if defined(AMREX_USE_HIP) Gpu::streamSynchronize(); // otherwise HIP may fail to allocate the necessary resources. #endif + +#ifdef ALLOW_GPU_PRINTF + std::fflush(nullptr); +#endif + } #if defined(AMREX_USE_GPU)