Skip to content

Commit 06d09bb

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 #12195 Signed-off-by: Howard Pritchard <[email protected]>
1 parent 1af4b98 commit 06d09bb

File tree

1 file changed

+110
-0
lines changed

1 file changed

+110
-0
lines changed

.github/workflows/ompi_mpi4py.yaml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
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+
--disable-oshmem
35+
LDFLAGS=-Wl,-rpath,/usr/local/lib
36+
working-directory: mpi-build
37+
38+
- name: Build MPI
39+
run: make -j 2
40+
working-directory: mpi-build
41+
42+
- name: Install MPI
43+
run: sudo make install
44+
working-directory: mpi-build
45+
46+
- name: Tweak MPI
47+
run: |
48+
# Tweak MPI
49+
mca_params="$HOME/.openmpi/mca-params.conf"
50+
mkdir -p "$(dirname "$mca_params")"
51+
echo mpi_param_check = true >> "$mca_params"
52+
echo mpi_show_handle_leaks = true >> "$mca_params"
53+
echo rmaps_base_oversubscribe = true >> "$mca_params"
54+
mca_params="$HOME/.prte/mca-params.conf"
55+
mkdir -p "$(dirname "$mca_params")"
56+
echo rmaps_default_mapping_policy = :oversubscribe >> "$mca_params"
57+
58+
- name: Show MPI
59+
run: ompi_info
60+
61+
- name: Show MPICC
62+
run: mpicc -show
63+
64+
- name: Use Python
65+
uses: actions/setup-python@v5
66+
with:
67+
python-version: 3
68+
architecture: x64
69+
70+
- name: Install Python packages (build)
71+
run: python -m pip install --upgrade
72+
setuptools pip wheel
73+
74+
- name: Install Python packages (test)
75+
run: python -m pip install --upgrade
76+
numpy cffi pyyaml
77+
78+
- name: Checkout mpi4py
79+
uses: actions/checkout@v4
80+
with:
81+
repository: "mpi4py/mpi4py"
82+
83+
- name: Install mpi4py
84+
run: python -m pip install .
85+
env:
86+
CFLAGS: "-O0"
87+
88+
- name: Test mpi4py (singleton)
89+
run: python test/main.py -v
90+
if: ${{ true }}
91+
- name: Test mpi4py (np=1)
92+
run: mpiexec -n 1 python test/main.py -v
93+
- name: Test mpi4py (np=2)
94+
run: mpiexec -n 2 python test/main.py -v -f
95+
- name: Test mpi4py (np=3)
96+
run: mpiexec -n 3 python test/main.py -v -f
97+
if: ${{ true }}
98+
timeout-minutes: 20
99+
- name: Test mpi4py (np=4)
100+
run: mpiexec -n 4 python test/main.py -v -f
101+
if: ${{ true }}
102+
timeout-minutes: 20
103+
- name: Test mpi4py (np=5)
104+
run: mpiexec -n 5 python test/main.py -v -f
105+
if: ${{ true }}
106+
timeout-minutes: 20
107+
- name: Test mpi4py.run
108+
run: python demo/test-run/test_run.py -v
109+
if: ${{ true }}
110+
timeout-minutes: 20

0 commit comments

Comments
 (0)