Skip to content

Commit 635a663

Browse files
committed
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, but only if the "mpi4py" label is set on the PR. As of March 2024, we know some of these tests are failing. 4. run_dynamic: run all the mpi4py tests, including the dynamic tests, but only if the "mpi4py" label is set on the PR. 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 <jeff@squyres.com>
1 parent 2911d48 commit 635a663

File tree

1 file changed

+172
-7
lines changed

1 file changed

+172
-7
lines changed

.github/workflows/ompi_mpi4py.yaml

Lines changed: 172 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@ name: mpi4py
33
on: [pull_request]
44

55
jobs:
6-
mpi4py:
6+
build:
77
runs-on: ubuntu-latest
8-
timeout-minutes: 60
9-
8+
timeout-minutes: 30
109
steps:
11-
1210
- name: Configure hostname
1311
run: echo 127.0.0.1 `hostname` | sudo tee -a /etc/hosts > /dev/null
1412
if: ${{ runner.os == 'Linux' || runner.os == 'macOS' }}
@@ -28,6 +26,11 @@ jobs:
2826
run: ./autogen.pl
2927
working-directory: mpi-build
3028

29+
# Install into a separate directory (/opt/openmpi) so that we can
30+
# bundle up that tree into an artifact to share with other jobs in
31+
# this github action. Specifically don't use /usr/local, because
32+
# there's a bunch of other stuff already installed in /usr/local,
33+
# and we don't need to include that in our artifact.
3134
- name: Configure Open MPI
3235
run: ./configure
3336
--disable-dependency-tracking
@@ -36,7 +39,8 @@ jobs:
3639
--disable-sphinx
3740
--disable-mpi-fortran
3841
--disable-oshmem
39-
LDFLAGS=-Wl,-rpath,/usr/local/lib
42+
--prefix=/opt/openmpi
43+
LDFLAGS=-Wl,-rpath,/opt/openmpi/lib
4044
working-directory: mpi-build
4145

4246
- name: Build MPI
@@ -47,6 +51,9 @@ jobs:
4751
run: sudo make install
4852
working-directory: mpi-build
4953

54+
- name: Add Open MPI to PATH
55+
run: echo /opt/openmpi/bin >> $GITHUB_PATH
56+
5057
- name: Tweak MPI
5158
run: |
5259
# Tweak MPI
@@ -84,11 +91,53 @@ jobs:
8491
with:
8592
repository: "mpi4py/mpi4py"
8693

87-
- name: Install mpi4py
88-
run: python -m pip install .
94+
- name: Build mpi4py wheel
95+
run: python -m pip wheel .
8996
env:
9097
CFLAGS: "-O0"
9198

