Skip to content

Commit 5d16c82

Browse files
committed
github-action: add a MPI4PY sanity check
seems like mpi4py finds a problem almost every time we advance openpmix/prrte shas so catch it early here. we test mpi4py master as it contains the mpi 4 stuff that so often breaks. related to open-mpi#12195 Signed-off-by: Howard Pritchard <[email protected]>
1 parent af0c640 commit 5d16c82

File tree

1 file changed

+109
-0
lines changed

1 file changed

+109
-0
lines changed

.github/workflows/ompi_mpi4py.yaml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: GitHub Action CI
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
mpi4py:
7+
runs-on: ubuntu-latest
8+
timeout-minutes: 60
9+
steps:
10+
- name: Configure hostname
11+
run: echo 127.0.0.1 `hostname` | sudo tee -a /etc/hosts > /dev/null
12+
if: ${{ runner.os == 'Linux' || runner.os == 'macOS' }}
13+
14+
- name: Install depencencies
15+
run: sudo apt-get install -y -q
16+
libnuma-dev
17+
18+
- name: Checkout Open MPI
19+
uses: actions/checkout@v4
20+
with:
21+
path: mpi-build
22+
submodules: recursive
23+
24+
- name: Bootstrap Open MPI
25+
run: ./autogen.pl
26+
working-directory: mpi-build
27+
28+
- name: Configure Open MPI
29+
run: ./configure
30+
--disable-dependency-tracking
31+
--disable-sphinx
32+
--disable-man-pages
33+
--disable-mpi-fortran
34+
LDFLAGS=-Wl,-rpath,/usr/local/lib
35+
working-directory: mpi-build
36+
37+
- name: Build MPI
38+
run: make -j 2
39+
working-directory: mpi-build
40+
41+
- name: Install MPI
42+
run: sudo make install
43+
working-directory: mpi-build
44+
45+
- name: Tweak MPI
46+
run: |
47+
# Tweak MPI
48+
mca_params="$HOME/.openmpi/mca-params.conf"
49+
mkdir -p "$(dirname "$mca_params")"
50+
echo mpi_param_check = true >> "$mca_params"
51+
echo mpi_show_handle_leaks = true >> "$mca_params"
52+
echo rmaps_base_oversubscribe = true >> "$mca_params"
53+
mca_params="$HOME/.prte/mca-params.conf"
54+
mkdir -p "$(dirname "$mca_params")"
55+
echo rmaps_default_mapping_policy = :oversubscribe >> "$mca_params"
56+
57+
- name: Show MPI
58+
run: ompi_info
59+
60+
- name: Show MPICC
61+
run: mpicc -show
62+
63+
- name: Use Python
64+
uses: actions/setup-python@v5
65+
with:
66+
python-version: 3
67+
architecture: x64
68+
69+
- name: Install Python packages (build)
70+
run: python -m pip install --upgrade
71+
setuptools pip wheel
72+
73+
- name: Install Python packages (test)
74+
run: python -m pip install --upgrade
75+
numpy cffi pyyaml
76+
77+
- name: Checkout mpi4py
78+
uses: actions/checkout@v4
79+
with:
80+
repository: "mpi4py/mpi4py"
81+
82+
- name: Install mpi4py
83+
run: python -m pip install .
84+
env:
85+
CFLAGS: "-O0"
86+
87+
- name: Test mpi4py (singleton)
88+
run: python test/main.py -v
89+
if: ${{ true }}
90+
- name: Test mpi4py (np=1)
91+
run: mpiexec -n 1 python test/main.py -v
92+
- name: Test mpi4py (np=2)
93+
run: mpiexec -n 2 python test/main.py -v -f
94+
- name: Test mpi4py (np=3)
95+
run: mpiexec -n 3 python test/main.py -v -f
96+
if: ${{ true }}
97+
timeout-minutes: 10
98+
- name: Test mpi4py (np=4)
99+
run: mpiexec -n 4 python test/main.py -v -f
100+
if: ${{ true }}
101+
timeout-minutes: 20
102+
- name: Test mpi4py (np=5)
103+
run: mpiexec -n 5 python test/main.py -v -f
104+
if: ${{ true }}
105+
timeout-minutes: 20
106+
- name: Test mpi4py.run
107+
run: python demo/test-run/test_run.py -v
108+
if: ${{ true }}
109+
timeout-minutes: 20

0 commit comments

Comments
 (0)