From 40008dbaa49e007a0db2469dd620b69c772b307c Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 6 Mar 2014 19:57:15 -0500 Subject: [PATCH 01/31] Updated release notes for 0.5.4. --- docs/source/releasenotes/notes_0.5.4.rst | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/docs/source/releasenotes/notes_0.5.4.rst b/docs/source/releasenotes/notes_0.5.4.rst index 174064e35b..97e01b0fdf 100644 --- a/docs/source/releasenotes/notes_0.5.4.rst +++ b/docs/source/releasenotes/notes_0.5.4.rst @@ -4,10 +4,6 @@ Release Notes for OpenMC 0.5.4 ============================== -.. note:: - These release notes are for an upcoming release of OpenMC and are still - subject to change. - ------------------- System Requirements ------------------- @@ -21,16 +17,17 @@ the problem at hand (mostly on the number of nuclides in the problem). New Features ------------ -- New XML parsing backend (FoX) +- Source sites outside geometry are resampled +- XML-Fortran backend replaced by FoX XML - Ability to write particle track files - Handle lost particles more gracefully (via particle track files) -- Source sites outside geometry are resampled - Multiple random number generator streams -- plot_mesh_tally.py utility converted to use Tkinter rather than PyQt +- Mesh tally plotting utility converted to use Tkinter rather than PyQt - Script added to download ACE data from NNDC - Mixed ASCII/binary cross_sections.xml now allowed - Expanded options for writing source bank - Re-enabled ability to use source file as starting source +- S(a,b) recalculation avoided when same nuclide and S(a,b) table are accessed --------- Bug Fixes @@ -41,12 +38,14 @@ Bug Fixes - 8884fb_: Check for all ZAIDs for S(a,b) tables - b38af0_: Fix XML reading on multiple levels of input - d28750_: Fix bug in convert_xsdir.py +- cf567c_: ENDF/B-VI data checked for compatibility .. _32c03c: https://github.com/mit-crpg/openmc/commit/32c03c .. _c71ef5: https://github.com/mit-crpg/openmc/commit/c71ef5 .. _8884fb: https://github.com/mit-crpg/openmc/commit/8884fb .. _b38af0: https://github.com/mit-crpg/openmc/commit/b38af0 .. _d28750: https://github.com/mit-crpg/openmc/commit/d28750 +.. _cf567c: https://github.com/mit-crpg/openmc/commit/cf567c ------------ Contributors From 943e66b59b325491fd24d9430a498ffa0e7002fa Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Thu, 6 Mar 2014 20:02:45 -0500 Subject: [PATCH 02/31] bumped version to 0.5.4 --- src/constants.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/constants.F90 b/src/constants.F90 index 9091460148..ef0d7c8ef3 100644 --- a/src/constants.F90 +++ b/src/constants.F90 @@ -8,7 +8,7 @@ module constants ! OpenMC major, minor, and release numbers integer, parameter :: VERSION_MAJOR = 0 integer, parameter :: VERSION_MINOR = 5 - integer, parameter :: VERSION_RELEASE = 3 + integer, parameter :: VERSION_RELEASE = 4 ! Revision numbers for binary files integer, parameter :: REVISION_STATEPOINT = 11 From 729a608e5ea884d77883ca87f64cc003f1647aa8 Mon Sep 17 00:00:00 2001 From: Adam Nelson Date: Fri, 7 Mar 2014 14:41:54 -0500 Subject: [PATCH 03/31] Fixed p_valid sampling of energy distributions. --- src/physics.F90 | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/physics.F90 b/src/physics.F90 index 2d3cfeb39f..8c98e0b794 100644 --- a/src/physics.F90 +++ b/src/physics.F90 @@ -1331,19 +1331,17 @@ contains ! SAMPLE ENERGY DISTRIBUTION IF THERE ARE MULTIPLE if (associated(edist % next)) then - if (edist % p_valid % n_regions > 0) then - p_valid = interpolate_tab1(edist % p_valid, E_in) + p_valid = interpolate_tab1(edist % p_valid, E_in) - if (prn() > p_valid) then - if (edist % law == 44 .or. edist % law == 61) then - call sample_energy(edist%next, E_in, E_out, mu_out) - elseif (edist % law == 66) then - call sample_energy(edist%next, E_in, E_out, A=A, Q=Q) - else - call sample_energy(edist%next, E_in, E_out) - end if - return + if (prn() > p_valid) then + if (edist % law == 44 .or. edist % law == 61) then + call sample_energy(edist%next, E_in, E_out, mu_out) + elseif (edist % law == 66) then + call sample_energy(edist%next, E_in, E_out, A=A, Q=Q) + else + call sample_energy(edist%next, E_in, E_out) end if + return end if end if From 2dd5ae6d9360a776c03cbfffe7fdd680e8c6fab5 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 7 Mar 2014 18:07:01 -0500 Subject: [PATCH 04/31] Updated test results for three tests. The prompt neutron energy distribution for Pu-240 second-chance fission (MT=20) was affected by the bug in #249 for three tests. --- tests/test_natural_element/results_true.dat | 2 +- tests/test_salphabeta_multiple/results_true.dat | 2 +- tests/test_void/results_true.dat | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_natural_element/results_true.dat b/tests/test_natural_element/results_true.dat index 335f10c5ad..9b2e933ab3 100644 --- a/tests/test_natural_element/results_true.dat +++ b/tests/test_natural_element/results_true.dat @@ -1,2 +1,2 @@ k-combined: -1.012443E+00 2.162448E-02 +1.010190E+00 1.740589E-02 diff --git a/tests/test_salphabeta_multiple/results_true.dat b/tests/test_salphabeta_multiple/results_true.dat index bbd61cdb53..3165faa41e 100644 --- a/tests/test_salphabeta_multiple/results_true.dat +++ b/tests/test_salphabeta_multiple/results_true.dat @@ -1,2 +1,2 @@ k-combined: -9.761880E-01 9.170415E-03 +9.701793E-01 8.482149E-03 diff --git a/tests/test_void/results_true.dat b/tests/test_void/results_true.dat index a649385868..e569957b77 100644 --- a/tests/test_void/results_true.dat +++ b/tests/test_void/results_true.dat @@ -1,2 +1,2 @@ k-combined: -1.010313E+00 3.162080E-02 +1.006312E+00 3.000112E-02 From 59f94b5cdfdcad1968d3bbb64677e93e81060665 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 10 Mar 2014 16:56:40 -0400 Subject: [PATCH 05/31] Fix typo 'indicies' affecting CMFD data in statepoint. --- src/cmfd_loss_operator.F90 | 2 +- src/state_point.F90 | 4 ++-- src/utils/statepoint.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cmfd_loss_operator.F90 b/src/cmfd_loss_operator.F90 index 69be017644..b89f0f5772 100644 --- a/src/cmfd_loss_operator.F90 +++ b/src/cmfd_loss_operator.F90 @@ -396,7 +396,7 @@ contains end subroutine indices_to_matrix !=============================================================================== -! MATRIX_TO_INDICES converts a matrix index to spatial and group indicies +! MATRIX_TO_INDICES converts a matrix index to spatial and group indices !=============================================================================== subroutine matrix_to_indices(irow, g, i, j, k, ng, nx, ny, nz) diff --git a/src/state_point.F90 b/src/state_point.F90 index 4cf62c7c10..36eeffb395 100644 --- a/src/state_point.F90 +++ b/src/state_point.F90 @@ -104,7 +104,7 @@ contains ! Write out CMFD info if (cmfd_on) then call sp % write_data(1, "cmfd_on") - call sp % write_data(cmfd % indices, "indicies", length=4, group="cmfd") + call sp % write_data(cmfd % indices, "indices", length=4, group="cmfd") call sp % write_data(cmfd % k_cmfd, "k_cmfd", length=current_batch, & group="cmfd") call sp % write_data(cmfd % cmfd_src, "cmfd_src", & @@ -599,7 +599,7 @@ contains ! Write out CMFD info if (int_array(1) == 1) then - call sp % read_data(cmfd % indices, "indicies", length=4, group="cmfd") + call sp % read_data(cmfd % indices, "indices", length=4, group="cmfd") call sp % read_data(cmfd % k_cmfd, "k_cmfd", length=restart_batch, & group="cmfd") length = cmfd % indices([4,1,2,3]) diff --git a/src/utils/statepoint.py b/src/utils/statepoint.py index 47809d4728..9613421e07 100644 --- a/src/utils/statepoint.py +++ b/src/utils/statepoint.py @@ -195,7 +195,7 @@ class StatePoint(object): # Read CMFD information cmfd_present = self._get_int(path='cmfd_on')[0] if cmfd_present == 1: - self.cmfd_indices = self._get_int(4, path='cmfd/indicies') + self.cmfd_indices = self._get_int(4, path='cmfd/indices') self.k_cmfd = self._get_double(self.current_batch, path='cmfd/k_cmfd') self.cmfd_src = self._get_double_array(np.product(self.cmfd_indices), From 3a980225abbc22fd70d9bf2113d0882b90d52a37 Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Tue, 18 Mar 2014 08:49:32 -0400 Subject: [PATCH 06/31] removed filename from message, path_source_point instead --- src/state_point.F90 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/state_point.F90 b/src/state_point.F90 index 36eeffb395..9703c30096 100644 --- a/src/state_point.F90 +++ b/src/state_point.F90 @@ -517,7 +517,6 @@ contains subroutine load_state_point() - character(MAX_FILE_LEN) :: filename character(MAX_FILE_LEN) :: path_temp character(19) :: current_time integer :: i @@ -790,7 +789,7 @@ contains call sp % file_close() ! Write message - message = "Loading source file " // trim(filename) // "..." + message = "Loading source file " // trim(path_source_point) // "..." call write_message(1) ! Open source file From e1d812727747ff0b159a099606a7afc0ad433c56 Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Tue, 18 Mar 2014 08:50:44 -0400 Subject: [PATCH 07/31] if user wants overwrite latest, source must be separate --- src/input_xml.F90 | 5 ++++- tests/test_sourcepoint_latest/settings.xml | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/input_xml.F90 b/src/input_xml.F90 index fffd4a54e7..76b1f696fd 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -685,7 +685,10 @@ contains call get_node_value(node_sp, "overwrite_latest", temp_str) call lower_case(temp_str) if (trim(temp_str) == 'true' .or. & - trim(temp_str) == '1') source_latest = .true. + trim(temp_str) == '1') then + source_latest = .true. + source_separate = .true. + end if end if else ! If no tag was present, by default we keep source bank in diff --git a/tests/test_sourcepoint_latest/settings.xml b/tests/test_sourcepoint_latest/settings.xml index 5056db4724..fa7f07dfae 100644 --- a/tests/test_sourcepoint_latest/settings.xml +++ b/tests/test_sourcepoint_latest/settings.xml @@ -1,7 +1,7 @@ - + 10 From 822e23005d24f6e64bbfe29fe95695681bfc3dc4 Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Wed, 19 Mar 2014 16:29:09 -0400 Subject: [PATCH 08/31] fixed memory leak particle during sample external source sites --- src/source.F90 | 1 + 1 file changed, 1 insertion(+) diff --git a/src/source.F90 b/src/source.F90 index 2d3f74ec99..ced7fe1dc5 100644 --- a/src/source.F90 +++ b/src/source.F90 @@ -130,6 +130,7 @@ contains end if end if end do + call p % clear() case (SRC_SPACE_POINT) ! Point source From 85b3cbd82a8c72c426cfba489026a66a4d442531 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 18 Mar 2014 20:01:27 -0400 Subject: [PATCH 09/31] Fix out-of-bounds error when using OpenMP threading. Closes #255 on github. --- src/physics.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/physics.F90 b/src/physics.F90 index 2d3cfeb39f..fbd4f60c6d 100644 --- a/src/physics.F90 +++ b/src/physics.F90 @@ -867,9 +867,9 @@ contains end if ! Bank source neutrons - if (nu == 0 .or. n_bank == 3*work) return + if (nu == 0 .or. n_bank == size(fission_bank)) return p % fission = .true. ! Fission neutrons will be banked - do i = int(n_bank,4) + 1, int(min(n_bank + nu, 3*work),4) + do i = int(n_bank,4) + 1, int(min(n_bank + nu, int(size(fission_bank),8)),4) ! Bank source neutrons by copying particle data fission_bank(i) % xyz = p % coord0 % xyz @@ -894,7 +894,7 @@ contains end do ! increment number of bank sites - n_bank = min(n_bank + nu, 3*work) + n_bank = min(n_bank + nu, int(size(fission_bank),8)) ! Store total weight banked for analog fission tallies p % n_bank = nu From 3b601bb96cf336484bf823976f35bbc57282f4f1 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sat, 22 Mar 2014 12:21:01 -0400 Subject: [PATCH 10/31] Updated installation instructions. --- docs/source/usersguide/install.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/source/usersguide/install.rst b/docs/source/usersguide/install.rst index 53bfbe4018..313372fa6b 100644 --- a/docs/source/usersguide/install.rst +++ b/docs/source/usersguide/install.rst @@ -83,8 +83,8 @@ Prerequisites OpenMC with. HDF5_ must be built with parallel I/O features if you intend to use HDF5_ with MPI. An example of configuring HDF5_ is listed below:: - FC=/opt/mpich/3.0.4-gnu/bin/mpif90 CC=/opt/mpich/3.0.4-gnu/bin/mpicc \ - ./configure --prefix=/opt/hdf5/1.8.11-gnu --enable-fortran \ + FC=/opt/mpich/3.1/bin/mpif90 CC=/opt/mpich/3.1/bin/mpicc \ + ./configure --prefix=/opt/hdf5/1.8.12 --enable-fortran \ --enable-fortran2003 --enable-parallel You may omit ``--enable-parallel`` if you want to compile HDF5_ in serial. @@ -97,8 +97,8 @@ Prerequisites requires PETSc_ to be configured with Fortran datatypes. An example of configuring PETSc_ is listed below:: - ./configure --prefix=/opt/petsc/3.4.2-gnu --download-f-blas-lapack \ - --with-mpi-dir=/opt/mpich/3.0.4-gnu/ --with-shared-libraries=0 \ + ./configure --prefix=/opt/petsc/3.4.4 --download-f-blas-lapack \ + --with-mpi-dir=/opt/mpich/3.1 --with-shared-libraries \ --with-fortran-datatypes The BLAS/LAPACK library is not required to be downloaded and can be linked @@ -194,8 +194,8 @@ should be used: Compiling with MPI ++++++++++++++++++ -To compile with MPI, set the FC environment variable to the path to the MPI -Fortran wrapper. For example, in a bash shell: +To compile with MPI, set the :envvar:`FC` environment variable to the path to +the MPI Fortran wrapper. For example, in a bash shell: .. code-block:: sh @@ -212,8 +212,8 @@ command, i.e. Compiling with HDF5 +++++++++++++++++++ -To compile with MPI, set the FC environment variable to the path to the HDF5 -Fortran wrapper. For example, in a bash shell: +To compile with MPI, set the :envvar:`FC` environment variable to the path to +the HDF5 Fortran wrapper. For example, in a bash shell: .. code-block:: sh From b552c2e6520e71bc6b4226f8dabb96f12138d0cd Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Tue, 25 Mar 2014 17:43:48 -0400 Subject: [PATCH 11/31] source present should only be written by master --- src/state_point.F90 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/state_point.F90 b/src/state_point.F90 index 9703c30096..6884620e2f 100644 --- a/src/state_point.F90 +++ b/src/state_point.F90 @@ -230,13 +230,13 @@ contains end do TALLY_METADATA - end if + ! Indicate where source bank is stored in statepoint + if (source_separate) then + call sp % write_data(0, "source_present") + else + call sp % write_data(1, "source_present") + end if - ! Indicate where source bank is stored in statepoint - if (source_separate) then - call sp % write_data(0, "source_present") - else - call sp % write_data(1, "source_present") end if ! Check for the no-tally-reduction method From 20f77e4e6f5a3f95349a865900a5548804044744 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 25 Mar 2014 17:47:22 -0400 Subject: [PATCH 12/31] Updated release notes with one more bug fix. --- docs/source/releasenotes/notes_0.5.4.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/source/releasenotes/notes_0.5.4.rst b/docs/source/releasenotes/notes_0.5.4.rst index 97e01b0fdf..a69354aa0a 100644 --- a/docs/source/releasenotes/notes_0.5.4.rst +++ b/docs/source/releasenotes/notes_0.5.4.rst @@ -39,6 +39,7 @@ Bug Fixes - b38af0_: Fix XML reading on multiple levels of input - d28750_: Fix bug in convert_xsdir.py - cf567c_: ENDF/B-VI data checked for compatibility +- 6b9461_: Fix p_valid sampling inside of sample_energy .. _32c03c: https://github.com/mit-crpg/openmc/commit/32c03c .. _c71ef5: https://github.com/mit-crpg/openmc/commit/c71ef5 @@ -46,6 +47,7 @@ Bug Fixes .. _b38af0: https://github.com/mit-crpg/openmc/commit/b38af0 .. _d28750: https://github.com/mit-crpg/openmc/commit/d28750 .. _cf567c: https://github.com/mit-crpg/openmc/commit/cf567c +.. _6b9461: https://github.com/mit-crpg/openmc/commit/6b9461 ------------ Contributors From 40a5d6d294cc71951251f6fa5da0c5d9252c8196 Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Tue, 25 Mar 2014 22:58:30 -0400 Subject: [PATCH 13/31] set default cmfd display to rms balance --- src/global.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/global.F90 b/src/global.F90 index c27f34f9e8..515b774bf9 100644 --- a/src/global.F90 +++ b/src/global.F90 @@ -359,7 +359,7 @@ module global logical :: cmfd_tally_on = .true. ! CMFD display info - character(len=25) :: cmfd_display + character(len=25) :: cmfd_display = 'balance' ! Information about state points to be written integer :: n_state_points = 0 From 9ea6e9bb8d8e10f02366abb9990242486e580752 Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Tue, 25 Mar 2014 22:58:56 -0400 Subject: [PATCH 14/31] updated statepoint revision documentation --- docs/source/devguide/statepoint.rst | 290 ++++++++++++++++++++++++++++ 1 file changed, 290 insertions(+) diff --git a/docs/source/devguide/statepoint.rst b/docs/source/devguide/statepoint.rst index 9862a45282..5f05c92c83 100644 --- a/docs/source/devguide/statepoint.rst +++ b/docs/source/devguide/statepoint.rst @@ -4,6 +4,296 @@ State Point Binary File Specifications ====================================== +----------- +Revision 11 +----------- + +**integer(4) FILETYPE_STATEPOINT** + + Flags whether this file is a statepoint file or a particle restart file. + +**integer(4) REVISION_STATEPOINT** + + Revision of the binary state point file. Any time a change is made in the + format of the state-point file, this integer is incremented. + +**integer(4) VERSION_MAJOR** + + Major version number for OpenMC + +**integer(4) VERSION_MINOR** + + Minor version number for OpenMC + +**integer(4) VERSION_RELEASE** + + Release version number for OpenMC + +**character(19) time_stamp** + + Date and time the state point was written. + +**character(255) path** + + Absolute path to directory containing input files. + +**integer(8) seed** + + Pseudo-random number generator seed. + +**integer(4) run_mode** + + run mode used. The modes are described in constants.F90. + +**integer(8) n_particles** + + Number of particles used per generation. + +**integer(4) n_batches** + + Total number of batches (active + inactive). + +**integer(4) current_batch** + + The number of batches already simulated. + +if (run_mode == MODE_EIGENVALUE) + + **integer(4) n_inactive** + + Number of inactive batches + + **integer(4) gen_per_batch** + + Number of generations per batch for criticality calculations + + *do i = 1, current_batch \* gen_per_batch* + + **real(8) k_generation(i)** + + k-effective for the i-th total generation + + *do i = 1, current_batch \* gen_per_batch* + + **real(8) entropy(i)** + + Shannon entropy for the i-th total generation + + **real(8) k_col_abs** + + Sum of product of collision/absorption estimates of k-effective + + **real(8) k_col_tra** + + Sum of product of collision/track-length estimates of k-effective + + **real(8) k_abs_tra** + + Sum of product of absorption/track-length estimates of k-effective + + **real(8) k_combined(2)** + + Mean and standard deviation of a combined estimate of k-effective + + **integer(4) cmfd_on** + + Flag that cmfd is on + + if (cmfd_on) + + **integer(4) cmfd % indices** + + Indices for cmfd mesh (i,j,k,g) + + **real(8) cmfd % k_cmfd(1:current_batch)** + + CMFD eigenvalues + + **real(8) cmfd % src(1:G,1:I,1:J,1:K)** + + CMFD fission source + + **real(8) cmfd % entropy(1:current_batch)** + + CMFD estimate of Shannon entropy + + **real(8) cmfd % balance(1:current_batch)** + + RMS of the residual neutron balance equation on CMFD mesh + + **real(8) cmfd % dom(1:current_batch)** + + CMFD estimate of dominance ratio + + **real(8) cmfd % scr_cmp(1:current_batch)** + + RMS comparison of difference between OpenMC and CMFD fission source + +**integer(4) n_meshes** + + Number of meshes in tallies.xml file + +*do i = 1, n_meshes* + + **integer(4) meshes(i) % id** + + Unique ID of mesh. + + **integer(4) meshes(i) % type** + + Type of mesh. + + **integer(4) meshes(i) % n_dimension** + + Number of dimensions for mesh (2 or 3). + + **integer(4) meshes(i) % dimension(:)** + + Number of mesh cells in each dimension. + + **real(8) meshes(i) % lower_left(:)** + + Coordinates of lower-left corner of mesh. + + **real(8) meshes(i) % upper_right(:)** + + Coordinates of upper-right corner of mesh. + + **real(8) meshes(i) % width(:)** + + Width of each mesh cell in each dimension. + +**integer(4) n_tallies** + +*do i = 1, n_tallies* + + **integer(4) tallies(i) % id** + + Unique ID of tally. + + **integer(4) tallies(i) % n_realizations** + + Number of realizations for the i-th tally. + + **integer(4) size(tallies(i) % scores, 1)** + + Total number of score bins for the i-th tally + + **integer(4) size(tallies(i) % scores, 2)** + + Total number of filter bins for the i-th tally + + **integer(4) tallies(i) % n_filters** + + *do j = 1, tallies(i) % n_filters* + + **integer(4) tallies(i) % filter(j) % type** + + Type of tally filter. + + **integer(4) tallies(i) % filter(j) % n_bins** + + Number of bins for filter. + + **integer(4)/real(8) tallies(i) % filter(j) % bins(:)** + + Value for each filter bin of this type. + + **integer(4) tallies(i) % n_nuclide_bins** + + Number of nuclide bins. If none are specified, this is just one. + + *do j = 1, tallies(i) % n_nuclide_bins* + + **integer(4) tallies(i) % nuclide_bins(j)** + + Values of specified nuclide bins + + **integer(4) tallies(i) % n_score_bins** + + Number of scoring bins. + + *do j = 1, tallies(i) % n_score_bins* + + **integer(4) tallies(i) % score_bins(j)** + + Values of specified scoring bins (e.g. SCORE_FLUX). + + *do j = 1, tallies(i) % n_score_bins* + + **integer(4) tallies(i) % scatt_order(j)** + + Scattering Order specified scoring bins. + + **integer(4) tallies(i) % n_score_bins** + + Number of scoring bins without accounting for those added by + the scatter-pn command. + +**integer(4) source_present** + + Flag indicated if source bank is present in the file + +**integer(4) n_realizations** + + Number of realizations for global tallies. + +**integer(4) N_GLOBAL_TALLIES** + + Number of global tally scores + +*do i = 1, N_GLOBAL_TALLIES* + + **real(8) global_tallies(i) % sum** + + Accumulated sum for the i-th global tally + + **real(8) global_tallies(i) % sum_sq** + + Accumulated sum of squares for the i-th global tally + +**integer(4) tallies_on** + + Flag indicated if tallies are present in the file. + +if (tallies_on > 0) + + *do i = 1, n_tallies* + + *do k = 1, size(tallies(i) % scores, 2)* + + *do j = 1, size(tallies(i) % scores, 1)* + + **real(8) tallies(i) % scores(j,k) % sum** + + Accumulated sum for the j-th score and k-th filter of the + i-th tally + + **real(8) tallies(i) % scores(j,k) % sum_sq** + + Accumulated sum of squares for the j-th score and k-th + filter of the i-th tally + +if (run_mode == MODE_EIGENVALUE and source_present) + + *do i = 1, n_particles* + + **real(8) source_bank(i) % wgt** + + Weight of the i-th source particle + + **real(8) source_bank(i) % xyz(1:3)** + + Coordinates of the i-th source particle. + + **real(8) source_bank(i) % uvw(1:3)** + + Direction of the i-th source particle + + **real(8) source_bank(i) % E** + + Energy of the i-th source particle. + ----------- Revision 10 ----------- From ffe4e1682339066a9b9797d1f1ba41b420da4d52 Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Tue, 25 Mar 2014 23:05:02 -0400 Subject: [PATCH 15/31] added default value to overwrite latest --- docs/source/usersguide/input.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/source/usersguide/input.rst b/docs/source/usersguide/input.rst index 83eb2a3d8a..eebe6bfc14 100644 --- a/docs/source/usersguide/input.rst +++ b/docs/source/usersguide/input.rst @@ -414,6 +414,8 @@ attributes/sub-elements: source bank will be available. It should be noted that a user can set both this element to "true" and specify batches to write a permanent source bank. + *Default*: false + ```` Element ------------------------------ From 7006c3a2b1a93b8b3aaecf61485344fa0456c87f Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 28 Mar 2014 17:14:27 -0400 Subject: [PATCH 16/31] Add test target to Makefile. --- src/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index 9c295176a0..990f22d9d3 100644 --- a/src/Makefile +++ b/src/Makefile @@ -6,7 +6,9 @@ clean: make -s -C build clean distclean: rm -fr build +test: + make -s -C build test install: make -s -C build install -.PHONY: all clean distclean install +.PHONY: all clean distclean test install From 15b7edb21b673ea53f17e436de812e5acd032dee Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Wed, 2 Apr 2014 16:47:59 -0400 Subject: [PATCH 17/31] added new command line options for better control over tests --- tests/run_tests.py | 48 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/tests/run_tests.py b/tests/run_tests.py index 9d686b68a6..9aa99a8e85 100755 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -7,6 +7,13 @@ import sys import shutil from subprocess import call from collections import OrderedDict +from optparse import OptionParser + +parser = OptionParser() +parser.add_option('-j', '--parallel', dest='n_procs') +parser.add_option('-R', '--tests-regex', dest='regex_tests') +parser.add_option('-c', '--configure', dest='configs') +(opts, args) = parser.parse_args() # Compiler paths FC_DEFAULT='gfortran' @@ -68,7 +75,17 @@ class Test(object): def run_make(self): if not self.success: return - rc = call(['make','-j', '-s','-C','build']) + + # Default make string + make_list = ['make','-s'] + + # Check for parallel + if opts.n_procs != None: + make_list.append('-j') + make_list.append(opts.n_procs) + + # Run make + rc = call(make_list) if rc != 0: self.success = False self.msg = 'Failed on make.' @@ -76,7 +93,22 @@ class Test(object): def run_ctests(self): if not self.success: return - rc = call(['make','test','-C','build']) + + # Default ctest string + ctest_list = ['ctest'] + + # Check for parallel + if opts.n_procs != None: + ctest_list.append('-j') + ctest_list.append(opts.n_procs) + + # Check for subset of tests + if opts.regex_tests != None: + ctest_list.append('-R') + ctest_list.append(opts.regex_tests) + + # Run ctests + rc = call(ctest_list) if rc != 0: self.success = False self.msg = 'Failed on testing.' @@ -121,9 +153,8 @@ add_test('omp-phdf5-petsc-debug', openmp=True, mpi=True, hdf5=True, petsc=True, add_test('omp-phdf5-petsc-optimize', openmp=True, mpi=True, hdf5=True, petsc=True, optimize=True) # Process command line arguments -if len(sys.argv) > 1: - flags = [i for i in sys.argv[1:] if i.startswith('-')] - tests_ = [i for i in sys.argv[1:] if not i.startswith('-')] +if opts.configs != None: + tests_ = opts.configs.split() # Check for special subsets of tests tests__ = [] @@ -161,16 +192,21 @@ for test in iter(tests): print(test + ' tests') print('-'*(len(test) + 6)) - # Run CMAKE to configure build tests[test].run_cmake() + # Go into build directory + os.chdir('build') + # Build OpenMC tests[test].run_make() # Run tests tests[test].run_ctests() + # Leave build directory + os.chdir('..') + # Copy test log file if failed if tests[test].msg == 'Failed on testing.': shutil.copy('build/Testing/Temporary/LastTest.log', From 032a21c45fba3b90e7e6018a62170f00ae45a0b4 Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Wed, 2 Apr 2014 17:21:00 -0400 Subject: [PATCH 18/31] added regular expression searching for test configurations --- tests/run_tests.py | 32 +++----------------------------- 1 file changed, 3 insertions(+), 29 deletions(-) diff --git a/tests/run_tests.py b/tests/run_tests.py index 9aa99a8e85..1df65e88ba 100755 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -5,6 +5,7 @@ from __future__ import print_function import os import sys import shutil +import re from subprocess import call from collections import OrderedDict from optparse import OptionParser @@ -152,37 +153,10 @@ add_test('omp-phdf5-petsc-normal', openmp=True, mpi=True, hdf5=True, petsc=True) add_test('omp-phdf5-petsc-debug', openmp=True, mpi=True, hdf5=True, petsc=True, debug=True) add_test('omp-phdf5-petsc-optimize', openmp=True, mpi=True, hdf5=True, petsc=True, optimize=True) -# Process command line arguments +# Delete items of dictionary that don't match regular expression if opts.configs != None: - tests_ = opts.configs.split() - - # Check for special subsets of tests - tests__ = [] - for i in tests_: - - # This checks for any subsets of tests. The string after - # all-XXXX will be used to search through all tests. - if i.startswith('all-'): - suffix = i.split('all-')[1] - for j in tests: - if j.rfind(suffix) != -1: - try: - tests__.index(j) - except ValueError: - tests__.append(j) - - # Test name specified on command line - else: - try: - tests__.index(i) - except ValueError: - tests__.append(i) # append specific test (e.g., mpi-debug) - - # Delete items of dictionary that are not in tests__ for key in iter(tests): - try: - tests__.index(key) - except ValueError: + if not re.search(opts.configs, key): del tests[key] # Begin testing From 3187698adc650d34007b2f69e22c0451701dde35 Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Wed, 2 Apr 2014 20:14:45 -0400 Subject: [PATCH 19/31] added usage printing --- tests/run_tests.py | 39 ++++++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/tests/run_tests.py b/tests/run_tests.py index 1df65e88ba..320fd71521 100755 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -11,9 +11,20 @@ from collections import OrderedDict from optparse import OptionParser parser = OptionParser() -parser.add_option('-j', '--parallel', dest='n_procs') -parser.add_option('-R', '--tests-regex', dest='regex_tests') -parser.add_option('-c', '--configure', dest='configs') +parser.add_option('-j', '--parallel', dest='n_procs', + help="Number of parallel jobs.") +parser.add_option('-R', '--tests-regex', dest='regex_tests', + help="Run tests matching regular expression. \ + Test names are the directories present in tests folder.\ + This uses standard regex syntax to select tests.") +parser.add_option('-C', '--build-config', dest='build_config', + help="Build configurations matching regular expression. \ + Specific build configurations can be printed out with \ + optional argument -p, --print. This uses standard \ + regex syntax to select build configurations.") +parser.add_option('-p', '--print', action="store_true", + dest="print_build_configs", default=False, + help="Print out build configurations.") (opts, args) = parser.parse_args() # Compiler paths @@ -150,13 +161,27 @@ add_test('phdf5-petsc-normal', mpi=True, hdf5=True, petsc=True) add_test('phdf5-petsc-debug', mpi=True, hdf5=True, petsc=True, debug=True) add_test('phdf5-petsc-optimize', mpi=True, hdf5=True, petsc=True, optimize=True) add_test('omp-phdf5-petsc-normal', openmp=True, mpi=True, hdf5=True, petsc=True) -add_test('omp-phdf5-petsc-debug', openmp=True, mpi=True, hdf5=True, petsc=True, debug=True) -add_test('omp-phdf5-petsc-optimize', openmp=True, mpi=True, hdf5=True, petsc=True, optimize=True) +add_test('omp-phdf5-petsc-debug', openmp=True, mpi=True, hdf5=True, petsc=True, + debug=True) +add_test('omp-phdf5-petsc-optimize', openmp=True, mpi=True, hdf5=True, petsc=True, + optimize=True) + +# Check to see if we are to just print build configuratinos +if opts.print_build_configs: + for key in iter(tests): + print('Configuration Name: {0}'.format(key)) + print(' Debug Flags:..........{0}'.format(tests[key].debug)) + print(' Optimization Flags:...{0}'.format(tests[key].optimize)) + print(' HDF5 Active:..........{0}'.format(tests[key].hdf5)) + print(' MPI Active:...........{0}'.format(tests[key].mpi)) + print(' OpenMP Active:........{0}'.format(tests[key].openmp)) + print(' PETSc Active:.........{0}\n'.format(tests[key].petsc)) + exit() # Delete items of dictionary that don't match regular expression -if opts.configs != None: +if opts.build_config != None: for key in iter(tests): - if not re.search(opts.configs, key): + if not re.search(opts.build_config, key): del tests[key] # Begin testing From 8da770c4cf6bb14658c33c852e482a90343cdc24 Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Wed, 2 Apr 2014 20:27:27 -0400 Subject: [PATCH 20/31] updated test suite readme --- tests/readme.rst | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/tests/readme.rst b/tests/readme.rst index fcc4d737fc..139a6da2a8 100644 --- a/tests/readme.rst +++ b/tests/readme.rst @@ -4,29 +4,37 @@ OpenMC Test Suite The purpose of this test suite is to ensure that OpenMC compiles using various combinations of compiler flags and options and that all user input options can -be used successfully without breaking the code. The test suite is by no means -complete and should not be viewed as a comprehensive unit test suite will full -coverage. Until more effort can be put into actual unit testing, this suite is a -simple means of making sure that new features added into the code don't break -existing features. +be used successfully without breaking the code. The test suite is based on +regression or integrated testing where different types of input files are +configured and the full OpenMC code is executed. Results from simulations +are compared with expected results. The test suite is comprised of many +build configurations (e.g. debug, mpi, hdf5) and the actual tests which +reside in sub-directories in the tests directory. -The test suite is designed to run with the third-party Python package -nose_. Running the test suite is as simple as going to the tests/ directory and -running: +The test suite is designed to integrate with cmake using ctest_. To run the +full test suite run: .. sh:: - nosetests + python run_tests.py -However, usually testing is split into two parts: compilation and running. To -run the compilation tests, use: +A subset of build configurations and/or tests can be run. To see how to use +the script run: .. sh:: - nosetests test_compile + python run_tests.py --help -Then, to run all the normal tests (which require that an OpenMC executable is -already built): +As an example, say we want to run all tests with debug flags only on tests +that have cone and plot in their name. Also, we would like to run this on +4 processors. We can run: .. sh:: - nosetests --exclude-dir=test_compile + python run_tests.py -j 4 -C debug -R "cone|plot" -.. _nose: https://nose.readthedocs.org +Note that standard regular expression syntax is used for selecting build +configurations and tests. To print out a list of build configurations, we +can run: + +.. sh:: + python run_tests.py -p + +.. _ctest: http://www.cmake.org/cmake/help/v2.8.8/ctest.html From 809f1640f7e47d0bf52a2dd04cd109be6b3adfaa Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Wed, 2 Apr 2014 20:34:36 -0400 Subject: [PATCH 21/31] added initial documentation on test suite --- docs/source/devguide/workflow.rst | 44 +++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/docs/source/devguide/workflow.rst b/docs/source/devguide/workflow.rst index f3793628af..b3733fab8b 100644 --- a/docs/source/devguide/workflow.rst +++ b/docs/source/devguide/workflow.rst @@ -91,6 +91,50 @@ features and bug fixes. The general steps for contributing are as follows: 6. After the pull request has been thoroughly vetted, it is merged back into the *develop* branch of mit-crpg/openmc. +OpenMC Test Suite +----------------- + +The purpose of this test suite is to ensure that OpenMC compiles using various +combinations of compiler flags and options and that all user input options can +be used successfully without breaking the code. The test suite is based on +regression or integrated testing where different types of input files are +configured and the full OpenMC code is executed. Results from simulations +are compared with expected results. The test suite is comprised of many +build configurations (e.g. debug, mpi, hdf5) and the actual tests which +reside in sub-directories in the tests directory. + +The test suite is designed to integrate with cmake using ctest_. To run the +full test suite run: + +.. code-block:: sh + + python run_tests.py + +A subset of build configurations and/or tests can be run. To see how to use +the script run: + +.. code-block:: sh + + python run_tests.py --help + +As an example, say we want to run all tests with debug flags only on tests +that have cone and plot in their name. Also, we would like to run this on +4 processors. We can run: + +.. code-block:: sh + + python run_tests.py -j 4 -C debug -R "cone|plot" + +Note that standard regular expression syntax is used for selecting build +configurations and tests. To print out a list of build configurations, we +can run: + +.. code-block:: sh + + python run_tests.py -p + +.. _ctest: http://www.cmake.org/cmake/help/v2.8.8/ctest.html + Private Development ------------------- From 9c43d1ec3f5adcebb6cca409b0f26d58d6267b03 Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Wed, 2 Apr 2014 20:38:51 -0400 Subject: [PATCH 22/31] fixed some syntax --- docs/source/devguide/workflow.rst | 3 +-- tests/readme.rst | 16 ++++++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/docs/source/devguide/workflow.rst b/docs/source/devguide/workflow.rst index b3733fab8b..78dfb6b5f3 100644 --- a/docs/source/devguide/workflow.rst +++ b/docs/source/devguide/workflow.rst @@ -38,7 +38,7 @@ following criteria must be satisfied for all proposed changes: - Changes have a clear purpose and are useful. - Compiles under all conditions (MPI, OpenMP, HDF5, etc.). This is checked as - part of the test suite (see `test_compile.py`_). + part of the test suite. - Passes the regression suite. - If appropriate, test cases are added to regression suite. - No memory leaks (checked with valgrind_). @@ -152,7 +152,6 @@ from your private repository into a public fork. .. _git: http://git-scm.com/ .. _GitHub: https://github.com/ .. _git flow: http://nvie.com/git-model -.. _test_compile.py: https://github.com/mit-crpg/openmc/blob/develop/tests/test_compile/test_compile.py .. _valgrind: http://valgrind.org/ .. _style guide: http://mit-crpg.github.io/openmc/devguide/styleguide.html .. _pull request: https://help.github.com/articles/using-pull-requests diff --git a/tests/readme.rst b/tests/readme.rst index 139a6da2a8..3a340582b7 100644 --- a/tests/readme.rst +++ b/tests/readme.rst @@ -5,7 +5,7 @@ OpenMC Test Suite The purpose of this test suite is to ensure that OpenMC compiles using various combinations of compiler flags and options and that all user input options can be used successfully without breaking the code. The test suite is based on -regression or integrated testing where different types of input files are +regression or integrated testing where different types of input files are configured and the full OpenMC code is executed. Results from simulations are compared with expected results. The test suite is comprised of many build configurations (e.g. debug, mpi, hdf5) and the actual tests which @@ -14,27 +14,31 @@ reside in sub-directories in the tests directory. The test suite is designed to integrate with cmake using ctest_. To run the full test suite run: -.. sh:: +.. code-block:: sh + python run_tests.py A subset of build configurations and/or tests can be run. To see how to use the script run: -.. sh:: +.. code-block:: sh + python run_tests.py --help As an example, say we want to run all tests with debug flags only on tests -that have cone and plot in their name. Also, we would like to run this on +that have cone and plot in their name. Also, we would like to run this on 4 processors. We can run: -.. sh:: +.. code-block:: sh + python run_tests.py -j 4 -C debug -R "cone|plot" Note that standard regular expression syntax is used for selecting build configurations and tests. To print out a list of build configurations, we can run: -.. sh:: +.. code-block:: sh + python run_tests.py -p .. _ctest: http://www.cmake.org/cmake/help/v2.8.8/ctest.html From cd2a44c428e25fca4ae3d1c932f2f8b691cde55b Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Wed, 2 Apr 2014 20:49:14 -0400 Subject: [PATCH 23/31] added more documentation on testing single build --- docs/source/devguide/workflow.rst | 5 +++-- docs/source/usersguide/install.rst | 24 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/docs/source/devguide/workflow.rst b/docs/source/devguide/workflow.rst index 78dfb6b5f3..d33a282c7a 100644 --- a/docs/source/devguide/workflow.rst +++ b/docs/source/devguide/workflow.rst @@ -91,6 +91,8 @@ features and bug fixes. The general steps for contributing are as follows: 6. After the pull request has been thoroughly vetted, it is merged back into the *develop* branch of mit-crpg/openmc. +.. _test suite: + OpenMC Test Suite ----------------- @@ -133,8 +135,6 @@ can run: python run_tests.py -p -.. _ctest: http://www.cmake.org/cmake/help/v2.8.8/ctest.html - Private Development ------------------- @@ -158,3 +158,4 @@ from your private repository into a public fork. .. _mit-crpg/openmc: https://github.com/mit-crpg/openmc .. _paid plan: https://github.com/plans .. _Bitbucket: https://bitbucket.org +.. _ctest: http://www.cmake.org/cmake/help/v2.8.8/ctest.html diff --git a/docs/source/usersguide/install.rst b/docs/source/usersguide/install.rst index 313372fa6b..ee196552df 100644 --- a/docs/source/usersguide/install.rst +++ b/docs/source/usersguide/install.rst @@ -322,6 +322,29 @@ This will build an executable named ``openmc``. .. _MinGW: http://www.mingw.org .. _SourceForge: http://sourceforge.net/projects/mingw +Testing Build +------------- + +If you have ENDF/B-VII.0 cross sections from MCNP5/X you can test your build. +There are two ways to run tests. The first is to use the Makefile present in +the source directory and run the following: + +.. code-block:: sh + + cd src + make test + +If you want more options for testing you can use ctest_ command. For example, +if we wanted to run only the plot tests with 4 processors, we run: + +.. code-block:: sh + + cd src/build + ctest -j 4 -R plot + +If you want to run the full test suite with different build options please +refer to our :ref:`test suite` documentation. + --------------------------- Cross Section Configuration --------------------------- @@ -467,3 +490,4 @@ schemas.xml file in your own OpenMC source directory. .. _GNU Emacs: http://www.gnu.org/software/emacs/ .. _validation: http://en.wikipedia.org/wiki/XML_validation .. _RELAX NG: http://relaxng.org/ +.. _ctest: http://www.cmake.org/cmake/help/v2.8.8/ctest.html From e94f84c1e213a58cbf7cfa103973cd8b1dba01e6 Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Thu, 3 Apr 2014 07:40:14 -0400 Subject: [PATCH 24/31] addresses @paulromano comments for python syntax and ctest version --- docs/source/devguide/workflow.rst | 2 +- docs/source/usersguide/install.rst | 2 +- tests/readme.rst | 2 +- tests/run_tests.py | 16 ++++++++-------- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/source/devguide/workflow.rst b/docs/source/devguide/workflow.rst index d33a282c7a..523fba32b2 100644 --- a/docs/source/devguide/workflow.rst +++ b/docs/source/devguide/workflow.rst @@ -158,4 +158,4 @@ from your private repository into a public fork. .. _mit-crpg/openmc: https://github.com/mit-crpg/openmc .. _paid plan: https://github.com/plans .. _Bitbucket: https://bitbucket.org -.. _ctest: http://www.cmake.org/cmake/help/v2.8.8/ctest.html +.. _ctest: http://www.cmake.org/cmake/help/v2.8.12/ctest.html diff --git a/docs/source/usersguide/install.rst b/docs/source/usersguide/install.rst index ee196552df..45e7671f52 100644 --- a/docs/source/usersguide/install.rst +++ b/docs/source/usersguide/install.rst @@ -490,4 +490,4 @@ schemas.xml file in your own OpenMC source directory. .. _GNU Emacs: http://www.gnu.org/software/emacs/ .. _validation: http://en.wikipedia.org/wiki/XML_validation .. _RELAX NG: http://relaxng.org/ -.. _ctest: http://www.cmake.org/cmake/help/v2.8.8/ctest.html +.. _ctest: http://www.cmake.org/cmake/help/v2.8.12/ctest.html diff --git a/tests/readme.rst b/tests/readme.rst index 3a340582b7..7c4d29e438 100644 --- a/tests/readme.rst +++ b/tests/readme.rst @@ -41,4 +41,4 @@ can run: python run_tests.py -p -.. _ctest: http://www.cmake.org/cmake/help/v2.8.8/ctest.html +.. _ctest: http://www.cmake.org/cmake/help/v2.8.12/ctest.html diff --git a/tests/run_tests.py b/tests/run_tests.py index 320fd71521..1e9f28238a 100755 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -92,7 +92,7 @@ class Test(object): make_list = ['make','-s'] # Check for parallel - if opts.n_procs != None: + if opts.n_procs is not None: make_list.append('-j') make_list.append(opts.n_procs) @@ -110,12 +110,12 @@ class Test(object): ctest_list = ['ctest'] # Check for parallel - if opts.n_procs != None: + if opts.n_procs is not None: ctest_list.append('-j') ctest_list.append(opts.n_procs) # Check for subset of tests - if opts.regex_tests != None: + if opts.regex_tests is not None: ctest_list.append('-R') ctest_list.append(opts.regex_tests) @@ -179,14 +179,14 @@ if opts.print_build_configs: exit() # Delete items of dictionary that don't match regular expression -if opts.build_config != None: - for key in iter(tests): +if opts.build_config is not None: + for key in tests: if not re.search(opts.build_config, key): del tests[key] # Begin testing -call(['rm','-rf','build']) -for test in iter(tests): +shutil.rmtree('build', ignore_errors=True) +for test in tests: print('-'*(len(test) + 6)) print(test + ' tests') print('-'*(len(test) + 6)) @@ -212,7 +212,7 @@ for test in iter(tests): 'LastTest_{0}.log'.format(test)) # Clean up build - call(['rm','-rf','build']) + shutil.rmtree('build', ignore_errors=True) # Print out summary of results print('\n' + '='*54) From c107cb40a6b0cc22ac972fdb6abd9174711f4502 Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Thu, 3 Apr 2014 07:40:56 -0400 Subject: [PATCH 25/31] removed last iter command --- tests/run_tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/run_tests.py b/tests/run_tests.py index 1e9f28238a..f98db06057 100755 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -168,7 +168,7 @@ add_test('omp-phdf5-petsc-optimize', openmp=True, mpi=True, hdf5=True, petsc=Tru # Check to see if we are to just print build configuratinos if opts.print_build_configs: - for key in iter(tests): + for key in tests: print('Configuration Name: {0}'.format(key)) print(' Debug Flags:..........{0}'.format(tests[key].debug)) print(' Optimization Flags:...{0}'.format(tests[key].optimize)) From 46d69ca6acc09becaee48328f872452b5ca4555d Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Thu, 3 Apr 2014 08:02:44 -0400 Subject: [PATCH 26/31] updated update_results script to match run_tests syntax --- tests/update_results.py | 48 ++++++++++++++++++++++++++++------------- 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/tests/update_results.py b/tests/update_results.py index 7afb63e158..c9c0be85dc 100755 --- a/tests/update_results.py +++ b/tests/update_results.py @@ -1,30 +1,48 @@ #!/usr/bin/env python +from __future__ import print_function + import os -import sys +import re from subprocess import Popen, call, STDOUT, PIPE from glob import glob +from optparse import OptionParser +parser = OptionParser() +parser.add_option('--exe', dest='exe', + help="Path to openmc executable with basic \ + configuration options (no HDF5, no MPI, etc.)") +parser.add_option('-R', '--tests-regex', dest='regex_tests', + help="Run tests matching regular expression. \ + Test names are the directories present in tests folder.\ + This uses standard regex syntax to select tests.") +(opts, args) = parser.parse_args() +cwd = os.getcwd() + +# Terminal color configurations OKGREEN = '\033[92m' FAIL = '\033[91m' ENDC = '\033[0m' BOLD = '\033[1m' -# Check for arguments -if len(sys.argv) > 1: - folders = [] - for i in range(len(sys.argv)): - if i == 0: - continue - folders.append(sys.argv[i]) +# Check for valid executable +if opts.exe is None: + raise Exception('Need to specify an OpenMC executable') else: - folders = glob('test_*') + openmc_exe = os.path.abspath(opts.exe) + +# Get a list of all test folders +folders = glob('test_*') + +# Check to see if a subset of tests is specified on command line +if opts.regex_tests is not None: + folders = [item for item in folders if re.search(opts.regex_tests, item)] # Loop around directories for adir in sorted(folders): # Skip test compile or plot - if adir == 'test_compile' or adir.find('plot') != -1: + if adir.find('plot') != -1: continue # Go into that directory @@ -33,18 +51,18 @@ for adir in sorted(folders): os.putenv('PWD', pwd) # Print status to screen - sys.stdout.write(adir) + print(adir, end="") sz = len(adir) for i in range(35 - sz): - sys.stdout.write('.') + print('.', end="") # Run openmc - proc = Popen(['../../src/openmc'], stderr=STDOUT, stdout=PIPE) + proc = Popen([openmc_exe], stderr=STDOUT, stdout=PIPE) returncode = proc.wait() if returncode == 0: - sys.stdout.write(BOLD + OKGREEN + "[OK]" + ENDC + "\n") + print(BOLD + OKGREEN + "[OK]" + ENDC) else: - sys.stdout.write(BOLD + FAIL + "[FAILED]" + ENDC + "\n") + print(BOLD + FAIL + "[FAILED]" + ENDC) # Process results if returncode == 0: From 7e3b4e3481d1d3141d560155e6c327210c9fa6eb Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Thu, 3 Apr 2014 08:03:36 -0400 Subject: [PATCH 27/31] removed unused package --- tests/run_tests.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/run_tests.py b/tests/run_tests.py index f98db06057..c977c5f5a6 100755 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -3,7 +3,6 @@ from __future__ import print_function import os -import sys import shutil import re from subprocess import call From 5970ee0e1821129a3a8987fcd9a51b3aad67aa38 Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Thu, 3 Apr 2014 08:08:02 -0400 Subject: [PATCH 28/31] removed another iter --- tests/run_tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/run_tests.py b/tests/run_tests.py index c977c5f5a6..a664438c81 100755 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -222,7 +222,7 @@ FAIL = '\033[91m' ENDC = '\033[0m' BOLD = '\033[1m' -for test in iter(tests): +for test in tests: print(test + '.'*(50 - len(test)), end='') if tests[test].success: print(BOLD + OK + '[OK]' + ENDC) From 1fc0690d63036a2887ae72f42783827b1103237c Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Thu, 3 Apr 2014 08:15:54 -0400 Subject: [PATCH 29/31] change python syntax from == None to is None --- tests/test_basic/test_basic.py | 2 +- tests/test_cmfd_feed/test_cmfd_feed.py | 2 +- tests/test_cmfd_jfnk/test_cmfd_jfnk.py | 2 +- tests/test_cmfd_nofeed/test_cmfd_nofeed.py | 2 +- tests/test_confidence_intervals/test_confidence_intervals.py | 2 +- tests/test_density_atombcm/test_density_atombcm.py | 2 +- tests/test_density_atomcm3/test_density_atomcm3.py | 2 +- tests/test_density_kgm3/test_density_kgm3.py | 2 +- tests/test_density_sum/test_density_sum.py | 2 +- .../test_eigenvalue_genperbatch/test_eigenvalue_genperbatch.py | 2 +- .../test_eigenvalue_no_inactive/test_eigenvalue_no_inactive.py | 2 +- tests/test_energy_grid/test_energy_grid.py | 2 +- tests/test_entropy/test_entropy.py | 2 +- tests/test_filter_cell/test_filter_cell.py | 2 +- tests/test_filter_cellborn/test_filter_cellborn.py | 2 +- tests/test_filter_energy/test_filter_energy.py | 2 +- tests/test_filter_energyout/test_filter_energyout.py | 2 +- tests/test_filter_group_transfer/test_filter_group_transfer.py | 2 +- tests/test_filter_material/test_filter_material.py | 2 +- tests/test_filter_mesh_2d/test_filter_mesh_2d.py | 2 +- tests/test_filter_mesh_3d/test_filter_mesh_3d.py | 2 +- tests/test_filter_universe/test_filter_universe.py | 2 +- tests/test_fixed_source/test_fixed_source.py | 2 +- tests/test_lattice/test_lattice.py | 2 +- tests/test_lattice_multiple/test_lattice_multiple.py | 2 +- tests/test_natural_element/test_natural_element.py | 2 +- tests/test_output/test_output.py | 2 +- tests/test_particle_restart/test_particle_restart.py | 2 +- tests/test_plot_background/test_plot_background.py | 2 +- tests/test_plot_basis/test_plot_basis.py | 2 +- tests/test_plot_colspec/test_plot_colspec.py | 2 +- tests/test_plot_mask/test_plot_mask.py | 2 +- tests/test_ptables_off/test_ptables_off.py | 2 +- tests/test_reflective_cone/test_reflective_cone.py | 2 +- tests/test_reflective_cylinder/test_reflective_cylinder.py | 2 +- tests/test_reflective_plane/test_reflective_plane.py | 2 +- tests/test_reflective_sphere/test_reflective_sphere.py | 2 +- tests/test_rotation/test_rotation.py | 2 +- tests/test_salphabeta/test_salphabeta.py | 2 +- tests/test_salphabeta_multiple/test_salphabeta_multiple.py | 2 +- tests/test_score_MT/test_score_MT.py | 2 +- tests/test_score_absorption/test_score_absorption.py | 2 +- tests/test_score_current/test_score_current.py | 2 +- tests/test_score_events/test_score_events.py | 2 +- tests/test_score_fission/test_score_fission.py | 2 +- tests/test_score_flux/test_score_flux.py | 2 +- tests/test_score_kappafission/test_score_kappafission.py | 2 +- tests/test_score_nufission/test_score_nufission.py | 2 +- tests/test_score_nuscatter/test_score_nuscatter.py | 2 +- tests/test_score_scatter/test_score_scatter.py | 2 +- tests/test_score_scatter_n/test_score_scatter_n.py | 2 +- tests/test_score_scatter_pn/test_score_scatter_pn.py | 2 +- tests/test_score_total/test_score_total.py | 2 +- tests/test_seed/test_seed.py | 2 +- tests/test_source_angle_mono/test_source_angle_mono.py | 2 +- tests/test_source_energy_maxwell/test_source_energy_maxwell.py | 2 +- tests/test_source_energy_mono/test_source_energy_mono.py | 2 +- tests/test_source_file/test_source_file.py | 2 +- tests/test_source_point/test_source_point.py | 2 +- tests/test_sourcepoint_batch/test_sourcepoint_batch.py | 2 +- tests/test_sourcepoint_interval/test_sourcepoint_interval.py | 2 +- tests/test_sourcepoint_latest/test_sourcepoint_latest.py | 2 +- tests/test_sourcepoint_restart/test_sourcepoint_restart.py | 2 +- tests/test_statepoint_batch/test_statepoint_batch.py | 2 +- tests/test_statepoint_interval/test_statepoint_interval.py | 2 +- tests/test_statepoint_restart/test_statepoint_restart.py | 2 +- tests/test_statepoint_sourcesep/test_statepoint_sourcesep.py | 2 +- tests/test_survival_biasing/test_survival_biasing.py | 2 +- tests/test_tally_assumesep/test_tally_assumesep.py | 2 +- tests/test_trace/test_trace.py | 2 +- tests/test_track_output/test_track_output.py | 2 +- tests/test_translation/test_translation.py | 2 +- tests/test_uniform_fs/test_uniform_fs.py | 2 +- tests/test_universe/test_universe.py | 2 +- tests/test_void/test_void.py | 2 +- 75 files changed, 75 insertions(+), 75 deletions(-) diff --git a/tests/test_basic/test_basic.py b/tests/test_basic/test_basic.py index 54733fb13c..ef2dceed89 100644 --- a/tests/test_basic/test_basic.py +++ b/tests/test_basic/test_basic.py @@ -47,7 +47,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_cmfd_feed/test_cmfd_feed.py b/tests/test_cmfd_feed/test_cmfd_feed.py index bafce9f444..4bc2914e3a 100644 --- a/tests/test_cmfd_feed/test_cmfd_feed.py +++ b/tests/test_cmfd_feed/test_cmfd_feed.py @@ -54,7 +54,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_cmfd_jfnk/test_cmfd_jfnk.py b/tests/test_cmfd_jfnk/test_cmfd_jfnk.py index 1386da3fee..0fae02dfdb 100644 --- a/tests/test_cmfd_jfnk/test_cmfd_jfnk.py +++ b/tests/test_cmfd_jfnk/test_cmfd_jfnk.py @@ -55,7 +55,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_cmfd_nofeed/test_cmfd_nofeed.py b/tests/test_cmfd_nofeed/test_cmfd_nofeed.py index 1386da3fee..0fae02dfdb 100644 --- a/tests/test_cmfd_nofeed/test_cmfd_nofeed.py +++ b/tests/test_cmfd_nofeed/test_cmfd_nofeed.py @@ -55,7 +55,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_confidence_intervals/test_confidence_intervals.py b/tests/test_confidence_intervals/test_confidence_intervals.py index 22932a02cd..30c53738fb 100644 --- a/tests/test_confidence_intervals/test_confidence_intervals.py +++ b/tests/test_confidence_intervals/test_confidence_intervals.py @@ -51,7 +51,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_density_atombcm/test_density_atombcm.py b/tests/test_density_atombcm/test_density_atombcm.py index 54733fb13c..ef2dceed89 100644 --- a/tests/test_density_atombcm/test_density_atombcm.py +++ b/tests/test_density_atombcm/test_density_atombcm.py @@ -47,7 +47,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_density_atomcm3/test_density_atomcm3.py b/tests/test_density_atomcm3/test_density_atomcm3.py index 77610a8261..c748062691 100644 --- a/tests/test_density_atomcm3/test_density_atomcm3.py +++ b/tests/test_density_atomcm3/test_density_atomcm3.py @@ -47,7 +47,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_density_kgm3/test_density_kgm3.py b/tests/test_density_kgm3/test_density_kgm3.py index 54733fb13c..ef2dceed89 100644 --- a/tests/test_density_kgm3/test_density_kgm3.py +++ b/tests/test_density_kgm3/test_density_kgm3.py @@ -47,7 +47,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_density_sum/test_density_sum.py b/tests/test_density_sum/test_density_sum.py index d6b4ac9cfa..f4167d1333 100644 --- a/tests/test_density_sum/test_density_sum.py +++ b/tests/test_density_sum/test_density_sum.py @@ -47,7 +47,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_eigenvalue_genperbatch/test_eigenvalue_genperbatch.py b/tests/test_eigenvalue_genperbatch/test_eigenvalue_genperbatch.py index 1e61af4a2b..453b1951fc 100644 --- a/tests/test_eigenvalue_genperbatch/test_eigenvalue_genperbatch.py +++ b/tests/test_eigenvalue_genperbatch/test_eigenvalue_genperbatch.py @@ -47,7 +47,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_eigenvalue_no_inactive/test_eigenvalue_no_inactive.py b/tests/test_eigenvalue_no_inactive/test_eigenvalue_no_inactive.py index 54733fb13c..ef2dceed89 100644 --- a/tests/test_eigenvalue_no_inactive/test_eigenvalue_no_inactive.py +++ b/tests/test_eigenvalue_no_inactive/test_eigenvalue_no_inactive.py @@ -47,7 +47,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_energy_grid/test_energy_grid.py b/tests/test_energy_grid/test_energy_grid.py index 54733fb13c..ef2dceed89 100644 --- a/tests/test_energy_grid/test_energy_grid.py +++ b/tests/test_energy_grid/test_energy_grid.py @@ -47,7 +47,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_entropy/test_entropy.py b/tests/test_entropy/test_entropy.py index 404b94634f..035a5c0ada 100644 --- a/tests/test_entropy/test_entropy.py +++ b/tests/test_entropy/test_entropy.py @@ -48,7 +48,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_filter_cell/test_filter_cell.py b/tests/test_filter_cell/test_filter_cell.py index 435cb80ebc..f2068f85f9 100644 --- a/tests/test_filter_cell/test_filter_cell.py +++ b/tests/test_filter_cell/test_filter_cell.py @@ -51,7 +51,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_filter_cellborn/test_filter_cellborn.py b/tests/test_filter_cellborn/test_filter_cellborn.py index c5cb425422..15f73ee352 100644 --- a/tests/test_filter_cellborn/test_filter_cellborn.py +++ b/tests/test_filter_cellborn/test_filter_cellborn.py @@ -48,7 +48,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_filter_energy/test_filter_energy.py b/tests/test_filter_energy/test_filter_energy.py index 435cb80ebc..f2068f85f9 100644 --- a/tests/test_filter_energy/test_filter_energy.py +++ b/tests/test_filter_energy/test_filter_energy.py @@ -51,7 +51,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_filter_energyout/test_filter_energyout.py b/tests/test_filter_energyout/test_filter_energyout.py index 435cb80ebc..f2068f85f9 100644 --- a/tests/test_filter_energyout/test_filter_energyout.py +++ b/tests/test_filter_energyout/test_filter_energyout.py @@ -51,7 +51,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_filter_group_transfer/test_filter_group_transfer.py b/tests/test_filter_group_transfer/test_filter_group_transfer.py index 435cb80ebc..f2068f85f9 100644 --- a/tests/test_filter_group_transfer/test_filter_group_transfer.py +++ b/tests/test_filter_group_transfer/test_filter_group_transfer.py @@ -51,7 +51,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_filter_material/test_filter_material.py b/tests/test_filter_material/test_filter_material.py index 435cb80ebc..f2068f85f9 100644 --- a/tests/test_filter_material/test_filter_material.py +++ b/tests/test_filter_material/test_filter_material.py @@ -51,7 +51,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_filter_mesh_2d/test_filter_mesh_2d.py b/tests/test_filter_mesh_2d/test_filter_mesh_2d.py index 435cb80ebc..f2068f85f9 100644 --- a/tests/test_filter_mesh_2d/test_filter_mesh_2d.py +++ b/tests/test_filter_mesh_2d/test_filter_mesh_2d.py @@ -51,7 +51,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_filter_mesh_3d/test_filter_mesh_3d.py b/tests/test_filter_mesh_3d/test_filter_mesh_3d.py index 435cb80ebc..f2068f85f9 100644 --- a/tests/test_filter_mesh_3d/test_filter_mesh_3d.py +++ b/tests/test_filter_mesh_3d/test_filter_mesh_3d.py @@ -51,7 +51,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_filter_universe/test_filter_universe.py b/tests/test_filter_universe/test_filter_universe.py index 435cb80ebc..f2068f85f9 100644 --- a/tests/test_filter_universe/test_filter_universe.py +++ b/tests/test_filter_universe/test_filter_universe.py @@ -51,7 +51,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_fixed_source/test_fixed_source.py b/tests/test_fixed_source/test_fixed_source.py index 435cb80ebc..f2068f85f9 100644 --- a/tests/test_fixed_source/test_fixed_source.py +++ b/tests/test_fixed_source/test_fixed_source.py @@ -51,7 +51,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_lattice/test_lattice.py b/tests/test_lattice/test_lattice.py index 54733fb13c..ef2dceed89 100644 --- a/tests/test_lattice/test_lattice.py +++ b/tests/test_lattice/test_lattice.py @@ -47,7 +47,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_lattice_multiple/test_lattice_multiple.py b/tests/test_lattice_multiple/test_lattice_multiple.py index 54733fb13c..ef2dceed89 100644 --- a/tests/test_lattice_multiple/test_lattice_multiple.py +++ b/tests/test_lattice_multiple/test_lattice_multiple.py @@ -47,7 +47,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_natural_element/test_natural_element.py b/tests/test_natural_element/test_natural_element.py index 54733fb13c..ef2dceed89 100644 --- a/tests/test_natural_element/test_natural_element.py +++ b/tests/test_natural_element/test_natural_element.py @@ -47,7 +47,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_output/test_output.py b/tests/test_output/test_output.py index 4ed4255392..b19e5d76d6 100644 --- a/tests/test_output/test_output.py +++ b/tests/test_output/test_output.py @@ -59,7 +59,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_particle_restart/test_particle_restart.py b/tests/test_particle_restart/test_particle_restart.py index 4c63efe372..6c5dcf0be2 100644 --- a/tests/test_particle_restart/test_particle_restart.py +++ b/tests/test_particle_restart/test_particle_restart.py @@ -54,7 +54,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_plot_background/test_plot_background.py b/tests/test_plot_background/test_plot_background.py index fdf786314c..4c990578a4 100644 --- a/tests/test_plot_background/test_plot_background.py +++ b/tests/test_plot_background/test_plot_background.py @@ -33,7 +33,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_plot_basis/test_plot_basis.py b/tests/test_plot_basis/test_plot_basis.py index 2c650d8767..057fd09a97 100644 --- a/tests/test_plot_basis/test_plot_basis.py +++ b/tests/test_plot_basis/test_plot_basis.py @@ -35,7 +35,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_plot_colspec/test_plot_colspec.py b/tests/test_plot_colspec/test_plot_colspec.py index fdf786314c..4c990578a4 100644 --- a/tests/test_plot_colspec/test_plot_colspec.py +++ b/tests/test_plot_colspec/test_plot_colspec.py @@ -33,7 +33,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_plot_mask/test_plot_mask.py b/tests/test_plot_mask/test_plot_mask.py index 2c650d8767..057fd09a97 100644 --- a/tests/test_plot_mask/test_plot_mask.py +++ b/tests/test_plot_mask/test_plot_mask.py @@ -35,7 +35,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_ptables_off/test_ptables_off.py b/tests/test_ptables_off/test_ptables_off.py index 54733fb13c..ef2dceed89 100644 --- a/tests/test_ptables_off/test_ptables_off.py +++ b/tests/test_ptables_off/test_ptables_off.py @@ -47,7 +47,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_reflective_cone/test_reflective_cone.py b/tests/test_reflective_cone/test_reflective_cone.py index 54733fb13c..ef2dceed89 100644 --- a/tests/test_reflective_cone/test_reflective_cone.py +++ b/tests/test_reflective_cone/test_reflective_cone.py @@ -47,7 +47,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_reflective_cylinder/test_reflective_cylinder.py b/tests/test_reflective_cylinder/test_reflective_cylinder.py index 54733fb13c..ef2dceed89 100644 --- a/tests/test_reflective_cylinder/test_reflective_cylinder.py +++ b/tests/test_reflective_cylinder/test_reflective_cylinder.py @@ -47,7 +47,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_reflective_plane/test_reflective_plane.py b/tests/test_reflective_plane/test_reflective_plane.py index 54733fb13c..ef2dceed89 100644 --- a/tests/test_reflective_plane/test_reflective_plane.py +++ b/tests/test_reflective_plane/test_reflective_plane.py @@ -47,7 +47,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_reflective_sphere/test_reflective_sphere.py b/tests/test_reflective_sphere/test_reflective_sphere.py index 54733fb13c..ef2dceed89 100644 --- a/tests/test_reflective_sphere/test_reflective_sphere.py +++ b/tests/test_reflective_sphere/test_reflective_sphere.py @@ -47,7 +47,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_rotation/test_rotation.py b/tests/test_rotation/test_rotation.py index 54733fb13c..ef2dceed89 100644 --- a/tests/test_rotation/test_rotation.py +++ b/tests/test_rotation/test_rotation.py @@ -47,7 +47,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_salphabeta/test_salphabeta.py b/tests/test_salphabeta/test_salphabeta.py index 54733fb13c..ef2dceed89 100644 --- a/tests/test_salphabeta/test_salphabeta.py +++ b/tests/test_salphabeta/test_salphabeta.py @@ -47,7 +47,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_salphabeta_multiple/test_salphabeta_multiple.py b/tests/test_salphabeta_multiple/test_salphabeta_multiple.py index 54733fb13c..ef2dceed89 100644 --- a/tests/test_salphabeta_multiple/test_salphabeta_multiple.py +++ b/tests/test_salphabeta_multiple/test_salphabeta_multiple.py @@ -47,7 +47,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_score_MT/test_score_MT.py b/tests/test_score_MT/test_score_MT.py index 435cb80ebc..f2068f85f9 100644 --- a/tests/test_score_MT/test_score_MT.py +++ b/tests/test_score_MT/test_score_MT.py @@ -51,7 +51,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_score_absorption/test_score_absorption.py b/tests/test_score_absorption/test_score_absorption.py index 435cb80ebc..f2068f85f9 100644 --- a/tests/test_score_absorption/test_score_absorption.py +++ b/tests/test_score_absorption/test_score_absorption.py @@ -51,7 +51,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_score_current/test_score_current.py b/tests/test_score_current/test_score_current.py index 435cb80ebc..f2068f85f9 100644 --- a/tests/test_score_current/test_score_current.py +++ b/tests/test_score_current/test_score_current.py @@ -51,7 +51,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_score_events/test_score_events.py b/tests/test_score_events/test_score_events.py index 435cb80ebc..f2068f85f9 100644 --- a/tests/test_score_events/test_score_events.py +++ b/tests/test_score_events/test_score_events.py @@ -51,7 +51,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_score_fission/test_score_fission.py b/tests/test_score_fission/test_score_fission.py index 435cb80ebc..f2068f85f9 100644 --- a/tests/test_score_fission/test_score_fission.py +++ b/tests/test_score_fission/test_score_fission.py @@ -51,7 +51,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_score_flux/test_score_flux.py b/tests/test_score_flux/test_score_flux.py index 435cb80ebc..f2068f85f9 100644 --- a/tests/test_score_flux/test_score_flux.py +++ b/tests/test_score_flux/test_score_flux.py @@ -51,7 +51,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_score_kappafission/test_score_kappafission.py b/tests/test_score_kappafission/test_score_kappafission.py index 435cb80ebc..f2068f85f9 100644 --- a/tests/test_score_kappafission/test_score_kappafission.py +++ b/tests/test_score_kappafission/test_score_kappafission.py @@ -51,7 +51,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_score_nufission/test_score_nufission.py b/tests/test_score_nufission/test_score_nufission.py index 435cb80ebc..f2068f85f9 100644 --- a/tests/test_score_nufission/test_score_nufission.py +++ b/tests/test_score_nufission/test_score_nufission.py @@ -51,7 +51,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_score_nuscatter/test_score_nuscatter.py b/tests/test_score_nuscatter/test_score_nuscatter.py index 435cb80ebc..f2068f85f9 100644 --- a/tests/test_score_nuscatter/test_score_nuscatter.py +++ b/tests/test_score_nuscatter/test_score_nuscatter.py @@ -51,7 +51,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_score_scatter/test_score_scatter.py b/tests/test_score_scatter/test_score_scatter.py index 435cb80ebc..f2068f85f9 100644 --- a/tests/test_score_scatter/test_score_scatter.py +++ b/tests/test_score_scatter/test_score_scatter.py @@ -51,7 +51,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_score_scatter_n/test_score_scatter_n.py b/tests/test_score_scatter_n/test_score_scatter_n.py index 435cb80ebc..f2068f85f9 100644 --- a/tests/test_score_scatter_n/test_score_scatter_n.py +++ b/tests/test_score_scatter_n/test_score_scatter_n.py @@ -51,7 +51,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_score_scatter_pn/test_score_scatter_pn.py b/tests/test_score_scatter_pn/test_score_scatter_pn.py index 435cb80ebc..f2068f85f9 100644 --- a/tests/test_score_scatter_pn/test_score_scatter_pn.py +++ b/tests/test_score_scatter_pn/test_score_scatter_pn.py @@ -51,7 +51,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_score_total/test_score_total.py b/tests/test_score_total/test_score_total.py index 435cb80ebc..f2068f85f9 100644 --- a/tests/test_score_total/test_score_total.py +++ b/tests/test_score_total/test_score_total.py @@ -51,7 +51,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_seed/test_seed.py b/tests/test_seed/test_seed.py index 54733fb13c..ef2dceed89 100644 --- a/tests/test_seed/test_seed.py +++ b/tests/test_seed/test_seed.py @@ -47,7 +47,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_source_angle_mono/test_source_angle_mono.py b/tests/test_source_angle_mono/test_source_angle_mono.py index 54733fb13c..ef2dceed89 100644 --- a/tests/test_source_angle_mono/test_source_angle_mono.py +++ b/tests/test_source_angle_mono/test_source_angle_mono.py @@ -47,7 +47,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_source_energy_maxwell/test_source_energy_maxwell.py b/tests/test_source_energy_maxwell/test_source_energy_maxwell.py index 54733fb13c..ef2dceed89 100644 --- a/tests/test_source_energy_maxwell/test_source_energy_maxwell.py +++ b/tests/test_source_energy_maxwell/test_source_energy_maxwell.py @@ -47,7 +47,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_source_energy_mono/test_source_energy_mono.py b/tests/test_source_energy_mono/test_source_energy_mono.py index 54733fb13c..ef2dceed89 100644 --- a/tests/test_source_energy_mono/test_source_energy_mono.py +++ b/tests/test_source_energy_mono/test_source_energy_mono.py @@ -47,7 +47,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_source_file/test_source_file.py b/tests/test_source_file/test_source_file.py index 3eca852d57..1be4b92cf8 100644 --- a/tests/test_source_file/test_source_file.py +++ b/tests/test_source_file/test_source_file.py @@ -105,7 +105,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_source_point/test_source_point.py b/tests/test_source_point/test_source_point.py index 54733fb13c..ef2dceed89 100644 --- a/tests/test_source_point/test_source_point.py +++ b/tests/test_source_point/test_source_point.py @@ -47,7 +47,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_sourcepoint_batch/test_sourcepoint_batch.py b/tests/test_sourcepoint_batch/test_sourcepoint_batch.py index f62ddacf9e..e7fd49b40a 100644 --- a/tests/test_sourcepoint_batch/test_sourcepoint_batch.py +++ b/tests/test_sourcepoint_batch/test_sourcepoint_batch.py @@ -47,7 +47,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_sourcepoint_interval/test_sourcepoint_interval.py b/tests/test_sourcepoint_interval/test_sourcepoint_interval.py index 52aa3b2d24..d59b5261d4 100644 --- a/tests/test_sourcepoint_interval/test_sourcepoint_interval.py +++ b/tests/test_sourcepoint_interval/test_sourcepoint_interval.py @@ -47,7 +47,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_sourcepoint_latest/test_sourcepoint_latest.py b/tests/test_sourcepoint_latest/test_sourcepoint_latest.py index cdf6d560b4..858656e837 100644 --- a/tests/test_sourcepoint_latest/test_sourcepoint_latest.py +++ b/tests/test_sourcepoint_latest/test_sourcepoint_latest.py @@ -52,7 +52,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_sourcepoint_restart/test_sourcepoint_restart.py b/tests/test_sourcepoint_restart/test_sourcepoint_restart.py index a67f078da6..81b16255f7 100644 --- a/tests/test_sourcepoint_restart/test_sourcepoint_restart.py +++ b/tests/test_sourcepoint_restart/test_sourcepoint_restart.py @@ -129,7 +129,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_statepoint_batch/test_statepoint_batch.py b/tests/test_statepoint_batch/test_statepoint_batch.py index 7dbce32cc0..ea3993d10b 100644 --- a/tests/test_statepoint_batch/test_statepoint_batch.py +++ b/tests/test_statepoint_batch/test_statepoint_batch.py @@ -55,7 +55,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_statepoint_interval/test_statepoint_interval.py b/tests/test_statepoint_interval/test_statepoint_interval.py index de42fc4e3a..f80cc2dca2 100644 --- a/tests/test_statepoint_interval/test_statepoint_interval.py +++ b/tests/test_statepoint_interval/test_statepoint_interval.py @@ -64,7 +64,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_statepoint_restart/test_statepoint_restart.py b/tests/test_statepoint_restart/test_statepoint_restart.py index 8b0636d6da..06b982917b 100644 --- a/tests/test_statepoint_restart/test_statepoint_restart.py +++ b/tests/test_statepoint_restart/test_statepoint_restart.py @@ -118,7 +118,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_statepoint_sourcesep/test_statepoint_sourcesep.py b/tests/test_statepoint_sourcesep/test_statepoint_sourcesep.py index b21720ef57..00e70444d0 100644 --- a/tests/test_statepoint_sourcesep/test_statepoint_sourcesep.py +++ b/tests/test_statepoint_sourcesep/test_statepoint_sourcesep.py @@ -52,7 +52,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_survival_biasing/test_survival_biasing.py b/tests/test_survival_biasing/test_survival_biasing.py index 54733fb13c..ef2dceed89 100644 --- a/tests/test_survival_biasing/test_survival_biasing.py +++ b/tests/test_survival_biasing/test_survival_biasing.py @@ -47,7 +47,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_tally_assumesep/test_tally_assumesep.py b/tests/test_tally_assumesep/test_tally_assumesep.py index 435cb80ebc..f2068f85f9 100644 --- a/tests/test_tally_assumesep/test_tally_assumesep.py +++ b/tests/test_tally_assumesep/test_tally_assumesep.py @@ -51,7 +51,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_trace/test_trace.py b/tests/test_trace/test_trace.py index d9511551ac..dae89b62b4 100644 --- a/tests/test_trace/test_trace.py +++ b/tests/test_trace/test_trace.py @@ -49,7 +49,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_track_output/test_track_output.py b/tests/test_track_output/test_track_output.py index 25c9449c51..d4670a1385 100644 --- a/tests/test_track_output/test_track_output.py +++ b/tests/test_track_output/test_track_output.py @@ -61,7 +61,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_translation/test_translation.py b/tests/test_translation/test_translation.py index 54733fb13c..ef2dceed89 100644 --- a/tests/test_translation/test_translation.py +++ b/tests/test_translation/test_translation.py @@ -47,7 +47,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_uniform_fs/test_uniform_fs.py b/tests/test_uniform_fs/test_uniform_fs.py index 54733fb13c..ef2dceed89 100644 --- a/tests/test_uniform_fs/test_uniform_fs.py +++ b/tests/test_uniform_fs/test_uniform_fs.py @@ -47,7 +47,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_universe/test_universe.py b/tests/test_universe/test_universe.py index 54733fb13c..ef2dceed89 100644 --- a/tests/test_universe/test_universe.py +++ b/tests/test_universe/test_universe.py @@ -47,7 +47,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests diff --git a/tests/test_void/test_void.py b/tests/test_void/test_void.py index 54733fb13c..ef2dceed89 100644 --- a/tests/test_void/test_void.py +++ b/tests/test_void/test_void.py @@ -47,7 +47,7 @@ def teardown(): if __name__ == '__main__': # test for openmc executable - if opts.exe == None: + if opts.exe is None: raise Exception('Must specify OpenMC executable from command line with --exe.') # run tests From d99ad7b19c9fca98f9eb3cb2589a22b9d6dfe154 Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Thu, 3 Apr 2014 15:06:24 -0400 Subject: [PATCH 30/31] added documentation on adding tests to test suite --- docs/source/devguide/index.rst | 2 +- docs/source/devguide/workflow.rst | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/docs/source/devguide/index.rst b/docs/source/devguide/index.rst index 1ceba324c1..999de9a536 100644 --- a/docs/source/devguide/index.rst +++ b/docs/source/devguide/index.rst @@ -10,7 +10,7 @@ as debugging. .. toctree:: :numbered: - :maxdepth: 2 + :maxdepth: 3 structures styleguide diff --git a/docs/source/devguide/workflow.rst b/docs/source/devguide/workflow.rst index 523fba32b2..11b6f69321 100644 --- a/docs/source/devguide/workflow.rst +++ b/docs/source/devguide/workflow.rst @@ -135,6 +135,32 @@ can run: python run_tests.py -p +Adding tests to test suite +++++++++++++++++++++++++++ + +To add a new test to the test suite, create a sub-directory in the tests +directory that conforms to the regular expression *test_*. To configure +a test you need to add the following files to your new test directory, +*test_name* for example: + + * OpenMC input XML files + * **test_name.py** - python test driver script, please refer to other + tests to see how to construct. Any output files that are generated + during testing must be removed at the end of this script. + * **results.py** - python script that extracts results from statepoint + output files. By default it should look for a binary file, but can + take an argument to overwrite which statepoint file is processed, + whether it is at a different batch or with an HDF5 extension. This + script must output a results file that is named *results_test.dat*. + * **results_true.dat** - ASCII file that contains the expected results + from the test. The file *results_test.dat* is compared to this file + during the execution of the python test driver script. + +In addition to this description, please see the various types of tests that +are already included in the test suite to see how to create them. If all is +implemented correctly, the new test directory will automatically be added +to the CTest framework. + Private Development ------------------- From 565a8493091c9b60ccac23b1f507d5a1101b26c9 Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Thu, 3 Apr 2014 15:13:30 -0400 Subject: [PATCH 31/31] added a few more suggestions when adding new tests --- docs/source/devguide/workflow.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/source/devguide/workflow.rst b/docs/source/devguide/workflow.rst index 11b6f69321..7a955f97d8 100644 --- a/docs/source/devguide/workflow.rst +++ b/docs/source/devguide/workflow.rst @@ -152,9 +152,14 @@ a test you need to add the following files to your new test directory, take an argument to overwrite which statepoint file is processed, whether it is at a different batch or with an HDF5 extension. This script must output a results file that is named *results_test.dat*. + It is recommended that any real numbers reported use *12.6E* format. * **results_true.dat** - ASCII file that contains the expected results from the test. The file *results_test.dat* is compared to this file - during the execution of the python test driver script. + during the execution of the python test driver script. When the + above files have been created, generate a *results_test.dat* file and + copy it to this name and commit. It should be noted that this file + should be generated with basic compiler options during openmc + configuration and build (e.g., no MPI/HDF5, no debug/optimization). In addition to this description, please see the various types of tests that are already included in the test suite to see how to create them. If all is