From f5d769b9b4c09ccff32c6699a7b441b77df15163 Mon Sep 17 00:00:00 2001 From: Wenduo Wang Date: Fri, 31 May 2024 08:18:07 -0700 Subject: [PATCH] mpi4py: enable spawn tests workflow by default The previous inter-communicator race condition has been fixed. Enable the workflow by default to catch new regressions. Signed-off-by: Wenduo Wang --- .github/workflows/ompi_mpi4py.yaml | 86 ++++++++++++---------- .github/workflows/ompi_mpi4py_tests.yaml | 91 ------------------------ 2 files changed, 48 insertions(+), 129 deletions(-) delete mode 100644 .github/workflows/ompi_mpi4py_tests.yaml diff --git a/.github/workflows/ompi_mpi4py.yaml b/.github/workflows/ompi_mpi4py.yaml index 40d88e2def0..3bc950da5b8 100644 --- a/.github/workflows/ompi_mpi4py.yaml +++ b/.github/workflows/ompi_mpi4py.yaml @@ -16,9 +16,11 @@ on: type: string jobs: - build: + test: runs-on: ubuntu-latest timeout-minutes: 30 + env: + MPI4PY_TEST_SPAWN: true steps: - name: Configure hostname run: echo 127.0.0.1 `hostname` | sudo tee -a /etc/hosts > /dev/null @@ -105,43 +107,51 @@ jobs: repository: ${{ inputs.repository || 'mpi4py/mpi4py' }} ref: ${{ inputs.ref }} - - name: Build mpi4py wheel - run: python -m pip wheel . + - name: Install mpi4py + run: python -m pip install . env: CFLAGS: "-O0" - - name: Save the artifacts for other jobs - uses: actions/upload-artifact@v4 - with: - path: | - /opt/openmpi - ~/.openmpi - ~/.prte - test - demo - mpi4py-*.whl - retention-days: 2 - name: build-artifacts - - #============================================== - - run_defaults: - # 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 job of tests to pass. - needs: [ build ] - uses: ./.github/workflows/ompi_mpi4py_tests.yaml - - #============================================== - - 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. - needs: [ build ] - # Only run if the label "mpi4py" is set on this PR. - if: ${{ contains(github.event.pull_request.labels.*.name, 'mpi4py-all') }} - uses: ./.github/workflows/ompi_mpi4py_tests.yaml - with: - # Enable the spawn tests - env_name: MPI4PY_TEST_SPAWN + - name: Test mpi4py (singleton) + run: python test/main.py -v + if: ${{ true }} + timeout-minutes: 10 + - name: Test mpi4py (np=1) + run: mpiexec -n 1 python test/main.py -v + if: ${{ true }} + timeout-minutes: 10 + - name: Test mpi4py (np=2) + run: mpiexec -n 2 python test/main.py -v -f + if: ${{ true }} + timeout-minutes: 10 + - name: Test mpi4py (np=3) + run: mpiexec -n 3 python test/main.py -v -f + if: ${{ true }} + timeout-minutes: 10 + - name: Test mpi4py (np=4) + run: mpiexec -n 4 python test/main.py -v -f + if: ${{ true }} + timeout-minutes: 10 + - name: Test mpi4py (np=5) + run: mpiexec -n 5 python test/main.py -v -f + if: ${{ true }} + timeout-minutes: 10 + + - name: Test mpi4py.run + run: python demo/test-run/test_run.py -v + if: ${{ true }} + timeout-minutes: 10 + + - name: Relocate Open MPI installation + run: mv /opt/openmpi /opt/ompi + - name: Update PATH and set OPAL_PREFIX and LD_LIBRARY_PATH + run: | + sed -i '\|/opt/openmpi/bin|d' $GITHUB_PATH + echo OPAL_PREFIX=/opt/ompi >> $GITHUB_ENV + echo LD_LIBRARY_PATH=/opt/ompi/lib >> $GITHUB_ENV + + - name: Test mpi4py (singleton) + run: python test/main.py -v + if: ${{ true }} + timeout-minutes: 10 + diff --git a/.github/workflows/ompi_mpi4py_tests.yaml b/.github/workflows/ompi_mpi4py_tests.yaml deleted file mode 100644 index d6c1a34623f..00000000000 --- a/.github/workflows/ompi_mpi4py_tests.yaml +++ /dev/null @@ -1,91 +0,0 @@ -# This is a reusable workflow that is invoked from mpi4py.yaml. -# -# It expects a single parameter: env_name. This string sets an -# environment variable of that name to value "1". - -name: mpi4py-tests - -on: - workflow_call: - inputs: - env_name: - default: 'MAKE_TODAY_AN_OMPI_DAY' - required: false - type: string - -jobs: - mpi4py-tests: - runs-on: ubuntu-latest - timeout-minutes: 30 - env: - ${{ inputs.env_name }}: true - steps: - - name: Use Python - uses: actions/setup-python@v5 - with: - python-version: 3 - architecture: x64 - - name: Get artifacts - uses: actions/download-artifact@v4 - with: - path: / - name: build-artifacts - - 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: Install the mpi4py wheel - run: python -m pip install mpi4py --no-index --find-links=. - - #---------------------------------------------- - - - name: Test mpi4py (singleton) - run: python test/main.py -v - if: ${{ true }} - timeout-minutes: 10 - - name: Test mpi4py (np=1) - run: mpiexec -n 1 python test/main.py -v - if: ${{ true }} - timeout-minutes: 10 - - name: Test mpi4py (np=2) - run: mpiexec -n 2 python test/main.py -v -f - if: ${{ true }} - timeout-minutes: 10 - - name: Test mpi4py (np=3) - run: mpiexec -n 3 python test/main.py -v -f - if: ${{ true }} - timeout-minutes: 10 - - name: Test mpi4py (np=4) - run: mpiexec -n 4 python test/main.py -v -f - if: ${{ true }} - timeout-minutes: 10 - - name: Test mpi4py (np=5) - run: mpiexec -n 5 python test/main.py -v -f - if: ${{ true }} - timeout-minutes: 10 - - - name: Test mpi4py.run - run: python demo/test-run/test_run.py -v - if: ${{ true }} - timeout-minutes: 10 - - #---------------------------------------------- - - - name: Relocate Open MPI installation - run: mv /opt/openmpi /opt/ompi - - name: Update PATH and set OPAL_PREFIX and LD_LIBRARY_PATH - run: | - sed -i '\|/opt/openmpi/bin|d' $GITHUB_PATH - echo OPAL_PREFIX=/opt/ompi >> $GITHUB_ENV - echo LD_LIBRARY_PATH=/opt/ompi/lib >> $GITHUB_ENV - - - name: Test mpi4py (singleton) - run: python test/main.py -v - if: ${{ true }} - timeout-minutes: 10 - - name: Test mpi4py (np=5) - run: /opt/ompi/bin/mpiexec -n 5 python test/main.py -v -f - if: ${{ true }} - timeout-minutes: 10 - - #----------------------------------------------