Skip to content

Commit f342a09

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. 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 <[email protected]>
1 parent e9a0e65 commit f342a09

File tree

1 file changed

+193
-7
lines changed

1 file changed

+193
-7
lines changed

.github/workflows/ompi_mpi4py.yaml

Lines changed: 193 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,58 @@ 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+
# I dislike hard-coding /home/runner, but I couldn't get $HOME
103+
# or ${{ env.HOME }} to expand properly.
104+
#
105+
# The "test" and "demo" directories are from mpi4py -- they
106+
# aren't installed by the wheel.
107+
path: |
108+
/opt/openmpi
109+
/home/runner/.openmpi
110+
/home/runner/.prte
111+
test
112+
demo
113+
mpi4py-*.whl
114+
retention-days: 2
115+
name: build-artifacts
116+
117+
#==============================================
118+
119+
run:
120+
# This whole set of tests run with mpi4py's defaults. As of March
121+
# 2024, this means disabling the spawn and dynamic tests. We want
122+
# this block of tests to pass.
123+
needs: [build]
124+
runs-on: ubuntu-latest
125+
timeout-minutes: 30
126+
steps:
127+
- name: Use Python
128+
uses: actions/setup-python@v5
129+
with:
130+
python-version: 3
131+
architecture: x64
132+
- name: Get artifacts
133+
uses: actions/download-artifact@v4
134+
with:
135+
path: /
136+
name: build-artifacts
137+
- name: Restore executable permissions
138+
run: chmod a+x /opt/openmpi/bin/*
139+
- name: Add Open MPI to PATH
140+
run: echo /opt/openmpi/bin >> $GITHUB_PATH
141+
- name: Install the mpi4py wheel
142+
run: python -m pip install mpi4py --no-index --find-links=.
143+
144+
#----------------------------------------------
145+
92146
- name: Test mpi4py (singleton)
93147
run: python test/main.py -v
94148
if: ${{ true }}
@@ -118,3 +172,135 @@ jobs:
118172
run: python demo/test-run/test_run.py -v
119173
if: ${{ true }}
120174
timeout-minutes: 10
175+
176+
#==============================================
177+
178+
run_spawn:
179+
# This whole set of tests runs explicitly with setting "enable the
180+
# spawn tests". As of March 2024, we know that Open MPI is
181+
# failing these tests.
182+
needs: [build]
183+
runs-on: ubuntu-latest
184+
timeout-minutes: 30
185+
steps:
186+
- name: Use Python
187+
uses: actions/setup-python@v5
188+
with:
189+
python-version: 3
190+
architecture: x64
191+
- name: Get artifacts
192+
uses: actions/download-artifact@v4
193+
with:
194+
path: /
195+
name: build-artifacts
196+
- name: Restore executable permissions
197+
run: chmod a+x /opt/openmpi/bin/*
198+
- name: Add Open MPI to PATH
199+
run: echo /opt/openmpi/bin >> $GITHUB_PATH
200+
- name: Install the mpi4py wheel
201+
run: python -m pip install mpi4py --no-index --find-links=.
202+
203+
#----------------------------------------------
204+
205+
- name: Test mpi4py (singleton)
206+
run: python test/main.py -v
207+
if: ${{ true }}
208+
env:
209+
MPI4PY_TEST_SPAWN: "1"
210+
timeout-minutes: 10
211+
- name: Test mpi4py (np=1)
212+
run: mpiexec -n 1 python test/main.py -v
213+
env:
214+
MPI4PY_TEST_SPAWN: "1"
215+
if: ${{ true }}
216+
timeout-minutes: 10
217+
- name: Test mpi4py (np=2)
218+
run: mpiexec -n 2 python test/main.py -v -f
219+
env:
220+
MPI4PY_TEST_SPAWN: "1"
221+
if: ${{ true }}
222+
timeout-minutes: 10
223+
- name: Test mpi4py (np=3)
224+
run: mpiexec -n 3 python test/main.py -v -f
225+
env:
226+
MPI4PY_TEST_SPAWN: "1"
227+
if: ${{ true }}
228+
timeout-minutes: 10
229+
- name: Test mpi4py (np=4)
230+
run: mpiexec -n 4 python test/main.py -v -f
231+
env:
232+
MPI4PY_TEST_SPAWN: "1"
233+
if: ${{ true }}
234+
timeout-minutes: 10
235+
- name: Test mpi4py (np=5)
236+
run: mpiexec -n 5 python test/main.py -v -f
237+
env:
238+
MPI4PY_TEST_SPAWN: "1"
239+
if: ${{ true }}
240+
timeout-minutes: 10
241+
242+
#==============================================
243+
244+
run_dynamic:
245+
# This whole set of tests runs explicitly with setting "enable the
246+
# dynamic tests". As of March 2024, we know that Open MPI is
247+
# failing these tests.
248+
needs: [build]
249+
runs-on: ubuntu-latest
250+
timeout-minutes: 30
251+
steps:
252+
- name: Use Python
253+
uses: actions/setup-python@v5
254+
with:
255+
python-version: 3
256+
architecture: x64
257+
- name: Get artifacts
258+
uses: actions/download-artifact@v4
259+
with:
260+
path: /
261+
name: build-artifacts
262+
- name: Restore executable permissions
263+
run: chmod a+x /opt/openmpi/bin/*
264+
- name: Add Open MPI to PATH
265+
run: echo /opt/openmpi/bin >> $GITHUB_PATH
266+
- name: Install the mpi4py wheel
267+
run: python -m pip install mpi4py --no-index --find-links=.
268+
269+
#----------------------------------------------
270+
271+
- name: Test mpi4py (singleton)
272+
run: python test/main.py -v
273+
if: ${{ true }}
274+
env:
275+
MPI4PY_TEST_DYNPROC: "1"
276+
timeout-minutes: 10
277+
- name: Test mpi4py (np=1)
278+
run: mpiexec -n 1 python test/main.py -v
279+
env:
280+
MPI4PY_TEST_DYNPROC: "1"
281+
if: ${{ true }}
282+
timeout-minutes: 10
283+
- name: Test mpi4py (np=2)
284+
run: mpiexec -n 2 python test/main.py -v -f
285+
env:
286+
MPI4PY_TEST_DYNPROC: "1"
287+
if: ${{ true }}
288+
timeout-minutes: 10
289+
- name: Test mpi4py (np=3)
290+
run: mpiexec -n 3 python test/main.py -v -f
291+
env:
292+
MPI4PY_TEST_DYNPROC: "1"
293+
if: ${{ true }}
294+
timeout-minutes: 10
295+
- name: Test mpi4py (np=4)
296+
run: mpiexec -n 4 python test/main.py -v -f
297+
env:
298+
MPI4PY_TEST_DYNPROC: "1"
299+
if: ${{ true }}
300+
timeout-minutes: 10
301+
- name: Test mpi4py (np=5)
302+
run: mpiexec -n 5 python test/main.py -v -f
303+
env:
304+
MPI4PY_TEST_DYNPROC: "1"
305+
if: ${{ true }}
306+
timeout-minutes: 10

0 commit comments

Comments
 (0)