-
Notifications
You must be signed in to change notification settings - Fork 50
/
.gitlab-ci.yml
294 lines (256 loc) · 9.78 KB
/
.gitlab-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
---
stages:
- prepare
- python
- compile
- fortran
- statistics
- finalize
###################################################################################################
default:
before_script:
- ${LOCAL_HOME}/bin/queue ${CI_JOB_ID} ${TOKEN}
- source env/DAMASK.sh
- export PATH=${TESTROOT}/bin:${PATH}
- echo Job start:" $(date)"
after_script:
- echo Job end:" $(date)"
###################################################################################################
variables:
# ===============================================================================================
# GitLab Settings
# ===============================================================================================
GIT_SUBMODULE_STRATEGY: normal
# ===============================================================================================
# Shortcut names
# ===============================================================================================
TESTROOT: "$LOCAL_HOME/GitLabCI_Pipeline_$CI_PIPELINE_ID"
# ===============================================================================================
# Names of module files to load
# ===============================================================================================
# ++++++++++++ Compiler +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
COMPILER_GNU: "Compiler/GNU/10"
COMPILER_INTELLLVM: "Compiler/oneAPI/2022.0.1 Libraries/IMKL/2022.0.1"
COMPILER_INTEL: "Compiler/Intel/2022.0.1 Libraries/IMKL/2022.0.1"
# ++++++++++++ MPI ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
MPI_GNU: "MPI/GNU/10/OpenMPI/4.1.2"
MPI_INTELLLVM: "MPI/oneAPI/2022.0.1/IntelMPI/2021.5.0"
MPI_INTEL: "MPI/Intel/2022.0.1/IntelMPI/2021.5.0"
# ++++++++++++ PETSc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
PETSC_GNU: "Libraries/PETSc/3.16.4/GNU-10-OpenMPI-4.1.2"
PETSC_INTELLLVM: "Libraries/PETSc/3.16.3/oneAPI-2022.0.1-IntelMPI-2021.5.0"
PETSC_INTEL: "Libraries/PETSc/3.16.5/Intel-2022.0.1-IntelMPI-2021.5.0"
# ++++++++++++ MSC Marc +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
MSC: "FEM/MSC/2024.1"
IntelMarc: "Compiler/Intel/19.1.2 Libraries/IMKL/2020"
HDF5Marc: "HDF5/1.12.2/Intel-19.1.2"
###################################################################################################
create_testroot:
stage: prepare
before_script:
- ${LOCAL_HOME}/bin/queue ${CI_JOB_ID} ${TOKEN}
- echo Job start:" $(date)"
script:
- mkdir -p ${TESTROOT}
###################################################################################################
setuptools:
stage: python
tags:
- matesting2-container-runner
image: git.damask-multiphysics.org:5050/damask/damask:python310_2407
before_script: []
script:
- sed -i 's/-[[:digit:]]*-.*//' VERSION
- cd python
- python3 -m build --wheel --no-isolation
pytest:
stage: python
tags:
- matesting2-container-runner
image: git.damask-multiphysics.org:5050/damask/damask:python310_2407
before_script: []
script:
- PYTHONPATH=$(pwd)/python:$PYTHONPATH
- cd python
- python3 -m pytest -v --cov=damask --cov-report=xml
- coverage report --fail-under=90 --show-missing
mypy:
stage: python
tags:
- matesting2-container-runner
image: git.damask-multiphysics.org:5050/damask/damask:python310_2407
before_script: []
script:
- cd python
- mypy damask
###################################################################################################
unittest_GNU_DEBUG:
stage: compile
script:
- module load ${COMPILER_GNU} ${MPI_GNU} ${PETSC_GNU}
- TEMPDIR=$(mktemp -d)
- cmake -B ${TEMPDIR} -DDAMASK_SOLVER=test -DCMAKE_INSTALL_PREFIX=${TEMPDIR} -DCMAKE_BUILD_TYPE=RELEASE -DBUILDCMD_POST=-coverage
- cmake --build ${TEMPDIR} --target install
- cd ${TEMPDIR}
- ./bin/DAMASK_test
- find -name \*.gcda -not -path "**/test/*" | xargs gcov
unittest_GNU_RELEASE:
stage: compile
script:
- module load ${COMPILER_GNU} ${MPI_GNU} ${PETSC_GNU}
- TEMPDIR=$(mktemp -d)
- cmake -B ${TEMPDIR} -DDAMASK_SOLVER=test -DCMAKE_INSTALL_PREFIX=${TEMPDIR} -DCMAKE_BUILD_TYPE=RELEASE -DBUILDCMD_POST=-coverage
- cmake --build ${TEMPDIR} --target install
- cd ${TEMPDIR}
- ./bin/DAMASK_test
- find -name \*.gcda -not -path "**/test/*" | xargs gcov
unittest_GNU_PERFORMANCE:
stage: compile
script:
- module load ${COMPILER_GNU} ${MPI_GNU} ${PETSC_GNU}
- TEMPDIR=$(mktemp -d)
- cmake -B ${TEMPDIR} -DDAMASK_SOLVER=test -DCMAKE_INSTALL_PREFIX=${TEMPDIR} -DCMAKE_BUILD_TYPE=PERFORMANCE -DBUILDCMD_POST=-coverage
- cmake --build ${TEMPDIR} --target install
- cd ${TEMPDIR}
- ./bin/DAMASK_test
- find -name \*.gcda -not -path "**/test/*" | xargs gcov
grid_GNU:
stage: compile
script:
- module load ${COMPILER_GNU} ${MPI_GNU} ${PETSC_GNU}
- cd PRIVATE/testing
- pytest -k 'compile and grid' --basetemp ${TESTROOT}/compile_grid_GNU
mesh_GNU:
stage: compile
script:
- module load ${COMPILER_GNU} ${MPI_GNU} ${PETSC_GNU}
- cd PRIVATE/testing
- pytest -k 'compile and mesh' --basetemp ${TESTROOT}/compile_mesh_GNU
grid_GNU-64bit:
stage: compile
script:
- module load Compiler/GNU/10 Libraries/PETSc/3.16.4/64bit
- cd PRIVATE/testing
- pytest -k 'compile and grid' --basetemp ${TESTROOT}/compile_grid_GNU-64bit
mesh_GNU-64bit:
stage: compile
script:
- module load Compiler/GNU/10 Libraries/PETSc/3.16.4/64bit
- cd PRIVATE/testing
- pytest -k 'compile and mesh' --basetemp ${TESTROOT}/compile_mesh_GNU-64bit
grid_IntelLLVM:
stage: compile
script:
- module load ${COMPILER_INTELLLVM} ${MPI_INTELLLVM} ${PETSC_INTELLLVM}
- cd PRIVATE/testing
- pytest -k 'compile and grid' --basetemp ${TESTROOT}/compile_grid_IntelLLVM
mesh_IntelLLVM:
stage: compile
script:
- module load ${COMPILER_INTELLLVM} ${MPI_INTELLLVM} ${PETSC_INTELLLVM}
- cd PRIVATE/testing
- pytest -k 'compile and mesh' --basetemp ${TESTROOT}/compile_mesh_IntelLLVM
grid_Intel:
stage: compile
script:
- module load ${COMPILER_INTEL} ${MPI_INTEL} ${PETSC_INTEL}
- cd PRIVATE/testing
- pytest -k 'compile and grid' --basetemp ${TESTROOT}/compile_grid_Intel
mesh_Intel:
stage: compile
script:
- module load ${COMPILER_INTEL} ${MPI_INTEL} ${PETSC_INTEL}
- cd PRIVATE/testing
- pytest -k 'compile and mesh' --basetemp ${TESTROOT}/compile_mesh_Intel
Marc_Intel:
stage: compile
script:
- module load $IntelMarc $HDF5Marc $MSC
- cd PRIVATE/testing
- pytest -k 'compile and Marc' --basetemp ${TESTROOT}/compile_Marc
setup_grid:
stage: compile
script:
- module load ${COMPILER_INTEL} ${MPI_INTEL} ${PETSC_INTEL}
- cd $(mktemp -d)
- cmake -DDAMASK_SOLVER=GRID -DCMAKE_INSTALL_PREFIX=${TESTROOT} ${CI_PROJECT_DIR}
- make -j2 all install
setup_mesh:
stage: compile
script:
- module load ${COMPILER_INTEL} ${MPI_INTEL} ${PETSC_INTEL}
- cd $(mktemp -d)
- cmake -DDAMASK_SOLVER=MESH -DCMAKE_INSTALL_PREFIX=${TESTROOT} ${CI_PROJECT_DIR}
- make -j2 all install
setup_Marc:
stage: compile
script:
- module load $IntelMarc $HDF5Marc $MSC
- cd $(mktemp -d)
- cp ${CI_PROJECT_DIR}/examples/Marc/* .
- python3 -c "import damask;damask.solver.Marc().submit_job('r-value','texture',True,'h')"
- mkdir -p ${TESTROOT}/src/Marc
- mv ${CI_PROJECT_DIR}/src/Marc/DAMASK_Marc.marc ${TESTROOT}/src/Marc
###################################################################################################
open-source:
stage: fortran
script:
- module load ${COMPILER_INTEL} ${MPI_INTEL} ${PETSC_INTEL}
- cd PRIVATE/testing
- pytest -k 'not compile and not Marc' -m 'not cifail' --basetemp ${TESTROOT}/open-source -v
Marc:
stage: fortran
script:
- cd PRIVATE/testing
- pytest -k 'not compile and Marc' -m 'not cifail' --damask-root=${TESTROOT} --basetemp ${TESTROOT}/Marc -v
# Needs closer look
# Phenopowerlaw_singleSlip:
# stage: fortran
# script: Phenopowerlaw_singleSlip/test.py
###################################################################################################
grid_performance:
stage: statistics
before_script:
- ${LOCAL_HOME}/bin/queue2 ${CI_JOB_ID} ${TOKEN} --blocking
- source env/DAMASK.sh
- echo Job start:" $(date)"
script:
- module load ${COMPILER_INTEL} ${MPI_INTEL} ${PETSC_INTEL}
- cd $(mktemp -d)
- cmake -DOPTIMIZATION=AGGRESSIVE -DDAMASK_SOLVER=GRID -DCMAKE_INSTALL_PREFIX=./ ${CI_PROJECT_DIR}
- make -j2 all install
- export PATH=${PWD}/bin:${PATH}
- cd $(mktemp -d)
- git clone -q [email protected]:damask/statistics.git .
- ./measure_performance.py --input_dir ${CI_PROJECT_DIR}/examples/grid --tag ${CI_COMMIT_SHA}
- >
if [ ${CI_COMMIT_BRANCH} == development ]; then
git add performance.txt
git commit -m ${CI_PIPELINE_ID}_${CI_COMMIT_SHA}
git push
fi
###################################################################################################
update_website:
stage: finalize
trigger:
project: damask/website
branch: master
only:
- development
update_revision:
stage: finalize
before_script:
- ${LOCAL_HOME}/bin/queue2 ${CI_JOB_ID} ${TOKEN}
- echo Job start:" $(date)"
script:
- cd $(mktemp -d)
- git clone -q [email protected]:damask/DAMASK.git .
- git pull
- export VERSION=$(git describe ${CI_COMMIT_SHA})
- echo ${VERSION:1} > VERSION
- >
git diff-index --quiet HEAD ||
git commit VERSION -m "[skip ci] updated version information after successful test of $VERSION"
- if [ ${CI_COMMIT_SHA} == $(git rev-parse HEAD^) ]; then git push --atomic --no-verify origin HEAD:development HEAD:master; fi
only:
- development