-
Notifications
You must be signed in to change notification settings - Fork 868
157 lines (135 loc) · 4.39 KB
/
ompi_mpi4py.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: mpi4py
on:
pull_request:
workflow_dispatch:
inputs:
repository:
description: 'mpi4py repository'
default: 'mpi4py/mpi4py'
required: false
type: string
ref:
description: 'mpi4py branch/tag/SHA'
default: 'master'
required: false
type: string
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 30
env:
MPI4PY_TEST_SPAWN: true
steps:
- name: Configure hostname
run: echo 127.0.0.1 `hostname` | sudo tee -a /etc/hosts > /dev/null
if: ${{ runner.os == 'Linux' || runner.os == 'macOS' }}
- name: Install depencencies
run: sudo apt-get install -y -q
libnuma-dev
if: ${{ runner.os == 'Linux' }}
- name: Checkout Open MPI
uses: actions/checkout@v4
with:
path: mpi-build
submodules: recursive
- name: Bootstrap Open MPI
run: ./autogen.pl
working-directory: mpi-build
# Install into a separate directory (/opt/openmpi) so that we can
# bundle up that tree into an artifact to share with other jobs in
# this github action. Specifically don't use /usr/local, because
# there's a bunch of other stuff already installed in /usr/local,
# and we don't need to include that in our artifact.
- name: Configure Open MPI
run: ./configure
--disable-dependency-tracking
--enable-debug
--enable-mem-debug
--disable-sphinx
--disable-mpi-fortran
--disable-oshmem
--disable-silent-rules
--prefix=/opt/openmpi
LDFLAGS=-Wl,-rpath,/opt/openmpi/lib
working-directory: mpi-build
- name: Build MPI
run: make -j $(nproc)
working-directory: mpi-build
- name: Install MPI
run: sudo make install
working-directory: mpi-build
- name: Add Open MPI to PATH
run: echo /opt/openmpi/bin >> $GITHUB_PATH
- name: Tweak MPI
run: |
# Tweak MPI
mca_params="$HOME/.openmpi/mca-params.conf"
mkdir -p "$(dirname "$mca_params")"
echo mpi_param_check = true >> "$mca_params"
echo mpi_show_handle_leaks = true >> "$mca_params"
mca_params="$HOME/.prte/mca-params.conf"
mkdir -p "$(dirname "$mca_params")"
echo rmaps_default_mapping_policy = :oversubscribe >> "$mca_params"
- name: Show MPI
run: ompi_info
- name: Show MPICC
run: mpicc -show
- name: Use Python
uses: actions/setup-python@v5
with:
python-version: 3
architecture: x64
- name: Install Python packages (build)
run: python -m pip install --upgrade
setuptools pip wheel
- name: Install Python packages (test)
run: python -m pip install --upgrade
numpy cffi pyyaml
- name: Checkout mpi4py
uses: actions/checkout@v4
with:
repository: ${{ inputs.repository || 'mpi4py/mpi4py' }}
ref: ${{ inputs.ref }}
- name: Install mpi4py
run: python -m pip install .
env:
CFLAGS: "-O0"
- name: Test mpi4py (singleton)
run: python test/main.py -v
if: ${{ true }}
timeout-minutes: 10
- name: Test mpi4py (np=1)
run: mpiexec -n 1 python test/main.py -v
if: ${{ true }}
timeout-minutes: 10
- name: Test mpi4py (np=2)
run: mpiexec -n 2 python test/main.py -v -f
if: ${{ true }}
timeout-minutes: 10
- name: Test mpi4py (np=3)
run: mpiexec -n 3 python test/main.py -v -f
if: ${{ true }}
timeout-minutes: 10
- name: Test mpi4py (np=4)
run: mpiexec -n 4 python test/main.py -v -f
if: ${{ true }}
timeout-minutes: 10
- name: Test mpi4py (np=5)
run: mpiexec -n 5 python test/main.py -v -f
if: ${{ true }}
timeout-minutes: 10
- name: Test mpi4py.run
run: python demo/test-run/test_run.py -v
if: ${{ true }}
timeout-minutes: 10
- name: Relocate Open MPI installation
run: mv /opt/openmpi /opt/ompi
- name: Update PATH and set OPAL_PREFIX and LD_LIBRARY_PATH
run: |
sed -i '\|/opt/openmpi/bin|d' $GITHUB_PATH
echo OPAL_PREFIX=/opt/ompi >> $GITHUB_ENV
echo LD_LIBRARY_PATH=/opt/ompi/lib >> $GITHUB_ENV
- name: Test mpi4py (singleton)
run: python test/main.py -v
if: ${{ true }}
timeout-minutes: 10