From 0ad934cae75ed146a0b08610af7032878128c801 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Wed, 20 Mar 2024 21:21:10 -0400 Subject: [PATCH] mpi4py: run the spawn and dynamic process tests Split the mpi4py Github Action into 4 parts: 1. build: do everything to build, configure, and install Open MPI and mpi4py 2. run: run all the mpi4py tests with its defaults. As of March 2024, this disables the spawn and dynamic tests, which means that the entire block of tests should pass. 3. run_spawn: run all the mpi4py tests, including the spawn tests. As of March 2024, we know some of these tests are failing. 4. run_dynamic: run all the mpi4py tests, including the dynamic tests. As of March 2024, we know some of these tests are failing. The spawn and dynamic failures are different, so we split them up and run them separately. Signed-off-by: Jeff Squyres --- .github/workflows/ompi_mpi4py.yaml | 229 ++++++++++++++++++++++++++++- 1 file changed, 224 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ompi_mpi4py.yaml b/.github/workflows/ompi_mpi4py.yaml index b0aad4ad2d6..f3e1007933a 100644 --- a/.github/workflows/ompi_mpi4py.yaml +++ b/.github/workflows/ompi_mpi4py.yaml @@ -3,12 +3,10 @@ name: mpi4py on: [pull_request] jobs: - mpi4py: + build: runs-on: ubuntu-latest - timeout-minutes: 60 - + timeout-minutes: 30 steps: - - name: Configure hostname run: echo 127.0.0.1 `hostname` | sudo tee -a /etc/hosts > /dev/null if: ${{ runner.os == 'Linux' || runner.os == 'macOS' }} @@ -36,7 +34,8 @@ jobs: --disable-sphinx --disable-mpi-fortran --disable-oshmem - LDFLAGS=-Wl,-rpath,/usr/local/lib + --prefix=/opt/openmpi + LDFLAGS=-Wl,-rpath,/opt/openmpi/lib working-directory: mpi-build - name: Build MPI @@ -47,6 +46,9 @@ jobs: run: sudo make install working-directory: mpi-build + - name: Add Open MPI to PATH + run: echo /opt/openmpi/bin >> $GITHUB_PATH + - name: Tweak MPI run: | # Tweak MPI @@ -65,6 +67,18 @@ jobs: - name: Show MPICC run: mpicc -show + - name: Save the Open MPI installation for other jobs + uses: actions/upload-artifact@v4 + with: + # I dislike hard-coding /home/runner, but I couldn't get $HOME + # or ${{ env.HOME }} to expand properly. + path: | + /opt/openmpi + /home/runner/.openmpi + /home/runner/.prte + name: ompi-build + retention-days: 2 + - name: Use Python uses: actions/setup-python@v5 with: @@ -89,6 +103,56 @@ jobs: env: CFLAGS: "-O0" + - name: Find where python's site-packages directory is located + run: python3 -c 'import site; print(f"pysite={site.getsitepackages()[0]}")' >> $GITHUB_ENV + + - name: Save the mpi4py installation for other jobs + uses: actions/upload-artifact@v4 + with: + # mpi4py was checked out in the same directory as OMPI. + # But we only need the "test" and "demo" directories from mpi4py. + path: | + test + demo + ${{ env.pysite }}/mpi4py + name: mpi4py-build + retention-days: 2 + + #============================================== + + run: + # This whole set of tests run with mpi4py's defaults. As of March + # 2024, this means disabling the spawn and dynamic tests. We want + # this block of tests to pass. + needs: [build] + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - name: Get OMPI build + uses: actions/download-artifact@v4 + with: + name: ompi-build + path: / + - name: Restore executable permissions + run: chmod a+x /opt/openmpi/bin/* + - name: Add Open MPI to PATH + run: echo /opt/openmpi/bin >> $GITHUB_PATH + + - name: Use Python + uses: actions/setup-python@v5 + with: + python-version: 3 + architecture: x64 + - name: Find where python's site-packages directory is located + run: python3 -c 'import site; print(f"pysite={site.getsitepackages()[0]}")' >> $GITHUB_ENV + - name: Get mpi4py build + uses: actions/download-artifact@v4 + with: + name: mpi4py-build + path: / + + #---------------------------------------------- + - name: Test mpi4py (singleton) run: python test/main.py -v if: ${{ true }} @@ -118,3 +182,158 @@ jobs: run: python demo/test-run/test_run.py -v if: ${{ true }} timeout-minutes: 10 + + #============================================== + + run_spawn: + # This whole set of tests runs explicitly with setting "enable the + # spawn tests". As of March 2024, we know that Open MPI is + # failing these tests. + # + # Note that we state here that we need the build *and* run jobs, + # because when a job fails, it will kill any concurrently-running + # jobs. Since we want the "run" job to complete, we make it a + # dependency of this job. + needs: [build, run] + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - name: Get OMPI build + uses: actions/download-artifact@v4 + with: + name: ompi-build + path: / + - name: Restore executable permissions + run: chmod a+x /opt/openmpi/bin/* + - name: Add Open MPI to PATH + run: echo /opt/openmpi/bin >> $GITHUB_PATH + + - name: Use Python + uses: actions/setup-python@v5 + with: + python-version: 3 + architecture: x64 + - name: Find where python's site-packages directory is located + run: python3 -c 'import site; print(f"pysite={site.getsitepackages()[0]}")' >> $GITHUB_ENV + - name: Get mpi4py build + uses: actions/download-artifact@v4 + with: + name: mpi4py-build + path: / + + #---------------------------------------------- + + - name: Test mpi4py (singleton) + run: python test/main.py -v + if: ${{ true }} + env: + MPI4PY_TEST_SPAWN: "1" + timeout-minutes: 10 + - name: Test mpi4py (np=1) + run: mpiexec -n 1 python test/main.py -v + env: + MPI4PY_TEST_SPAWN: "1" + if: ${{ true }} + timeout-minutes: 10 + - name: Test mpi4py (np=2) + run: mpiexec -n 2 python test/main.py -v -f + env: + MPI4PY_TEST_SPAWN: "1" + if: ${{ true }} + timeout-minutes: 10 + - name: Test mpi4py (np=3) + run: mpiexec -n 3 python test/main.py -v -f + env: + MPI4PY_TEST_SPAWN: "1" + if: ${{ true }} + timeout-minutes: 10 + - name: Test mpi4py (np=4) + run: mpiexec -n 4 python test/main.py -v -f + env: + MPI4PY_TEST_SPAWN: "1" + if: ${{ true }} + timeout-minutes: 10 + - name: Test mpi4py (np=5) + run: mpiexec -n 5 python test/main.py -v -f + env: + MPI4PY_TEST_SPAWN: "1" + if: ${{ true }} + timeout-minutes: 10 + + #============================================== + + run_dynamic: + # This whole set of tests runs explicitly with setting "enable the + # dynamic tests". As of March 2024, we know that Open MPI is + # failing these tests. + # + # Note that we state here that we need the build *and* run jobs, + # because when a job fails, it will kill any concurrently-running + # jobs. Since we want the "run" job to complete, we make it a + # dependency of this job. + needs: [build, run] + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - name: Get OMPI build + uses: actions/download-artifact@v4 + with: + name: ompi-build + path: / + - name: Restore executable permissions + run: chmod a+x /opt/openmpi/bin/* + - name: Add Open MPI to PATH + run: echo /opt/openmpi/bin >> $GITHUB_PATH + + - name: Use Python + uses: actions/setup-python@v5 + with: + python-version: 3 + architecture: x64 + - name: Find where python's site-packages directory is located + run: python3 -c 'import site; print(f"pysite={site.getsitepackages()[0]}")' >> $GITHUB_ENV + - name: Get mpi4py build + uses: actions/download-artifact@v4 + with: + name: mpi4py-build + path: / + + #---------------------------------------------- + + - name: Test mpi4py (singleton) + run: python test/main.py -v + if: ${{ true }} + env: + MPI4PY_TEST_DYNPROC: "1" + timeout-minutes: 10 + - name: Test mpi4py (np=1) + run: mpiexec -n 1 python test/main.py -v + env: + MPI4PY_TEST_DYNPROC: "1" + if: ${{ true }} + timeout-minutes: 10 + - name: Test mpi4py (np=2) + run: mpiexec -n 2 python test/main.py -v -f + env: + MPI4PY_TEST_DYNPROC: "1" + if: ${{ true }} + timeout-minutes: 10 + - name: Test mpi4py (np=3) + run: mpiexec -n 3 python test/main.py -v -f + env: + MPI4PY_TEST_DYNPROC: "1" + if: ${{ true }} + timeout-minutes: 10 + - name: Test mpi4py (np=4) + run: mpiexec -n 4 python test/main.py -v -f + env: + MPI4PY_TEST_DYNPROC: "1" + if: ${{ true }} + timeout-minutes: 10 + - name: Test mpi4py (np=5) + run: mpiexec -n 5 python test/main.py -v -f + env: + MPI4PY_TEST_DYNPROC: "1" + if: ${{ true }} + timeout-minutes: 10 +