Skip to content

Commit

Permalink
Improve MPI unit tests runner
Browse files Browse the repository at this point in the history
  • Loading branch information
tskisner committed Jan 1, 2025
1 parent c54f249 commit 6eef58a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,5 @@ jobs:
&& export OMP_NUM_THREADS=1 \
&& mkdir -p test \
&& pushd test >/dev/null 2>&1 \
&& mpirun -np 2 python -c 'import flacarray.tests; flacarray.tests.run()' \
&& mpirun -np 2 python -m mpi4py -c 'import flacarray.tests; flacarray.tests.run()' \
&& popd >/dev/null 2>&1
4 changes: 4 additions & 0 deletions flacarray/tests/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import sys
import unittest

from ..mpi import use_mpi, MPI

from . import array as test_array
from . import bindings as test_bindings
from . import hdf5 as test_hdf5
Expand Down Expand Up @@ -41,6 +43,8 @@ def test(name=None):
_ret = runner.run(suite)
if not _ret.wasSuccessful():
ret = 1
if use_mpi:
MPI.COMM_WORLD.Abort(6)

if ret > 0:
print("Some tests failed", flush=True)
Expand Down

0 comments on commit 6eef58a

Please sign in to comment.