From 296dc72b3b05f560424a1df52e324a406c9aeb9f Mon Sep 17 00:00:00 2001 From: rockfool Date: Fri, 3 Apr 2020 13:38:39 -0400 Subject: [PATCH] fix a bug in total timer --- openmc/deplete/operator.py | 1 + openmc/lib/core.py | 6 +++++- src/timer.cpp | 17 ----------------- 3 files changed, 6 insertions(+), 18 deletions(-) diff --git a/openmc/deplete/operator.py b/openmc/deplete/operator.py index 8eb033783f..646a869e1d 100644 --- a/openmc/deplete/operator.py +++ b/openmc/deplete/operator.py @@ -274,6 +274,7 @@ class Operator(TransportOperator): # Run OpenMC openmc.lib.reset() openmc.lib.run() + openmc.lib.reset_timers() # Extract results op_result = self._unpack_tallies_and_normalize(power) diff --git a/openmc/lib/core.py b/openmc/lib/core.py index a30341ed5d..e2e5e73a90 100644 --- a/openmc/lib/core.py +++ b/openmc/lib/core.py @@ -307,8 +307,12 @@ def plot_geometry(): def reset(): - """Reset tallies and timers.""" + """Reset tallies but keep timers.""" _dll.openmc_reset() + + +def reset_timers(): + """Reset timers and restart for next batch.""" _dll.openmc_reset_timers() _dll.openmc_restart_timers() diff --git a/src/timer.cpp b/src/timer.cpp index 71b85e33f0..454f770038 100644 --- a/src/timer.cpp +++ b/src/timer.cpp @@ -89,24 +89,7 @@ void reset_timers() void restart_timers() { - simulation::time_active.start(); - simulation::time_bank.start(); - simulation::time_bank_sample.start(); - simulation::time_bank_sendrecv.start(); - simulation::time_finalize.start(); - simulation::time_inactive.start(); - simulation::time_initialize.start(); - simulation::time_read_xs.start(); - simulation::time_sample_source.start(); - simulation::time_tallies.start(); simulation::time_total.start(); - simulation::time_transport.start(); - simulation::time_event_init.start(); - simulation::time_event_calculate_xs.start(); - simulation::time_event_advance_particle.start(); - simulation::time_event_surface_crossing.start(); - simulation::time_event_collision.start(); - simulation::time_event_death.start(); } } // namespace openmc