forked from CEED/libCEED
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
190 lines (187 loc) · 10.9 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
stages:
- test
noether-rocm:
stage: test
tags:
- rocm
interruptible: true
image: jedbrown/rocm:latest
script:
- rm -f .SUCCESS
# Compilers
- export COVERAGE=1 CC=gcc CXX=g++ FC=gfortran HIPCC=hipcc
- echo "-------------- nproc ---------------" && NPROC_CPU=$(nproc) && NPROC_GPU=$(($(nproc)<8?$(nproc):8)) && echo "NPROC_CPU" $NPROC_CPU && echo "NPROC_GPU" $NPROC_GPU
- echo "-------------- CC ------------------" && $CC --version
- echo "-------------- CXX -----------------" && $CXX --version
- echo "-------------- FC ------------------" && $FC --version
- echo "-------------- HIPCC ---------------" && $HIPCC --version
- echo "-------------- GCOV ----------------" && gcov --version
# Libraries for backends
# -- MAGMA from dev branch
- echo "-------------- MAGMA ---------------"
- export MAGMA_DIR=/projects/hipMAGMA && git -C $MAGMA_DIR describe
# -- LIBXSMM v1.16.1
- cd .. && export XSMM_VERSION=libxsmm-1.16.1 && { [[ -d $XSMM_VERSION ]] || { git clone --depth 1 --branch 1.16.1 https://github.com/hfp/libxsmm.git $XSMM_VERSION && make -C $XSMM_VERSION -j$(nproc); }; } && export XSMM_DIR=$PWD/$XSMM_VERSION && cd libCEED
- echo "-------------- LIBXSMM -------------" && git -C $XSMM_DIR describe --tags
# -- OCCA v1.1.0
- cd .. && export OCCA_VERSION=occa-1.1.0 OCCA_OPENCL_ENABLED=0 && { [[ -d $OCCA_VERSION ]] || { git clone --depth 1 --branch v1.1.0 https://github.com/libocca/occa.git $OCCA_VERSION && make -C $OCCA_VERSION -j$(nproc); }; } && export OCCA_DIR=$PWD/$OCCA_VERSION && cd libCEED
- echo "-------------- OCCA ----------------" && make -C $OCCA_DIR info
# libCEED
- make configure HIP_DIR=/opt/rocm OPT='-O -march=native -ffp-contract=fast'
# Note: OCCA backends currently disabled in CI
- BACKENDS_CPU=$(OCCA_DIR= make info-backends-all | grep -o '/cpu[^ ]*') && BACKENDS_GPU=$(OCCA_DIR= make info-backends | grep -o '/gpu[^ ]*')
- echo "-------------- libCEED -------------" && make info
- echo "-------------- BACKENDS_CPU---------" && echo $BACKENDS_CPU
- echo "-------------- BACKENDS_GPU---------" && echo $BACKENDS_GPU
- make -j$NPROC_CPU
# -- libCEED only tests
- echo "-------------- core tests ----------"
- echo '[{"subject":"/","metrics":[{"name":"Transfer Size (KB)","value":"19.5","desiredSize":"smaller"},{"name":"Speed Index","value":0,"desiredSize":"smaller"},{"name":"Total Score","value":92,"desiredSize":"larger"},{"name":"Requests","value":4,"desiredSize":"smaller"}]}]' > performance.json
# Note: PETSC_DIR is set by default in GitLab runner env, unsetting to isolate core tests
- export PETSC_DIR= PETSC_ARCH=
- make -k -j$NPROC_CPU BACKENDS="$BACKENDS_CPU" junit realsearch=%
- make -k -j$NPROC_GPU BACKENDS="$BACKENDS_GPU" junit realsearch=%
# Libraries for examples
# -- PETSc with HIP (minimal)
- export PETSC_DIR=/projects/petsc PETSC_ARCH=mpich-hip && git -C $PETSC_DIR describe
- echo "-------------- PETSc ---------------" && make -C $PETSC_DIR info
- make -k -j$NPROC_CPU BACKENDS="$BACKENDS_CPU" junit search="petsc fluids solids"
- make -k -j$NPROC_GPU BACKENDS="$BACKENDS_GPU" junit search="petsc fluids solids"
# -- MFEM v4.2
- cd .. && export MFEM_VERSION=mfem-4.2 && { [[ -d $MFEM_VERSION ]] || { git clone --depth 1 --branch v4.2 https://github.com/mfem/mfem.git $MFEM_VERSION && make -C $MFEM_VERSION -j$(nproc) serial CXXFLAGS="-O -std=c++11"; }; } && export MFEM_DIR=$PWD/$MFEM_VERSION && cd libCEED
- echo "-------------- MFEM ----------------" && make -C $MFEM_DIR info
- make -k -j$NPROC_CPU BACKENDS="$BACKENDS_CPU" junit search=mfem
- make -k -j$NPROC_GPU BACKENDS="$BACKENDS_GPU" junit search=mfem
# -- Nek5000 v19.0
- export COVERAGE=0
- cd .. && export NEK5K_VERSION=Nek5000-19.0 && { [[ -d $NEK5K_VERSION ]] || { git clone --depth 1 --branch v19.0 https://github.com/Nek5000/Nek5000.git $NEK5K_VERSION && cd $NEK5K_VERSION/tools && ./maketools genbox genmap reatore2 && cd ../..; }; } && export NEK5K_DIR=$PWD/$NEK5K_VERSION && export PATH=$NEK5K_DIR/bin:$PATH MPI=0 && cd libCEED
- echo "-------------- Nek5000 -------------" && git -C $NEK5K_DIR describe --tags
- make -k -j$NPROC_CPU BACKENDS="$BACKENDS_CPU" junit search=nek
- make -k -j$NPROC_GPU BACKENDS="$BACKENDS_GPU" junit search=nek
# Clang-tidy
- echo "-------------- clang-tidy ----------" && clang-tidy --version
- TIDY_OPTS="-fix-errors" make -j$NPROC_CPU tidy && git diff --exit-code
# Report status
- touch .SUCCESS
after_script:
- |
if [ -f .SUCCESS ]; then
lcov --directory . --capture --output-file coverage.info;
bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F interface;
bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F gallery;
bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F backends;
bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F tests;
bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F examples;
fi
artifacts:
paths:
- build/*.junit
reports:
junit: build/*.junit
performance: performance.json
noether-float:
stage: test
tags:
- rocm
interruptible: true
image: jedbrown/rocm:latest
script:
# Compilers
- export COVERAGE=1 CC=gcc CXX=g++ FC= HIPCC=hipcc
- echo "-------------- nproc ---------------" && NPROC_CPU=$(nproc) && NPROC_GPU=$(($(nproc)<8?$(nproc):8)) && echo "NPROC_CPU" $NPROC_CPU && echo "NPROC_GPU" $NPROC_GPU
- echo "-------------- CC ------------------" && $CC --version
- echo "-------------- CXX -----------------" && $CXX --version
- echo "-------------- HIPCC ---------------" && $HIPCC --version
- echo "-------------- GCOV ----------------" && gcov --version
# Libraries for backends
# -- MAGMA from dev branch
- echo "-------------- MAGMA ---------------"
- export MAGMA_DIR=/projects/hipMAGMA && git -C $MAGMA_DIR describe
# -- LIBXSMM v1.16.1
- cd .. && export XSMM_VERSION=libxsmm-1.16.1 && { [[ -d $XSMM_VERSION ]] || { git clone --depth 1 --branch 1.16.1 https://github.com/hfp/libxsmm.git $XSMM_VERSION && make -C $XSMM_VERSION -j$(nproc); }; } && export XSMM_DIR=$PWD/$XSMM_VERSION && cd libCEED
- echo "-------------- LIBXSMM -------------" && git -C $XSMM_DIR describe --tags
# libCEED
# First change to single precision
- sed -i 's/ceed-f64/ceed-f32/1' include/ceed/ceed.h
# Build libCEED
- make configure HIP_DIR=/opt/rocm OPT='-O -march=native -ffp-contract=fast'
- BACKENDS_CPU=$(make info-backends-all | grep -o '/cpu[^ ]*') && BACKENDS_GPU=$(make info-backends | grep -o '/gpu[^ ]*')
- echo "-------------- libCEED -------------" && make info
- echo "-------------- BACKENDS_CPU---------" && echo $BACKENDS_CPU
- echo "-------------- BACKENDS_GPU---------" && echo $BACKENDS_GPU
- make -j$NPROC_CPU
# -- libCEED only tests
- echo "-------------- core tests ----------"
- echo '[{"subject":"/","metrics":[{"name":"Transfer Size (KB)","value":"19.5","desiredSize":"smaller"},{"name":"Speed Index","value":0,"desiredSize":"smaller"},{"name":"Total Score","value":92,"desiredSize":"larger"},{"name":"Requests","value":4,"desiredSize":"smaller"}]}]' > performance.json
# Note: PETSC_DIR is set by default in GitLab runner env, unsetting to isolate core tests
- export PETSC_DIR= PETSC_ARCH=
- make -k -j$NPROC_CPU BACKENDS="$BACKENDS_CPU" junit realsearch=%
- make -k -j$NPROC_GPU BACKENDS="$BACKENDS_GPU" junit realsearch=%
# Report status
- echo "SUCCESS" > .job_status
after_script:
- |
if [ $(cat .job_status) == "SUCCESS" ]; then
lcov --directory . --capture --output-file coverage.info;
bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F interface;
bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F gallery;
bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F backends;
bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F tests;
bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F examples;
fi
- sed -i 's/ceed-f32/ceed-f64/1' include/ceed/ceed.h
artifacts:
paths:
- build/*.junit
reports:
junit: build/*.junit
performance: performance.json
lv-cuda:
stage: test
tags:
- cuda
interruptible: true
before_script:
# Compilers
- . /opt/rh/gcc-toolset-10/enable
- export COVERAGE=1 CC=gcc CXX=g++ FC=gfortran
- export CUDA_DIR=/usr/local/cuda-11.4
- export CUDA_VISIBLE_DEVICES=GPU-c4529365-8229-f689-b43d-ccd7f1677079 # our RTX 2080 Super via nvidia-smi -L
- echo "-------------- nproc ---------------" && NPROC_CPU=$(nproc) && NPROC_GPU=1 && echo "NPROC_CPU" $NPROC_CPU && echo "NPROC_GPU" $NPROC_GPU
- echo "-------------- CC ------------------" && $CC --version
- echo "-------------- CXX -----------------" && $CXX --version
- echo "-------------- FC ------------------" && $FC --version
- echo "-------------- NVCC ----------------" && $CUDA_DIR/bin/nvcc --version
# libCEED
- make configure OPT='-O -march=native -ffp-contract=fast'
- echo "-------------- libCEED -------------" && make info
- BACKENDS_GPU=$(make info-backends | grep -o '/gpu[^ ]*')
- echo "-------------- BACKENDS_GPU---------" && echo $BACKENDS_GPU
- export PETSC_DIR=/home/jeth8984/petsc PETSC_ARCH=cuda-O && git -C $PETSC_DIR describe
script:
- rm -f .SUCCESS
- nice make -k -j$NPROC_CPU -l$NPROC_CPU
- echo "-------------- quick CPU tests to get everything built (no junit) --------------"
- nice make -k -j$NPROC_CPU -l$NPROC_CPU test BACKENDS=/cpu/self/avx/blocked realsearch=%
- echo "-------------- CUDA tests without PETSc (makes *.junit) --------------"
- nice make -k -j$NPROC_GPU junit PETSC_DIR= BACKENDS="$BACKENDS_GPU" realsearch=%
- echo "-------------- CUDA tests with PETSc (makes *.junit) --------------"
# skip fluids and solids due to CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES on RTX 2080 Super
- nice make -k -j$NPROC_GPU junit BACKENDS="$BACKENDS_GPU" search="petsc"
# Report status
- touch .SUCCESS
after_script:
- |
if [ -f .SUCCESS ]; then
lcov --directory . --capture --output-file coverage.info;
bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F interface;
bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F gallery;
bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F backends;
bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F tests;
bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F examples;
fi
artifacts:
paths:
- build/*.junit
reports:
junit: build/*.junit