-
Notifications
You must be signed in to change notification settings - Fork 52
309 lines (303 loc) · 14.6 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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
name: PelePhysics-CI
on:
workflow_dispatch:
push:
branches: [development]
pull_request:
branches: [development]
concurrency:
group: ${{github.ref}}-${{github.head_ref}}-ci
cancel-in-progress: true
jobs:
Formatting:
runs-on: ubuntu-latest
steps:
- name: Clone
uses: actions/checkout@v4
- name: Check formatting
uses: DoozyX/[email protected]
with:
source: './Source ./Testing ./Mechanisms'
exclude: '.'
extensions: 'H,h,cpp'
clangFormatVersion: 18
Codespell:
needs: Formatting
runs-on: ubuntu-latest
steps:
- name: Clone
uses: actions/checkout@v4
with:
submodules: false
- name: Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Dependencies
run: |
# Install Python packages
python -m pip install --upgrade pip
pip install codespell
- name: Run codespell
run: codespell
CEPTR:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11']
poetry-version: ['1.4.2']
defaults:
run:
working-directory: ${{github.workspace}}/Support/ceptr
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{matrix.python-version}}
- name: Run image
uses: abatilo/[email protected]
with:
poetry-version: ${{matrix.poetry-version}}
- name: Install Dependencies using Poetry
run: poetry install
- name: Formatting with black
run: poetry run black --check .
- name: Sort imports with isort
run: poetry run isort --check-only --diff .
- name: Lint with flake8
run: poetry run flake8 .
- name: Run tests
run: poetry run pytest
- name: Convert air mechanism
run: poetry run convert -f ${{github.workspace}}/Mechanisms/air/mechanism.yaml
- name: Convert LiDryer mechanism
run: poetry run convert -f ${{github.workspace}}/Mechanisms/LiDryer/mechanism.yaml
Transport-EOS-Reactions:
needs: Formatting
runs-on: ubuntu-20.04
strategy:
matrix:
comp: [gnu, llvm, cuda, hip, sycl]
python-version: ['3.11']
poetry-version: ['1.4.2']
include:
- comp: gnu
amrex_build_args: 'COMP=gnu'
dependency_cmds:
- comp: llvm
amrex_build_args: 'COMP=llvm'
dependency_cmds:
- comp: cuda
amrex_build_args: 'COMP=gnu USE_CUDA=TRUE'
dependency_cmds: '.github/workflows/dependencies/dependencies_cuda.sh'
- comp: hip
amrex_build_args: 'USE_HIP=TRUE AMD_ARCH=gfx90a LIBRARY_LOCATIONS=/opt/rocm/lib'
dependency_cmds: '.github/workflows/dependencies/dependencies_hip.sh'
- comp: sycl
amrex_build_args: 'USE_SYCL=TRUE'
dependency_cmds: '.github/workflows/dependencies/dependencies_dpcpp.sh'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{matrix.python-version}}
- name: Run image
uses: abatilo/[email protected]
with:
poetry-version: ${{matrix.poetry-version}}
- name: Clone PelePhysics
uses: actions/checkout@v4
with:
path: PelePhysics-${{matrix.comp}}
submodules: recursive
- name: Set Environment Variables
run: |
echo "PELE_PHYSICS_HOME=${{github.workspace}}/PelePhysics-${{matrix.comp}}" >> $GITHUB_ENV
echo "TRANSPORT_WORKING_DIRECTORY=${{github.workspace}}/PelePhysics-${{matrix.comp}}/Testing/Exec/TranEval" >> $GITHUB_ENV
echo "EOS_WORKING_DIRECTORY=${{github.workspace}}/PelePhysics-${{matrix.comp}}/Testing/Exec/EosEval" >> $GITHUB_ENV
echo "REACT_WORKING_DIRECTORY=${{github.workspace}}/PelePhysics-${{matrix.comp}}/Testing/Exec/ReactEval" >> $GITHUB_ENV
echo "IGNDELAY_WORKING_DIRECTORY=${{github.workspace}}/PelePhysics-${{matrix.comp}}/Testing/Exec/IgnitionDelay" >> $GITHUB_ENV
echo "JAC_WORKING_DIRECTORY=${{github.workspace}}/PelePhysics-${{matrix.comp}}/Testing/Exec/Jacobian" >> $GITHUB_ENV
echo "NPROCS=$(nproc)" >> $GITHUB_ENV
echo "CCACHE_COMPRESS=1" >> $GITHUB_ENV
echo "CCACHE_COMPRESSLEVEL=5" >> $GITHUB_ENV
echo "CCACHE_LOGFILE=${{github.workspace}}/ccache.log.txt" >> $GITHUB_ENV
echo "CCACHE_MAXSIZE=1G" >> $GITHUB_ENV
if [ "${{matrix.comp}}" == 'cuda' ]; then \
echo "CUDA_HOME=/usr/local/cuda-11.2" >> $GITHUB_ENV; \
echo "LD_LIBRARY_PATH=/usr/local/cuda-11.2/lib64:${LD_LIBRARY_PATH}" >> $GITHUB_ENV; \
echo "/usr/local/cuda-11.2/bin" >> $GITHUB_PATH; \
fi
- name: Install Ccache
run: |
wget https://github.com/ccache/ccache/releases/download/v4.8/ccache-4.8-linux-x86_64.tar.xz
tar xvf ccache-4.8-linux-x86_64.tar.xz
sudo cp -f ccache-4.8-linux-x86_64/ccache /usr/local/bin/
- name: Set Up Ccache
uses: actions/cache@v4
with:
path: ~/.cache/ccache
key: ccache-${{github.workflow}}-${{github.job}}-${{matrix.comp}}-git-${{github.sha}}
restore-keys: |
ccache-${{github.workflow}}-${{github.job}}-${{matrix.comp}}-git-
- name: Dependencies
working-directory: ${{env.TRANSPORT_WORKING_DIRECTORY}}
run: |
if [ "${{matrix.comp}}" == 'cuda' ]; then \
${{github.workspace}}/PelePhysics-${{matrix.comp}}/${{matrix.dependency_cmds}}; \
echo "CUDA_HOME=${CUDA_HOME}"; \
ls ${CUDA_HOME} > /dev/null; \
which nvcc || echo "nvcc not in PATH!"; \
fi
if [ "${{matrix.comp}}" == 'hip' ]; then \
${{github.workspace}}/PelePhysics-${{matrix.comp}}/${{matrix.dependency_cmds}}; \
source /etc/profile.d/rocm.sh
which hipcc || echo "hipcc not in PATH!"; \
fi
if [ "${{matrix.comp}}" == 'sycl' ]; then \
${{github.workspace}}/PelePhysics-${{matrix.comp}}/${{matrix.dependency_cmds}}; \
source /opt/intel/oneapi/setvars.sh || true
which icpx || echo "icpx not in PATH!"; \
fi
cmake --version
make TPL ${{matrix.amrex_build_args}};
if [ "${{matrix.comp}}" == 'gnu' ] || [ "${{matrix.comp}}" == 'llvm' ]; then \
make TPL DEBUG=TRUE TINY_PROFILE=TRUE ${{matrix.amrex_build_args}};
cd ${{github.workspace}}/PelePhysics-${{matrix.comp}}/Support/ceptr
poetry install
fi
- name: Test Transport
working-directory: ${{env.TRANSPORT_WORKING_DIRECTORY}}
run: |
echo "::add-matcher::${{github.workspace}}/PelePhysics-${{matrix.comp}}/.github/problem-matchers/gcc.json"
if [ "${{matrix.comp}}" == 'hip' ]; then source /etc/profile.d/rocm.sh; fi;
if [ "${{matrix.comp}}" == 'sycl' ]; then source /opt/intel/oneapi/setvars.sh || true; fi;
ccache -z
for TYPE in Constant Simple Sutherland Manifold; do \
printf "\n-------- ${TYPE} --------\n"; \
if [ "${TYPE}" == 'Manifold' ]; then EOSMODEL=Manifold; else EOSMODEL=Fuego; fi; \
if [ "${TYPE}" == 'Manifold' ]; then CHEMISTRY=Null; else CHEMISTRY=air; fi; \
if [ "${TYPE}" != 'Manifold' ] || [ "${{matrix.comp}}" != 'sycl' ]; then \
make -j ${{env.NPROCS}} Eos_Model=${EOSMODEL} Chemistry_Model=${CHEMISTRY} Transport_Model=${TYPE} TINY_PROFILE=TRUE USE_CCACHE=TRUE ${{matrix.amrex_build_args}}; \
fi; \
if [ "${{matrix.comp}}" == 'gnu' ] || [ "${{matrix.comp}}" == 'llvm' ]; then \
./Pele2d.${{matrix.comp}}.TPROF.ex inputs.2d_${TYPE}; \
if [ "${TYPE}" == 'Manifold' ]; then \
./Pele2d.${{matrix.comp}}.TPROF.ex inputs.2d_Network
fi; \
fi; \
make realclean; \
if [ $? -ne 0 ]; then exit 1; fi; \
done
- name: Transport ccache report
working-directory: ${{env.TRANSPORT_WORKING_DIRECTORY}}
run: |
ccache -s
du -hs ${HOME}/.cache/ccache
- name: Test EOS
working-directory: ${{env.EOS_WORKING_DIRECTORY}}
run: |
echo "::add-matcher::${{github.workspace}}/PelePhysics-${{matrix.comp}}/.github/problem-matchers/gcc.json"
if [ "${{matrix.comp}}" == 'hip' ]; then source /etc/profile.d/rocm.sh; fi;
if [ "${{matrix.comp}}" == 'sycl' ]; then source /opt/intel/oneapi/setvars.sh || true; fi;
ccache -z
for TYPE in Fuego GammaLaw Soave-Redlich-Kwong Manifold; do \
if [ "${TYPE}" == 'Fuego' ] || [ "${TYPE}" == 'Soave-Redlich-Kwong' ]; then CHEMISTRY=LiDryer; else CHEMISTRY=Null; fi; \
if [ "${TYPE}" == 'Soave-Redlich-Kwong' ]; then TRANSPORT=Simple; else TRANSPORT=Constant; fi; \
if [ "${TYPE}" == 'Manifold' ]; then INPUTFILE=inputs.2d.table2d; else INPUTFILE=inputs.2d; fi; \
printf "\n-------- ${TYPE} --------\n"; \
if [ "${TYPE}" != 'Manifold' ] || [ "${{matrix.comp}}" != 'sycl' ]; then \
make -j ${{env.NPROCS}} Eos_Model=${TYPE} Chemistry_Model=${CHEMISTRY} Transport_Model=${TRANSPORT} TINY_PROFILE=TRUE USE_CCACHE=TRUE ${{matrix.amrex_build_args}}; \
fi; \
if [ "${{matrix.comp}}" == 'gnu' ] || [ "${{matrix.comp}}" == 'llvm' ]; then \
./Pele2d.${{matrix.comp}}.TPROF.ex ${INPUTFILE}; \
if [ "${TYPE}" == 'Manifold' ]; then \
./Pele2d.${{matrix.comp}}.TPROF.ex inputs.2d.network
fi; \
fi; \
make realclean; \
if [ $? -ne 0 ]; then exit 1; fi; \
done
- name: EOS ccache report
working-directory: ${{env.EOS_WORKING_DIRECTORY}}
run: |
ccache -s
du -hs ${HOME}/.cache/ccache
- name: Test Integration
working-directory: ${{env.REACT_WORKING_DIRECTORY}}
run: |
echo "::add-matcher::${{github.workspace}}/PelePhysics-${{matrix.comp}}/.github/problem-matchers/gcc.json"
if [ "${{matrix.comp}}" == 'hip' ]; then source /etc/profile.d/rocm.sh; fi;
if [ "${{matrix.comp}}" == 'sycl' ]; then source /opt/intel/oneapi/setvars.sh || true; fi;
ccache -z
make -j ${{env.NPROCS}} Eos_Model=Fuego Chemistry_Model=drm19 TINY_PROFILE=TRUE USE_CCACHE=TRUE ${{matrix.amrex_build_args}}
if [ "${{matrix.comp}}" == 'gnu' ] || [ "${{matrix.comp}}" == 'llvm' ]; then \
for TYPE in Cvode Arkode RK64; do \
printf "\n-------- ${TYPE} --------\n"; \
./Pele3d.${{matrix.comp}}.TPROF.ex inputs.3d_Array4 ode.dt=1.e-05 ode.ndt=100 chem_integrator="Reactor${TYPE}"; \
./Pele3d.${{matrix.comp}}.TPROF.ex inputs.3d_1dArray ode.dt=1.e-05 ode.ndt=100 chem_integrator="Reactor${TYPE}"; \
if [ $? -ne 0 ]; then exit 1; fi; \
done \
fi;
make realclean
make -j ${{env.NPROCS}} Eos_Model=Fuego Chemistry_Model=LiDryer TINY_PROFILE=TRUE USE_CCACHE=TRUE ${{matrix.amrex_build_args}}
if [ "${{matrix.comp}}" == 'gnu' ] || [ "${{matrix.comp}}" == 'llvm' ]; then \
for TYPE in Cvode Arkode RK64; do \
printf "\n-------- ${TYPE} --------\n"; \
./Pele3d.${{matrix.comp}}.TPROF.ex inputs.3d_Array4 fuel_name=H2 ode.dt=1.e-05 ode.ndt=100 chem_integrator="Reactor${TYPE}"; \
./Pele3d.${{matrix.comp}}.TPROF.ex inputs.3d_1dArray fuel_name=H2 ode.dt=1.e-05 ode.ndt=100 chem_integrator="Reactor${TYPE}"; \
if [ $? -ne 0 ]; then exit 1; fi; \
done \
fi
make realclean
- name: Integration ccache report
working-directory: ${{env.REACT_WORKING_DIRECTORY}}
run: |
ccache -s
du -hs ${HOME}/.cache/ccache
- name: Test Ignition delay
working-directory: ${{env.IGNDELAY_WORKING_DIRECTORY}}
run: |
echo "::add-matcher::${{github.workspace}}/PelePhysics-${{matrix.comp}}/.github/problem-matchers/gcc.json"
if [ "${{matrix.comp}}" == 'gnu' ] || [ "${{matrix.comp}}" == 'llvm' ]; then \
python -m pip install --upgrade pip
pip install numpy
ccache -z
make -j ${{env.NPROCS}} Eos_Model=Fuego Chemistry_Model=dodecane_lu TINY_PROFILE=TRUE USE_CCACHE=TRUE ${{matrix.amrex_build_args}}
bash exec_ignDelay.sh firstpass
python check_ignDelay.py
if [ $? -ne 0 ]; then exit 1; fi; \
rm log PPreaction.txt inputs/inputs.0d_refine
make realclean
make -j ${{env.NPROCS}} Eos_Model=Manifold Transport_Model=Manifold Manifold_Dim=1 Chemistry_Model=Null TINY_PROFILE=TRUE USE_CCACHE=TRUE ${{matrix.amrex_build_args}}
bash exec_ignDelay.sh manifold
python check_ignDelay.py 0.0766 10
if [ $? -ne 0 ]; then exit 1; fi; \
fi;
make realclean
- name: Ignition delay ccache report
working-directory: ${{env.IGNDELAY_WORKING_DIRECTORY}}
run: |
ccache -s
du -hs ${HOME}/.cache/ccache
- name: Test Jacobian
working-directory: ${{env.JAC_WORKING_DIRECTORY}}
run: |
echo "::add-matcher::${{github.workspace}}/PelePhysics-${{matrix.comp}}/.github/problem-matchers/gcc.json"
if [ "${{matrix.comp}}" == 'gnu' ] || [ "${{matrix.comp}}" == 'llvm' ]; then \
ccache -z
cd ${{github.workspace}}/PelePhysics-${{matrix.comp}}/Support/ceptr
poetry run qssa -f ${{github.workspace}}/PelePhysics-${{matrix.comp}}/Mechanisms/dodecane_lu_qss/skeletal.yaml -n ${{github.workspace}}/Mechanisms/dodecane_lu_qss/non_qssa_list.yaml
poetry run convert -f ${{github.workspace}}/PelePhysics-${{matrix.comp}}/Mechanisms/dodecane_lu_qss/qssa.yaml --qss_format_input ${{github.workspace}}/PelePhysics-${{matrix.comp}}/Mechanisms/dodecane_lu_qss/qssa_input_non_optimized.toml --qss_symbolic_jacobian
cd ${{env.JAC_WORKING_DIRECTORY}}
make -j ${{env.NPROCS}} Eos_Model=Fuego Chemistry_Model=dodecane_lu_qss DEBUG=TRUE TINY_PROFILE=TRUE USE_CCACHE=TRUE ${{matrix.amrex_build_args}}
./Pele3d.${{matrix.comp}}.DEBUG.TPROF.ex; \
if [ $? -ne 0 ]; then exit 1; fi; \
fi;
make realclean
- name: Jacobian ccache report
working-directory: ${{env.JAC_WORKING_DIRECTORY}}
run: |
ccache -s
du -hs ${HOME}/.cache/ccache