mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Remove non-HDF5 configurations from tests
This commit is contained in:
parent
e93afed7a0
commit
d1139cbedc
4 changed files with 44 additions and 95 deletions
|
|
@ -39,20 +39,12 @@ add_definitions(-DMAX_COORD=${maxcoord})
|
|||
#===============================================================================
|
||||
|
||||
set(MPI_ENABLED FALSE)
|
||||
set(HDF5_ENABLED FALSE)
|
||||
if($ENV{FC} MATCHES "mpi[^/]*$")
|
||||
message("-- Detected MPI wrapper: $ENV{FC}")
|
||||
add_definitions(-DMPI)
|
||||
set(MPI_ENABLED TRUE)
|
||||
elseif($ENV{FC} MATCHES "h5fc$")
|
||||
if($ENV{FC} MATCHES "h5fc$")
|
||||
message("-- Detected HDF5 wrapper: $ENV{FC}")
|
||||
add_definitions(-DHDF5)
|
||||
set(HDF5_ENABLED TRUE)
|
||||
elseif($ENV{FC} MATCHES "h5pfc$")
|
||||
message("-- Detected parallel HDF5 wrapper: $ENV{FC}")
|
||||
add_definitions(-DMPI -DHDF5)
|
||||
add_definitions(-DMPI)
|
||||
set(MPI_ENABLED TRUE)
|
||||
set(HDF5_ENABLED TRUE)
|
||||
endif()
|
||||
|
||||
# Check for Fortran 2008 MPI interface
|
||||
|
|
@ -332,38 +324,18 @@ foreach(test ${TESTS})
|
|||
# If a restart test is encounted, need to run with -r and restart file(s)
|
||||
elseif(${test} MATCHES "restart")
|
||||
|
||||
# Set restart file names
|
||||
if (${HDF5_ENABLED})
|
||||
|
||||
# Handle restart tests separately
|
||||
if(${test} MATCHES "test_statepoint_restart")
|
||||
set(RESTART_FILE statepoint.07.h5)
|
||||
elseif(${test} MATCHES "test_sourcepoint_restart")
|
||||
set(RESTART_FILE statepoint.07.h5 source.07.h5)
|
||||
elseif(${test} MATCHES "test_particle_restart_eigval")
|
||||
set(RESTART_FILE particle_9_555.h5)
|
||||
elseif(${test} MATCHES "test_particle_restart_fixed")
|
||||
set(RESTART_FILE particle_7_928.h5)
|
||||
else(${test} MATCHES "test_statepoint_restart")
|
||||
message(FATAL_ERROR "Restart test ${test} not recognized")
|
||||
endif(${test} MATCHES "test_statepoint_restart")
|
||||
|
||||
else(${HDF5_ENABLED})
|
||||
|
||||
# Handle restart tests separately
|
||||
if(${test} MATCHES "test_statepoint_restart")
|
||||
set(RESTART_FILE statepoint.07.binary)
|
||||
elseif(${test} MATCHES "test_sourcepoint_restart")
|
||||
set(RESTART_FILE statepoint.07.binary source.07.binary)
|
||||
elseif(${test} MATCHES "test_particle_restart_eigval")
|
||||
set(RESTART_FILE particle_9_555.binary)
|
||||
elseif(${test} MATCHES "test_particle_restart_fixed")
|
||||
set(RESTART_FILE particle_7_6144.binary)
|
||||
else(${test} MATCHES "test_statepoint_restart")
|
||||
message(FATAL_ERROR "Restart test ${test} not recognized")
|
||||
endif(${test} MATCHES "test_statepoint_restart")
|
||||
|
||||
endif(${HDF5_ENABLED})
|
||||
# Handle restart tests separately
|
||||
if(${test} MATCHES "test_statepoint_restart")
|
||||
set(RESTART_FILE statepoint.07.h5)
|
||||
elseif(${test} MATCHES "test_sourcepoint_restart")
|
||||
set(RESTART_FILE statepoint.07.h5 source.07.h5)
|
||||
elseif(${test} MATCHES "test_particle_restart_eigval")
|
||||
set(RESTART_FILE particle_9_555.h5)
|
||||
elseif(${test} MATCHES "test_particle_restart_fixed")
|
||||
set(RESTART_FILE particle_7_928.h5)
|
||||
else(${test} MATCHES "test_statepoint_restart")
|
||||
message(FATAL_ERROR "Restart test ${test} not recognized")
|
||||
endif(${test} MATCHES "test_statepoint_restart")
|
||||
|
||||
# Perform serial valgrind and coverage test
|
||||
add_test(NAME ${TEST_NAME}
|
||||
|
|
|
|||
|
|
@ -107,13 +107,12 @@ tests = OrderedDict()
|
|||
|
||||
class Test(object):
|
||||
def __init__(self, name, debug=False, optimize=False, mpi=False, openmp=False,
|
||||
hdf5=False, valgrind=False, coverage=False):
|
||||
valgrind=False, coverage=False):
|
||||
self.name = name
|
||||
self.debug = debug
|
||||
self.optimize = optimize
|
||||
self.mpi = mpi
|
||||
self.openmp = openmp
|
||||
self.hdf5 = hdf5
|
||||
self.valgrind = valgrind
|
||||
self.coverage = coverage
|
||||
self.success = True
|
||||
|
|
@ -124,15 +123,11 @@ class Test(object):
|
|||
self.cmake = ['cmake', '-H..', '-Bbuild',
|
||||
'-DPYTHON_EXECUTABLE=' + sys.executable]
|
||||
|
||||
# Check for MPI/HDF5
|
||||
if self.mpi and not self.hdf5:
|
||||
self.fc = MPI_DIR+'/bin/mpif90'
|
||||
elif not self.mpi and self.hdf5:
|
||||
self.fc = HDF5_DIR+'/bin/h5fc'
|
||||
elif self.mpi and self.hdf5:
|
||||
self.fc = PHDF5_DIR+'/bin/h5pfc'
|
||||
# Check for MPI
|
||||
if self.mpi:
|
||||
self.fc = PHDF5_DIR + '/bin/h5pfc'
|
||||
else:
|
||||
self.fc = FC
|
||||
self.fc = HDF5_DIR + '/bin/h5fc'
|
||||
|
||||
# Sets the build name that will show up on the CDash
|
||||
def get_build_name(self):
|
||||
|
|
@ -263,41 +258,26 @@ class Test(object):
|
|||
|
||||
# Simple function to add a test to the global tests dictionary
|
||||
def add_test(name, debug=False, optimize=False, mpi=False, openmp=False,\
|
||||
hdf5=False, valgrind=False, coverage=False):
|
||||
tests.update({name: Test(name, debug, optimize, mpi, openmp, hdf5,
|
||||
valgrind=False, coverage=False):
|
||||
tests.update({name: Test(name, debug, optimize, mpi, openmp,
|
||||
valgrind, coverage)})
|
||||
|
||||
# List of all tests that may be run. User can add -C to command line to specify
|
||||
# a subset of these configurations
|
||||
add_test('basic-normal')
|
||||
add_test('basic-debug', debug=True)
|
||||
add_test('basic-optimize', optimize=True)
|
||||
add_test('omp-normal', openmp=True)
|
||||
add_test('omp-debug', openmp=True, debug=True)
|
||||
add_test('omp-optimize', openmp=True, optimize=True)
|
||||
add_test('hdf5-normal', hdf5=True)
|
||||
add_test('hdf5-debug', hdf5=True, debug=True)
|
||||
add_test('hdf5-optimize', hdf5=True, optimize=True)
|
||||
add_test('omp-hdf5-normal', openmp=True, hdf5=True)
|
||||
add_test('omp-hdf5-debug', openmp=True, hdf5=True, debug=True)
|
||||
add_test('omp-hdf5-optimize', openmp=True, hdf5=True, optimize=True)
|
||||
add_test('mpi-normal', mpi=True)
|
||||
add_test('mpi-debug', mpi=True, debug=True)
|
||||
add_test('mpi-optimize', mpi=True, optimize=True)
|
||||
add_test('mpi-omp-normal', mpi=True, openmp=True)
|
||||
add_test('mpi-omp-debug', mpi=True, openmp=True, debug=True)
|
||||
add_test('mpi-omp-optimize', mpi=True, openmp=True, optimize=True)
|
||||
add_test('phdf5-normal', mpi=True, hdf5=True)
|
||||
add_test('phdf5-debug', mpi=True, hdf5=True, debug=True)
|
||||
add_test('phdf5-optimize', mpi=True, hdf5=True, optimize=True)
|
||||
add_test('phdf5-omp-normal', mpi=True, hdf5=True, openmp=True)
|
||||
add_test('phdf5-omp-debug', mpi=True, hdf5=True, openmp=True, debug=True)
|
||||
add_test('phdf5-omp-optimize', mpi=True, hdf5=True, openmp=True, optimize=True)
|
||||
add_test('basic-debug_valgrind', debug=True, valgrind=True)
|
||||
add_test('hdf5-debug_valgrind', hdf5=True, debug=True, valgrind=True)
|
||||
add_test('basic-debug_coverage', debug=True, coverage=True)
|
||||
add_test('hdf5-debug_coverage', debug=True, hdf5=True, coverage=True)
|
||||
add_test('mpi-debug_coverage', debug=True, mpi=True, coverage=True)
|
||||
add_test('hdf5-normal')
|
||||
add_test('hdf5-debug', debug=True)
|
||||
add_test('hdf5-optimize', optimize=True)
|
||||
add_test('omp-hdf5-normal', openmp=True)
|
||||
add_test('omp-hdf5-debug', openmp=True, debug=True)
|
||||
add_test('omp-hdf5-optimize', openmp=True, optimize=True)
|
||||
add_test('phdf5-normal', mpi=True)
|
||||
add_test('phdf5-debug', mpi=True, debug=True)
|
||||
add_test('phdf5-optimize', mpi=True, optimize=True)
|
||||
add_test('phdf5-omp-normal', mpi=True, openmp=True)
|
||||
add_test('phdf5-omp-debug', mpi=True, openmp=True, debug=True)
|
||||
add_test('phdf5-omp-optimize', mpi=True, openmp=True, optimize=True)
|
||||
add_test('hdf5-debug_valgrind', debug=True, valgrind=True)
|
||||
add_test('hdf5-debug_coverage', debug=True, coverage=True)
|
||||
|
||||
# Check to see if we should just print build configuration information to user
|
||||
if options.list_build_configs:
|
||||
|
|
@ -305,7 +285,6 @@ if options.list_build_configs:
|
|||
print('Configuration Name: {0}'.format(key))
|
||||
print(' Debug Flags:..........{0}'.format(tests[key].debug))
|
||||
print(' Optimization Flags:...{0}'.format(tests[key].optimize))
|
||||
print(' HDF5 Active:..........{0}'.format(tests[key].hdf5))
|
||||
print(' MPI Active:...........{0}'.format(tests[key].mpi))
|
||||
print(' OpenMP Active:........{0}'.format(tests[key].openmp))
|
||||
print(' Valgrind Test:........{0}'.format(tests[key].valgrind))
|
||||
|
|
|
|||
|
|
@ -82,9 +82,8 @@ class TestHarness(object):
|
|||
statepoint = glob.glob(os.path.join(os.getcwd(), self._sp_name))
|
||||
assert len(statepoint) == 1, 'Either multiple or no statepoint files ' \
|
||||
'exist.'
|
||||
assert statepoint[0].endswith('binary') \
|
||||
or statepoint[0].endswith('h5'), \
|
||||
'Statepoint file is not a binary or hdf5 file.'
|
||||
assert statepoint[0].endswith('h5'), \
|
||||
'Statepoint file is not a HDF5 file.'
|
||||
if self._tallies:
|
||||
assert os.path.exists(os.path.join(os.getcwd(), 'tallies.out')), \
|
||||
'Tally output file does not exist.'
|
||||
|
|
@ -155,7 +154,7 @@ class HashedTestHarness(TestHarness):
|
|||
|
||||
|
||||
class PlotTestHarness(TestHarness):
|
||||
"""Specialized TestHarness for running OpenMC plotting tests."""
|
||||
"""Specialized TestHarness for running OpenMC plotting tests."""
|
||||
def __init__(self, plot_names):
|
||||
self._plot_names = plot_names
|
||||
self._opts = None
|
||||
|
|
@ -199,7 +198,7 @@ class PlotTestHarness(TestHarness):
|
|||
|
||||
|
||||
class CMFDTestHarness(TestHarness):
|
||||
"""Specialized TestHarness for running OpenMC CMFD tests."""
|
||||
"""Specialized TestHarness for running OpenMC CMFD tests."""
|
||||
def _get_results(self):
|
||||
"""Digest info in the statepoint and return as a string."""
|
||||
# Read the statepoint file.
|
||||
|
|
@ -233,15 +232,14 @@ class CMFDTestHarness(TestHarness):
|
|||
|
||||
|
||||
class ParticleRestartTestHarness(TestHarness):
|
||||
"""Specialized TestHarness for running OpenMC particle restart tests."""
|
||||
"""Specialized TestHarness for running OpenMC particle restart tests."""
|
||||
def _test_output_created(self):
|
||||
"""Make sure the restart file has been created."""
|
||||
particle = glob.glob(os.path.join(os.getcwd(), self._sp_name))
|
||||
assert len(particle) == 1, 'Either multiple or no particle restart ' \
|
||||
'files exist.'
|
||||
assert particle[0].endswith('binary') \
|
||||
or particle[0].endswith('h5'), \
|
||||
'Particle restart file is not a binary or hdf5 file.'
|
||||
assert particle[0].endswith('h5'), \
|
||||
'Particle restart file is not a HDF5 file.'
|
||||
|
||||
def _get_results(self):
|
||||
"""Digest info in the statepoint and return as a string."""
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ set -ev
|
|||
# Run all debug tests
|
||||
./check_source.py
|
||||
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
|
||||
./run_tests.py -C "^basic-debug$|^hdf5-debug$|^mpi-omp-debug$|^phdf5-omp-debug$" -j 2 -s
|
||||
./run_tests.py -C "^hdf5-debug$|^phdf5-debug$|^phdf5-omp-debug$" -j 2 -s
|
||||
else
|
||||
./run_tests.py -C "^basic-debug$" -j 2
|
||||
./run_tests.py -C "^hdf5-debug$" -j 2
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue