Additional comments in test

This commit is contained in:
helen-brooks 2022-05-27 09:09:55 +01:00
parent 82a7ccb16d
commit 33ded6d2d3

View file

@ -101,15 +101,25 @@ class ExternalDAGMCTest(PyAPITestHarness):
self.executable = executable
def _run_openmc(self):
"""
Just test if results generated with the external C++ API are
self-consistent with the internal python API.
We generate the "truth" results with the python API but
the main test produces the results file by running the
executable compiled from main.cpp. This future-proofs
the test - we only care that the two routes are equivalent.
"""
if config['update']:
# Generate the results file with internal python API
openmc.run(openmc_exec=config['exe'], event_based=config['event'])
elif config['mpi']:
mpi_args = [config['mpiexec'], '-n', config['mpi_np']]
# Run main cpp executable with MPI
openmc.run(openmc_exec=self.executable,
mpi_args=mpi_args,
event_based=config['event'])
else:
# Run main cpp executable
openmc.run(openmc_exec=self.executable,
event_based=config['event'])