From 51cec9db939b31b289f30d3d67c8728f9665203f Mon Sep 17 00:00:00 2001 From: John Tramm Date: Fri, 24 Jan 2020 03:02:45 +0000 Subject: [PATCH] Running in event-based mode correctly, from what I can tell./ --- openmc/settings.py | 4 ++-- tests/testing_harness.py | 7 ++++++- tools/ci/travis-script.sh | 23 +++++++++++------------ 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/openmc/settings.py b/openmc/settings.py index 0ad42f175e..80f679a010 100644 --- a/openmc/settings.py +++ b/openmc/settings.py @@ -387,8 +387,8 @@ class Settings(object): return self._dagmc @property - def event(self): - return self._event + def event_based(self): + return self._event_based @property def max_in_flight_particles(self): diff --git a/tests/testing_harness.py b/tests/testing_harness.py index a44b0683a0..5bd030a816 100644 --- a/tests/testing_harness.py +++ b/tests/testing_harness.py @@ -66,9 +66,14 @@ class TestHarness(object): self._cleanup() def _run_openmc(self): - if config['mpi']: + if config['mpi'] and not config['event']: mpi_args = [config['mpiexec'], '-n', config['mpi_np']] openmc.run(openmc_exec=config['exe'], mpi_args=mpi_args) + elif config['mpi'] and config['event']: + mpi_args = [config['mpiexec'], '-n', config['mpi_np']] + openmc.run(openmc_exec=config['exe'], mpi_args=mpi_args, event_based=True) + elif config['event']: + openmc.run(openmc_exec=config['exe'], event_based=True) else: openmc.run(openmc_exec=config['exe']) diff --git a/tools/ci/travis-script.sh b/tools/ci/travis-script.sh index 94384d5fb3..ae9b6caecb 100755 --- a/tools/ci/travis-script.sh +++ b/tools/ci/travis-script.sh @@ -1,17 +1,16 @@ #!/bin/bash set -ex -# Run regression and unit tests +# Compile argument list +args=" " + if [[ $MPI == 'y' ]]; then - if [[ $EVENT == 'y' ]]; then - pytest --cov=openmc -v --mpi --event tests - else - pytest --cov=openmc -v --mpi tests - fi -else - if [[ $EVENT == 'y' ]]; then - pytest --cov=openmc -v --event tests - else - pytest --cov=openmc -v tests - fi + args="${args} --mpi " fi + +if [[ $EVENT == 'y' ]]; then + args="${args} --event " +fi + +# Run regression and unit tests +pytest --cov=openmc -v $args tests