From 020c31a1c1a28ff9f47b3be671f7c8457572f55f Mon Sep 17 00:00:00 2001 From: Adam Nelson Date: Wed, 1 Jul 2015 20:42:47 -0400 Subject: [PATCH] Named all the OpenMP critical regions in the code. --- src/particle_restart_write.F90 | 4 ++-- src/tally.F90 | 8 ++++---- src/track_output.F90 | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/particle_restart_write.F90 b/src/particle_restart_write.F90 index fa40d1e52..5f905cb5e 100644 --- a/src/particle_restart_write.F90 +++ b/src/particle_restart_write.F90 @@ -38,7 +38,7 @@ contains filename = trim(filename) // '.binary' #endif -!$omp critical +!$omp critical (write_particle_restart) ! Create file call pr % file_create(filename) @@ -66,7 +66,7 @@ contains ! Close file call pr % file_close() -!$omp end critical +!$omp end critical (write_particle_restart) end subroutine write_particle_restart diff --git a/src/tally.F90 b/src/tally.F90 index f860149f6..52b05d56c 100644 --- a/src/tally.F90 +++ b/src/tally.F90 @@ -470,13 +470,13 @@ contains num_nm = 2 * n + 1 ! multiply score by the angular flux moments and store -!$omp critical +!$omp critical (score_general_scatt_yn) t % results(score_index: score_index + num_nm - 1, filter_index) & % value = t & % results(score_index: score_index + num_nm - 1, filter_index)& % value & + score * calc_pn(n, p % mu) * calc_rn(n, p % last_uvw) -!$omp end critical +!$omp end critical (score_general_scatt_yn) end do i = i + (t % moment_order(i) + 1)**2 - 1 @@ -498,13 +498,13 @@ contains num_nm = 2 * n + 1 ! multiply score by the angular flux moments and store -!$omp critical +!$omp critical (score_general_flux_tot_yn) t % results(score_index: score_index + num_nm - 1, filter_index) & % value = t & % results(score_index: score_index + num_nm - 1, filter_index)& % value & + score * calc_rn(n, uvw) -!$omp end critical +!$omp end critical (score_general_flux_tot_yn) end do i = i + (t % moment_order(i) + 1)**2 - 1 diff --git a/src/track_output.F90 b/src/track_output.F90 index 81faaa567..60ab7e968 100644 --- a/src/track_output.F90 +++ b/src/track_output.F90 @@ -69,12 +69,12 @@ contains // '_' // trim(to_str(current_gen)) // '_' // trim(to_str(p % id)) & // '.binary' #endif -!$omp critical +!$omp critical (finalize_particle_track) call binout % file_create(fname) length = [3, n_tracks] call binout % write_data(coords, 'coordinates', length=length) call binout % file_close() -!$omp end critical +!$omp end critical (finalize_particle_track) deallocate(coords) end subroutine finalize_particle_track