diff --git a/CMakeLists.txt b/CMakeLists.txt index 3bbc353f63..45b626324c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -287,6 +287,22 @@ foreach(test ${TESTS}) WORKING_DIRECTORY ${TEST_PATH} COMMAND $ -p ${TEST_PATH}) + elseif(${test} MATCHES "test_filter_distribcell") + + # Add each case for distribcell tests + add_test(NAME ${TEST_NAME}_case-1 + WORKING_DIRECTORY ${TEST_PATH}/case-1 + COMMAND $ ${TEST_PATH}/case-1) + add_test(NAME ${TEST_NAME}_case-2 + WORKING_DIRECTORY ${TEST_PATH}/case-2 + COMMAND $ ${TEST_PATH}/case-2) + add_test(NAME ${TEST_NAME}_case-3 + WORKING_DIRECTORY ${TEST_PATH}/case-3 + COMMAND $ ${TEST_PATH}/case-3) + add_test(NAME ${TEST_NAME}_case-4 + WORKING_DIRECTORY ${TEST_PATH}/case-4 + COMMAND $ ${TEST_PATH}/case-4) + # If a restart test is encounted, need to run with -r and restart file(s) elseif(${test} MATCHES "restart") diff --git a/openmc/clean_xml.py b/openmc/clean_xml.py index 619475fa07..2bb3f39f1b 100644 --- a/openmc/clean_xml.py +++ b/openmc/clean_xml.py @@ -82,11 +82,11 @@ def clean_xml_indentation(element, level=0): if not element.tail or not element.tail.strip(): element.tail = i - for element in element: - clean_xml_indentation(element, level+1) + for sub_element in element: + clean_xml_indentation(sub_element, level+1) - if not element.tail or not element.tail.strip(): - element.tail = i + if not sub_element.tail or not sub_element.tail.strip(): + sub_element.tail = i else: if level and (not element.tail or not element.tail.strip()): 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..9dbd57324f 100644 --- a/src/fixed_source.F90 +++ b/src/fixed_source.F90 @@ -117,6 +117,17 @@ 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() diff --git a/src/output.F90 b/src/output.F90 index cd08e46110..939451c6fb 100644 --- a/src/output.F90 +++ b/src/output.F90 @@ -7,7 +7,7 @@ module output use endf, only: reaction_name use error, only: fatal_error, warning use geometry_header, only: Cell, Universe, Surface, Lattice, RectLattice, & - &HexLattice, BASE_UNIVERSE + HexLattice, BASE_UNIVERSE use global use math, only: t_percentile use mesh_header, only: StructuredMesh diff --git a/tests/test_fixed_source/results_true.dat b/tests/test_fixed_source/results_true.dat index 2ec2d00b8e..99eb15e10d 100644 --- a/tests/test_fixed_source/results_true.dat +++ b/tests/test_fixed_source/results_true.dat @@ -1,3 +1,6 @@ tally 1: 4.483337E+02 2.017057E+04 +leakage: +9.820000E+00 +9.648000E+00 diff --git a/tests/test_fixed_source/test_fixed_source.py b/tests/test_fixed_source/test_fixed_source.py index 1f4382c08f..e96a3ad8fe 100644 --- a/tests/test_fixed_source/test_fixed_source.py +++ b/tests/test_fixed_source/test_fixed_source.py @@ -28,6 +28,10 @@ class FixedSourceTestHarness(TestHarness): outstr += '\n'.join(results) + '\n' tally_num += 1 + outstr += 'leakage:\n' + outstr += '{0:12.6E}'.format(sp._global_tallies[3][0]) + '\n' + outstr += '{0:12.6E}'.format(sp._global_tallies[3][1]) + '\n' + return outstr