From 07c324c3efde90c3176cf1a9ec39652dc6930018 Mon Sep 17 00:00:00 2001 From: Matthias Diener Date: Tue, 9 May 2023 13:15:04 -0500 Subject: [PATCH] logging fixes (#901) --- examples/combozzle-mpi.py | 10 +++++----- examples/heat-source-mpi.py | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/combozzle-mpi.py b/examples/combozzle-mpi.py index 0957d9465..331c5608d 100644 --- a/examples/combozzle-mpi.py +++ b/examples/combozzle-mpi.py @@ -1234,11 +1234,6 @@ def dummy_rhs(t, state): my_write_restart(step=current_step, t=current_t, state=final_fluid_state, temperature_seed=tseed) - if logmgr: - logmgr.close() - elif use_profiling: - print(actx.tabulate_profiling_data()) - comm.Barrier() finish_tol = 1e-16 @@ -1256,6 +1251,11 @@ def dummy_rhs(t, state): comm.Barrier() + if logmgr: + logmgr.close() + elif use_profiling: + print(actx.tabulate_profiling_data()) + if __name__ == "__main__": import argparse diff --git a/examples/heat-source-mpi.py b/examples/heat-source-mpi.py index 0772ed2f6..37b208a7d 100644 --- a/examples/heat-source-mpi.py +++ b/examples/heat-source-mpi.py @@ -179,14 +179,14 @@ def rhs(t, u): set_dt(logmgr, dt) logmgr.tick_after() - if logmgr: - logmgr.close() - final_answer = actx.to_numpy(op.norm(dcoll, u, np.inf)) resid = abs(final_answer - 0.0002062062188374177) if resid > 1e-15: raise ValueError(f"Run did not produce the expected result {resid=}") + if logmgr: + logmgr.close() + if __name__ == "__main__": import argparse