forked from OP-DSL/OPS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
447 lines (434 loc) · 16 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
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
# Defines stages which are to be executed
stages:
- API_Build
- APP_Build
- HIP
- test
- docs
- clean
# Stage "build"
build:GNU:API:
stage: API_Build
tags:
- CCP, test
script:
- mkdir build
- cd build
- cmake ../ -DCMAKE_INSTALL_PREFIX=$CI_PROJECT_DIR/OPS-INSTALL
- cmake --build . -j 4
- cmake --install .
artifacts:
expire_in: 1 week
paths:
- $CI_PROJECT_DIR/OPS-INSTALL
Test:HIP:
stage: HIP
tags:
- CCP, test
script:
- |-
export PATH=/opt/rocm-4.5.0/bin:$PATH
export OPS_COMPILER=hip
export MPI_INSTALL_PATH=/usr
export HDF5_INSTALL_PATH=/usr/lib/x86_64-linux-gnu/hdf5/openmpi
export HIP_INSTALL_PATH=/opt/rocm-4.5.0/
export OPS_INSTALL_PATH=$CI_PROJECT_DIR/ops
export MPICC=mpicc
export MPICXX=mpic++
export MPICPP=mpicxx
export MPIFC=mpif90
export MPIF90=mpif90
export MPI_INC=/usr/lib/x86_64-linux-gnu/openmpi/include
export XCOMPILER=-Xcompiler
export HIP_LINK="-L/usr/local/cuda/lib64 -lcudart"
export HIP_HDF5_MPI_LINK="-L/usr/lib/x86_64-linux-gnu/hdf5/openmpi/lib -lmpi_cxx -lmpi"
export HIPMPICPP=mpicxx
export HIPIEEE="--fmad false"
export HIP_PLATFORM=nvidia
- cd ops/c
- make seq IEEE=1
- make hip IEEE=1
- make hdf5_seq IEEE=1
- cd ../../apps/c
- cd CloverLeaf
- make cloverleaf_hip IEEE=1
- |-
./cloverleaf_hip OPS_BLOCK_SIZE_X=64 OPS_BLOCK_SIZE_Y=4 > perf_out
grep "PASSED" clover.out
rc=$?; if [[ $rc != 0 ]]; then echo "TEST FAILED";exit $rc; fi
- cd ../CloverLeaf_3D
- make cloverleaf_hip IEEE=1
- |-
./cloverleaf_hip OPS_BLOCK_SIZE_X=64 OPS_BLOCK_SIZE_Y=4 > perf_out
grep "PASSED" clover.out
rc=$?; if [[ $rc != 0 ]]; then echo "TEST FAILED";exit $rc; fi
- cd ../CloverLeaf_3D_HDF5
- make cloverleaf_hip IEEE=1
- make generate_file IEEE=1
- |-
./generate_file
./cloverleaf_hip OPS_BLOCK_SIZE_X=64 OPS_BLOCK_SIZE_Y=4 > perf_out
grep "PASSED" clover.out
rc=$?; if [[ $rc != 0 ]]; then echo "TEST FAILED";exit $rc; fi
- cd ../lowdim_test
- make lowdim_hip
- |-
./lowdim_hip OPS_BLOCK_SIZE_X=64 OPS_BLOCK_SIZE_Y=4 > perf_out
grep "PASSED" perf_out
rc=$?; if [[ $rc != 0 ]]; then echo "TEST FAILED";exit $rc; fi
- cd ../mblock
- make mblock_hip
- |-
./mblock_hip OPS_BLOCK_SIZE_X=64 OPS_BLOCK_SIZE_Y=4 > mblock.out
grep "PASSED" mblock.out
rc=$?; if [[ $rc != 0 ]]; then echo "TEST FAILED";exit $rc; fi
- cd ../mb_shsgc/Max_datatransfer
# - make shsgc_hip
# - |-
# ./shsgc_hip OPS_BLOCK_SIZE_X=64 OPS_BLOCK_SIZE_Y=4 > perf_out
# grep "Pre shock error is:" perf_out
# grep "Post shock error is:" perf_out
# grep "Post shock Error is" perf_out
# grep "Total Wall time" perf_out
# grep -e "acceptable" -e "correct" perf_out
# rc=$?; if [[ $rc != 0 ]]; then echo "TEST FAILED";exit $rc; fi
- cd ../../multiDim
- make multidim_hip
- |-
./multidim_hip OPS_BLOCK_SIZE_X=64 OPS_BLOCK_SIZE_Y=4 > perf_out
grep "PASSED" perf_out
rc=$?; if [[ $rc != 0 ]]; then echo "TEST FAILED";exit $rc; fi
- cd ../multiDim3D
- make multidim_hip
- |-
./multidim_hip OPS_BLOCK_SIZE_X=64 OPS_BLOCK_SIZE_Y=4 > perf_out
grep "PASSED" perf_out
rc=$?; if [[ $rc != 0 ]]; then echo "TEST FAILED";exit $rc; fi
- cd ../poisson
- make poisson_hip
- |-
./poisson_hip OPS_BLOCK_SIZE_X=64 OPS_BLOCK_SIZE_Y=4 > perf_out
grep "PASSED" perf_out
rc=$?; if [[ $rc != 0 ]]; then echo "TEST FAILED";exit $rc; fi
- cd ../shsgc
- make shsgc_hip
- |-
./shsgc_hip OPS_BLOCK_SIZE_X=64 OPS_BLOCK_SIZE_Y=4 > perf_out
grep "PASSED" perf_out
rc=$?; if [[ $rc != 0 ]]; then echo "TEST FAILED";exit $rc; fi
- cd ../TeaLeaf
- make tealeaf_hip
- |-
./tealeaf_hip OPS_BLOCK_SIZE_X=64 OPS_BLOCK_SIZE_Y=4 > perf_out
grep "PASSED" perf_out
rc=$?; if [[ $rc != 0 ]]; then echo "TEST FAILED";exit $rc; fi
- cd ../multiDim_HDF5
- make -f Makefile.write write_hip
- rm .generated
- make read_hip
- |-
rm -rf write_data.h5 read_data.h5
./write_hip OPS_BLOCK_SIZE_X=64 OPS_BLOCK_SIZE_Y=4
./read_hip OPS_BLOCK_SIZE_X=64 OPS_BLOCK_SIZE_Y=4
h5diff write_data.h5 read_data.h5
rc=$?; if [[ $rc != 0 ]]; then echo "TEST FAILED";exit $rc; else echo "TEST PASSED"; fi
build:Intel:API:
stage: API_Build
tags:
- CCP, test
script:
- source /opt/intel/oneapi/setvars.sh
- export OMPI_MPICC=icc
- export OMPI_MPICXX=icpc
- export CC=icc
- export CXX=icpc
- |-
git clone https://github.com/OP-DSL/tridsolver.git
cd $CI_PROJECT_DIR/tridsolver
mkdir build
cd build
cmake ../scalar -DCMAKE_BUILD_TYPE=Release -DBUILD_FOR_CPU=ON -DBUILD_FOR_GPU=ON -DBUILD_FOR_MPI=ON -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc -DBUILD_FOR_SN=ON -DCMAKE_INSTALL_PREFIX=$CI_PROJECT_DIR/tridlib
cmake --build .
cmake --install .
cd $CI_PROJECT_DIR/
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CI_PROJECT_DIR/tridlib/libtrid/lib:/usr/local/hdf5-intel/lib
- mkdir build-intel
- cd build-intel
- cmake ../ -DCMAKE_INSTALL_PREFIX=$CI_PROJECT_DIR/OPS-INSTALL-Intel -DHDF5_ROOT=/usr/local/hdf5-intel -DLIBTRID_PATH=$CI_PROJECT_DIR/tridlib/libtrid
- cmake --build . -j 4
- cmake --install .
artifacts:
expire_in: 1 week
paths:
- $CI_PROJECT_DIR/OPS-INSTALL-Intel
build:GNU:APP:
stage: APP_Build
tags:
- CCP, test
script:
- git clone https://github.com/opensbli/opensbli.git
- export PYTHONPATH=$PYTHONPATH:$CI_PROJECT_DIR/opensbli/
- |-
cd $CI_PROJECT_DIR/opensbli/apps
echo dir=\$1 > translate.sh
echo pyfile=\$2 >> translate.sh
echo "cd \$dir" >> translate.sh
echo "python \$pyfile" >> translate.sh
echo "head -n-3 opensbli.cpp > tmp.cpp" >> translate.sh
echo "echo \"ops_printf(\\\"PASSED\!\\\\\\\\\\\\n\\\");\" >> tmp.cpp " >> translate.sh
echo "tail -n3 opensbli.cpp >> tmp.cpp" >> translate.sh
echo "cp tmp.cpp opensbli.cpp" >> translate.sh
echo "rm tmp.cpp" >> translate.sh
echo "echo \"cmake_minimum_required(VERSION 3.18)\" > CMakeLists.txt" >> translate.sh
echo "echo \"CreateTempDir()\" >> CMakeLists.txt" >> translate.sh
echo "echo \"BUILD_OPS_C_SAMPLE(\$3 \\\"NONE\\\" \\\"NONE\\\" \\\"NONE\\\" \\\"NO\\\" \\\"YES\\\")\" >> CMakeLists.txt" >> translate.sh
echo "cd \$CI_PROJECT_DIR/opensbli/apps" >> translate.sh
echo "cp \$dir \$CI_PROJECT_DIR/apps/c -r" >> translate.sh
cat translate.sh
source translate.sh taylor_green_vortex taylor_green_vortex.py tgv
echo " " >> $CI_PROJECT_DIR/apps/c/CMakeLists.txt
echo "add_subdirectory(taylor_green_vortex)" >> $CI_PROJECT_DIR/apps/c/CMakeLists.txt
# source translate.sh channel_flow/laminar_2D laminar_channel.py laminar2d
# echo " " >> $CI_PROJECT_DIR/apps/c/CMakeLists.txt
# echo "add_subdirectory(laminar_2D)" >> $CI_PROJECT_DIR/apps/c/CMakeLists.txt
cd $CI_PROJECT_DIR
- mkdir appbuild
- cd appbuild
- cmake ../apps/c -DOPS_INSTALL_DIR=$CI_PROJECT_DIR/OPS-INSTALL -DAPP_INSTALL_DIR=$CI_PROJECT_DIR/OPS-APP
- cmake --build . -j 12
- cmake --install .
dependencies:
- build:GNU:API
except:
- master
build:Intel:APP:
stage: APP_Build
tags:
- CCP, test
script:
- git clone https://github.com/opensbli/opensbli.git
- export PYTHONPATH=$PYTHONPATH:$CI_PROJECT_DIR/opensbli/
- |-
cd $CI_PROJECT_DIR/opensbli/apps
echo dir=\$1 > translate.sh
echo pyfile=\$2 >> translate.sh
echo "cd \$dir" >> translate.sh
echo "python \$pyfile" >> translate.sh
echo "head -n-3 opensbli.cpp > tmp.cpp" >> translate.sh
echo "echo \"ops_printf(\\\"PASSED\!\\\\\\\\\\\\n\\\");\" >> tmp.cpp " >> translate.sh
echo "tail -n3 opensbli.cpp >> tmp.cpp" >> translate.sh
echo "cp tmp.cpp opensbli.cpp" >> translate.sh
echo "rm tmp.cpp" >> translate.sh
echo "echo \"cmake_minimum_required(VERSION 3.18)\" > CMakeLists.txt" >> translate.sh
echo "echo \"CreateTempDir()\" >> CMakeLists.txt" >> translate.sh
echo "echo \"BUILD_OPS_C_SAMPLE(\$3 \\\"NONE\\\" \\\"NONE\\\" \\\"NONE\\\" \\\"NO\\\" \\\"YES\\\")\" >> CMakeLists.txt" >> translate.sh
echo "cd \$CI_PROJECT_DIR/opensbli/apps" >> translate.sh
echo "cp \$dir \$CI_PROJECT_DIR/apps/c -r" >> translate.sh
cat translate.sh
source translate.sh taylor_green_vortex taylor_green_vortex.py tgv
echo " " >> $CI_PROJECT_DIR/apps/c/CMakeLists.txt
echo "add_subdirectory(taylor_green_vortex)" >> $CI_PROJECT_DIR/apps/c/CMakeLists.txt
# source translate.sh channel_flow/laminar_2D laminar_channel.py laminar2d
# echo " " >> $CI_PROJECT_DIR/apps/c/CMakeLists.txt
# echo "add_subdirectory(laminar_2D)" >> $CI_PROJECT_DIR/apps/c/CMakeLists.txt
cd $CI_PROJECT_DIR
- source /opt/intel/oneapi/setvars.sh
- export OMPI_MPICC=icc
- export OMPI_MPICXX=icpc
- export CC=icc
- export CXX=icpc
- |-
git clone https://github.com/OP-DSL/tridsolver.git
cd $CI_PROJECT_DIR/tridsolver
mkdir build
cd build
cmake ../scalar -DCMAKE_BUILD_TYPE=Release -DBUILD_FOR_CPU=ON -DBUILD_FOR_GPU=ON -DBUILD_FOR_MPI=ON -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc -DBUILD_FOR_SN=ON -DCMAKE_INSTALL_PREFIX=$CI_PROJECT_DIR/tridlib
cmake --build .
cmake --install .
cd $CI_PROJECT_DIR/
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CI_PROJECT_DIR/tridlib/libtrid/lib:/usr/local/hdf5-intel/lib
- mkdir appbuild-intel
- cd appbuild-intel
- cmake ../apps/c -DOPS_INSTALL_DIR=$CI_PROJECT_DIR/OPS-INSTALL-Intel -DAPP_INSTALL_DIR=$CI_PROJECT_DIR/OPS-APP-Intel -DHDF5_ROOT=/usr/local/hdf5-intel -DLIBTRID_PATH=$CI_PROJECT_DIR/tridlib/libtrid
- cmake --build . -j 12
- cmake --install .
dependencies:
- build:Intel:API
except:
- master
build:Translator:App:
stage: APP_Build
tags:
- CCP, test
script:
- export PATH=$PATH:$CI_PROJECT_DIR/ops_translator/c:$CI_PROJECT_DIR/ops_translator/fortran
- git clone git@github.com:OP-DSL/OPS-APPS.git
- cd OPS-APPS
- rm -r -f c
- cp -r $CI_PROJECT_DIR/apps/c .
- cd c
- |-
for f in *; do
if [ -d "$f" ]; then
# $f is a directory
echo $f
cd $f
source source_list
cd ../
fi
done
- cd ../
- cp -r $CI_PROJECT_DIR/apps/fortran .
- cd fortran
- |-
for f in *; do
if [ -d "$f" ]; then
# $f is a directory
echo $f
cd $f
source source_list
cd ../
fi
done
- cd ../
- git add --all
- git commit -a -m "$(date)"
- git push origin
only:
refs:
- merge_requests
changes:
- apps
- ops_translator
#Stage "test"
test:GNU:
stage: test
tags:
- CCP,test
dependencies:
- build:GNU:API
script:
- git clone https://github.com/opensbli/opensbli.git
- export PYTHONPATH=$PYTHONPATH:$CI_PROJECT_DIR/opensbli/
- |-
cd $CI_PROJECT_DIR/opensbli/apps
echo dir=\$1 > translate.sh
echo pyfile=\$2 >> translate.sh
echo "cd \$dir" >> translate.sh
echo "python \$pyfile" >> translate.sh
echo "head -n-3 opensbli.cpp > tmp.cpp" >> translate.sh
echo "echo \"ops_printf(\\\"PASSED\!\\\\\\\\\\\\n\\\");\" >> tmp.cpp " >> translate.sh
echo "tail -n3 opensbli.cpp >> tmp.cpp" >> translate.sh
echo "cp tmp.cpp opensbli.cpp" >> translate.sh
echo "rm tmp.cpp" >> translate.sh
echo "echo \"cmake_minimum_required(VERSION 3.18)\" > CMakeLists.txt" >> translate.sh
echo "echo \"CreateTempDir()\" >> CMakeLists.txt" >> translate.sh
echo "echo \"BUILD_OPS_C_SAMPLE(\$3 \\\"NONE\\\" \\\"NONE\\\" \\\"NONE\\\" \\\"NO\\\" \\\"YES\\\")\" >> CMakeLists.txt" >> translate.sh
echo "cd \$CI_PROJECT_DIR/opensbli/apps" >> translate.sh
echo "cp \$dir \$CI_PROJECT_DIR/apps/c -r" >> translate.sh
cat translate.sh
source translate.sh taylor_green_vortex taylor_green_vortex.py tgv
echo " " >> $CI_PROJECT_DIR/apps/c/CMakeLists.txt
echo "add_subdirectory(taylor_green_vortex)" >> $CI_PROJECT_DIR/apps/c/CMakeLists.txt
# source translate.sh channel_flow/laminar_2D laminar_channel.py laminar2d
# echo " " >> $CI_PROJECT_DIR/apps/c/CMakeLists.txt
# echo "add_subdirectory(laminar_2D)" >> $CI_PROJECT_DIR/apps/c/CMakeLists.txt
cd $CI_PROJECT_DIR
- mkdir appbuild
- cd appbuild
- cmake ../apps/c -DOPS_INSTALL_DIR=$CI_PROJECT_DIR/OPS-INSTALL -DAPP_INSTALL_DIR=$CI_PROJECT_DIR/OPS-APP -DOPS_TEST=ON -DGPU_NUMBER=1
- cmake --build . -j 12
- ctest
artifacts:
expire_in: 1 week
paths:
- appbuild/Testing/Temporary
only:
- master
test:Intel:
stage: test
tags:
- CCP,test
dependencies:
- build:Intel:API
script:
- git clone https://github.com/opensbli/opensbli.git
- export PYTHONPATH=$PYTHONPATH:$CI_PROJECT_DIR/opensbli/
- |-
cd $CI_PROJECT_DIR/opensbli/apps
echo dir=\$1 > translate.sh
echo pyfile=\$2 >> translate.sh
echo "cd \$dir" >> translate.sh
echo "python \$pyfile" >> translate.sh
echo "head -n-3 opensbli.cpp > tmp.cpp" >> translate.sh
echo "echo \"ops_printf(\\\"PASSED\!\\\\\\\\\\\\n\\\");\" >> tmp.cpp " >> translate.sh
echo "tail -n3 opensbli.cpp >> tmp.cpp" >> translate.sh
echo "cp tmp.cpp opensbli.cpp" >> translate.sh
echo "rm tmp.cpp" >> translate.sh
echo "echo \"cmake_minimum_required(VERSION 3.18)\" > CMakeLists.txt" >> translate.sh
echo "echo \"CreateTempDir()\" >> CMakeLists.txt" >> translate.sh
echo "echo \"BUILD_OPS_C_SAMPLE(\$3 \\\"NONE\\\" \\\"NONE\\\" \\\"NONE\\\" \\\"NO\\\" \\\"YES\\\")\" >> CMakeLists.txt" >> translate.sh
echo "cd \$CI_PROJECT_DIR/opensbli/apps" >> translate.sh
echo "cp \$dir \$CI_PROJECT_DIR/apps/c -r" >> translate.sh
cat translate.sh
source translate.sh taylor_green_vortex taylor_green_vortex.py tgv
echo " " >> $CI_PROJECT_DIR/apps/c/CMakeLists.txt
echo "add_subdirectory(taylor_green_vortex)" >> $CI_PROJECT_DIR/apps/c/CMakeLists.txt
# source translate.sh channel_flow/laminar_2D laminar_channel.py laminar2d
# echo " " >> $CI_PROJECT_DIR/apps/c/CMakeLists.txt
# echo "add_subdirectory(laminar_2D)" >> $CI_PROJECT_DIR/apps/c/CMakeLists.txt
cd $CI_PROJECT_DIR
- source /opt/intel/oneapi/setvars.sh
- export OMPI_MPICC=icc
- export OMPI_MPICXX=icpc
- export CC=icc
- export CXX=icpc
- |-
git clone https://github.com/OP-DSL/tridsolver.git
cd $CI_PROJECT_DIR/tridsolver
mkdir build
cd build
cmake ../scalar -DCMAKE_BUILD_TYPE=Release -DBUILD_FOR_CPU=ON -DBUILD_FOR_GPU=ON -DBUILD_FOR_MPI=ON -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc -DBUILD_FOR_SN=ON -DCMAKE_INSTALL_PREFIX=$CI_PROJECT_DIR/tridlib
cmake --build .
cmake --install .
cd $CI_PROJECT_DIR/
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CI_PROJECT_DIR/tridlib/libtrid/lib:/usr/local/hdf5-intel/lib
- mkdir appbuild-intel
- cd appbuild-intel
- cmake ../apps/c -DOPS_INSTALL_DIR=$CI_PROJECT_DIR/OPS-INSTALL-Intel -DAPP_INSTALL_DIR=$CI_PROJECT_DIR/OPS-APP-Intel -DOPS_TEST=ON -DGPU_NUMBER=1 -DHDF5_ROOT=/usr/local/hdf5-intel -DLIBTRID_PATH=$CI_PROJECT_DIR/tridlib/libtrid
- cmake --build . -j 12
- ctest
artifacts:
expire_in: 1 week
paths:
- appbuild-intel/Testing/Temporary
only:
- master
# #Stage "docs"
# make-docs:
# stage: docs
# when: always
# tags:
# - CCP, test
# script:
# - cd doc && make all clean
# artifacts:
# expire_in: 4 week
# paths:
# - doc/user.pdf
# - doc/ops/html
# - doc/ops/latex/refman.pdf
# - doc/ops_translator/html
# - doc/ops_translator/latex/refman.pdf
pages:
stage: docs
when: always
tags:
- CCP, test
script:
- cd doc
- doxygen ops/Doxyfile
- mv ops/html/ $CI_PROJECT_DIR/public/
artifacts:
paths:
- public