-
Notifications
You must be signed in to change notification settings - Fork 4
180 lines (161 loc) · 5.92 KB
/
CI.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
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
BUILD_TYPE: Debug
jobs:
build:
strategy:
matrix:
os: [ubuntu-22.04]
mpi: [mpich, openmpi]
shared: [shared-off, shared-on]
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- name: Install ${{matrix.mpi}}
run: |
case "${{matrix.mpi}}" in
mpich)
sudo apt-get update
sudo apt-get install libmpich-dev
;;
openmpi)
sudo apt-get update
sudo apt-get install libopenmpi-dev
;;
esac
# - name: Restore dependencies
# id: cache
# uses: actions/cache/restore@v3
# with:
# path: /usr/local
# key: ${{runner.os}}-${{matrix.mpi}}-dependencies
#
# - name: Build ${{matrix.mpi}}
# if: steps.cache.outputs.cache-hit != 'true'
# run: |
# case "${{matrix.mpi}}" in
# mpich)
# ;;
# openmpi)
# ./.github/workflows/install-openmpi.sh
# ;;
# esac
#
# - name: Save dependencies
# uses: actions/cache/save@v3
# with:
# path: /usr/local
# key: ${{steps.cache.cache-primary-key}}
- name: Configure MPIwrapper
working-directory: ${{github.workspace}}/mpiwrapper
run: |
cmake \
-B build \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_COMPILER=mpicc \
-DCMAKE_Fortran_COMPILER=mpifort \
-DCMAKE_INSTALL_PREFIX=$HOME/mpiwrapper-${{matrix.mpi}}
- name: Build MPIwrapper
working-directory: ${{github.workspace}}/mpiwrapper
run: cmake --build build
# - name: Test
# working-directory: ${{github.workspace}}/build
# run: ctest -C ${{env.BUILD_TYPE}}
- name: Install MPIwrapper
working-directory: ${{github.workspace}}/mpiwrapper
run: cmake --install build
- name: Configure MPItrampoline
working-directory: ${{github.workspace}}/mpitrampoline
run: |
shared=$(echo ${{matrix.shared}} | sed -e 's/shared-//')
cmake \
-B build \
-DBUILD_SHARED_LIBS=${shared} \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_PREFIX=$HOME/mpitrampoline
- name: Build MPItrampoline
working-directory: ${{github.workspace}}/mpitrampoline
run: cmake --build build
# - name: Test
# working-directory: ${{github.workspace}}/build,
# run: ctest -C ${{env.BUILD_TYPE}}
- name: Install MPItrampoline
working-directory: ${{github.workspace}}/mpitrampoline
run: cmake --install build
- name: Test C
working-directory: ${{github.workspace}}/test
run: |
$HOME/mpitrampoline/bin/mpicc -c hello-world-c.c
$HOME/mpitrampoline/bin/mpicc -o hello-world-c hello-world-c.o
export MPITRAMPOLINE_LIB=$HOME/mpiwrapper-${{matrix.mpi}}/lib/libmpiwrapper.so
case "${{matrix.mpi}}" in
mpich) mpiexec_options='';;
openmpi) mpiexec_options='--oversubscribe';;
esac
./hello-world-c 1
mpiexec $mpiexec_options -n 4 ./hello-world-c 4
- name: Test C++
working-directory: ${{github.workspace}}/test
run: |
$HOME/mpitrampoline/bin/mpicxx -c hello-world-cxx.cxx
$HOME/mpitrampoline/bin/mpicxx -o hello-world-cxx hello-world-cxx.o
export MPITRAMPOLINE_LIB=$HOME/mpiwrapper-${{matrix.mpi}}/lib/libmpiwrapper.so
case "${{matrix.mpi}}" in
mpich) mpiexec_options='';;
openmpi) mpiexec_options='--oversubscribe';;
esac
./hello-world-cxx 1
mpiexec $mpiexec_options -n 4 ./hello-world-cxx 4
- name: Test fixed form Fortran
working-directory: ${{github.workspace}}/test
run: |
$HOME/mpitrampoline/bin/mpifc -c hello-world-f.f
$HOME/mpitrampoline/bin/mpifc -o hello-world-f hello-world-f.o
export MPITRAMPOLINE_LIB=$HOME/mpiwrapper-${{matrix.mpi}}/lib/libmpiwrapper.so
case "${{matrix.mpi}}" in
mpich) mpiexec_options='';;
openmpi) mpiexec_options='--oversubscribe';;
esac
./hello-world-f 1
mpiexec $mpiexec_options -n 4 ./hello-world-f 4
- name: Test free form Fortran
working-directory: ${{github.workspace}}/test
run: |
$HOME/mpitrampoline/bin/mpifc -c hello-world-f90.f90
$HOME/mpitrampoline/bin/mpifc -o hello-world-f90 hello-world-f90.o
export MPITRAMPOLINE_LIB=$HOME/mpiwrapper-${{matrix.mpi}}/lib/libmpiwrapper.so
case "${{matrix.mpi}}" in
mpich) mpiexec_options='';;
openmpi) mpiexec_options='--oversubscribe';;
esac
./hello-world-f90 1
mpiexec $mpiexec_options -n 4 ./hello-world-f90 4
- name: Test Fortran 90
working-directory: ${{github.workspace}}/test
run: |
$HOME/mpitrampoline/bin/mpifc -c hello-world-fortran.f90
$HOME/mpitrampoline/bin/mpifc -o hello-world-fortran hello-world-fortran.o
export MPITRAMPOLINE_LIB=$HOME/mpiwrapper-${{matrix.mpi}}/lib/libmpiwrapper.so
case "${{matrix.mpi}}" in
mpich) mpiexec_options='';;
openmpi) mpiexec_options='--oversubscribe';;
esac
./hello-world-fortran 1
mpiexec $mpiexec_options -n 4 ./hello-world-fortran 4
- name: Test Fortran 2008
working-directory: ${{github.workspace}}/test
run: |
$HOME/mpitrampoline/bin/mpifc -c hello-world-fortran08.f90
$HOME/mpitrampoline/bin/mpifc -o hello-world-fortran08 hello-world-fortran08.o
export MPITRAMPOLINE_LIB=$HOME/mpiwrapper-${{matrix.mpi}}/lib/libmpiwrapper.so
case "${{matrix.mpi}}" in
mpich) mpiexec_options='';;
openmpi) mpiexec_options='--oversubscribe';;
esac
./hello-world-fortran08 1
mpiexec $mpiexec_options -n 4 ./hello-world-fortran08 4