Skip to content

Commit 71c2882

Browse files
authored
Merge pull request #12591 from wenduwan/enable_mpi4py_spawn
mpi4py: enable spawn tests workflow by default
2 parents 55a2ac8 + f5d769b commit 71c2882

File tree

2 files changed

+48
-129
lines changed

2 files changed

+48
-129
lines changed

.github/workflows/ompi_mpi4py.yaml

Lines changed: 48 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ on:
1616
type: string
1717

1818
jobs:
19-
build:
19+
test:
2020
runs-on: ubuntu-latest
2121
timeout-minutes: 30
22+
env:
23+
MPI4PY_TEST_SPAWN: true
2224
steps:
2325
- name: Configure hostname
2426
run: echo 127.0.0.1 `hostname` | sudo tee -a /etc/hosts > /dev/null
@@ -105,43 +107,51 @@ jobs:
105107
repository: ${{ inputs.repository || 'mpi4py/mpi4py' }}
106108
ref: ${{ inputs.ref }}
107109

108-
- name: Build mpi4py wheel
109-
run: python -m pip wheel .
110+
- name: Install mpi4py
111+
run: python -m pip install .
110112
env:
111113
CFLAGS: "-O0"
112114

113-
- name: Save the artifacts for other jobs
114-
uses: actions/upload-artifact@v4
115-
with:
116-
path: |
117-
/opt/openmpi
118-
~/.openmpi
119-
~/.prte
120-
test
121-
demo
122-
mpi4py-*.whl
123-
retention-days: 2
124-
name: build-artifacts
125-
126-
#==============================================
127-
128-
run_defaults:
129-
# This whole set of tests run with mpi4py's defaults. As of March
130-
# 2024, this means disabling the spawn and dynamic tests. We want
131-
# this job of tests to pass.
132-
needs: [ build ]
133-
uses: ./.github/workflows/ompi_mpi4py_tests.yaml
134-
135-
#==============================================
136-
137-
run_spawn:
138-
# This whole set of tests runs explicitly with setting "enable the
139-
# spawn tests". As of March 2024, we know that Open MPI is
140-
# failing these tests.
141-
needs: [ build ]
142-
# Only run if the label "mpi4py" is set on this PR.
143-
if: ${{ contains(github.event.pull_request.labels.*.name, 'mpi4py-all') }}
144-
uses: ./.github/workflows/ompi_mpi4py_tests.yaml
145-
with:
146-
# Enable the spawn tests
147-
env_name: MPI4PY_TEST_SPAWN
115+
- name: Test mpi4py (singleton)
116+
run: python test/main.py -v
117+
if: ${{ true }}
118+
timeout-minutes: 10
119+
- name: Test mpi4py (np=1)
120+
run: mpiexec -n 1 python test/main.py -v
121+
if: ${{ true }}
122+
timeout-minutes: 10
123+
- name: Test mpi4py (np=2)
124+
run: mpiexec -n 2 python test/main.py -v -f
125+
if: ${{ true }}
126+
timeout-minutes: 10
127+
- name: Test mpi4py (np=3)
128+
run: mpiexec -n 3 python test/main.py -v -f
129+
if: ${{ true }}
130+
timeout-minutes: 10
131+
- name: Test mpi4py (np=4)
132+
run: mpiexec -n 4 python test/main.py -v -f
133+
if: ${{ true }}
134+
timeout-minutes: 10
135+
- name: Test mpi4py (np=5)
136+
run: mpiexec -n 5 python test/main.py -v -f
137+
if: ${{ true }}
138+
timeout-minutes: 10
139+
140+
- name: Test mpi4py.run
141+
run: python demo/test-run/test_run.py -v
142+
if: ${{ true }}
143+
timeout-minutes: 10
144+
145+
- name: Relocate Open MPI installation
146+
run: mv /opt/openmpi /opt/ompi
147+
- name: Update PATH and set OPAL_PREFIX and LD_LIBRARY_PATH
148+
run: |
149+
sed -i '\|/opt/openmpi/bin|d' $GITHUB_PATH
150+
echo OPAL_PREFIX=/opt/ompi >> $GITHUB_ENV
151+
echo LD_LIBRARY_PATH=/opt/ompi/lib >> $GITHUB_ENV
152+
153+
- name: Test mpi4py (singleton)
154+
run: python test/main.py -v
155+
if: ${{ true }}
156+
timeout-minutes: 10
157+

.github/workflows/ompi_mpi4py_tests.yaml

Lines changed: 0 additions & 91 deletions
This file was deleted.

0 commit comments

Comments
 (0)