99+
- name: Save the artifacts for other jobs
100+
uses: actions/upload-artifact@v4
101+
with:
102+
path: |
103+
/opt/openmpi
104+
~/.openmpi
105+
~/.prte
106+
test
107+
demo
108+
mpi4py-*.whl
109+
retention-days: 2
110+
name: build-artifacts
111+
112+
#==============================================
113+
114+
run:
115+
# This whole set of tests run with mpi4py's defaults. As of March
116+
# 2024, this means disabling the spawn and dynamic tests. We want
117+
# this block of tests to pass.
118+
needs: [build]
119+
runs-on: ubuntu-latest
120+
timeout-minutes: 30
121+
steps:
122+
- name: Use Python
123+
uses: actions/setup-python@v5
124+
with:
125+
python-version: 3
126+
architecture: x64
127+
- name: Get artifacts
128+
uses: actions/download-artifact@v4
129+
with:
130+
path: /
131+
name: build-artifacts
132+
- name: Restore executable permissions
133+
run: chmod a+x /opt/openmpi/bin/*
134+
- name: Add Open MPI to PATH
135+
run: echo /opt/openmpi/bin >> $GITHUB_PATH
136+
- name: Install the mpi4py wheel
137+
run: python -m pip install mpi4py --no-index --find-links=.
138+
139+
#----------------------------------------------
140+
92141
- name: Test mpi4py (singleton)
93142
run: python test/main.py -v
94143
if: ${{ true }}
@@ -118,3 +167,119 @@ jobs:
118167
run: python demo/test-run/test_run.py -v
119168
if: ${{ true }}
120169
timeout-minutes: 10
170+
171+
#==============================================
172+
173+
run_spawn:
174+
# This whole set of tests runs explicitly with setting "enable the
175+
# spawn tests". As of March 2024, we know that Open MPI is
176+
# failing these tests.
177+
needs: [build]
178+
runs-on: ubuntu-latest
179+
timeout-minutes: 30
180+
# Only run this job if the "mpi4py" label is set.
181+
if: ${{ github.event.label.name == 'mpi4py' }}
182+
env:
183+
MPI4PY_TEST_SPAWN: "1"
184+
steps:
185+
- name: Use Python
186+
uses: actions/setup-python@v5
187+
with:
188+
python-version: 3
189+
architecture: x64
190+
- name: Get artifacts
191+
uses: actions/download-artifact@v4
192+
with:
193+
path: /
194+
name: build-artifacts
195+
- name: Restore executable permissions
196+
run: chmod a+x /opt/openmpi/bin/*
197+
- name: Add Open MPI to PATH
198+
run: echo /opt/openmpi/bin >> $GITHUB_PATH
199+
- name: Install the mpi4py wheel
200+
run: python -m pip install mpi4py --no-index --find-links=.
201+
202+
#----------------------------------------------
203+
204+
- name: Test mpi4py (singleton)
205+
run: python test/main.py -v
206+
if: ${{ true }}
207+
timeout-minutes: 10
208+
- name: Test mpi4py (np=1)
209+
run: mpiexec -n 1 python test/main.py -v
210+
if: ${{ true }}
211+
timeout-minutes: 10
212+
- name: Test mpi4py (np=2)
213+
run: mpiexec -n 2 python test/main.py -v -f
214+
if: ${{ true }}
215+
timeout-minutes: 10
216+
- name: Test mpi4py (np=3)
217+
run: mpiexec -n 3 python test/main.py -v -f
218+
if: ${{ true }}
219+
timeout-minutes: 10
220+
- name: Test mpi4py (np=4)
221+
run: mpiexec -n 4 python test/main.py -v -f
222+
if: ${{ true }}
223+
timeout-minutes: 10
224+
- name: Test mpi4py (np=5)
225+
run: mpiexec -n 5 python test/main.py -v -f
226+
if: ${{ true }}
227+
timeout-minutes: 10
228+
229+
#==============================================
230+
231+
run_dynamic:
232+
# This whole set of tests runs explicitly with setting "enable the
233+
# dynamic tests". As of March 2024, we know that Open MPI is
234+
# failing these tests.
235+
needs: [build]
236+
runs-on: ubuntu-latest
237+
timeout-minutes: 30
238+
# Only run this job if the "mpi4py" label is set.
239+
if: ${{ github.event.label.name == 'mpi4py' }}
240+
env:
241+
MPI4PY_TEST_DYNPROC: "1"
242+
steps:
243+
- name: Use Python
244+
uses: actions/setup-python@v5
245+
with:
246+
python-version: 3
247+
architecture: x64
248+
- name: Get artifacts
249+
uses: actions/download-artifact@v4
250+
with:
251+
path: /
252+
name: build-artifacts
253+
- name: Restore executable permissions
254+
run: chmod a+x /opt/openmpi/bin/*
255+
- name: Add Open MPI to PATH
256+
run: echo /opt/openmpi/bin >> $GITHUB_PATH
257+
- name: Install the mpi4py wheel
258+
run: python -m pip install mpi4py --no-index --find-links=.
259+
260+
#----------------------------------------------
261+
262+
- name: Test mpi4py (singleton)
263+
run: python test/main.py -v
264+
if: ${{ true }}
265+
timeout-minutes: 10
266+
- name: Test mpi4py (np=1)
267+
run: mpiexec -n 1 python test/main.py -v
268+
if: ${{ true }}
269+
timeout-minutes: 10
270+
- name: Test mpi4py (np=2)
271+
run: mpiexec -n 2 python test/main.py -v -f
272+
if: ${{ true }}
273+
timeout-minutes: 10
274+
- name: Test mpi4py (np=3)
275+
run: mpiexec -n 3 python test/main.py -v -f
276+
if: ${{ true }}
277+
timeout-minutes: 10
278+
- name: Test mpi4py (np=4)
279+
run: mpiexec -n 4 python test/main.py -v -f
280+
if: ${{ true }}
281+
timeout-minutes: 10
282+
- name: Test mpi4py (np=5)
283+
run: mpiexec -n 5 python test/main.py -v -f
284+
if: ${{ true }}
285+
timeout-minutes: 10

0 commit comments

Comments
 (0)