@@ -3,12 +3,10 @@ name: mpi4py
3
3
on : [pull_request]
4
4
5
5
jobs :
6
- mpi4py :
6
+ build :
7
7
runs-on : ubuntu-latest
8
- timeout-minutes : 60
9
-
8
+ timeout-minutes : 30
10
9
steps :
11
-
12
10
- name : Configure hostname
13
11
run : echo 127.0.0.1 `hostname` | sudo tee -a /etc/hosts > /dev/null
14
12
if : ${{ runner.os == 'Linux' || runner.os == 'macOS' }}
28
26
run : ./autogen.pl
29
27
working-directory : mpi-build
30
28
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.
31
34
- name : Configure Open MPI
32
35
run : ./configure
33
36
--disable-dependency-tracking
36
39
--disable-sphinx
37
40
--disable-mpi-fortran
38
41
--disable-oshmem
39
- LDFLAGS=-Wl,-rpath,/usr/local/lib
42
+ --prefix=/opt/openmpi
43
+ LDFLAGS=-Wl,-rpath,/opt/openmpi/lib
40
44
working-directory : mpi-build
41
45
42
46
- name : Build MPI
47
51
run : sudo make install
48
52
working-directory : mpi-build
49
53
54
+ - name : Add Open MPI to PATH
55
+ run : echo /opt/openmpi/bin >> $GITHUB_PATH
56
+
50
57
- name : Tweak MPI
51
58
run : |
52
59
# Tweak MPI
@@ -84,11 +91,53 @@ jobs:
84
91
with :
85
92
repository : " mpi4py/mpi4py"
86
93
87
- - name : Install mpi4py
88
- run : python -m pip install .
94
+ - name : Build mpi4py wheel
95
+ run : python -m pip wheel .
89
96
env :
90
97
CFLAGS : " -O0"
91
98
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
+
92
141
- name : Test mpi4py (singleton)
93
142
run : python test/main.py -v
94
143
if : ${{ true }}
@@ -118,3 +167,119 @@ jobs:
118
167
run : python demo/test-run/test_run.py -v
119
168
if : ${{ true }}
120
169
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