From 7d00c0b5eb41cdd8ef7d7b665539a2459cb7a4b9 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 8 Nov 2017 23:30:02 -0600 Subject: [PATCH] Account for possibility of running beyond n_batches --- src/simulation.F90 | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/simulation.F90 b/src/simulation.F90 index 94a285688a..ad2841f54d 100644 --- a/src/simulation.F90 +++ b/src/simulation.F90 @@ -57,13 +57,8 @@ contains subroutine openmc_run() bind(C) call openmc_simulation_init() - - do - if (openmc_next_batch() < 0) exit + do while (openmc_next_batch() == 0) end do - - call time_active % stop() - call openmc_simulation_finalize() end subroutine openmc_run @@ -459,12 +454,15 @@ contains real(8) :: tempr(3) ! temporary array for communication #endif + ! Stop active batch timer + call time_active % stop() + !$omp parallel deallocate(micro_xs, filter_matches) !$omp end parallel ! Increment total number of generations - total_gen = total_gen + n_batches*gen_per_batch + total_gen = total_gen + current_batch*gen_per_batch ! Start finalization timer call time_finalize % start()