From 35ced559ffd8e1487a16f22f437e4b7a2337127c Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 29 Nov 2013 13:36:06 -0500 Subject: [PATCH 01/33] Added CMakeLists.txt. --- src/CMakeLists.txt | 148 +++++++++++++++++++++++ src/Makefile | 289 ++------------------------------------------- 2 files changed, 156 insertions(+), 281 deletions(-) create mode 100644 src/CMakeLists.txt diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000000..5f4a6608f4 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,148 @@ +cmake_minimum_required(VERSION 2.8 FATAL_ERROR) +project(openmc Fortran) + +#=============================================================================== +# Command line options +#=============================================================================== + +option(openmp "Enable shared-memory parallelism with OpenMP" OFF) +option(profile "Compile with profiling flags" OFF) +option(hdf5 "Enable HDF5 binary output" OFF) +option(petsc "Enable PETSC for use in CMFD acceleration" OFF) +option(debug "Compile with debug flags" OFF) +option(optimize "Turn on all compiler optimization flags" OFF) + +#=============================================================================== +# MPI for distributed-memory parallelism +#=============================================================================== + +if($ENV{FC} MATCHES "mpi*") + find_package(MPI REQUIRED) + add_definitions(-DMPI) + include_directories(BEFORE "${MPI_Fortran_INCLUDE_PATH}") + set(f90flags ${MPI_Fortran_COMPILE_FLAGS} ${f90flags}) + set(libraries ${MPI_Fortran_LIBRARIES} ${libraries}) +endif() + +#=============================================================================== +# Set compile/link flags based on which compiler is being used +#=============================================================================== + +if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU") + # GNU Fortran compiler options + set(f90flags "-cpp -std=f2008 -fbacktrace") + if(debug) + set(f90flags "-g -Wall -pedantic -fbounds-check -ffpe-trap=invalid,overflow,underflow ${f90flags}") + set(ldflags "-g") + endif() + if(profile) + set(f90flags "-pg ${f90flags}") + set(ldflags "-pg ${ldflags}") + endif() + if(optimize) + set(f90flags "-O3 ${f90flags}") + endif() + if(openmp) + set(f90flags "-fopenmp ${f90flags}") + set(ldflags "-fopenmp ${ldflags}") + add_definitions(-DOPENMP) + endif() + +elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "Intel") + # Intel Fortran compiler options + set(f90flags "-fpp -warn -assume byterecl -traceback") + if(debug) + set(f90flags "-g -ftrapuv -fp-stack-check -check all -fpe0 ${f90flags}") + set(ldflags "-g") + endif() + if(profile) + set(f90flags "-pg ${f90flags}") + set(ldflags "-pg ${ldflags}") + endif() + if(optimize) + set(f90flags "-O3 ${f90flags}") + endif() + if(openmp) + set(f90flags "-openmp ${f90flags}") + set(ldflags "-openmp ${ldflags}") + add_definitions(-DOPENMP) + endif() + +elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "PGI") + # PGI Fortran compiler options + set(f90flags "-Mpreprocess -Minform=inform -traceback") + add_definitions(-DNO_F2008) + if(debug) + set(f90flags "-g -Mbounds -Mchkptr -Mchkstk ${f90flags}") + set(ldflags "-g") + endif() + if(profile) + set(f90flags "-pg ${f90flags}") + set(ldflags "-pg ${ldflags}") + endif() + if(optimize) + set(f90flags "-fast -Mipa ${f90flags}") + endif() + +elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "XL") + # IBM XL compiler options + set(f90flags "-WF,-DNO_F2008 -O2") + if(debug) + set(f90flags "-g -C -qflag=i:i -u") + set(ldflags "-g") + endif() + if(profile) + set(f90flags "-p ${f90flags}") + set(ldflags "-p ${ldflags}") + endif() + if(optimize) + set(f90flags "-O3 ${f90flags}") + endif() + if(openmp) + set(f90flags "-qsmp=omp -WF,-DOPENMP ${f90flags}") + set(ldflags "-qsmp=omp ${ldflags}") + endif() + +elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "Cray") + # Cray Fortran compiler options + set(f90flags "-e Z -m 0") + if(debug) + set(f90flags "-g -R abcnsp -O0 ${f90flags}") + set(ldflags "-g") + endif() + +endif() + +#=============================================================================== +# HDF5 for binary output +#=============================================================================== + +if(hdf5) + find_package(HDF5 COMPONENTS Fortran Fortran_HL REQUIRED) + add_definitions(-DHDF5) + include_directories(BEFORE ${HDF5_INCLUDE_DIRS}) + set(libraries ${HDF5_LIBRARIES} ${HDF5_Fortran_LIBRARIES} ${HDF5_Fortran_HL_LIBRARIES} ${libraries}) +endif() + +#=============================================================================== +# PETSc for CMFD functionality +#=============================================================================== + +#=============================================================================== +# FoX Fortran XML Library +#=============================================================================== + +file(GLOB_RECURSE source_fox xml/*.F90) +add_library(fox STATIC ${source_fox}) + +#=============================================================================== +# Build OpenMC executable +#=============================================================================== + +set(program "openmc") +file(GLOB source *.F90) +add_executable(${program} ${source}) +target_link_libraries(${program} ${libraries} fox) +set_target_properties(${program} PROPERTIES + COMPILE_FLAGS "${f90flags}" + COMPILE_DEFINITIONS "${definitions}") diff --git a/src/Makefile b/src/Makefile index 03c370e07a..7b292eca7d 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,283 +1,10 @@ -program = openmc -prefix = /usr/local - -source = $(wildcard *.F90) -objects = $(source:.F90=.o) -xml_lib = -Lxml/lib -lxml - -#=============================================================================== -# User Options -#=============================================================================== - -COMPILER = gnu -DEBUG = no -PROFILE = no -OPTIMIZE = no -MPI = no -OPENMP = no -HDF5 = no -PETSC = no - -#=============================================================================== -# External Library Paths -#=============================================================================== - -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.4.2-$(COMPILER) - -#=============================================================================== -# Add git SHA-1 hash -#=============================================================================== - -GIT_SHA1 = $(shell git log -1 2>/dev/null | head -n 1 | awk '{print $$2}') - -#=============================================================================== -# GNU Fortran compiler options -#=============================================================================== - -ifeq ($(COMPILER),gnu) - F90 = gfortran - F90FLAGS := -cpp -std=f2008 -fbacktrace - LDFLAGS = - - # Debugging - ifeq ($(DEBUG),yes) - F90FLAGS += -g -Wall -pedantic -fbounds-check \ - -ffpe-trap=invalid,overflow,underflow - LDFLAGS += -g - endif - - # Profiling - ifeq ($(PROFILE),yes) - F90FLAGS += -pg - LDFLAGS += -pg - endif - - # Optimization - ifeq ($(OPTIMIZE),yes) - F90FLAGS += -O3 - endif -endif - -#=============================================================================== -# Intel Fortran compiler options -#=============================================================================== - -ifeq ($(COMPILER),intel) - F90 = ifort - F90FLAGS := -fpp -std08 -assume byterecl -traceback - LDFLAGS = - - # Debugging - ifeq ($(DEBUG),yes) - F90FLAGS += -g -warn -ftrapuv -fp-stack-check -check all -fpe0 - LDFLAGS += -g - endif - - # Profiling - ifeq ($(PROFILE),yes) - F90FLAGS += -pg - LDFLAGS += -pg - endif - - # Optimization - ifeq ($(OPTIMIZE),yes) - F90FLAGS += -O3 - endif -endif - -#=============================================================================== -# PGI compiler options -#=============================================================================== - -ifeq ($(COMPILER),pgi) - F90 = pgf90 - F90FLAGS := -Mpreprocess -DNO_F2008 -Minform=inform -traceback - LDFLAGS = - - # Debugging - ifeq ($(DEBUG),yes) - F90FLAGS += -g -Mbounds -Mchkptr -Mchkstk - LDFLAGS += -g - endif - - # Profiling - ifeq ($(PROFILE),yes) - F90FLAGS += -pg - LDFLAGS += -pg - endif - - # Optimization - ifeq ($(OPTIMIZE),yes) - F90FLAGS += -fast -Mipa - endif -endif - -#=============================================================================== -# IBM XL compiler options -#=============================================================================== - -ifeq ($(COMPILER),ibm) - F90 = xlf2003 - F90FLAGS := -WF,-DNO_F2008 -O2 - - # Debugging - ifeq ($(DEBUG),yes) - F90FLAGS += -g -C -qflag=i:i -u - LDFLAGS += -g - endif - - # Profiling - ifeq ($(PROFILE),yes) - F90FLAGS += -p - LDFLAGS += -p - endif - - # Optimization - ifeq ($(OPTIMIZE),yes) - F90FLAGS += -O3 - endif -endif - -#=============================================================================== -# Cray compiler options -#=============================================================================== - -ifeq ($(COMPILER),cray) - F90 = ftn - F90FLAGS := -e Z -m 0 - - # Debugging - ifeq ($(DEBUG),yes) - F90FLAGS += -g -R abcnsp -O0 - LDFLAGS += -g - endif -endif - -#=============================================================================== -# Setup External Libraries -#=============================================================================== - -# MPI for distributed-memory parallelism and HDF5 for I/O - -ifeq ($(MPI),yes) - ifeq ($(HDF5),yes) - F90 = $(PHDF5_DIR)/bin/h5pfc - F90FLAGS += -DHDF5 - else - F90 = $(MPI_DIR)/bin/mpif90 - endif - F90FLAGS += -DMPI -else - ifeq ($(HDF5),yes) - F90 = $(HDF5_DIR)/bin/h5fc - F90FLAGS += -DHDF5 - endif -endif - -# OpenMP for shared-memory parallelism - -ifeq ($(OPENMP),yes) - ifeq ($(COMPILER),intel) - F90FLAGS += -openmp -DOPENMP - LDFLAGS += -openmp - endif - - ifeq ($(COMPILER),gnu) - F90FLAGS += -fopenmp -DOPENMP - LDFLAGS += -fopenmp - endif - - ifeq ($(COMPILER),ibm) - F90FLAGS += -qsmp=omp -WF,-DOPENMP - LDFLAGS += -qsmp=omp - endif -endif - -# PETSC for CMFD functionality - -ifeq ($(PETSC),yes) - # Check to make sure MPI is set - ifneq ($(MPI),yes) - $(error MPI must be enabled to compile with PETSC!) - endif - - # Set up PETSc environment - include $(PETSC_DIR)/conf/petscvariables - F90FLAGS += -I$(PETSC_DIR)/include -DPETSC - LDFLAGS += $(PETSC_LIB) -endif - -#=============================================================================== -# Machine-specific setup -#=============================================================================== - -# IBM Blue Gene/P ANL supercomputer - -ifeq ($(MACHINE),bluegene) - 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) - F90 = ftn - F90FLAGS += -DMPI -endif - -# IBM Blue Gene/Q ANL supercomputer - -ifeq ($(MACHINE),bluegeneq) - F90 = mpixlf2003 - F90FLAGS = -WF,-DNO_F2008,-DMPI -O5 -endif - -#=============================================================================== -# Targets -#=============================================================================== - -all: xml $(program) -xml: - cd xml; make MACHINE=$(MACHINE) F90=$(F90) F90FLAGS="$(F90FLAGS)" LDFLAGS="$(LDFLAGS)" -$(program): $(objects) - $(F90) $(objects) $(xml_lib) $(LDFLAGS) -o $@ -install: - @install -D $(program) $(DESTDIR)$(prefix)/bin/$(program) - @install -D utils/statepoint_cmp.py $(DESTDIR)$(prefix)/bin/statepoint_cmp - @install -D utils/statepoint_histogram.py $(DESTDIR)$(prefix)/bin/statepoint_histogram - @install -D utils/statepoint_meshplot.py $(DESTDIR)$(prefix)/bin/statepoint_meshplot - @install -D ../man/man1/openmc.1 $(DESTDIR)$(prefix)/share/man/man1/openmc.1 - @install -D ../LICENSE $(DESTDIR)$(prefix)/share/doc/$(program)/copyright -uninstall: - @rm $(DESTDIR)$(prefix)/bin/$(program) - @rm $(DESTDIR)$(prefix)/bin/statepoint_cmp - @rm $(DESTDIR)$(prefix)/bin/statepoint_histogram - @rm $(DESTDIR)$(prefix)/bin/statepoint_meshplot - @rm $(DESTDIR)$(prefix)/share/man/man1/openmc.1 - @rm $(DESTDIR)$(prefix)/share/doc/$(program)/copyright -distclean: clean - cd xml; make clean +all: + mkdir -p build + cmake -H. -Bbuild + make -s -C build clean: - @rm -f *.o *.mod $(program) -neat: - @rm -f *.o *.mod + make -s -C build clean +distclean: + rm -fr build -#=============================================================================== -# Rules -#=============================================================================== - -.SUFFIXES: .F90 .o -.PHONY: all xml install uninstall clean neat distclean - -%.o: %.F90 - $(F90) $(F90FLAGS) -DGIT_SHA1="\"$(GIT_SHA1)\"" -Ixml/include -c $< - -#=============================================================================== -# Dependencies -#=============================================================================== - -include DEPENDENCIES +.PHONY: all clean distclean From 049b894bb60a135f668e4be6742d3db7c034bd59 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 29 Nov 2013 13:43:48 -0500 Subject: [PATCH 02/33] Fixed regex in CMakeLists.txt so that MPI detection works. --- src/CMakeLists.txt | 2 +- src/output_interface.F90 | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5f4a6608f4..8883a331ea 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -16,7 +16,7 @@ option(optimize "Turn on all compiler optimization flags" OFF) # MPI for distributed-memory parallelism #=============================================================================== -if($ENV{FC} MATCHES "mpi*") +if($ENV{FC} MATCHES "mpi.*") find_package(MPI REQUIRED) add_definitions(-DMPI) include_directories(BEFORE "${MPI_Fortran_INCLUDE_PATH}") diff --git a/src/output_interface.F90 b/src/output_interface.F90 index f7b342e506..3c04ba36d4 100644 --- a/src/output_interface.F90 +++ b/src/output_interface.F90 @@ -7,7 +7,8 @@ module output_interface #ifdef HDF5 use hdf5_interface -#elif MPI +#endif +#ifdef MPI use mpiio_interface #endif From 6e4bfb406502a873a8bd5f685d66a8d608726d6d Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sun, 1 Dec 2013 20:03:31 -0500 Subject: [PATCH 03/33] Add verbose option to CMakeLists.txt. --- src/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8883a331ea..bfffce3bc6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -11,6 +11,11 @@ option(hdf5 "Enable HDF5 binary output" OFF) option(petsc "Enable PETSC for use in CMFD acceleration" OFF) option(debug "Compile with debug flags" OFF) option(optimize "Turn on all compiler optimization flags" OFF) +option(verbose "Create verbose Makefiles" OFF) + +if (verbose) + set(CMAKE_VERBOSE_MAKEFILE on) +endif() #=============================================================================== # MPI for distributed-memory parallelism From 36a76deb71c44543af2355c80d039f26cc716498 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sun, 1 Dec 2013 20:32:16 -0500 Subject: [PATCH 04/33] Check for MPI/HDF5/PHDF5 wrapper using FC environment variable. --- src/CMakeLists.txt | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bfffce3bc6..4cb27f8ed2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -7,7 +7,6 @@ project(openmc Fortran) option(openmp "Enable shared-memory parallelism with OpenMP" OFF) option(profile "Compile with profiling flags" OFF) -option(hdf5 "Enable HDF5 binary output" OFF) option(petsc "Enable PETSC for use in CMFD acceleration" OFF) option(debug "Compile with debug flags" OFF) option(optimize "Turn on all compiler optimization flags" OFF) @@ -18,15 +17,18 @@ if (verbose) endif() #=============================================================================== -# MPI for distributed-memory parallelism +# MPI for distributed-memory parallelism / HDF5 for binary output #=============================================================================== if($ENV{FC} MATCHES "mpi.*") - find_package(MPI REQUIRED) + message("-- Detected MPI wrapper: $ENV{FC}") add_definitions(-DMPI) - include_directories(BEFORE "${MPI_Fortran_INCLUDE_PATH}") - set(f90flags ${MPI_Fortran_COMPILE_FLAGS} ${f90flags}) - set(libraries ${MPI_Fortran_LIBRARIES} ${libraries}) +elseif($ENV{FC} MATCHES "h5fc$") + message("-- Detected HDF5 wrapper: $ENV{FC}") + add_definitions(-DHDF5) +elseif($ENV{FC} MATCHES "h5pfc$") + message("-- Detected parallel HDF5 wrapper: $ENV{FC}") + add_definitions(-DMPI -DHDF5) endif() #=============================================================================== @@ -118,17 +120,6 @@ elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "Cray") endif() -#=============================================================================== -# HDF5 for binary output -#=============================================================================== - -if(hdf5) - find_package(HDF5 COMPONENTS Fortran Fortran_HL REQUIRED) - add_definitions(-DHDF5) - include_directories(BEFORE ${HDF5_INCLUDE_DIRS}) - set(libraries ${HDF5_LIBRARIES} ${HDF5_Fortran_LIBRARIES} ${HDF5_Fortran_HL_LIBRARIES} ${libraries}) -endif() - #=============================================================================== # PETSc for CMFD functionality #=============================================================================== From bdcc88d319746fee33e3af6d54b254bbf9fe2d21 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sun, 1 Dec 2013 21:29:34 -0500 Subject: [PATCH 05/33] Add LINK_FLAGS to openmc target. --- src/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4cb27f8ed2..731d173917 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -141,4 +141,5 @@ add_executable(${program} ${source}) target_link_libraries(${program} ${libraries} fox) set_target_properties(${program} PROPERTIES COMPILE_FLAGS "${f90flags}" - COMPILE_DEFINITIONS "${definitions}") + COMPILE_DEFINITIONS "${definitions}" + LINK_FLAGS "${ldflags}") From 9d3d3b403c27eec0ad542411c3ee00993be73146 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sun, 1 Dec 2013 21:55:47 -0500 Subject: [PATCH 06/33] Ability to build with PETSc by setting PETSC_DIR environment variable. --- src/CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 731d173917..c432fec01e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -124,6 +124,15 @@ endif() # PETSc for CMFD functionality #=============================================================================== +if(petsc) + find_package(PETSc REQUIRED HINTS $ENV{PETSC_DIR}/conf) + find_library(libpetsc petsc $ENV{PETSC_DIR}/lib) + message("-- Using PETSC: ${libpetsc}") + add_definitions(-DPETSC) + set(f90flags "-I$ENV{PETSC_DIR}/include ${f90flags}") + set(libraries "${PETSC_PACKAGE_LIBS};${libpetsc};${libraries}") +endif() + #=============================================================================== # FoX Fortran XML Library #=============================================================================== From f4c250a9810c118e7b7b668c733f5eaedb54d821 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sun, 1 Dec 2013 22:09:35 -0500 Subject: [PATCH 07/33] Set output directories in CMakeLists.txt. --- src/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c432fec01e..8283383c29 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,6 +1,12 @@ cmake_minimum_required(VERSION 2.8 FATAL_ERROR) project(openmc Fortran) +# Setup output directories +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) +set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/include) + #=============================================================================== # Command line options #=============================================================================== From d87fb3535e8665ca6f205f7e4a0ae1d171951c12 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sun, 1 Dec 2013 22:11:37 -0500 Subject: [PATCH 08/33] Use include_directories instead of manually adding -I flag. --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8283383c29..e9bde56757 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -135,7 +135,7 @@ if(petsc) find_library(libpetsc petsc $ENV{PETSC_DIR}/lib) message("-- Using PETSC: ${libpetsc}") add_definitions(-DPETSC) - set(f90flags "-I$ENV{PETSC_DIR}/include ${f90flags}") + include_directories($ENV{PETSC_DIR}/include) set(libraries "${PETSC_PACKAGE_LIBS};${libpetsc};${libraries}") endif() From 727ec960151fe603bf1269cf4601e7a83d580ba4 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 5 Dec 2013 23:32:08 -0500 Subject: [PATCH 09/33] Add installation of executable, scripts, files. --- src/CMakeLists.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e9bde56757..ce8dfdd2c9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -158,3 +158,20 @@ set_target_properties(${program} PROPERTIES COMPILE_FLAGS "${f90flags}" COMPILE_DEFINITIONS "${definitions}" LINK_FLAGS "${ldflags}") + +#=============================================================================== +# Install executable, scripts, manpage, license +#=============================================================================== + +install(TARGETS ${program} RUNTIME DESTINATION bin) +install(PROGRAMS utils/statepoint_cmp.py + DESTINATION bin + RENAME statepoint_cmp) +install(PROGRAMS utils/statepoint_histogram.py + DESTINATION bin + RENAME statepoint_histogram) +install(PROGRAMS utils/statepoint_meshplot.py + DESTINATION bin + RENAME statepoint_meshplot) +install(FILES ../man/man1/openmc.1 DESTINATION share/man/man1) +install(FILES ../LICENSE DESTINATION "share/doc/${program}/copyright") From 9b2741e1abce6a7bcb09ef2b704483ee85376a46 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 20 Jan 2014 19:58:59 -0500 Subject: [PATCH 10/33] Install statepoint.py script using distutils. --- src/CMakeLists.txt | 7 +++++++ src/Makefile | 4 +++- src/utils/setup.py | 11 +++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 src/utils/setup.py diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 281d7362eb..95cda112af 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -173,3 +173,10 @@ install(PROGRAMS utils/statepoint_meshplot.py RENAME statepoint_meshplot) install(FILES ../man/man1/openmc.1 DESTINATION share/man/man1) install(FILES ../LICENSE DESTINATION "share/doc/${program}/copyright") + +find_package(PythonInterp) +if(PYTHONINTERP_FOUND) + install(CODE "execute_process( + COMMAND ${PYTHON_EXECUTABLE} setup.py install --user + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/utils)") +endif() \ No newline at end of file diff --git a/src/Makefile b/src/Makefile index 7b292eca7d..9c295176a0 100644 --- a/src/Makefile +++ b/src/Makefile @@ -6,5 +6,7 @@ clean: make -s -C build clean distclean: rm -fr build +install: + make -s -C build install -.PHONY: all clean distclean +.PHONY: all clean distclean install diff --git a/src/utils/setup.py b/src/utils/setup.py new file mode 100644 index 0000000000..c69e7f6c58 --- /dev/null +++ b/src/utils/setup.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python + +from distutils.core import setup + +setup(name='statepoint', + version='0.5.4', + description='OpenMC StatePoint', + author='Paul Romano', + author_email='paul.k.romano@gmail.com', + url='https://github.com/mit-crpg/openmc', + py_modules=['statepoint']) From 0c5234e9841defb747d6c3f5e9dc55c6f74fc35a Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 29 Jan 2014 21:44:46 -0500 Subject: [PATCH 11/33] Updated installation instructions for using CMake. --- docs/source/usersguide/install.rst | 114 +++++++++++++++++++++-------- 1 file changed, 85 insertions(+), 29 deletions(-) diff --git a/docs/source/usersguide/install.rst b/docs/source/usersguide/install.rst index 164b0151be..30eaa5a321 100644 --- a/docs/source/usersguide/install.rst +++ b/docs/source/usersguide/install.rst @@ -50,6 +50,15 @@ Prerequisites sudo apt-get install gfortran + * CMake_ cross-platform build system + + The compiling and linking of source files is handled by CMake in a + platform-independent manner. If you are using Debian or a Debian + derivative such as Ubuntu, you can install CMake using the following + command:: + + sudo apt-get install cmake + .. admonition:: Optional * An MPI implementation for distributed-memory parallel runs @@ -98,6 +107,7 @@ Prerequisites * git_ version control software for obtaining source code .. _gfortran: http://gcc.gnu.org/wiki/GFortran +.. _CMake: http://www.cmake.org .. _OpenMPI: http://www.open-mpi.org .. _MPICH: http://www.mpich.org .. _HDF5: http://www.hdfgroup.org/HDF5/ @@ -131,50 +141,95 @@ switch to the source of the latest stable release, run the following commands:: Build Configuration ------------------- -All configuration for OpenMC is done within the Makefile located in -``src/Makefile``. In the Makefile, you will see that there are a number of User -Options which can be changed. It is recommended that you do not change anything -else in the Makefile unless you are experienced with compiling and building -software using Makefiles. The following parameters can be set from the User -Options sections in the Makefile: +Compiling OpenMC with CMake is carried out in two steps. First, ``cmake`` is run +to determine the compiler, whether optional packages (MPI, HDF5, PETSc) are +available, to generate a list of dependencies between source files so that they +may be compiled in the correct order, and to generate a normal Makefile. The +Makefile is then used by ``make`` to actually carry out the compile and linking +commands. A typical out-of-source build would thus look something like the +following -COMPILER - This variable tells the Makefile which compiler to use. Valid options are - gnu, intel, pgi, ibm, and cray. The default is gnu (gfortran). +.. code-block:: sh -DEBUG + mkdir src/build + cd src/build + cmake .. + make + +Note that first a build directory is created as a subdirectory of the source +directory. The Makefile in ``src/`` will automatically perform an out-of-source +build with default options. + +CMakeLists.txt Options +++++++++++++++++++++++ + +The following options are available in the CMakeLists.txt file: + +debug Enables debugging when compiling. The flags added are dependent on which compiler is used. -PROFILE +profile Enables profiling using the GNU profiler, gprof. -OPTIMIZE +optimize Enables high-optimization using compiler-dependent flags. For gfortran and Intel Fortran, this compiles with -O3. -MPI - Enables parallel runs using the Message Passing Interface. The MPI_DIR - variable should be set to the base directory of the MPI implementation. - -OPENMP +openmp Enables shared-memory parallelism using the OpenMP API. The Fortran compiler being used must support OpenMP. -HDF5 - Enables HDF5 output in addition to normal screen and text file output. The - HDF5_DIR variable should be set to the base directory of the HDF5 - installation. - -PETSC +petsc Enables PETSc for use in CMFD acceleration. The PETSC_DIR variable should be set to the base directory of the PETSc installation. -It is also possible to change these options from the command line itself. For -example, if you want to compile with DEBUG turned on without actually change the -Makefile, you can enter the following from a terminal:: +To set any of these options (e.g. turning on debug mode), the following form +should be used: - make DEBUG=yes +.. code-block:: sh + + cmake -Ddebug=on /path/to/src + +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: + +.. code-block:: sh + + export FC=mpif90 + cmake /path/to/src + +Note that in many shells, an environment variable can be set for a single +command, i.e. + +.. code-block:: sh + + FC=mpif90 cmake /path/to/src + +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: + +.. code-block:: sh + + export FC=h5fc + cmake /path/to/src + +As noted above, an environment variable can typically be set for a single +command, i.e. + +.. code-block:: sh + + FC=h5fc cmake /path/to/src + +To compile with support for both MPI and HDF5, use the parallel HDF5 wrapper +``h5pfc`` instead. Note that this requires that your HDF5 installation be +compiled with ``--enable-parallel``. Compiling on Linux and Mac OS X ------------------------------- @@ -202,9 +257,10 @@ a Linux-like environment for Windows. You will need to first `install Cygwin`_. When you are asked to select packages, make sure the following are selected: -* Devel: gcc4-core -* Devel: gcc4-fortran +* Devel: gcc-core +* Devel: gcc-fortran * Devel: make +* Devel: cmake If you plan on obtaining the source code directly using git, select the following packages: From c54a3463d4b8c32a19a6cd9adc4beff95429ab2d Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 29 Jan 2014 22:54:17 -0500 Subject: [PATCH 12/33] Define GIT_SHA1 in header file. --- .gitignore | 1 + src/CMakeLists.txt | 19 ++++++++++++++++++- src/output.F90 | 1 + 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 9f720f9894..bc3678cc38 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ *.mod *.log *.out +git_sha1.h # Compiler python objects *.pyc diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 95cda112af..453a87c89b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -137,6 +137,24 @@ if(petsc) set(libraries "${PETSC_PACKAGE_LIBS};${libpetsc};${libraries}") endif() +#=============================================================================== +# git SHA1 hash +#=============================================================================== + +execute_process(COMMAND git log -1 + COMMAND head -n 1 + COMMAND cut -c8- + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + RESULT_VARIABLE GIT_SHA1_SUCCESS + OUTPUT_VARIABLE GIT_SHA1 + ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) +if(GIT_SHA1_SUCCESS EQUAL 0) + file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/git_sha1.h + "#define GIT_SHA1 \"${GIT_SHA1}\"") +else() + file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/git_sha1.h "") +endif() + #=============================================================================== # FoX Fortran XML Library #=============================================================================== @@ -154,7 +172,6 @@ add_executable(${program} ${source}) target_link_libraries(${program} ${libraries} fox) set_target_properties(${program} PROPERTIES COMPILE_FLAGS "${f90flags}" - COMPILE_DEFINITIONS "${definitions}" LINK_FLAGS "${ldflags}") #=============================================================================== diff --git a/src/output.F90 b/src/output.F90 index ee0a8391c2..061500734d 100644 --- a/src/output.F90 +++ b/src/output.F90 @@ -55,6 +55,7 @@ contains ' License: http://mit-crpg.github.io/openmc/license.html' write(UNIT=OUTPUT_UNIT, FMT='(6X,"Version:",8X,I1,".",I1,".",I1)') & VERSION_MAJOR, VERSION_MINOR, VERSION_RELEASE +#include "git_sha1.h" #ifdef GIT_SHA1 write(UNIT=OUTPUT_UNIT, FMT='(6X,"Git SHA1:",7X,A)') GIT_SHA1 #endif From 0d1176ea030492d43f64adeab3d8cbeb898138ab Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sun, 2 Feb 2014 18:23:55 -0500 Subject: [PATCH 13/33] Copy executable rather than moving when running run_suite. --- tests/run_tests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/run_tests.py b/tests/run_tests.py index 49975c218a..610ad2422b 100755 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -6,6 +6,7 @@ import os import sys import nose import glob +import shutil from subprocess import call from nose_mpi import NoseMPI @@ -46,9 +47,8 @@ def run_suite(name=None, mpi=False): try: os.chdir(pwd) - os.rename(pwd + '/../src/openmc-' + name, pwd + '/../src/openmc') + shutil.copyfile(pwd + '/../src/openmc-' + name, pwd + '/../src/openmc') result = nose.run(argv=argv, addplugins=plugins) - os.rename(pwd + '/../src/openmc', pwd + '/../src/openmc-' + name) except OSError: result = False print('No OpenMC executable found for ' + name + ' tests') From 488d7582dff27919b99a6fa1819a14fd2a68b951 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sun, 2 Feb 2014 18:24:28 -0500 Subject: [PATCH 14/33] Convert test_compily.py to use cmake. --- tests/test_compile/test_compile.py | 307 ++++++++++++++++++----------- 1 file changed, 192 insertions(+), 115 deletions(-) diff --git a/tests/test_compile/test_compile.py b/tests/test_compile/test_compile.py index 8d411abd91..882a4795c1 100644 --- a/tests/test_compile/test_compile.py +++ b/tests/test_compile/test_compile.py @@ -15,10 +15,11 @@ import shutil pwd = os.path.dirname(__file__) -if 'COMPILER' in os.environ: - compiler = 'COMPILER=' + os.environ['COMPILER'] -else: - compiler = 'COMPILER=gnu' +# Set default copmilers +fc = 'gfortran' +h5fc = 'h5fc' +h5pfc = 'h5pfc' +mpifc = 'mpif90' def setup(): @@ -27,257 +28,333 @@ def setup(): def test_normal(): - returncode = run(['make', 'distclean']) - returncode = run(['make', compiler]) + shutil.rmtree('build', ignore_errors=True) + returncode = run('FC={0} cmake -H. -Bbuild'.format(fc)) assert returncode == 0 - shutil.move('openmc', 'openmc-normal') + returncode = run('make -s -C build') + assert returncode == 0 + shutil.move('build/bin/openmc', 'openmc-normal') def test_debug(): - returncode = run(['make', 'distclean']) - returncode = run(['make', compiler, 'DEBUG=yes']) + shutil.rmtree('build', ignore_errors=True) + returncode = run('FC={0} cmake -Ddebug=on -H. -Bbuild'.format(fc)) assert returncode == 0 - shutil.move('openmc', 'openmc-debug') + returncode = run('make -s -C build') + assert returncode == 0 + shutil.move('build/bin/openmc', 'openmc-debug') def test_profile(): - returncode = run(['make', 'distclean']) - returncode = run(['make', compiler, 'PROFILE=yes']) + shutil.rmtree('build', ignore_errors=True) + returncode = run('FC={0} cmake -Dprofile=on -H. -Bbuild'.format(fc)) assert returncode == 0 + returncode = run('make -s -C build') + assert returncode == 0 + shutil.move('build/bin/openmc', 'openmc-profile') def test_optimize(): - returncode = run(['make', 'distclean']) - returncode = run(['make', compiler, 'OPTIMIZE=yes']) + shutil.rmtree('build', ignore_errors=True) + returncode = run('FC={0} cmake -Doptimize=on -H. -Bbuild'.format(fc)) assert returncode == 0 - shutil.move('openmc', 'openmc-optimize') + returncode = run('make -s -C build') + assert returncode == 0 + shutil.move('build/bin/openmc', 'openmc-optimize') def test_mpi(): - returncode = run(['make', 'distclean']) - returncode = run(['make', compiler, 'MPI=yes']) + shutil.rmtree('build', ignore_errors=True) + returncode = run('FC={0} cmake -H. -Bbuild'.format(mpifc)) assert returncode == 0 - shutil.move('openmc', 'openmc-mpi') + returncode = run('make -s -C build') + assert returncode == 0 + shutil.move('build/bin/openmc', 'openmc-mpi') def test_mpi_debug(): - returncode = run(['make', 'distclean']) - returncode = run(['make', compiler, 'MPI=yes', 'DEBUG=yes']) + shutil.rmtree('build', ignore_errors=True) + returncode = run('FC={0} cmake -Ddebug=on -H. -Bbuild'.format(mpifc)) assert returncode == 0 - shutil.move('openmc', 'openmc-mpi-debug') + returncode = run('make -s -C build') + assert returncode == 0 + shutil.move('build/bin/openmc', 'openmc-mpi-debug') def test_mpi_optimize(): - returncode = run(['make', 'distclean']) - returncode = run(['make', compiler, 'MPI=yes', 'OPTIMIZE=yes']) + shutil.rmtree('build', ignore_errors=True) + returncode = run('FC={0} cmake -Doptimize=on -H. -Bbuild'.format(mpifc)) assert returncode == 0 - shutil.move('openmc', 'openmc-mpi-optimize') + returncode = run('make -s -C build') + assert returncode == 0 + shutil.move('build/bin/openmc', 'openmc-mpi-optimize') def test_omp(): - returncode = run(['make', 'distclean']) - returncode = run(['make', compiler, 'OPENMP=yes']) + shutil.rmtree('build', ignore_errors=True) + returncode = run('FC={0} cmake -Dopenmp=on -H. -Bbuild'.format(fc)) assert returncode == 0 - shutil.move('openmc', 'openmc-omp') + returncode = run('make -s -C build') + assert returncode == 0 + shutil.move('build/bin/openmc', 'openmc-omp') def test_omp_debug(): - returncode = run(['make', 'distclean']) - returncode = run(['make', compiler, 'OPENMP=yes', 'DEBUG=yes']) + shutil.rmtree('build', ignore_errors=True) + returncode = run('FC={0} cmake -Dopenmp=on -Ddebug=on '.format(fc) + + '-H. -Bbuild') assert returncode == 0 - shutil.move('openmc', 'openmc-omp-debug') + returncode = run('make -s -C build') + assert returncode == 0 + shutil.move('build/bin/openmc', 'openmc-omp-debug') def test_omp_optimize(): - returncode = run(['make', 'distclean']) - returncode = run(['make', compiler, 'OPENMP=yes', 'OPTIMIZE=yes']) + shutil.rmtree('build', ignore_errors=True) + returncode = run('FC={0} cmake -Dopenmp=on -Doptimize=on '.format(fc) + + '-H. -Bbuild') assert returncode == 0 - shutil.move('openmc', 'openmc-omp-optimize') + returncode = run('make -s -C build') + assert returncode == 0 + shutil.move('build/bin/openmc', 'openmc-omp-optimize') def test_hdf5(): - returncode = run(['make', 'distclean']) - returncode = run(['make', compiler, 'HDF5=yes']) + shutil.rmtree('build', ignore_errors=True) + returncode = run('FC={0} cmake -H. -Bbuild'.format(h5fc)) assert returncode == 0 - shutil.move('openmc', 'openmc-hdf5') + returncode = run('make -s -C build') + assert returncode == 0 + shutil.move('build/bin/openmc', 'openmc-hdf5') def test_hdf5_debug(): - returncode = run(['make', 'distclean']) - returncode = run(['make', compiler, 'HDF5=yes', 'DEBUG=yes']) + shutil.rmtree('build', ignore_errors=True) + returncode = run('FC={0} cmake -Ddebug=on -H. -Bbuild'.format(h5fc)) assert returncode == 0 - shutil.move('openmc', 'openmc-hdf5-debug') + returncode = run('make -s -C build') + assert returncode == 0 + shutil.move('build/bin/openmc', 'openmc-hdf5-debug') def test_hdf5_optimize(): - returncode = run(['make', 'distclean']) - returncode = run(['make', compiler, 'HDF5=yes', 'OPTIMIZE=yes']) + shutil.rmtree('build', ignore_errors=True) + returncode = run('FC={0} cmake -Doptimize=on -H. -Bbuild'.format(h5fc)) assert returncode == 0 - shutil.move('openmc', 'openmc-hdf5-optimize') + returncode = run('make -s -C build') + assert returncode == 0 + shutil.move('build/bin/openmc', 'openmc-hdf5-optimize') def test_omp_hdf5(): - returncode = run(['make', 'distclean']) - returncode = run(['make', compiler, 'OPENMP=yes', 'HDF5=yes']) + shutil.rmtree('build', ignore_errors=True) + returncode = run('FC={0} cmake -Dopenmp=on -H. -Bbuild'.format(h5fc)) assert returncode == 0 - shutil.move('openmc', 'openmc-omp-hdf5') + returncode = run('make -s -C build') + assert returncode == 0 + shutil.move('build/bin/openmc', 'openmc-omp-hdf5') def test_omp_hdf5_debug(): - returncode = run(['make', 'distclean']) - returncode = run(['make', compiler, 'OPENMP=yes', 'HDF5=yes', 'DEBUG=yes']) + shutil.rmtree('build', ignore_errors=True) + returncode = run('FC={0} cmake -Dopenmp=on -Ddebug=on '.format(h5fc) + + '-H. -Bbuild') assert returncode == 0 - shutil.move('openmc', 'openmc-omp-hdf5-debug') + returncode = run('make -s -C build') + assert returncode == 0 + shutil.move('build/bin/openmc', 'openmc-omp-hdf5-debug') def test_omp_hdf5_optimize(): - returncode = run(['make', 'distclean']) - returncode = run(['make', compiler, 'OPENMP=yes', 'HDF5=yes', 'OPTIMIZE=yes']) + shutil.rmtree('build', ignore_errors=True) + returncode = run('FC={0} cmake -Dopenmp=on -Doptimize=on '.format(h5fc) + + '-H. -Bbuild') assert returncode == 0 - shutil.move('openmc', 'openmc-omp-hdf5-optimize') + returncode = run('make -s -C build') + assert returncode == 0 + shutil.move('build/bin/openmc', 'openmc-omp-hdf5-optimize') def test_petsc(): - returncode = run(['make', 'distclean']) - returncode = run(['make', compiler, 'MPI=yes', 'PETSC=yes']) + shutil.rmtree('build', ignore_errors=True) + returncode = run('FC={0} cmake -Dpetsc=on -H. -Bbuild'.format(mpifc)) assert returncode == 0 - shutil.move('openmc', 'openmc-petsc') + returncode = run('make -s -C build') + assert returncode == 0 + shutil.move('build/bin/openmc', 'openmc-petsc') def test_petsc_debug(): - returncode = run(['make', 'distclean']) - returncode = run(['make', compiler, 'MPI=yes', 'PETSC=yes', 'DEBUG=yes']) + shutil.rmtree('build', ignore_errors=True) + returncode = run('FC={0} cmake -Dpetsc=on -Ddebug=on '.format(mpifc) + + '-H. -Bbuild') assert returncode == 0 - shutil.move('openmc', 'openmc-petsc-debug') + returncode = run('make -s -C build') + assert returncode == 0 + shutil.move('build/bin/openmc', 'openmc-petsc-debug') def test_petsc_optimize(): - returncode = run(['make', 'distclean']) - returncode = run(['make', compiler, 'MPI=yes', 'PETSC=yes', - 'OPTIMIZE=yes']) + shutil.rmtree('build', ignore_errors=True) + returncode = run('FC={0} cmake -Dpetsc=on -Doptimize=on '.format(mpifc) + + '-H. -Bbuild') assert returncode == 0 - shutil.move('openmc', 'openmc-petsc-optimize') + returncode = run('make -s -C build') + assert returncode == 0 + shutil.move('build/bin/openmc', 'openmc-petsc-optimize') def test_mpi_omp(): - returncode = run(['make', 'distclean']) - returncode = run(['make', compiler, 'MPI=yes', 'OPENMP=yes']) + shutil.rmtree('build', ignore_errors=True) + returncode = run('FC={0} cmake -Dopenmp=on -H. -Bbuild'.format(mpifc)) assert returncode == 0 - shutil.move('openmc', 'openmc-mpi-omp') + returncode = run('make -s -C build') + assert returncode == 0 + shutil.move('build/bin/openmc', 'openmc-mpi-omp') def test_mpi_omp_debug(): - returncode = run(['make', 'distclean']) - returncode = run(['make', compiler, 'MPI=yes', 'OPENMP=yes', 'DEBUG=yes']) + shutil.rmtree('build', ignore_errors=True) + returncode = run('FC={0} cmake -Dopenmp=on -Ddebug=on '.format(mpifc) + + '-H. -Bbuild') assert returncode == 0 - shutil.move('openmc', 'openmc-mpi-omp-debug') + returncode = run('make -s -C build') + assert returncode == 0 + shutil.move('build/bin/openmc', 'openmc-mpi-omp-debug') def test_mpi_omp_optimize(): - returncode = run(['make', 'distclean']) - returncode = run(['make', compiler, 'MPI=yes', 'OPENMP=yes', 'OPTIMIZE=yes']) + shutil.rmtree('build', ignore_errors=True) + returncode = run('FC={0} cmake -Dopenmp=on -Doptimize=on '.format(mpifc) + + '-H. -Bbuild') assert returncode == 0 - shutil.move('openmc', 'openmc-mpi-omp-optimize') + returncode = run('make -s -C build') + assert returncode == 0 + shutil.move('build/bin/openmc', 'openmc-mpi-omp-optimize') def test_mpi_hdf5(): - returncode = run(['make', 'distclean']) - returncode = run(['make', compiler, 'MPI=yes', 'HDF5=yes']) + shutil.rmtree('build', ignore_errors=True) + returncode = run('FC={0} cmake -H. -Bbuild'.format(h5pfc)) assert returncode == 0 - shutil.move('openmc', 'openmc-phdf5') + returncode = run('make -s -C build') + assert returncode == 0 + shutil.move('build/bin/openmc', 'openmc-phdf5') def test_mpi_hdf5_debug(): - returncode = run(['make', 'distclean']) - returncode = run(['make', compiler, 'MPI=yes', 'HDF5=yes', 'DEBUG=yes']) + shutil.rmtree('build', ignore_errors=True) + returncode = run('FC={0} cmake -Ddebug=on -H. -Bbuild'.format(h5pfc)) assert returncode == 0 - shutil.move('openmc', 'openmc-phdf5-debug') + returncode = run('make -s -C build') + assert returncode == 0 + shutil.move('build/bin/openmc', 'openmc-phdf5-debug') def test_mpi_hdf5_optimize(): - returncode = run(['make', 'distclean']) - returncode = run(['make', compiler, 'MPI=yes', 'HDF5=yes', 'OPTIMIZE=yes']) + shutil.rmtree('build', ignore_errors=True) + returncode = run('FC={0} cmake -Doptimize=on -H. -Bbuild'.format(h5pfc)) assert returncode == 0 - shutil.move('openmc', 'openmc-phdf5-optimize') + returncode = run('make -s -C build') + assert returncode == 0 + shutil.move('build/bin/openmc', 'openmc-phdf5-optimize') def test_mpi_omp_hdf5(): - returncode = run(['make', 'distclean']) - returncode = run(['make', compiler, 'MPI=yes', 'OPENMP=yes', 'HDF5=yes']) + shutil.rmtree('build', ignore_errors=True) + returncode = run('FC={0} cmake -Dopenmp=on -H. -Bbuild'.format(h5pfc)) assert returncode == 0 - shutil.move('openmc', 'openmc-phdf5-omp') + returncode = run('make -s -C build') + assert returncode == 0 + shutil.move('build/bin/openmc', 'openmc-phdf5-omp') def test_mpi_omp_hdf5_debug(): - returncode = run(['make', 'distclean']) - returncode = run(['make', compiler, 'MPI=yes', 'OPENMP=yes', 'HDF5=yes', - 'DEBUG=yes']) + shutil.rmtree('build', ignore_errors=True) + returncode = run('FC={0} cmake -Dopenmp=on -Ddebug=on '.format(h5pfc) + + '-H. -Bbuild') assert returncode == 0 - shutil.move('openmc', 'openmc-phdf5-omp-debug') + returncode = run('make -s -C build') + assert returncode == 0 + shutil.move('build/bin/openmc', 'openmc-phdf5-omp-debug') def test_mpi_omp_hdf5_optimize(): - returncode = run(['make', 'distclean']) - returncode = run(['make', compiler, 'MPI=yes', 'OPENMP=yes', 'HDF5=yes', - 'OPTIMIZE=yes']) + shutil.rmtree('build', ignore_errors=True) + returncode = run('FC={0} cmake -Dopenmp=on -Doptimize=on '.format(h5pfc) + + '-H. -Bbuild') assert returncode == 0 - shutil.move('openmc', 'openmc-phdf5-omp-optimize') + returncode = run('make -s -C build') + assert returncode == 0 + shutil.move('build/bin/openmc', 'openmc-phdf5-omp-optimize') def test_mpi_hdf5_petsc(): - returncode = run(['make', 'distclean']) - returncode = run(['make', compiler, 'MPI=yes', 'HDF5=yes', 'PETSC=yes']) + shutil.rmtree('build', ignore_errors=True) + returncode = run('FC={0} cmake -Dpetsc=on -H. -Bbuild'.format(h5pfc)) assert returncode == 0 - shutil.move('openmc', 'openmc-phdf5-petsc') + returncode = run('make -s -C build') + assert returncode == 0 + shutil.move('build/bin/openmc', 'openmc-phdf5-petsc') def test_mpi_hdf5_petsc_debug(): - returncode = run(['make', 'distclean']) - returncode = run(['make', compiler, 'MPI=yes', 'HDF5=yes', 'PETSC=yes', - 'DEBUG=yes']) + shutil.rmtree('build', ignore_errors=True) + returncode = run('FC={0} cmake -Dpetsc=on -Ddebug=on '.format(h5pfc) + + '-H. -Bbuild') assert returncode == 0 - shutil.move('openmc', 'openmc-phdf5-petsc-debug') + returncode = run('make -s -C build') + assert returncode == 0 + shutil.move('build/bin/openmc', 'openmc-phdf5-petsc-debug') def test_mpi_hdf5_petsc_optimize(): - returncode = run(['make', 'distclean']) - returncode = run(['make', compiler, 'MPI=yes', 'HDF5=yes', 'PETSC=yes', - 'OPTIMIZE=yes']) + shutil.rmtree('build', ignore_errors=True) + returncode = run('FC={0} cmake -Dpetsc=on -Doptimize=on '.format(h5pfc) + + '-H. -Bbuild') assert returncode == 0 - shutil.move('openmc', 'openmc-phdf5-petsc-optimize') + returncode = run('make -s -C build') + assert returncode == 0 + shutil.move('build/bin/openmc', 'openmc-phdf5-petsc-optimize') def test_mpi_omp_hdf5_petsc(): - returncode = run(['make', 'distclean']) - returncode = run(['make', compiler, 'MPI=yes', 'OMP=yes', 'HDF5=yes', - 'PETSC=yes']) + shutil.rmtree('build', ignore_errors=True) + returncode = run('FC={0} cmake -Dpetsc=on -Dopenmp=on '.format(h5pfc) + + '-H. -Bbuild') assert returncode == 0 - shutil.move('openmc', 'openmc-omp-phdf5-petsc') + returncode = run('make -s -C build') + assert returncode == 0 + shutil.move('build/bin/openmc', 'openmc-omp-phdf5-petsc') def test_mpi_omp_hdf5_petsc_debug(): - returncode = run(['make', 'distclean']) - returncode = run(['make', compiler, 'MPI=yes', 'OMP=yes', 'HDF5=yes', - 'PETSC=yes', 'DEBUG=yes']) + shutil.rmtree('build', ignore_errors=True) + returncode = run('FC={0} cmake -Dpetsc=on -Dopenmp=on '.format(h5pfc) + + '-Ddebug=on -H. -Bbuild') assert returncode == 0 - shutil.move('openmc', 'openmc-omp-phdf5-petsc-debug') + returncode = run('make -s -C build') + assert returncode == 0 + shutil.move('build/bin/openmc', 'openmc-omp-phdf5-petsc-debug') def test_mpi_omp_hdf5_petsc_optimize(): - returncode = run(['make', 'distclean']) - returncode = run(['make', compiler, 'MPI=yes', 'OMP=yes', 'HDF5=yes', - 'PETSC=yes', 'OPTIMIZE=yes']) + shutil.rmtree('build', ignore_errors=True) + returncode = run('FC={0} cmake -Dpetsc=on -Dopenmp=on '.format(h5pfc) + + '-Doptimize=on -H. -Bbuild') assert returncode == 0 - shutil.move('openmc', 'openmc-omp-phdf5-petsc-optimize') + returncode = run('make -s -C build') + assert returncode == 0 + shutil.move('build/bin/openmc', 'openmc-omp-phdf5-petsc-optimize') def run(commands): - proc = Popen(commands, stderr=STDOUT, stdout=PIPE) + proc = Popen(commands, shell=True, stderr=STDOUT, stdout=PIPE) print(proc.communicate()[0]) returncode = proc.returncode return returncode def teardown(commands): - returncode = run(['make', 'distclean']) + shutil.rmtree('build', ignore_errors=True) shutil.copy('openmc-normal', 'openmc') From 45a2c5a8187167f698896bfb9b6d1289a3d76115 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 6 Feb 2014 23:27:01 -0500 Subject: [PATCH 15/33] Fix for PETSc not finding libfblas and libflapack. --- src/CMakeLists.txt | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 453a87c89b..2781f4d27d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -131,10 +131,25 @@ endif() if(petsc) find_package(PETSc REQUIRED HINTS $ENV{PETSC_DIR}/conf) find_library(libpetsc petsc $ENV{PETSC_DIR}/lib) + + # If libfblas wasn't found, search the PETSc lib directory + if(PETSC_FBLAS_LIB STREQUAL "PETSC_FBLAS_LIB-NOTFOUND") + find_library(PETSC_FBLAS_LIB fblas $ENV{PETSC_DIR}/lib) + list(REMOVE_ITEM PETSC_PACKAGE_LIBS PETSC_FBLAS_LIB-NOTFOUND) + list(INSERT PETSC_PACKAGE_LIBS 0 ${PETSC_FBLAS_LIB}) + endif() + + # If libflapack wasn't found, search the PETSc lib directory + if(PETSC_FLAPACK_LIB STREQUAL "PETSC_FLAPACK_LIB-NOTFOUND") + find_library(PETSC_FLAPACK_LIB flapack $ENV{PETSC_DIR}/lib) + list(REMOVE_ITEM PETSC_PACKAGE_LIBS PETSC_FLAPACK_LIB-NOTFOUND) + list(INSERT PETSC_PACKAGE_LIBS 0 ${PETSC_FLAPACK_LIB}) + endif() + message("-- Using PETSC: ${libpetsc}") add_definitions(-DPETSC) include_directories($ENV{PETSC_DIR}/include) - set(libraries "${PETSC_PACKAGE_LIBS};${libpetsc};${libraries}") + set(libraries "${libpetsc};${PETSC_PACKAGE_LIBS};${libraries}") endif() #=============================================================================== From 216be5029e1a58aad691312223e232f5064106d3 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 18 Feb 2014 17:55:04 -0500 Subject: [PATCH 16/33] Add build/ directories to .gitignore. --- .gitignore | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitignore b/.gitignore index bc3678cc38..eb7d7df349 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,12 @@ src/openmc docs/build docs/source/_images/*.pdf +# Source build +src/build + +# build from src/utils/setup.py +src/utils/build + # xml-fortran reader src/xml-fortran/xmlreader From 937db3e4757073e232c851ec79c994368474afb2 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 3 Mar 2014 18:43:52 -0500 Subject: [PATCH 17/33] Update Intel compile flags as suggested by @bhermanmit. --- src/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2781f4d27d..40586ca23b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -62,9 +62,9 @@ if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU") elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "Intel") # Intel Fortran compiler options - set(f90flags "-fpp -warn -assume byterecl -traceback") + set(f90flags "-fpp -std08 -assume byterecl -traceback") if(debug) - set(f90flags "-g -ftrapuv -fp-stack-check -check all -fpe0 ${f90flags}") + set(f90flags "-g -warn -ftrapuv -fp-stack-check -check all -fpe0 ${f90flags}") set(ldflags "-g") endif() if(profile) From fe58e8bdebd01837485aff7aa233aa694f2ea7ad Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 4 Mar 2014 20:13:47 -0500 Subject: [PATCH 18/33] Replace pipeline for producing git SHA1 with single command. --- src/CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 40586ca23b..dd0bcaaa05 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -156,9 +156,7 @@ endif() # git SHA1 hash #=============================================================================== -execute_process(COMMAND git log -1 - COMMAND head -n 1 - COMMAND cut -c8- +execute_process(COMMAND git rev-parse -q HEAD WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} RESULT_VARIABLE GIT_SHA1_SUCCESS OUTPUT_VARIABLE GIT_SHA1 From 40008dbaa49e007a0db2469dd620b69c772b307c Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 6 Mar 2014 19:57:15 -0500 Subject: [PATCH 19/33] 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 20/33] 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 21/33] 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 22/33] 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 23/33] 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 500d26eac1352edd5f2811b8b9ab6e8e19920a18 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 10 Mar 2014 17:37:47 -0400 Subject: [PATCH 24/33] Remove DEPENDENCIES file. --- src/DEPENDENCIES | 396 ----------------------------------------------- 1 file changed, 396 deletions(-) delete mode 100644 src/DEPENDENCIES diff --git a/src/DEPENDENCIES b/src/DEPENDENCIES deleted file mode 100644 index 579bf26fb1..0000000000 --- a/src/DEPENDENCIES +++ /dev/null @@ -1,396 +0,0 @@ -ace.o: ace_header.o -ace.o: constants.o -ace.o: endf.o -ace.o: error.o -ace.o: fission.o -ace.o: global.o -ace.o: material_header.o -ace.o: output.o -ace.o: set_header.o -ace.o: string.o - -ace_header.o: constants.o -ace_header.o: endf_header.o - -cmfd_data.o: cmfd_header.o -cmfd_data.o: constants.o -cmfd_data.o: error.o -cmfd_data.o: global.o -cmfd_data.o: mesh.o -cmfd_data.o: mesh_header.o -cmfd_data.o: string.o -cmfd_data.o: tally_header.o - -cmfd_execute.o: cmfd_data.o -cmfd_execute.o: cmfd_jfnk_solver.o -cmfd_execute.o: cmfd_power_solver.o -cmfd_execute.o: constants.o -cmfd_execute.o: error.o -cmfd_execute.o: global.o -cmfd_execute.o: mesh.o -cmfd_execute.o: mesh_header.o -cmfd_execute.o: output.o -cmfd_execute.o: search.o -cmfd_execute.o: tally.o - -cmfd_header.o: constants.o - -cmfd_input.o: cmfd_header.o -cmfd_input.o: constants.o -cmfd_input.o: error.o -cmfd_input.o: global.o -cmfd_input.o: mesh_header.o -cmfd_input.o: output.o -cmfd_input.o: string.o -cmfd_input.o: tally.o -cmfd_input.o: tally_header.o -cmfd_input.o: tally_initialize.o -cmfd_input.o: xml_interface.o - -cmfd_jfnk_solver.o: cmfd_loss_operator.o -cmfd_jfnk_solver.o: cmfd_power_solver.o -cmfd_jfnk_solver.o: cmfd_prod_operator.o -cmfd_jfnk_solver.o: constants.o -cmfd_jfnk_solver.o: global.o -cmfd_jfnk_solver.o: matrix_header.o -cmfd_jfnk_solver.o: solver_interface.o -cmfd_jfnk_solver.o: vector_header.o - -cmfd_loss_operator.o: constants.o -cmfd_loss_operator.o: global.o -cmfd_loss_operator.o: matrix_header.o - -cmfd_power_solver.o: cmfd_loss_operator.o -cmfd_power_solver.o: cmfd_prod_operator.o -cmfd_power_solver.o: constants.o -cmfd_power_solver.o: global.o -cmfd_power_solver.o: matrix_header.o -cmfd_power_solver.o: solver_interface.o -cmfd_power_solver.o: vector_header.o - -cmfd_prod_operator.o: constants.o -cmfd_prod_operator.o: global.o -cmfd_prod_operator.o: matrix_header.o - -cmfd_slepc_solver.o: cmfd_loss_operator.o -cmfd_slepc_solver.o: cmfd_prod_operator.o -cmfd_slepc_solver.o: constants.o -cmfd_slepc_solver.o: global.o - -cross_section.o: ace_header.o -cross_section.o: constants.o -cross_section.o: error.o -cross_section.o: fission.o -cross_section.o: global.o -cross_section.o: material_header.o -cross_section.o: particle_header.o -cross_section.o: random_lcg.o -cross_section.o: search.o - -doppler.o: constants.o - -eigenvalue.o: cmfd_execute.o -eigenvalue.o: constants.o -eigenvalue.o: error.o -eigenvalue.o: global.o -eigenvalue.o: math.o -eigenvalue.o: mesh.o -eigenvalue.o: mesh_header.o -eigenvalue.o: output.o -eigenvalue.o: particle_header.o -eigenvalue.o: random_lcg.o -eigenvalue.o: search.o -eigenvalue.o: source.o -eigenvalue.o: state_point.o -eigenvalue.o: string.o -eigenvalue.o: tally.o -eigenvalue.o: tracking.o - -endf.o: constants.o -endf.o: string.o - -energy_grid.o: constants.o -energy_grid.o: global.o -energy_grid.o: list_header.o -energy_grid.o: output.o - -error.o: global.o - -finalize.o: global.o -finalize.o: hdf5_interface.o -finalize.o: output.o -finalize.o: tally.o - -fission.o: ace_header.o -fission.o: constants.o -fission.o: error.o -fission.o: global.o -fission.o: interpolation.o -fission.o: search.o - -fixed_source.o: constants.o -fixed_source.o: global.o -fixed_source.o: output.o -fixed_source.o: particle_header.o -fixed_source.o: random_lcg.o -fixed_source.o: source.o -fixed_source.o: state_point.o -fixed_source.o: string.o -fixed_source.o: tally.o -fixed_source.o: tracking.o - -geometry.o: constants.o -geometry.o: error.o -geometry.o: geometry_header.o -geometry.o: global.o -geometry.o: output.o -geometry.o: particle_header.o -geometry.o: particle_restart_write.o -geometry.o: string.o -geometry.o: tally.o - -global.o: ace_header.o -global.o: bank_header.o -global.o: cmfd_header.o -global.o: constants.o -global.o: dict_header.o -global.o: geometry_header.o -global.o: hdf5_interface.o -global.o: material_header.o -global.o: mesh_header.o -global.o: plot_header.o -global.o: set_header.o -global.o: source_header.o -global.o: tally_header.o -global.o: timer_header.o - -hdf5_summary.o: ace_header.o -hdf5_summary.o: constants.o -hdf5_summary.o: endf.o -hdf5_summary.o: geometry_header.o -hdf5_summary.o: global.o -hdf5_summary.o: material_header.o -hdf5_summary.o: mesh_header.o -hdf5_summary.o: output.o -hdf5_summary.o: output_interface.o -hdf5_summary.o: string.o -hdf5_summary.o: tally_header.o - -initialize.o: ace.o -initialize.o: bank_header.o -initialize.o: constants.o -initialize.o: dict_header.o -initialize.o: energy_grid.o -initialize.o: error.o -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.o -initialize.o: output_interface.o -initialize.o: random_lcg.o -initialize.o: source.o -initialize.o: state_point.o -initialize.o: string.o -initialize.o: tally_header.o -initialize.o: tally_initialize.o - -input_xml.o: cmfd_input.o -input_xml.o: constants.o -input_xml.o: dict_header.o -input_xml.o: error.o -input_xml.o: geometry_header.o -input_xml.o: global.o -input_xml.o: list_header.o -input_xml.o: mesh_header.o -input_xml.o: output.o -input_xml.o: plot_header.o -input_xml.o: random_lcg.o -input_xml.o: string.o -input_xml.o: tally_header.o -input_xml.o: tally_initialize.o -input_xml.o: xml_interface.o - -interpolation.o: constants.o -interpolation.o: endf_header.o -interpolation.o: error.o -interpolation.o: global.o -interpolation.o: search.o -interpolation.o: string.o - -list_header.o: constants.o - -main.o: constants.o -main.o: eigenvalue.o -main.o: finalize.o -main.o: fixed_source.o -main.o: global.o -main.o: initialize.o -main.o: particle_restart.o -main.o: plot.o - -math.o: constants.o -math.o: random_lcg.o - -matrix_header.o: constants.o -matrix_header.o: vector_header.o - -mesh.o: constants.o -mesh.o: global.o -mesh.o: mesh_header.o -mesh.o: particle_header.o -mesh.o: search.o - -output.o: ace_header.o -output.o: constants.o -output.o: endf.o -output.o: error.o -output.o: geometry_header.o -output.o: global.o -output.o: math.o -output.o: mesh.o -output.o: mesh_header.o -output.o: particle_header.o -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 -particle_header.o: geometry_header.o - -particle_restart.o: bank_header.o -particle_restart.o: constants.o -particle_restart.o: geometry_header.o -particle_restart.o: global.o -particle_restart.o: output.o -particle_restart.o: output_interface.o -particle_restart.o: particle_header.o -particle_restart.o: random_lcg.o -particle_restart.o: tracking.o - -particle_restart_write.o: bank_header.o -particle_restart_write.o: global.o -particle_restart_write.o: output_interface.o -particle_restart_write.o: particle_header.o -particle_restart_write.o: string.o - -physics.o: ace_header.o -physics.o: constants.o -physics.o: endf.o -physics.o: error.o -physics.o: fission.o -physics.o: global.o -physics.o: interpolation.o -physics.o: material_header.o -physics.o: math.o -physics.o: mesh.o -physics.o: output.o -physics.o: particle_header.o -physics.o: particle_restart_write.o -physics.o: random_lcg.o -physics.o: search.o -physics.o: string.o - -plot.o: constants.o -plot.o: error.o -plot.o: geometry.o -plot.o: geometry_header.o -plot.o: global.o -plot.o: output.o -plot.o: particle_header.o -plot.o: plot_header.o -plot.o: ppmlib.o -plot.o: string.o - -plot_header.o: constants.o - -random_lcg.o: global.o - -search.o: error.o -search.o: global.o - -set_header.o: constants.o -set_header.o: list_header.o - -solver_interface.o: error.o -solver_interface.o: global.o -solver_interface.o: matrix_header.o -solver_interface.o: vector_header.o - -source.o: bank_header.o -source.o: constants.o -source.o: error.o -source.o: geometry.o -source.o: geometry_header.o -source.o: global.o -source.o: math.o -source.o: output.o -source.o: particle_header.o -source.o: random_lcg.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 -state_point.o: output_interface.o -state_point.o: string.o -state_point.o: tally_header.o - -string.o: constants.o -string.o: error.o -string.o: global.o - -tally.o: ace_header.o -tally.o: constants.o -tally.o: error.o -tally.o: global.o -tally.o: math.o -tally.o: mesh.o -tally.o: mesh_header.o -tally.o: output.o -tally.o: particle_header.o -tally.o: search.o -tally.o: string.o -tally.o: tally_header.o - -tally_header.o: constants.o - -tally_initialize.o: constants.o -tally_initialize.o: global.o -tally_initialize.o: tally_header.o - -timer_header.o: constants.o - -track_output.o: global.o -track_output.o: output_interface.o -track_output.o: particle_header.o -track_output.o: string.o - -tracking.o: cross_section.o -tracking.o: error.o -tracking.o: geometry.o -tracking.o: geometry_header.o -tracking.o: global.o -tracking.o: output.o -tracking.o: particle_header.o -tracking.o: physics.o -tracking.o: random_lcg.o -tracking.o: string.o -tracking.o: tally.o -tracking.o: track_output.o - -vector_header.o: constants.o - -xml_interface.o: constants.o -xml_interface.o: error.o -xml_interface.o: global.o From 3dc9822b6d99f9a6c5cd0c211160e27c6a1106ce Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 11 Mar 2014 23:49:12 -0400 Subject: [PATCH 25/33] Change back to using -DGIT_SHA1. --- .gitignore | 1 - src/CMakeLists.txt | 5 +---- src/output.F90 | 1 - 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index a58bf032e6..8fd929bbcb 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,6 @@ *.mod *.log *.out -git_sha1.h # Compiler python objects *.pyc diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index dd0bcaaa05..4235e72cac 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -162,10 +162,7 @@ execute_process(COMMAND git rev-parse -q HEAD OUTPUT_VARIABLE GIT_SHA1 ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) if(GIT_SHA1_SUCCESS EQUAL 0) - file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/git_sha1.h - "#define GIT_SHA1 \"${GIT_SHA1}\"") -else() - file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/git_sha1.h "") + add_definitions(-DGIT_SHA1="${GIT_SHA1}") endif() #=============================================================================== diff --git a/src/output.F90 b/src/output.F90 index 061500734d..ee0a8391c2 100644 --- a/src/output.F90 +++ b/src/output.F90 @@ -55,7 +55,6 @@ contains ' License: http://mit-crpg.github.io/openmc/license.html' write(UNIT=OUTPUT_UNIT, FMT='(6X,"Version:",8X,I1,".",I1,".",I1)') & VERSION_MAJOR, VERSION_MINOR, VERSION_RELEASE -#include "git_sha1.h" #ifdef GIT_SHA1 write(UNIT=OUTPUT_UNIT, FMT='(6X,"Git SHA1:",7X,A)') GIT_SHA1 #endif From 3a980225abbc22fd70d9bf2113d0882b90d52a37 Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Tue, 18 Mar 2014 08:49:32 -0400 Subject: [PATCH 26/33] 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 27/33] 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 3b601bb96cf336484bf823976f35bbc57282f4f1 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sat, 22 Mar 2014 12:21:01 -0400 Subject: [PATCH 28/33] 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 29/33] 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 30/33] 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 31/33] 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 32/33] 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 33/33] 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 ------------------------------