Skip to content

Commit 3c10787

Browse files
authored
Merge pull request #12217 from hppritcha/add_mpi4py_gaction
github-action: add a MPI4PY sanity check
2 parents 5ead6fe + 5a1cf9c commit 3c10787

File tree

1 file changed

+112
-0
lines changed

1 file changed

+112
-0
lines changed

.github/workflows/ompi_mpi4py.yaml

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

0 commit comments

Comments
 (0)