diff --git a/src/eigenvalue.F90 b/src/eigenvalue.F90 index 1bbcbe850e..c4b9b9a678 100644 --- a/src/eigenvalue.F90 +++ b/src/eigenvalue.F90 @@ -176,19 +176,19 @@ contains !$omp critical global_tallies(K_TRACKLENGTH) % value = & global_tallies(K_TRACKLENGTH) % value + global_tally_tracklength - global_tallies(K_COLLISION) % value = & + global_tallies(K_COLLISION) % value = & global_tallies(K_COLLISION) % value + global_tally_collision - global_tallies(LEAKAGE) % value = & + global_tallies(LEAKAGE) % value = & global_tallies(LEAKAGE) % value + global_tally_leakage - global_tallies(K_ABSORPTION) % value = & + global_tallies(K_ABSORPTION) % value = & global_tallies(K_ABSORPTION) % value + global_tally_absorption !$omp end critical ! reset private tallies - global_tally_tracklength = 0 - global_tally_collision = 0 - global_tally_leakage = 0 - global_tally_absorption = 0 + global_tally_tracklength = ZERO + global_tally_collision = ZERO + global_tally_leakage = ZERO + global_tally_absorption = ZERO !$omp end parallel #ifdef _OPENMP diff --git a/src/fixed_source.F90 b/src/fixed_source.F90 index 9e2d34600b..9e7059aa80 100644 --- a/src/fixed_source.F90 +++ b/src/fixed_source.F90 @@ -6,7 +6,7 @@ module fixed_source use constants, only: ZERO, MAX_LINE_LEN use global - use output, only: write_message, header + use output, only: write_message, header, print_batch_leakage use particle_header, only: Particle use random_lcg, only: set_particle_seed use source, only: sample_external_source, copy_source_attributes @@ -117,11 +117,24 @@ contains subroutine finalize_batch() +! Update global tallies with the omp private accumulation variables +!$omp parallel +!$omp critical + global_tallies(LEAKAGE) % value = & + global_tallies(LEAKAGE) % value + global_tally_leakage +!$omp end critical + + ! reset private tallies + global_tally_leakage = ZERO +!$omp end parallel + ! Collect and accumulate tallies call time_tallies % start() call synchronize_tallies() call time_tallies % stop() + if (master) call print_batch_leakage() + ! Check_triggers if (master) call check_triggers() #ifdef MPI