From 01e86efc9e40ebe815323581be1d9d024fe19a6c Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 29 Nov 2022 13:29:57 -0600 Subject: [PATCH] Only show print() output from openmc.deplete on rank 0 --- openmc/deplete/abc.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openmc/deplete/abc.py b/openmc/deplete/abc.py index 279082c30..5b405b1d5 100644 --- a/openmc/deplete/abc.py +++ b/openmc/deplete/abc.py @@ -798,7 +798,7 @@ class Integrator(ABC): t, self._i_res = self._get_start_data() for i, (dt, source_rate) in enumerate(self): - if output: + if output and comm.rank == 0: print(f"[openmc.deplete] t={t} s, dt={dt} s, source={source_rate}") # Solve transport equation (or obtain result from restart) @@ -818,7 +818,7 @@ class Integrator(ABC): conc = conc_list.pop() StepResult.save(self.operator, conc_list, res_list, [t, t + dt], - source_rate, self._i_res + i, proc_time) + source_rate, self._i_res + i, proc_time) t += dt @@ -826,7 +826,7 @@ class Integrator(ABC): # source rate is passed to the transport operator (which knows to # just return zero reaction rates without actually doing a transport # solve) - if output and final_step: + if output and final_step and comm.rank == 0: print(f"[openmc.deplete] t={t} (final operator evaluation)") res_list = [self.operator(conc, source_rate if final_step else 0.0)] StepResult.save(self.operator, [conc], res_list, [t, t],