From b888130b68967ac5761d0e388093ee4138d18aa9 Mon Sep 17 00:00:00 2001 From: Adrian Price-Whelan Date: Sat, 17 Aug 2024 16:57:57 -0400 Subject: [PATCH 1/3] matrix over mpi4py versions --- .github/workflows/ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ce9f6e4..1b56939 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: ["~=2.0", "~=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: | From 0af1f4e19de3a2fef3c0531f02faa03cf747fa1c Mon Sep 17 00:00:00 2001 From: Adrian Price-Whelan Date: Sat, 17 Aug 2024 17:29:17 -0400 Subject: [PATCH 2/3] skip old mpi4py --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1b56939..a212b48 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: matrix: python-version: ["3.9", "3.10", "3.11", "3.12"] mpi-dist: ["openmpi", "mpich"] - mpipy-version: ["~=2.0", "~=3.0", "~=4.0"] + mpipy-version: ["~=3.0", "~=4.0"] steps: - uses: actions/checkout@v4 From 625ea28866bc36f1fc73b249ef75d13ded2d673f Mon Sep 17 00:00:00 2001 From: Adrian Price-Whelan Date: Sat, 17 Aug 2024 17:35:15 -0400 Subject: [PATCH 3/3] add output --- tests/test_mpi.py | 2 ++ tests/test_mpi_with_dill.py | 2 ++ 2 files changed, 4 insertions(+) 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()