-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (88 loc) · 2.71 KB
/
mpi4py.yml
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
name: mpi4py
on: # yamllint disable-line rule:truthy
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
permissions:
contents: read
jobs:
mpi4py:
runs-on: ubuntu-latest
steps:
- name: Checkout mpi-stubs
uses: actions/checkout@v4
with:
path: mpi-stubs
- name: Install mpi-stubs
run: make -C mpi-stubs
- run: |
mpi_stubs=${{ github.workspace }}/mpi-stubs
echo $mpi_stubs/bin >> $GITHUB_PATH
echo LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$mpi_stubs/lib >> $GITHUB_ENV
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3
- name: Checkout mpi4py
uses: actions/checkout@v4
with:
repository: mpi4py/mpi4py
path: mpi4py
- name: Install mpi4py
run: python -m pip install ./mpi4py
env:
CFLAGS: "-O0"
- name: Check mpi4py symbols
run: |
module=$(python -m mpi4py --prefix)/MPI.*.so
nci=$(nm $module | awk '/ PyMPI_.*_c$/' | wc -l)
ncx=$(nm $module | awk '/ MPI_.*_x$/' | wc -l)
ncc=$(nm $module | awk '/ MPI_.*_c$/' | wc -l)
test $nci -eq 0
test $ncx -eq 0
test $ncc -ge 159
- name: Test mpi4py module
shell: python {0}
run: |
# load-python-module
import importlib.util as imp
spec = imp.find_spec("mpi4py.MPI")
module = imp.module_from_spec(spec)
print(module)
- name: Configure mpi4py (small-count)
run: |
config=mpi4py/src/lib-mpi/config.h
echo "#undef MPI_VERSION" >> config.h
echo "#undef MPI_SUBVERSION" >> config.h
echo "#define MPI_VERSION 3" >> config.h
echo "#define MPI_SUBVERSION 1" >> config.h
cat mpi4py/src/lib-mpi/config.h >> config.h
mv config.h mpi4py/src/lib-mpi/config.h
- name: Install mpi4py (small-count)
run: python -m pip install ./mpi4py
env:
CFLAGS: "-O0"
- name: Check mpi4py symbols (small-count)
run: |
module=$(python -m mpi4py --prefix)/MPI.*.so
nci=$(nm $module | awk '/ PyMPI_.*_c$/' | wc -l)
ncx=$(nm $module | awk '/ MPI_.*_x$/' | wc -l)
ncc=$(nm $module | awk '/ MPI_.*_c$/' | wc -l)
test $nci -ge 149
test $ncx -eq 0
test $ncc -eq 5
- name: Test mpi4py module (small-count)
shell: python {0}
run: |
# load-python-module
import importlib.util as imp
spec = imp.find_spec("mpi4py.MPI")
module = imp.module_from_spec(spec)
print(module)