diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ce9f6e4..a212b48 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,6 +20,7 @@ jobs: matrix: python-version: ["3.9", "3.10", "3.11", "3.12"] mpi-dist: ["openmpi", "mpich"] + mpipy-version: ["~=3.0", "~=4.0"] steps: - uses: actions/checkout@v4 @@ -31,7 +32,9 @@ jobs: - name: Install OpenMPI if: matrix.mpi-dist == 'openmpi' - run: sudo apt-get install -y -q openmpi-bin libopenmpi-dev + run: | + sudo apt-get install -y -q openmpi-bin libopenmpi-dev + mpiexec --version - name: Install MPICH if: matrix.mpi-dist == 'mpich' @@ -41,6 +44,7 @@ jobs: run: | python -m pip install -U pip python -m pip install -e .[test] + python -m pip install mpi4py${{ matrix.mpipy-version }} - name: Test MPI run: | diff --git a/tests/test_mpi.py b/tests/test_mpi.py index 698526f..39a5c3b 100644 --- a/tests/test_mpi.py +++ b/tests/test_mpi.py @@ -38,6 +38,8 @@ def test_mpi(pool): for r in results: assert all([isclose(x, 42.01) for x in r]) + print("All tests passed") + if __name__ == "__main__": from schwimmbad.mpi import MPIPool diff --git a/tests/test_mpi_with_dill.py b/tests/test_mpi_with_dill.py index b7bb661..50d54ff 100644 --- a/tests/test_mpi_with_dill.py +++ b/tests/test_mpi_with_dill.py @@ -41,6 +41,8 @@ def test_mpi_with_dill(): pool.close() + print("All tests passed") + if __name__ == "__main__": test_mpi_with_dill()