From 167f9511ba1a19f3165055f0763046016d2d1c32 Mon Sep 17 00:00:00 2001 From: Nick Horelik Date: Thu, 6 Jun 2013 08:24:13 -0700 Subject: [PATCH 01/17] Added cell overlap checking subroutine --- src/geometry.F90 | 51 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/src/geometry.F90 b/src/geometry.F90 index 448691ca2d..84edc80930 100644 --- a/src/geometry.F90 +++ b/src/geometry.F90 @@ -62,6 +62,57 @@ contains end function simple_cell_contains + +!=============================================================================== +! CHECK_CELL_OVERLAP checks for overlapping cells at the current particle's +! position using simple_cell_contains and the LocalCoord's built up by +! find_cell. This should be called immediately following calls to +! find_cell. +!=============================================================================== + + subroutine check_cell_overlap() + + integer :: i ! cell loop index on a level + integer :: n ! number of cells to search on a level + integer :: index_cell ! index in cells array + type(Cell), pointer :: c ! pointer to cell + type(Universe), pointer :: univ ! universe to search in + type(LocalCoord), pointer :: coord ! particle coordinate to search on + + coord => p % coord0 + + ! loop through each coordinate level + do while (associated(coord)) + + p % coord => coord + + univ => universes(coord % universe) + n = univ % n_cells + + ! loop through each cell on this level + do i = 1, n + index_cell = univ % cells(i) + c => cells(index_cell) + + if (simple_cell_contains(c)) then + ! that particle should only be contained in one cell per level + if (index_cell /= coord % cell) then + message = "Overlapping cells detected: " // & + trim(to_str(cells(index_cell) % id)) // ", " // & + trim(to_str(cells(coord % cell) % id)) // & + " on universe " // trim(to_str(univ % id)) + call fatal_error() + end if + end if + + end do + + coord => coord % next + + end do + + end subroutine check_cell_overlap + !=============================================================================== ! FIND_CELL determines what cell a source particle is in within a particular ! universe. If the base universe is passed, the particle should be found as long From 6aeb5281b0758bcbd39eda4d1af33a10c3c8ec8b Mon Sep 17 00:00:00 2001 From: Nick Horelik Date: Thu, 6 Jun 2013 08:25:49 -0700 Subject: [PATCH 02/17] Made plots check for cell overlaps by default --- src/plot.F90 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plot.F90 b/src/plot.F90 index c38788402a..5158718573 100644 --- a/src/plot.F90 +++ b/src/plot.F90 @@ -2,8 +2,8 @@ module plot use constants use error, only: fatal_error - use geometry, only: find_cell - use geometry_header, only: Universe, BASE_UNIVERSE + use geometry, only: find_cell, check_cell_overlap + use geometry_header, only: Cell, BASE_UNIVERSE use global use output, only: write_message use particle_header, only: deallocate_coord @@ -62,6 +62,7 @@ contains p % coord => p % coord0 call find_cell(found_cell) + call check_cell_overlap() if (.not. found_cell) then ! If no cell, revert to default color From d9165b5a6a23a6383c8bbc1d788bd341b564f25f Mon Sep 17 00:00:00 2001 From: Nick Horelik Date: Thu, 6 Jun 2013 09:08:56 -0700 Subject: [PATCH 03/17] Added command-line flag to enable cell overlap checking during transport --- src/global.F90 | 3 +++ src/initialize.F90 | 3 +++ src/physics.F90 | 5 ++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/global.F90 b/src/global.F90 index e0f0bd5bbf..f2bbff6019 100644 --- a/src/global.F90 +++ b/src/global.F90 @@ -274,6 +274,9 @@ module global ! screen and in logs integer :: verbosity = 7 + ! Flag for enabling cell overlap checking during transport + logical :: check_overlaps = .false. + ! Trace for single particle logical :: trace integer :: trace_batch diff --git a/src/initialize.F90 b/src/initialize.F90 index dd28f9bf9c..8cd85a5e90 100644 --- a/src/initialize.F90 +++ b/src/initialize.F90 @@ -297,6 +297,9 @@ contains path_state_point = argv(i) restart_run = .true. + case ('-g', '-geometry-debug', '--geometry-debug') + check_overlaps = .true. + case ('-?', '-help', '--help') call print_usage() stop diff --git a/src/physics.F90 b/src/physics.F90 index 707049b1a8..4dc5e13b29 100644 --- a/src/physics.F90 +++ b/src/physics.F90 @@ -7,7 +7,8 @@ module physics use error, only: fatal_error, warning use fission, only: nu_total, nu_delayed use geometry, only: find_cell, distance_to_boundary, & - cross_surface, cross_lattice + cross_surface, cross_lattice, & + check_cell_overlap use geometry_header, only: Universe, BASE_UNIVERSE use global use interpolation, only: interpolate_tab1 @@ -75,6 +76,8 @@ contains do while (p % alive) + if (check_overlaps) call check_cell_overlap() + ! Calculate microscopic and macroscopic cross sections -- note: if the ! material is the same as the last material and the energy of the ! particle hasn't changed, we don't need to lookup cross sections again. From f96e952c09912f96e3cf828609ae539178f6839f Mon Sep 17 00:00:00 2001 From: Nick Horelik Date: Thu, 6 Jun 2013 11:49:12 -0700 Subject: [PATCH 04/17] Added output summary for cell overlap checking --- src/finalize.F90 | 4 +++- src/geometry.F90 | 5 ++++- src/global.F90 | 6 +++++- src/initialize.F90 | 17 ++++++++++++++--- src/input_xml.F90 | 5 +++++ src/output.F90 | 36 ++++++++++++++++++++++++++++++++++++ src/plot.F90 | 2 +- 7 files changed, 68 insertions(+), 7 deletions(-) diff --git a/src/finalize.F90 b/src/finalize.F90 index d601c2e592..da9d80e2fd 100644 --- a/src/finalize.F90 +++ b/src/finalize.F90 @@ -4,7 +4,8 @@ module finalize use cmfd_output, only: finalize_cmfd # endif use global - use output, only: print_runtime, print_results, write_tallies + use output, only: print_runtime, print_results, & + print_overlap_check, write_tallies use tally, only: tally_statistics #ifdef MPI @@ -50,6 +51,7 @@ contains run_mode /= MODE_PARTICLE)) then call print_runtime() call print_results() + if (check_overlaps) call print_overlap_check() end if ! deallocate arrays diff --git a/src/geometry.F90 b/src/geometry.F90 index 84edc80930..52bd0a43cf 100644 --- a/src/geometry.F90 +++ b/src/geometry.F90 @@ -95,7 +95,7 @@ contains c => cells(index_cell) if (simple_cell_contains(c)) then - ! that particle should only be contained in one cell per level + ! the particle should only be contained in one cell per level if (index_cell /= coord % cell) then message = "Overlapping cells detected: " // & trim(to_str(cells(index_cell) % id)) // ", " // & @@ -103,6 +103,9 @@ contains " on universe " // trim(to_str(univ % id)) call fatal_error() end if + + overlap_check_cnt(index_cell) = overlap_check_cnt(index_cell) + 1 + end if end do diff --git a/src/global.F90 b/src/global.F90 index f2bbff6019..addfaadbed 100644 --- a/src/global.F90 +++ b/src/global.F90 @@ -275,7 +275,8 @@ module global integer :: verbosity = 7 ! Flag for enabling cell overlap checking during transport - logical :: check_overlaps = .false. + logical :: check_overlaps = .false. + integer, allocatable :: overlap_check_cnt(:) ! Trace for single particle logical :: trace @@ -399,6 +400,9 @@ contains if (allocated(materials)) deallocate(materials) if (allocated(plots)) deallocate(plots) + ! Deallocate geometry debugging information + if (allocated(overlap_check_cnt)) deallocate(overlap_check_cnt) + ! Deallocate cross section data, listings, and cache if (allocated(nuclides)) then ! First call the clear routines diff --git a/src/initialize.F90 b/src/initialize.F90 index 8cd85a5e90..4870123bb4 100644 --- a/src/initialize.F90 +++ b/src/initialize.F90 @@ -5,14 +5,15 @@ module initialize use constants use dict_header, only: DictIntInt, ElemKeyValueII use energy_grid, only: unionized_grid - use error, only: fatal_error + use error, only: fatal_error, warning use geometry, only: neighbor_lists use geometry_header, only: Cell, Universe, Lattice, BASE_UNIVERSE use global use input_xml, only: read_input_xml, read_cross_sections_xml, & cells_in_univ_dict, read_plots_xml use output, only: title, header, write_summary, print_version, & - print_usage, write_xs_summary, print_plot + print_usage, write_xs_summary, print_plot, & + write_message use random_lcg, only: initialize_prng use source, only: initialize_source use state_point, only: load_state_point @@ -145,9 +146,17 @@ contains end if end if - ! check for particle restart run + ! Check for particle restart run if (particle_restart_run) run_mode = MODE_PARTICLE + ! Warn if overlap checking is on + if (check_overlaps) then + message = "" + call write_message() + message = "Cell overlap checking is ON" + call warning() + end if + ! Stop initialization timer call time_initialize % stop() @@ -272,6 +281,8 @@ contains select case (argv(i)) case ('-p', '-plot', '--plot') run_mode = MODE_PLOTTING + check_overlaps = .true. + case ('-n', '-n_particles', '--n_particles') ! Read number of particles per cycle i = i + 1 diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 75d0518d1f..5c00ed8d0c 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -626,6 +626,11 @@ contains ! Allocate cells array allocate(cells(n_cells)) + if (check_overlaps) then + allocate(overlap_check_cnt(n_cells)) + overlap_check_cnt = 0 + end if + n_universes = 0 do i = 1, n_cells c => cells(i) diff --git a/src/output.F90 b/src/output.F90 index 4ca455624b..fc5d1d6a69 100644 --- a/src/output.F90 +++ b/src/output.F90 @@ -1472,6 +1472,42 @@ contains end subroutine print_results +!=============================================================================== +! PRINT_OVERLAP_DEBUG displays information regarding overlap checking results +!=============================================================================== + + subroutine print_overlap_check + + integer :: i, j + integer :: num_sparse = 0 + + ! display header block for geometry debugging section + call header("Cell Overlap Check Summary") + + write(ou,100) 'Cell ID','No. Overlap Checks' + + do i = 1, n_cells + write(ou,101) cells(i) % id, overlap_check_cnt(i) + if (overlap_check_cnt(i) < 10) num_sparse = num_sparse + 1 + end do + write(ou,*) + write(ou,'(1X,A)') 'There were ' // trim(to_str(num_sparse)) // & + ' cells with less than 10 overlap checks' + j = 0 + do i = 1, n_cells + if (overlap_check_cnt(i) < 10) then + j = j + 1 + write(ou,'(1X,A8)', advance='no') trim(to_str(cells(i) % id)) + if (modulo(j,8) == 0) write(ou,*) + end if + end do + write(ou,*) + +100 format (1X,A,T15,A) +101 format (1X,I8,T15,I8) + + end subroutine print_overlap_check + !=============================================================================== ! WRITE_TALLIES creates an output file and writes out the mean values of all ! tallies and their standard deviations diff --git a/src/plot.F90 b/src/plot.F90 index 5158718573..e7b8a235a6 100644 --- a/src/plot.F90 +++ b/src/plot.F90 @@ -62,7 +62,7 @@ contains p % coord => p % coord0 call find_cell(found_cell) - call check_cell_overlap() + if (check_overlaps) call check_cell_overlap() if (.not. found_cell) then ! If no cell, revert to default color From 00286f1e49612ff3e486432fb7b0bf58c3b1b2a8 Mon Sep 17 00:00:00 2001 From: Nick Horelik Date: Thu, 6 Jun 2013 13:04:05 -0700 Subject: [PATCH 05/17] Added support for parallel runs to geometry overlap checking --- src/finalize.F90 | 19 +++++++++++++++++++ src/global.F90 | 4 ++-- src/initialize.F90 | 2 +- src/output.F90 | 2 +- 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/finalize.F90 b/src/finalize.F90 index da9d80e2fd..0236eb4e84 100644 --- a/src/finalize.F90 +++ b/src/finalize.F90 @@ -36,6 +36,7 @@ contains if (output_tallies) then if (master) call write_tallies() end if + if (check_overlaps) call reduce_overlap_count() end if #ifdef PETSC @@ -69,4 +70,22 @@ contains end subroutine finalize_run +!=============================================================================== +! REDUCE_OVERLAP_COUNT accumulates cell overlap check counts to master +!=============================================================================== + + subroutine reduce_overlap_count() + +#ifdef MPI + if (master) then + call MPI_REDUCE(MPI_IN_PLACE, overlap_check_cnt, n_cells, & + MPI_INTEGER8, MPI_SUM, 0, MPI_COMM_WORLD, mpi_err) + else + call MPI_REDUCE(overlap_check_cnt, overlap_check_cnt, n_cells, & + MPI_INTEGER8, MPI_SUM, 0, MPI_COMM_WORLD, mpi_err) + end if +#endif + + end subroutine reduce_overlap_count + end module finalize diff --git a/src/global.F90 b/src/global.F90 index addfaadbed..502968054a 100644 --- a/src/global.F90 +++ b/src/global.F90 @@ -275,8 +275,8 @@ module global integer :: verbosity = 7 ! Flag for enabling cell overlap checking during transport - logical :: check_overlaps = .false. - integer, allocatable :: overlap_check_cnt(:) + logical :: check_overlaps = .false. + integer(8), allocatable :: overlap_check_cnt(:) ! Trace for single particle logical :: trace diff --git a/src/initialize.F90 b/src/initialize.F90 index 4870123bb4..c9c572ddda 100644 --- a/src/initialize.F90 +++ b/src/initialize.F90 @@ -150,7 +150,7 @@ contains if (particle_restart_run) run_mode = MODE_PARTICLE ! Warn if overlap checking is on - if (check_overlaps) then + if (master .and. check_overlaps) then message = "" call write_message() message = "Cell overlap checking is ON" diff --git a/src/output.F90 b/src/output.F90 index fc5d1d6a69..727747dff5 100644 --- a/src/output.F90 +++ b/src/output.F90 @@ -1504,7 +1504,7 @@ contains write(ou,*) 100 format (1X,A,T15,A) -101 format (1X,I8,T15,I8) +101 format (1X,I8,T15,I12) end subroutine print_overlap_check From d88b2e504016fda7219ba9d5727d3614be17986d Mon Sep 17 00:00:00 2001 From: nhorelik Date: Thu, 6 Jun 2013 15:52:08 -0400 Subject: [PATCH 06/17] Updated documentation with overlap checking --- docs/source/usersguide/processing.rst | 2 +- docs/source/usersguide/troubleshoot.rst | 37 ++++++++++++++++++++++++- man/man1/openmc.1 | 4 +++ src/geometry.F90 | 4 +-- 4 files changed, 42 insertions(+), 5 deletions(-) diff --git a/docs/source/usersguide/processing.rst b/docs/source/usersguide/processing.rst index 874290465d..7105e9f7d1 100644 --- a/docs/source/usersguide/processing.rst +++ b/docs/source/usersguide/processing.rst @@ -288,7 +288,7 @@ SILO file can be created with: import silomesh as sm sm.init_silo("fluxtally.silo") - sm.init_mesh('tally_mesh',*mesh.dimension, *mesh.lower_left, *mesh.upper_right) + sm.init_mesh('tally_mesh', *mesh.dimension, *mesh.lower_left, *mesh.upper_right) sm.init_var('flux_tally_thermal') for x in range(1,nx+1): for y in range(1,ny+1): diff --git a/docs/source/usersguide/troubleshoot.rst b/docs/source/usersguide/troubleshoot.rst index 64b955593e..49cf41c8de 100644 --- a/docs/source/usersguide/troubleshoot.rst +++ b/docs/source/usersguide/troubleshoot.rst @@ -98,8 +98,38 @@ with the :envvar:`CROSS_SECTIONS` environment variable. It is recommended to add a line in your ``.profile`` or ``.bash_profile`` setting the :envvar:`CROSS_SECTIONS` environment variable. +Geometry Debugging +****************** + +Overlapping Cells +^^^^^^^^^^^^^^^^^ + +For fast run times, normal simulations do not check if the geometry is +incorrectly defined to have overlapping cells. This can lead to incorrect +results that may or may not be obvious when there are errors in the geometry +input file. The built-in 2D and 3D plotters will check for cell overlaps at +the center of every pixel or voxel position they process, however this might +not be a sufficient check to ensure correctly defined geometry. For instance, +if an overlap is of small aspect ratio, the plotting resolution might not be +high enough to produce any pixels in the overlapping area. + +To reliably validate a geometry input, it is best to run the problem in +geometry debugging mode with the ``-g``, ``-geometry-debug``, or +``--geometry-debug`` command-line options. This will enable checks for +overlapping cells at every move of esch simulated particle. Depending on the +complexity of the geometry input file, this could add considerable overhead to +the run (these runs can still be done in parallel). As a result, for this run +mode the user will probably want to run fewer particles than a normal +simulation run. In this case it is important to be aware of how much coverage +each area of the geometry is getting. For instance, if certain regions do not +have many particles travelling through them there will not be many locations +where overlaps are checked for in that region. The user should refer to the +output after a geometry debug run to see how many checks were performed in each +cell, and then adjust the number of starting particles or starting source +distributions accordingly to achieve good coverage. + ERROR: After particle __ crossed surface __ it could not be located in any cell and it did not leak. -**************************************************************************************************** +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This error can arise either if a problem is specified with no boundary conditions or if there is an error in the geometry itself. First check to ensure @@ -120,5 +150,10 @@ has a collision. For example, if you received this error at cycle 5, generation 5 1 4032 +For large runs it is often advantageous to run only the offending particle by +using particle restart mode with the ``-s``, ``-particle``, or ``--particle`` +command-line options in conjunction with the particle restart files that are +created when particles are lost with this error. + .. _gfortran: http://gcc.gnu.org/wiki/GFortran .. _mailing list: https://groups.google.com/forum/?fromgroups=#!forum/openmc-users diff --git a/man/man1/openmc.1 b/man/man1/openmc.1 index b8a9d9c44c..aefbca9171 100644 --- a/man/man1/openmc.1 +++ b/man/man1/openmc.1 @@ -13,6 +13,10 @@ It is assumed that if no is specified, the XML input files are present in the current directory. .SH OPTIONS .TP +.B "\-g\fR, \fP\-\-geometry-debug" +Run in geometry debugging mode, where cell overlaps are checked for after each +move of a particle +.TP .B "\-p\fR, \fP\-\-plot" Run in plotting mode .TP diff --git a/src/geometry.F90 b/src/geometry.F90 index 52bd0a43cf..cb90997846 100644 --- a/src/geometry.F90 +++ b/src/geometry.F90 @@ -65,9 +65,7 @@ contains !=============================================================================== ! CHECK_CELL_OVERLAP checks for overlapping cells at the current particle's -! position using simple_cell_contains and the LocalCoord's built up by -! find_cell. This should be called immediately following calls to -! find_cell. +! position using simple_cell_contains and the LocalCoord's built up by find_cell !=============================================================================== subroutine check_cell_overlap() From 3f7065c9ed8458a32b715c46683cf425767bc622 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 14 Jun 2013 21:53:58 -0400 Subject: [PATCH 07/17] Restructured how MPI and HDF5 are treated in Makefile. --- src/Makefile | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/Makefile b/src/Makefile index 780b45ce7d..8a15142967 100644 --- a/src/Makefile +++ b/src/Makefile @@ -28,8 +28,9 @@ PETSC = no # External Library Paths #=============================================================================== -MPI_DIR = /opt/mpich/3.0.2-$(COMPILER) -HDF5_DIR = /opt/hdf5/1.8.10-patch1-$(COMPILER) +MPI_DIR = /opt/mpich/3.0.4-$(COMPILER) +HDF5_DIR = /opt/hdf5/1.8.11-$(COMPILER) +PHDF5_DIR = /opt/phdf5/1.8.11-$(COMPILER) PETSC_DIR = /opt/petsc/3.3-p6-$(COMPILER) #=============================================================================== @@ -165,20 +166,21 @@ endif # Setup External Libraries #=============================================================================== -# MPI for distributed-memory parallelism +# MPI for distributed-memory parallelism and HDF5 for I/O ifeq ($(MPI),yes) - F90 = $(MPI_DIR)/bin/mpif90 + ifeq ($(HDF5),yes) + F90 = $(PHDF5_DIR)/bin/h5pfc + F90FLAGS += -DHDF5 + else + F90 = $(MPI_DIR)/bin/mpif90 + endif F90FLAGS += -DMPI -endif - -# HDF5 for I/O - -ifeq ($(HDF5),yes) - F90FLAGS += -DHDF5 -I$(HDF5_DIR)/include - LDFLAGS += -L$(HDF5_DIR)/lib $(HDF5_DIR)/lib/libhdf5hl_fortran.a \ - $(HDF5_DIR)/lib/libhdf5_hl.a $(HDF5_DIR)/lib/libhdf5_fortran.a \ - $(HDF5_DIR)/lib/libhdf5.a -lz -lrt -lm -Wl,-rpath -Wl,$(HDF5_DIR)/lib +else + ifeq ($(HDF5),yes) + F90 = $(HDF5_DIR)/bin/h5fc + F90FLAGS += -DHDF5 + endif endif # PETSC for CMFD functionality From 93c7af05a3a938480bc5b46fe9a7382cea0512fc Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 14 Jun 2013 21:56:43 -0400 Subject: [PATCH 08/17] Remove -DNO_F2008 for gfortran. --- src/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index 8a15142967..05cb7df6e8 100644 --- a/src/Makefile +++ b/src/Makefile @@ -45,7 +45,7 @@ GIT_SHA1 = $(shell git log -1 2>/dev/null | head -n 1 | awk '{print $$2}') ifeq ($(COMPILER),gnu) F90 = gfortran - F90FLAGS := -cpp -fbacktrace -DNO_F2008 + F90FLAGS := -cpp -fbacktrace LDFLAGS = # Debugging From 1a6f7a1b9aa935ad7841713a5b5551f0e548f834 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 14 Jun 2013 22:11:26 -0400 Subject: [PATCH 09/17] Changed F90 to FC in Makefiles. --- src/Makefile | 80 ++++++++++++++++++++-------------------- src/templates/Makefile | 8 ++-- src/xml-fortran/Makefile | 10 ++--- 3 files changed, 49 insertions(+), 49 deletions(-) diff --git a/src/Makefile b/src/Makefile index 05cb7df6e8..d1961fb71a 100644 --- a/src/Makefile +++ b/src/Makefile @@ -44,26 +44,26 @@ GIT_SHA1 = $(shell git log -1 2>/dev/null | head -n 1 | awk '{print $$2}') #=============================================================================== ifeq ($(COMPILER),gnu) - F90 = gfortran - F90FLAGS := -cpp -fbacktrace + FC = gfortran + FCFLAGS := -cpp -fbacktrace LDFLAGS = # Debugging ifeq ($(DEBUG),yes) - F90FLAGS += -g -Wall -pedantic -std=f2008 -fbounds-check \ + FCFLAGS += -g -Wall -pedantic -std=f2008 -fbounds-check \ -ffpe-trap=invalid,overflow,underflow LDFLAGS += -g endif # Profiling ifeq ($(PROFILE),yes) - F90FLAGS += -pg + FCFLAGS += -pg LDFLAGS += -pg endif # Optimization ifeq ($(OPTIMIZE),yes) - F90FLAGS += -O3 + FCFLAGS += -O3 endif endif @@ -72,25 +72,25 @@ endif #=============================================================================== ifeq ($(COMPILER),intel) - F90 = ifort - F90FLAGS := -fpp -warn -assume byterecl -traceback + FC = ifort + FCFLAGS := -fpp -warn -assume byterecl -traceback LDFLAGS = # Debugging ifeq ($(DEBUG),yes) - F90FLAGS += -g -ftrapuv -fp-stack-check -check all -fpe0 + FCFLAGS += -g -ftrapuv -fp-stack-check -check all -fpe0 LDFLAGS += -g endif # Profiling ifeq ($(PROFILE),yes) - F90FLAGS += -pg + FCFLAGS += -pg LDFLAGS += -pg endif # Optimization ifeq ($(OPTIMIZE),yes) - F90FLAGS += -O3 + FCFLAGS += -O3 endif endif @@ -99,25 +99,25 @@ endif #=============================================================================== ifeq ($(COMPILER),pgi) - F90 = pgf90 - F90FLAGS := -Mpreprocess -DNO_F2008 -Minform=inform -traceback + FC = pgf90 + FCFLAGS := -Mpreprocess -DNO_F2008 -Minform=inform -traceback LDFLAGS = # Debugging ifeq ($(DEBUG),yes) - F90FLAGS += -g -Mbounds -Mchkptr -Mchkstk + FCFLAGS += -g -Mbounds -Mchkptr -Mchkstk LDFLAGS += -g endif # Profiling ifeq ($(PROFILE),yes) - F90FLAGS += -pg + FCFLAGS += -pg LDFLAGS += -pg endif # Optimization ifeq ($(OPTIMIZE),yes) - F90FLAGS += -fast -Mipa + FCFLAGS += -fast -Mipa endif endif @@ -126,24 +126,24 @@ endif #=============================================================================== ifeq ($(COMPILER),ibm) - F90 = xlf2003 - F90FLAGS := -WF,-DNO_F2008 -O2 + FC = xlf2003 + FCFLAGS := -WF,-DNO_F2008 -O2 # Debugging ifeq ($(DEBUG),yes) - F90FLAGS += -g -C -qflag=i:i -u + FCFLAGS += -g -C -qflag=i:i -u LDFLAGS += -g endif # Profiling ifeq ($(PROFILE),yes) - F90FLAGS += -p + FCFLAGS += -p LDFLAGS += -p endif # Optimization ifeq ($(OPTIMIZE),yes) - F90FLAGS += -O3 + FCFLAGS += -O3 endif endif @@ -152,12 +152,12 @@ endif #=============================================================================== ifeq ($(COMPILER),cray) - F90 = ftn - F90FLAGS := -e Z -m 0 + FC = ftn + FCFLAGS := -e Z -m 0 # Debugging ifeq ($(DEBUG),yes) - F90FLAGS += -g -R abcnsp -O0 + FCFLAGS += -g -R abcnsp -O0 LDFLAGS += -g endif endif @@ -170,16 +170,16 @@ endif ifeq ($(MPI),yes) ifeq ($(HDF5),yes) - F90 = $(PHDF5_DIR)/bin/h5pfc - F90FLAGS += -DHDF5 + FC = $(PHDF5_DIR)/bin/h5pfc + FCFLAGS += -DHDF5 else - F90 = $(MPI_DIR)/bin/mpif90 + FC = $(MPI_DIR)/bin/mpif90 endif - F90FLAGS += -DMPI + FCFLAGS += -DMPI else ifeq ($(HDF5),yes) - F90 = $(HDF5_DIR)/bin/h5fc - F90FLAGS += -DHDF5 + FC = $(HDF5_DIR)/bin/h5fc + FCFLAGS += -DHDF5 endif endif @@ -193,7 +193,7 @@ ifeq ($(PETSC),yes) # Set up PETSc environment include $(PETSC_DIR)/conf/petscvariables - F90FLAGS += -I$(PETSC_DIR)/include -DPETSC + FCFLAGS += -I$(PETSC_DIR)/include -DPETSC LDFLAGS += $(PETSC_LIB) endif @@ -204,23 +204,23 @@ endif # IBM Blue Gene/P ANL supercomputer ifeq ($(MACHINE),bluegene) - F90 = /bgsys/drivers/ppcfloor/comm/xl/bin/mpixlf2003 - F90FLAGS = -WF,-DNO_F2008,-DMPI -O3 + FC = /bgsys/drivers/ppcfloor/comm/xl/bin/mpixlf2003 + FCFLAGS = -WF,-DNO_F2008,-DMPI -O3 LDFLAGS = -lmpich.cnkf90 endif # Cray XK6 ORNL Titan supercomputer ifeq ($(MACHINE),crayxk6) - F90 = ftn - F90FLAGS += -DMPI + FC = ftn + FCFLAGS += -DMPI endif # IBM Blue Gene/Q ANL supercomputer ifeq ($(MACHINE),bluegeneq) - F90 = mpixlf2003 - F90FLAGS = -WF,-DNO_F2008,-DMPI -O5 + FC = mpixlf2003 + FCFLAGS = -WF,-DNO_F2008,-DMPI -O5 endif #=============================================================================== @@ -229,10 +229,10 @@ endif all: xml-fortran $(program) xml-fortran: - cd xml-fortran; make MACHINE=$(MACHINE) F90=$(F90) F90FLAGS="$(F90FLAGS)" - cd templates; make F90=$(F90) F90FLAGS="$(F90FLAGS)" + cd xml-fortran; make MACHINE=$(MACHINE) FC=$(FC) FCFLAGS="$(FCFLAGS)" + cd templates; make FC=$(FC) FCFLAGS="$(FCFLAGS)" $(program): $(objects) - $(F90) $(objects) $(templates) $(xml_fort) $(LDFLAGS) -o $@ + $(FC) $(objects) $(templates) $(xml_fort) $(LDFLAGS) -o $@ install: @install -D $(program) $(DESTDIR)$(prefix)/bin/$(program) @install -D utils/statepoint_cmp.py $(DESTDIR)$(prefix)/bin/statepoint_cmp @@ -263,7 +263,7 @@ neat: .PHONY: all xml-fortran install uninstall clean neat distclean %.o: %.F90 - $(F90) $(F90FLAGS) -DGIT_SHA1="\"$(GIT_SHA1)\"" -Ixml-fortran -Itemplates -c $< + $(FC) $(FCFLAGS) -DGIT_SHA1="\"$(GIT_SHA1)\"" -Ixml-fortran -Itemplates -c $< #=============================================================================== # Dependencies diff --git a/src/templates/Makefile b/src/templates/Makefile index 232ae96090..59144c189c 100644 --- a/src/templates/Makefile +++ b/src/templates/Makefile @@ -7,12 +7,12 @@ objects = $(templates:.xml=.o) # Add include for subdirectory -override F90FLAGS += -I../xml-fortran +override FCFLAGS += -I../xml-fortran # Ignore unused variables -ifeq ($(F90),ifort) - override F90FLAGS += -warn nounused +ifeq ($(FC),ifort) + override FCFLAGS += -warn nounused endif #=============================================================================== @@ -35,4 +35,4 @@ clean: ../xml-fortran/xmlreader $(basename $@) %.o: %.f90 - $(F90) $(F90FLAGS) -c $(basename $@).f90 + $(FC) $(FCFLAGS) -c $(basename $@).f90 diff --git a/src/xml-fortran/Makefile b/src/xml-fortran/Makefile index c0514533a3..c662d88b4b 100644 --- a/src/xml-fortran/Makefile +++ b/src/xml-fortran/Makefile @@ -9,11 +9,11 @@ objects = $(source:.f90=.o) # Ignore unused variables ifeq ($(MACHINE),bluegene) - override F90 = xlf2003 + override FC = xlf2003 endif -ifeq ($(F90),ifort) - override F90FLAGS += -warn nounused +ifeq ($(FC),ifort) + override FCFLAGS += -warn nounused endif #=============================================================================== @@ -22,7 +22,7 @@ endif all: $(reader) $(reader): $(objects) - $(F90) $(objects) -o $@ + $(FC) $(objects) -o $@ clean: @rm -f *.o *.mod $(reader) neat: @@ -36,7 +36,7 @@ neat: .PHONY: all clean neat %.o: %.f90 - $(F90) $(F90FLAGS) -c $< + $(FC) $(FCFLAGS) -c $< #=============================================================================== # Dependencies From f4670af68edacc9a873a933d1084662202c30645 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sat, 15 Jun 2013 13:25:26 -0400 Subject: [PATCH 10/17] Revert "Changed F90 to FC in Makefiles." FC was overwritten if PETSC=yes because of an include file. This reverts commit 1a6f7a1b9aa935ad7841713a5b5551f0e548f834. --- src/Makefile | 80 ++++++++++++++++++++-------------------- src/templates/Makefile | 8 ++-- src/xml-fortran/Makefile | 10 ++--- 3 files changed, 49 insertions(+), 49 deletions(-) diff --git a/src/Makefile b/src/Makefile index d1961fb71a..05cb7df6e8 100644 --- a/src/Makefile +++ b/src/Makefile @@ -44,26 +44,26 @@ GIT_SHA1 = $(shell git log -1 2>/dev/null | head -n 1 | awk '{print $$2}') #=============================================================================== ifeq ($(COMPILER),gnu) - FC = gfortran - FCFLAGS := -cpp -fbacktrace + F90 = gfortran + F90FLAGS := -cpp -fbacktrace LDFLAGS = # Debugging ifeq ($(DEBUG),yes) - FCFLAGS += -g -Wall -pedantic -std=f2008 -fbounds-check \ + F90FLAGS += -g -Wall -pedantic -std=f2008 -fbounds-check \ -ffpe-trap=invalid,overflow,underflow LDFLAGS += -g endif # Profiling ifeq ($(PROFILE),yes) - FCFLAGS += -pg + F90FLAGS += -pg LDFLAGS += -pg endif # Optimization ifeq ($(OPTIMIZE),yes) - FCFLAGS += -O3 + F90FLAGS += -O3 endif endif @@ -72,25 +72,25 @@ endif #=============================================================================== ifeq ($(COMPILER),intel) - FC = ifort - FCFLAGS := -fpp -warn -assume byterecl -traceback + F90 = ifort + F90FLAGS := -fpp -warn -assume byterecl -traceback LDFLAGS = # Debugging ifeq ($(DEBUG),yes) - FCFLAGS += -g -ftrapuv -fp-stack-check -check all -fpe0 + F90FLAGS += -g -ftrapuv -fp-stack-check -check all -fpe0 LDFLAGS += -g endif # Profiling ifeq ($(PROFILE),yes) - FCFLAGS += -pg + F90FLAGS += -pg LDFLAGS += -pg endif # Optimization ifeq ($(OPTIMIZE),yes) - FCFLAGS += -O3 + F90FLAGS += -O3 endif endif @@ -99,25 +99,25 @@ endif #=============================================================================== ifeq ($(COMPILER),pgi) - FC = pgf90 - FCFLAGS := -Mpreprocess -DNO_F2008 -Minform=inform -traceback + F90 = pgf90 + F90FLAGS := -Mpreprocess -DNO_F2008 -Minform=inform -traceback LDFLAGS = # Debugging ifeq ($(DEBUG),yes) - FCFLAGS += -g -Mbounds -Mchkptr -Mchkstk + F90FLAGS += -g -Mbounds -Mchkptr -Mchkstk LDFLAGS += -g endif # Profiling ifeq ($(PROFILE),yes) - FCFLAGS += -pg + F90FLAGS += -pg LDFLAGS += -pg endif # Optimization ifeq ($(OPTIMIZE),yes) - FCFLAGS += -fast -Mipa + F90FLAGS += -fast -Mipa endif endif @@ -126,24 +126,24 @@ endif #=============================================================================== ifeq ($(COMPILER),ibm) - FC = xlf2003 - FCFLAGS := -WF,-DNO_F2008 -O2 + F90 = xlf2003 + F90FLAGS := -WF,-DNO_F2008 -O2 # Debugging ifeq ($(DEBUG),yes) - FCFLAGS += -g -C -qflag=i:i -u + F90FLAGS += -g -C -qflag=i:i -u LDFLAGS += -g endif # Profiling ifeq ($(PROFILE),yes) - FCFLAGS += -p + F90FLAGS += -p LDFLAGS += -p endif # Optimization ifeq ($(OPTIMIZE),yes) - FCFLAGS += -O3 + F90FLAGS += -O3 endif endif @@ -152,12 +152,12 @@ endif #=============================================================================== ifeq ($(COMPILER),cray) - FC = ftn - FCFLAGS := -e Z -m 0 + F90 = ftn + F90FLAGS := -e Z -m 0 # Debugging ifeq ($(DEBUG),yes) - FCFLAGS += -g -R abcnsp -O0 + F90FLAGS += -g -R abcnsp -O0 LDFLAGS += -g endif endif @@ -170,16 +170,16 @@ endif ifeq ($(MPI),yes) ifeq ($(HDF5),yes) - FC = $(PHDF5_DIR)/bin/h5pfc - FCFLAGS += -DHDF5 + F90 = $(PHDF5_DIR)/bin/h5pfc + F90FLAGS += -DHDF5 else - FC = $(MPI_DIR)/bin/mpif90 + F90 = $(MPI_DIR)/bin/mpif90 endif - FCFLAGS += -DMPI + F90FLAGS += -DMPI else ifeq ($(HDF5),yes) - FC = $(HDF5_DIR)/bin/h5fc - FCFLAGS += -DHDF5 + F90 = $(HDF5_DIR)/bin/h5fc + F90FLAGS += -DHDF5 endif endif @@ -193,7 +193,7 @@ ifeq ($(PETSC),yes) # Set up PETSc environment include $(PETSC_DIR)/conf/petscvariables - FCFLAGS += -I$(PETSC_DIR)/include -DPETSC + F90FLAGS += -I$(PETSC_DIR)/include -DPETSC LDFLAGS += $(PETSC_LIB) endif @@ -204,23 +204,23 @@ endif # IBM Blue Gene/P ANL supercomputer ifeq ($(MACHINE),bluegene) - FC = /bgsys/drivers/ppcfloor/comm/xl/bin/mpixlf2003 - FCFLAGS = -WF,-DNO_F2008,-DMPI -O3 + F90 = /bgsys/drivers/ppcfloor/comm/xl/bin/mpixlf2003 + F90FLAGS = -WF,-DNO_F2008,-DMPI -O3 LDFLAGS = -lmpich.cnkf90 endif # Cray XK6 ORNL Titan supercomputer ifeq ($(MACHINE),crayxk6) - FC = ftn - FCFLAGS += -DMPI + F90 = ftn + F90FLAGS += -DMPI endif # IBM Blue Gene/Q ANL supercomputer ifeq ($(MACHINE),bluegeneq) - FC = mpixlf2003 - FCFLAGS = -WF,-DNO_F2008,-DMPI -O5 + F90 = mpixlf2003 + F90FLAGS = -WF,-DNO_F2008,-DMPI -O5 endif #=============================================================================== @@ -229,10 +229,10 @@ endif all: xml-fortran $(program) xml-fortran: - cd xml-fortran; make MACHINE=$(MACHINE) FC=$(FC) FCFLAGS="$(FCFLAGS)" - cd templates; make FC=$(FC) FCFLAGS="$(FCFLAGS)" + cd xml-fortran; make MACHINE=$(MACHINE) F90=$(F90) F90FLAGS="$(F90FLAGS)" + cd templates; make F90=$(F90) F90FLAGS="$(F90FLAGS)" $(program): $(objects) - $(FC) $(objects) $(templates) $(xml_fort) $(LDFLAGS) -o $@ + $(F90) $(objects) $(templates) $(xml_fort) $(LDFLAGS) -o $@ install: @install -D $(program) $(DESTDIR)$(prefix)/bin/$(program) @install -D utils/statepoint_cmp.py $(DESTDIR)$(prefix)/bin/statepoint_cmp @@ -263,7 +263,7 @@ neat: .PHONY: all xml-fortran install uninstall clean neat distclean %.o: %.F90 - $(FC) $(FCFLAGS) -DGIT_SHA1="\"$(GIT_SHA1)\"" -Ixml-fortran -Itemplates -c $< + $(F90) $(F90FLAGS) -DGIT_SHA1="\"$(GIT_SHA1)\"" -Ixml-fortran -Itemplates -c $< #=============================================================================== # Dependencies diff --git a/src/templates/Makefile b/src/templates/Makefile index 59144c189c..232ae96090 100644 --- a/src/templates/Makefile +++ b/src/templates/Makefile @@ -7,12 +7,12 @@ objects = $(templates:.xml=.o) # Add include for subdirectory -override FCFLAGS += -I../xml-fortran +override F90FLAGS += -I../xml-fortran # Ignore unused variables -ifeq ($(FC),ifort) - override FCFLAGS += -warn nounused +ifeq ($(F90),ifort) + override F90FLAGS += -warn nounused endif #=============================================================================== @@ -35,4 +35,4 @@ clean: ../xml-fortran/xmlreader $(basename $@) %.o: %.f90 - $(FC) $(FCFLAGS) -c $(basename $@).f90 + $(F90) $(F90FLAGS) -c $(basename $@).f90 diff --git a/src/xml-fortran/Makefile b/src/xml-fortran/Makefile index c662d88b4b..c0514533a3 100644 --- a/src/xml-fortran/Makefile +++ b/src/xml-fortran/Makefile @@ -9,11 +9,11 @@ objects = $(source:.f90=.o) # Ignore unused variables ifeq ($(MACHINE),bluegene) - override FC = xlf2003 + override F90 = xlf2003 endif -ifeq ($(FC),ifort) - override FCFLAGS += -warn nounused +ifeq ($(F90),ifort) + override F90FLAGS += -warn nounused endif #=============================================================================== @@ -22,7 +22,7 @@ endif all: $(reader) $(reader): $(objects) - $(FC) $(objects) -o $@ + $(F90) $(objects) -o $@ clean: @rm -f *.o *.mod $(reader) neat: @@ -36,7 +36,7 @@ neat: .PHONY: all clean neat %.o: %.f90 - $(FC) $(FCFLAGS) -c $< + $(F90) $(F90FLAGS) -c $< #=============================================================================== # Dependencies From c03da91153b677ce80a21533898b34280c9eaf2b Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sat, 15 Jun 2013 13:39:45 -0400 Subject: [PATCH 11/17] Added -g to print_usage. --- src/output.F90 | 1 + 1 file changed, 1 insertion(+) diff --git a/src/output.F90 b/src/output.F90 index 727747dff5..698338d091 100644 --- a/src/output.F90 +++ b/src/output.F90 @@ -165,6 +165,7 @@ contains write(OUTPUT_UNIT,*) 'Usage: openmc [options] [directory]' write(OUTPUT_UNIT,*) write(OUTPUT_UNIT,*) 'Options:' + write(OUTPUT_UNIT,*) ' -g, --geometry-debug Run in geometry debugging mode' write(OUTPUT_UNIT,*) ' -p, --plot Run in plotting mode' write(OUTPUT_UNIT,*) ' -r, --restart Restart a previous run' write(OUTPUT_UNIT,*) ' -s, --particle Run a single particle history' From 85292363d1ee343ba1df73eb22904abf49f7827b Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sat, 15 Jun 2013 15:26:38 -0400 Subject: [PATCH 12/17] Combine -r and -s options in man page. --- man/man1/openmc.1 | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/man/man1/openmc.1 b/man/man1/openmc.1 index aefbca9171..eb8981f38f 100644 --- a/man/man1/openmc.1 +++ b/man/man1/openmc.1 @@ -20,12 +20,9 @@ move of a particle .B "\-p\fR, \fP\-\-plot" Run in plotting mode .TP -.BI \-r " statepoint" "\fR,\fP \-\-restart" " statepoint" -Restart a previous run using data stored in \fIstatepoint\fP. -.TP -.BI \-s " particleFile" "\fR,\fP \-\-particle" " particleFile" -Run a single particle history from a particle restart file named -\fIparticleFile\fP. +.BI \-r " binaryFile" "\fR,\fP \-\-restart" " binaryFile" +Restart a previous run from a state point or a particle restart file named +\fIbinaryFile\fP. .TP .B "\-v\fR, \fP\-\-version" Show version information. From 45d389c641ffad51d24311100b0f8f93a95ff5e2 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sat, 15 Jun 2013 16:11:54 -0400 Subject: [PATCH 13/17] Made numerous Python scripts in utils work with either 2 or 3. --- src/utils/build_dependencies.py | 4 +--- src/utils/convert_xsdir.py | 29 +++++++++++++++------------- src/utils/memory_usage.py | 6 ------ src/utils/read_source.py | 34 --------------------------------- src/utils/split_nuclide.py | 2 +- 5 files changed, 18 insertions(+), 57 deletions(-) delete mode 100755 src/utils/read_source.py diff --git a/src/utils/build_dependencies.py b/src/utils/build_dependencies.py index 37cd76bea4..44a5c5ccaf 100755 --- a/src/utils/build_dependencies.py +++ b/src/utils/build_dependencies.py @@ -20,9 +20,7 @@ for src in glob.iglob('*.F90'): dependencies[module] = sorted(list(deps)) -keys = dependencies.keys() -keys.sort() -for module in keys: +for module in dependencies.keys(): for dep in dependencies[module]: print("{0}.o: {1}.o".format(module, dep)) print('') diff --git a/src/utils/convert_xsdir.py b/src/utils/convert_xsdir.py index 90fa3ee891..b7fa9cc187 100755 --- a/src/utils/convert_xsdir.py +++ b/src/utils/convert_xsdir.py @@ -212,21 +212,24 @@ class XsdirTable(object): @property def alias(self): zaid = self.zaid - Z = int(zaid[:-3]) - A = zaid[-3:] + if zaid: + Z = int(zaid[:-3]) + A = zaid[-3:] - if A == '000': - s = 'Nat' - elif zaid == '95242': - s = '242m' - elif zaid == '95642': - s = '242' - elif int(A) > 300: - s = str(int(A) - 400) + "m" + if A == '000': + s = 'Nat' + elif zaid == '95242': + s = '242m' + elif zaid == '95642': + s = '242' + elif int(A) > 300: + s = str(int(A) - 400) + "m" + else: + s = str(int(A)) + + return "{0}-{1}.{2}".format(elements[Z], s, self.xs) else: - s = str(int(A)) - - return "{0}-{1}.{2}".format(elements[Z], s, self.xs) + return None @property def zaid(self): diff --git a/src/utils/memory_usage.py b/src/utils/memory_usage.py index 757fadaa86..b4f62e68b0 100755 --- a/src/utils/memory_usage.py +++ b/src/utils/memory_usage.py @@ -5,7 +5,6 @@ import sys import os -import matplotlib.pyplot as pyplot if len(sys.argv) > 1: # Get path to cross_sections.out file from command line argument @@ -56,8 +55,3 @@ print(' Secondary Energy Distributions = ' + str(sum(memory_energy))) print(' Probability Tables = ' + str(sum(memory_urr))) print(' S(a,b) Tables = ' + str(sum(memory_sab))) print(' Total = ' + str(sum(memory_total))) - -# Histograms -# pyplot.hist(memory_xs,100) -# pyplot.title('Memory for Cross Sections') -# pyplot.show() diff --git a/src/utils/read_source.py b/src/utils/read_source.py deleted file mode 100755 index 347ae0a182..0000000000 --- a/src/utils/read_source.py +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env python2 - -import struct - -class SourceFile(object): - def __init__(self, filename): - # Open source file for reading - self.f = open(filename, 'r') - - # Read number of source sites - self.n_sites = struct.unpack('q', self.f.read(8))[0] - - # Create list to store source sites - self.sites = [] - - for i in range(self.n_sites): - # Read position, angle, and energy - (weight,) = struct.unpack('d', self.f.read(8)) - xyz = struct.unpack('3d', self.f.read(24)) - uvw = struct.unpack('3d', self.f.read(24)) - (E,) = struct.unpack('d', self.f.read(8)) - - # Create source site and append to list - self.sites.append(SourceSite(weight, xyz, uvw, E)) - -class SourceSite(object): - def __init__(self, weight, xyz, uvw, E): - self.weight = weight - self.xyz = xyz - self.uvw = uvw - self.E = E - - def __repr__(self): - return "".format(self.xyz, self.E) diff --git a/src/utils/split_nuclide.py b/src/utils/split_nuclide.py index 6e028fb80f..beadbd70bd 100755 --- a/src/utils/split_nuclide.py +++ b/src/utils/split_nuclide.py @@ -3,7 +3,7 @@ import sys if len(sys.argv) != 3: - print "Must supply element and atom/b-cm" + print("Must supply element and atom/b-cm") exit element = sys.argv[1] From 4fee078e624a9ce96243f21989a23c69a2891b72 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sun, 16 Jun 2013 16:09:45 -0400 Subject: [PATCH 14/17] Write warnings to stderr instead of stdout. --- src/error.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/error.F90 b/src/error.F90 index ec8b9f2fad..2f3813fda7 100644 --- a/src/error.F90 +++ b/src/error.F90 @@ -29,7 +29,7 @@ contains if (.not. master) return ! Write warning at beginning - write(OUTPUT_UNIT, fmt='(1X,A)', advance='no') 'WARNING: ' + write(ERROR_UNIT, fmt='(1X,A)', advance='no') 'WARNING: ' ! Set line wrapping and indentation line_wrap = 80 @@ -42,7 +42,7 @@ contains do if (length - i_start < line_wrap - indent + 1) then ! Remainder of message will fit on line - write(OUTPUT_UNIT, fmt='(A)') message(i_start+1:length) + write(ERROR_UNIT, fmt='(A)') message(i_start+1:length) exit else @@ -58,7 +58,7 @@ contains i_end = i_end - 1 else ! Write up to last space - write(OUTPUT_UNIT, fmt='(A/A)', advance='no') & + write(ERROR_UNIT, fmt='(A/A)', advance='no') & message(i_start+1:i_end-1), repeat(' ', indent) end if From 8d8bb1f06ce1bede4506c0cec3a35bfa6df3888b Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sun, 16 Jun 2013 16:10:38 -0400 Subject: [PATCH 15/17] Fix test_particle_restart. --- tests/test_particle_restart/geometry.xml | 13 +++++-------- tests/test_particle_restart/materials.xml | 2 +- tests/test_particle_restart/settings.xml | 2 +- .../test_particle_restart/test_particle_restart.py | 6 +++--- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/tests/test_particle_restart/geometry.xml b/tests/test_particle_restart/geometry.xml index 3dc9f24c1c..52fea4df64 100644 --- a/tests/test_particle_restart/geometry.xml +++ b/tests/test_particle_restart/geometry.xml @@ -1,12 +1,9 @@ - - - - - - - - + + + + + diff --git a/tests/test_particle_restart/materials.xml b/tests/test_particle_restart/materials.xml index 1f85510e0d..003e8ebc9a 100644 --- a/tests/test_particle_restart/materials.xml +++ b/tests/test_particle_restart/materials.xml @@ -2,7 +2,7 @@ - + diff --git a/tests/test_particle_restart/settings.xml b/tests/test_particle_restart/settings.xml index f278bb5b07..a6b5abbbae 100644 --- a/tests/test_particle_restart/settings.xml +++ b/tests/test_particle_restart/settings.xml @@ -9,7 +9,7 @@ - -20 -20 -5 20 20 5 + -10 -10 -5 10 10 5 diff --git a/tests/test_particle_restart/test_particle_restart.py b/tests/test_particle_restart/test_particle_restart.py index b1f9a01088..b3a8b3396c 100644 --- a/tests/test_particle_restart/test_particle_restart.py +++ b/tests/test_particle_restart/test_particle_restart.py @@ -15,16 +15,16 @@ def test_run(): assert stderr != '' def test_created_restart(): - assert os.path.exists(pwd + '/particle_0.binary') + assert os.path.exists(pwd + '/particle_10_638.binary') def test_run_restart(): - proc = Popen([pwd + '/../../src/openmc -s particle_0.binary'], + proc = Popen([pwd + '/../../src/openmc -s particle_10_638.binary'], stderr=PIPE, stdout=PIPE, shell=True) stdout, stderr = proc.communicate() assert stderr != '' def teardown(): - output = [pwd + '/particle_0.binary'] + output = [pwd + '/particle_10_638.binary'] for f in output: if os.path.exists(f): os.remove(f) From b02abf7775fd8bd5db7cdb2860c367b95676fda6 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sun, 16 Jun 2013 15:52:10 -0400 Subject: [PATCH 16/17] Add release notes for 0.5.2 and increment version numbers. --- docs/source/conf.py | 2 +- docs/source/releasenotes/index.rst | 1 + docs/source/releasenotes/notes_0.5.2.rst | 55 ++++++++++++++++++++++++ src/constants.F90 | 2 +- src/output.F90 | 12 +++--- 5 files changed, 64 insertions(+), 8 deletions(-) create mode 100644 docs/source/releasenotes/notes_0.5.2.rst diff --git a/docs/source/conf.py b/docs/source/conf.py index ea084a66e8..f3553c33e1 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -48,7 +48,7 @@ copyright = u'2011-2013, Massachusetts Institute of Technology' # The short X.Y version. version = "0.5" # The full version, including alpha/beta/rc tags. -release = "0.5.1" +release = "0.5.2" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/source/releasenotes/index.rst b/docs/source/releasenotes/index.rst index 1fb7c0e15c..876d953ff8 100644 --- a/docs/source/releasenotes/index.rst +++ b/docs/source/releasenotes/index.rst @@ -10,6 +10,7 @@ bugs fixed, and known issues for each successive release. .. toctree:: :maxdepth: 1 + notes_0.5.2 notes_0.5.1 notes_0.5.0 notes_0.4.4 diff --git a/docs/source/releasenotes/notes_0.5.2.rst b/docs/source/releasenotes/notes_0.5.2.rst new file mode 100644 index 0000000000..c50ca2fd19 --- /dev/null +++ b/docs/source/releasenotes/notes_0.5.2.rst @@ -0,0 +1,55 @@ +.. _notes_0.5.2: + +============================== +Release Notes for OpenMC 0.5.2 +============================== + +------------------- +System Requirements +------------------- + +There are no special requirements for running the OpenMC code. As of this +release, OpenMC has been tested on a variety of Linux distributions, Mac OS X, +and Microsoft Windows 7. Memory requirements will vary depending on the size of +the problem at hand (mostly on the number of nuclides in the problem). + +------------ +New Features +------------ + +- Python script for mesh tally plotting +- Isotopic abundances based on IUPAC 2009 when using +- Particle restart file +- Code will abort after certain number of lost particles (defaults to 10) +- Region outside lattice can be filled with material (void by default) +- 3D voxel plots +- Full HDF5/PHDF5 support (including support in statepoint.py) +- Cell overlap checking with -g command line flag (or when plotting) + +--------- +Bug Fixes +--------- + +- 7632f3_: Fixed bug in statepoint.py for multiple generations per batch. +- f85ac4_: Fix infinite loop bug in error module. +- 49c36b_: Don't convert surface ids if surface filter is for current tallies. +- 5ccc78_: Fix bug in reassignment of bins for mesh filter. +- b1f52f_: Fixed bug in plot color specification. +- eae7e5_: Fixed many memory leaks. +- 10c1cc_: Minor CMFD fixes. +- afdb50_: Add compatibility for XML comments without whitespace. +- a3c593_: Fixed bug in use of free gas scattering for H-1. +- 3a66e3_: Fixed bug in 2D mesh tally implementation. +- ab0793_: Corrected PETSC_NULL references to their correct types. + +.. _7632f3: https://github.com/mit-crpg/openmc/commit/7632f3 +.. _f85ac4: https://github.com/mit-crpg/openmc/commit/f85ac4 +.. _49c36b: https://github.com/mit-crpg/openmc/commit/49c36b +.. _5ccc78: https://github.com/mit-crpg/openmc/commit/5ccc78 +.. _b1f52f: https://github.com/mit-crpg/openmc/commit/b1f52f +.. _eae7e5: https://github.com/mit-crpg/openmc/commit/eae7e5 +.. _10c1cc: https://github.com/mit-crpg/openmc/commit/10c1cc +.. _afdb50: https://github.com/mit-crpg/openmc/commit/afdb50 +.. _a3c593: https://github.com/mit-crpg/openmc/commit/a3c593 +.. _3a66e3: https://github.com/mit-crpg/openmc/commit/3a66e3 +.. _ab0793: https://github.com/mit-crpg/openmc/commit/ab0793 diff --git a/src/constants.F90 b/src/constants.F90 index 4442d05ca1..0ffd9e85af 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 = 1 + integer, parameter :: VERSION_RELEASE = 2 ! Revision numbers for binary files integer, parameter :: REVISION_STATEPOINT = 9 diff --git a/src/output.F90 b/src/output.F90 index b3481f509b..3a1278f0a2 100644 --- a/src/output.F90 +++ b/src/output.F90 @@ -166,12 +166,12 @@ contains write(OUTPUT_UNIT,*) write(OUTPUT_UNIT,*) 'Options:' write(OUTPUT_UNIT,*) ' -g, --geometry-debug Run in geometry debugging mode' - write(OUTPUT_UNIT,*) ' -p, --plot Run in plotting mode' - write(OUTPUT_UNIT,*) ' -r, --restart Restart a previous run from a state point' - write(OUTPUT_UNIT,*) ' or a particle restart file' - write(OUTPUT_UNIT,*) ' -t, --tallies Write tally results from state point' - write(OUTPUT_UNIT,*) ' -v, --version Show version information' - write(OUTPUT_UNIT,*) ' -?, --help Show this message' + write(OUTPUT_UNIT,*) ' -p, --plot Run in plotting mode' + write(OUTPUT_UNIT,*) ' -r, --restart Restart a previous run from a state point' + write(OUTPUT_UNIT,*) ' or a particle restart file' + write(OUTPUT_UNIT,*) ' -t, --tallies Write tally results from state point' + write(OUTPUT_UNIT,*) ' -v, --version Show version information' + write(OUTPUT_UNIT,*) ' -?, --help Show this message' end if end subroutine print_usage From 5b91d7f17507442bac4f40288dd5c6478c844107 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sun, 16 Jun 2013 22:19:37 -0400 Subject: [PATCH 17/17] Update DEPENDENCIES. --- src/DEPENDENCIES | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/DEPENDENCIES b/src/DEPENDENCIES index fcabd989e0..e8cc541f4f 100644 --- a/src/DEPENDENCIES +++ b/src/DEPENDENCIES @@ -99,7 +99,6 @@ eigenvalue.o: cmfd_execute.o eigenvalue.o: constants.o eigenvalue.o: error.o eigenvalue.o: global.o -eigenvalue.o: hdf5_interface.o eigenvalue.o: math.o eigenvalue.o: mesh.o eigenvalue.o: mesh_header.o @@ -137,7 +136,6 @@ fission.o: search.o fixed_source.o: constants.o fixed_source.o: global.o -fixed_source.o: hdf5_interface.o fixed_source.o: output.o fixed_source.o: physics.o fixed_source.o: random_lcg.o @@ -177,8 +175,9 @@ hdf5_summary.o: constants.o hdf5_summary.o: endf.o hdf5_summary.o: geometry_header.o hdf5_summary.o: global.o -hdf5_summary.o: hdf5_interface.o hdf5_summary.o: material_header.o +hdf5_summary.o: mesh_header.o +hdf5_summary.o: output_interface.o hdf5_summary.o: output.o hdf5_summary.o: string.o hdf5_summary.o: tally_header.o @@ -193,7 +192,9 @@ initialize.o: geometry.o initialize.o: geometry_header.o initialize.o: global.o initialize.o: hdf5_interface.o +initialize.o: hdf5_summary.o initialize.o: input_xml.o +initialize.o: output_interface.o initialize.o: output.o initialize.o: random_lcg.o initialize.o: source.o @@ -262,8 +263,12 @@ output.o: plot_header.o output.o: string.o output.o: tally_header.o +output_interface.o: constants.o +output_interface.o: error.o +output_interface.o: global.o output_interface.o: hdf5_interface.o output_interface.o: mpiio_interface.o +output_interface.o: tally_header.o particle_header.o: constants.o @@ -334,9 +339,9 @@ source.o: output.o source.o: particle_header.o source.o: physics.o source.o: random_lcg.o -source.o: state_point.o source.o: string.o +state_point.o: constants.o state_point.o: error.o state_point.o: global.o state_point.o: output.o