From 677b8ea2ffd541b61da649b282e4387d7c212f64 Mon Sep 17 00:00:00 2001 From: "Eric T. Johnson" Date: Mon, 19 Aug 2024 16:21:46 -0400 Subject: [PATCH] Allow printing errors in normalize_species on GPUs (#2944) This was helpful for debugging my failing flame_wave run on Frontier. --- Source/driver/Castro.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/driver/Castro.cpp b/Source/driver/Castro.cpp index 8cacbcf560..0600a16d1c 100644 --- a/Source/driver/Castro.cpp +++ b/Source/driver/Castro.cpp @@ -3125,6 +3125,9 @@ Castro::normalize_species (MultiFab& S_new, int ng) X > 1.0_rt + castro::abundance_failure_tolerance) { #ifndef AMREX_USE_GPU std::cout << "(i, j, k) = " << i << " " << j << " " << k << " " << ", X[" << n << "] = " << X << " (density here is: " << u(i,j,k,URHO) << ")" << std::endl; +#elif defined(ALLOW_GPU_PRINTF) + AMREX_DEVICE_PRINTF("(i, j, k) = %d %d %d, X[%d] = %g (density here is: %g)\n", + i, j, k, n, X, u(i,j,k,URHO)); #endif } }