Skip to content

Commit 55a2ac8

Browse files
authored
Merge pull request #12526 from dalcinl/test/ompi-relocate
mpi4py: Run mpi4py tests with a relocated Open MPI installation
2 parents 88302d9 + bead2b3 commit 55a2ac8

File tree

2 files changed

+40
-9
lines changed

2 files changed

+40
-9
lines changed

.github/workflows/ompi_mpi4py.yaml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
name: mpi4py
22

3-
on: [ pull_request ]
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
inputs:
7+
repository:
8+
description: 'mpi4py repository'
9+
default: 'mpi4py/mpi4py'
10+
required: false
11+
type: string
12+
ref:
13+
description: 'mpi4py branch/tag/SHA'
14+
default: 'master'
15+
required: false
16+
type: string
417

518
jobs:
619
build:
@@ -89,7 +102,8 @@ jobs:
89102
- name: Checkout mpi4py
90103
uses: actions/checkout@v4
91104
with:
92-
repository: "mpi4py/mpi4py"
105+
repository: ${{ inputs.repository || 'mpi4py/mpi4py' }}
106+
ref: ${{ inputs.ref }}
93107

94108
- name: Build mpi4py wheel
95109
run: python -m pip wheel .
@@ -117,11 +131,6 @@ jobs:
117131
# this job of tests to pass.
118132
needs: [ build ]
119133
uses: ./.github/workflows/ompi_mpi4py_tests.yaml
120-
with:
121-
# This parameter is required, so send a meaningless
122-
# environment variable name that will not affect the tests at
123-
# all (i.e., the tests will be run with default values).
124-
env_name: MAKE_TODAY_AN_OMPI_DAY
125134

126135
#==============================================
127136

.github/workflows/ompi_mpi4py_tests.yaml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,16 @@ on:
99
workflow_call:
1010
inputs:
1111
env_name:
12-
required: true
12+
default: 'MAKE_TODAY_AN_OMPI_DAY'
13+
required: false
1314
type: string
1415

1516
jobs:
1617
mpi4py-tests:
1718
runs-on: ubuntu-latest
1819
timeout-minutes: 30
1920
env:
20-
${{ inputs.env_name}}: 1
21+
${{ inputs.env_name }}: true
2122
steps:
2223
- name: Use Python
2324
uses: actions/setup-python@v5
@@ -67,3 +68,24 @@ jobs:
6768
run: python demo/test-run/test_run.py -v
6869
if: ${{ true }}
6970
timeout-minutes: 10
71+
72+
#----------------------------------------------
73+
74+
- name: Relocate Open MPI installation
75+
run: mv /opt/openmpi /opt/ompi
76+
- name: Update PATH and set OPAL_PREFIX and LD_LIBRARY_PATH
77+
run: |
78+
sed -i '\|/opt/openmpi/bin|d' $GITHUB_PATH
79+
echo OPAL_PREFIX=/opt/ompi >> $GITHUB_ENV
80+
echo LD_LIBRARY_PATH=/opt/ompi/lib >> $GITHUB_ENV
81+
82+
- name: Test mpi4py (singleton)
83+
run: python test/main.py -v
84+
if: ${{ true }}
85+
timeout-minutes: 10
86+
- name: Test mpi4py (np=5)
87+
run: /opt/ompi/bin/mpiexec -n 5 python test/main.py -v -f
88+
if: ${{ true }}
89+
timeout-minutes: 10
90+
91+
#----------------------------------------------

0 commit comments

Comments
 (0)