xref: /honee/.gitlab-ci.yml (revision a32db64d340db16914d4892be21e91c50f2a7cbd)
1# ----------------------------------------------------------------------------------------
2# HONEE GitLab CI
3# ----------------------------------------------------------------------------------------
4stages:
5  - test:stage-lint
6  - test:stage-full
7
8.test-basic:
9  interruptible: true
10  only:
11    refs:
12      - web
13      - merge_requests
14
15.test:
16  extends: .test-basic
17  only:
18    refs:
19      - web
20      - merge_requests
21      - main
22      - release
23  except:
24    variables:
25      # Skip if the No-Code label is attached to a merge request (i.e., documentation only)
26      - $CI_MERGE_REQUEST_LABELS =~ /(^|,)No-Code($|,)/
27  needs:
28    - job: docker-build
29      optional: true
30
31.docs:
32  image: python:3.10
33  before_script:
34    - pip install -r doc/requirements.txt
35    - apt-get update
36    - apt-get install -y doxygen librsvg2-bin
37
38
39# ----------------------------------------------------------------------------------------
40# Test formatting and static analysis
41# ----------------------------------------------------------------------------------------
42noether-lint:
43  stage: test:stage-lint
44  extends: .test
45  tags:
46    - noether
47    - shell
48  needs: []
49  script:
50    - rm -f .SUCCESS
51    # Environment
52    - export COVERAGE=1 CC=gcc HIPCC=hipcc
53    - echo "-------------- nproc ---------------" && NPROC_CPU=$(nproc) && NPROC_GPU=$(($(nproc)<8?$(nproc):8)) && echo "NPROC_CPU" $NPROC_CPU && echo "NPROC_GPU" $NPROC_GPU
54    - echo "-------------- CC ------------------" && $CC --version
55    - echo "-------------- GCOV ----------------" && gcov --version
56    - echo "-------------- HIPCC ---------------" && $HIPCC --version && export HIP_DIR=/opt/rocm
57    # Libraries
58    # -- libCEED
59    - echo "-------------- libCEED -------------"
60    - export CEED_DIR=/projects/honee/libCEED && git -C $CEED_DIR -c safe.directory=$CEED_DIR describe && make -C $CEED_DIR info
61    # -- PETSc
62    - echo "-------------- PETSc ---------------"
63    - export PETSC_DIR=/projects/honee/petsc
64    - export PETSC_ARCH=arch-serial-gpu && git -C $PETSC_DIR -c safe.directory=$PETSC_DIR describe && make -C $PETSC_DIR info
65    - export PETSC_OPTIONS='-malloc_debug no' # faster tests
66    - export LD_LIBRARY_PATH=$PETSC_DIR/lib PATH="$PATH:$PETSC_DIR/bin" # cgnsdiff
67    # make with Werror, Wall, supress loop vectorization warnings
68    - echo "-------------- make Werror ---------"
69    - PEDANTIC=1 PEDANTICFLAGS="-Werror -Wall -Wno-pass-failed" make -j$NPROC_CPU
70    # make format
71    - echo "-------------- make format ---------" && export CLANG_FORMAT=clang-format-15 && $CLANG_FORMAT --version
72    - make -j$NPROC_CPU format && git diff --color=always --exit-code
73    # Clang-tidy
74    - echo "-------------- clang-tidy ----------" && export CLANG_TIDY=clang-tidy-15 && $CLANG_TIDY --version
75    - PETSC_ARCH=arch-serial-gpu make -j$NPROC_CPU tidy
76    # Report status
77    - touch .SUCCESS
78
79
80# ----------------------------------------------------------------------------------------
81# Test memory access assumptions
82# ----------------------------------------------------------------------------------------
83noether-memcheck:
84  stage: test:stage-lint
85  extends: .test
86  tags:
87    - noether
88    - shell
89  needs: []
90  script:
91    - rm -f .SUCCESS
92    # Environment
93    # -- NOTE: Coverage disabled because it doesn't play nice with the ASAN options
94    - export CC=clang-15
95    - export NPROC_POOL=8
96    - echo "-------------- nproc ---------------" && NPROC_CPU=$(nproc) && NPROC_GPU=$(($(nproc)<8?$(nproc):8)) && echo "NPROC_CPU" $NPROC_CPU && echo "NPROC_GPU" $NPROC_GPU
97    - echo "-------------- CC ------------------" && $CC --version
98    # Libraries
99    # -- libCEED
100    - echo "-------------- libCEED -------------"
101    - export CEED_DIR=/projects/honee/libCEED-cpu && git -C $CEED_DIR -c safe.directory=$CEED_DIR describe && make -C $CEED_DIR info
102    # -- PETSc
103    - echo "-------------- PETSc ---------------"
104    - export PETSC_DIR=/projects/honee/petsc
105    - export PETSC_ARCH=arch-serial-cpu-clang && git -C $PETSC_DIR -c safe.directory=$PETSC_DIR describe && make -C $PETSC_DIR info
106    - export PETSC_OPTIONS='-malloc_debug no' # faster tests
107    - export LD_LIBRARY_PATH=$PETSC_DIR/lib PATH="$PATH:$PETSC_DIR/bin" # cgnsdiff
108    # ASAN
109    - echo "-------------- ASAN ----------------"
110    - echo "ASAN intentionlly skipped, known leaks"
111    # - export ASAN=1 AFLAGS="-fsanitize=address -fsanitize=leak"
112    - echo $AFLAGS
113    # HONEE
114    - echo "-------------- HONEE ---------------" && make info
115    - make clean
116    - make -j$NPROC_CPU
117    # Test suite
118    - echo "-------------- HONEE tests ---------"
119    - 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
120    # -- Memcheck libCEED CPU backend, serial
121    - NPROC_TEST=1 make -k -j$((NPROC_CPU / NPROC_POOL)) CEED_BACKENDS="/cpu/self/memcheck" JUNIT_BATCH="cpu-serial-memcheck" junit realsearch=%
122    # Report status
123    - touch .SUCCESS
124  artifacts:
125    paths:
126      - build/*.junit
127    reports:
128      junit: build/*.junit
129      performance: performance.json
130    expire_in: 28 days
131
132
133# ----------------------------------------------------------------------------------------
134# CPU testing on Noether
135# ----------------------------------------------------------------------------------------
136noether-cpu:
137  stage: test:stage-full
138  extends: .test
139  tags:
140    - noether
141    - shell
142  script:
143    - rm -f .SUCCESS
144    # Environment
145    - export COVERAGE=1 CC=gcc HIPCC=hipcc
146    - export NPROC_POOL=4
147    - echo "-------------- nproc ---------------" && NPROC_CPU=$(nproc) && NPROC_GPU=$(($(nproc)<8?$(nproc):8)) && echo "NPROC_CPU" $NPROC_CPU && echo "NPROC_GPU" $NPROC_GPU
148    - echo "-------------- CC ------------------" && $CC --version
149    - echo "-------------- GCOV ----------------" && gcov --version
150    - echo "-------------- HIPCC ---------------" && $HIPCC --version && export HIP_DIR=/opt/rocm
151    # Libraries
152    # -- libCEED
153    - echo "-------------- libCEED -------------"
154    - export CEED_DIR=/projects/honee/libCEED && git -C $CEED_DIR -c safe.directory=$CEED_DIR describe && make -C $CEED_DIR info
155    # -- PETSc
156    - echo "-------------- PETSc ---------------"
157    - export PETSC_DIR=/projects/honee/petsc
158    - export PETSC_ARCH=arch-parallel-gpu && git -C $PETSC_DIR -c safe.directory=$PETSC_DIR describe && make -C $PETSC_DIR info
159    - export PETSC_OPTIONS='-malloc_debug no' # faster tests
160    - export LD_LIBRARY_PATH=$PETSC_DIR/$PETSC_ARCH/lib PATH="$PATH:$PETSC_DIR/$PETSC_ARCH/bin" # cgnsdiff
161    # HONEE
162    - echo "-------------- HONEE ---------------" && make info
163    - make clean
164    - make -j$NPROC_CPU
165    # Test suite
166    - echo "-------------- HONEE tests ---------"
167    - 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
168    # -- Fastest libCEED CPU backend, parallel
169    # Note: /shared is faster due to /gen JiT time for CeedOperators overwhelming runtime improvements at these problem sizes
170    - echo "Parallel tests skipped for now"
171    # - NPROC_TEST=2 make -k -j$((NPROC_GPU / NPROC_POOL / 2)) CEED_BACKENDS="/gpu/hip/shared" JUNIT_BATCH="cpu-parallel" junit realsearch=%
172    # Report status
173    - touch .SUCCESS
174  after_script:
175    - |
176      if [ -f .SUCCESS ]; then
177        gcovr --xml-pretty --exclude-unreachable-branches --print-summary -o coverage.xml;
178      fi
179  artifacts:
180    paths:
181      - coverage.xml
182      - build/*.junit
183    reports:
184      coverage_report:
185        coverage_format: cobertura
186        path: coverage.xml
187      junit: build/*.junit
188      performance: performance.json
189    expire_in: 28 days
190
191
192# ----------------------------------------------------------------------------------------
193# GPU testing on Noether
194# ----------------------------------------------------------------------------------------
195noether-gpu:
196  stage: test:stage-full
197  extends: .test
198  tags:
199    - noether
200    - shell
201  script:
202    - rm -f .SUCCESS
203    # Environment
204    - export COVERAGE=1 CC=gcc HIPCC=hipcc
205    - export NPROC_POOL=4
206    - echo "-------------- nproc ---------------" && NPROC_CPU=$(nproc) && NPROC_GPU=$(($(nproc)<8?$(nproc):8)) && echo "NPROC_CPU" $NPROC_CPU && echo "NPROC_GPU" $NPROC_GPU
207    - echo "-------------- CC ------------------" && $CC --version
208    - echo "-------------- GCOV ----------------" && gcov --version
209    - echo "-------------- HIPCC ---------------" && $HIPCC --version && export HIP_DIR=/opt/rocm
210    # Libraries
211    # -- libCEED
212    - echo "-------------- libCEED -------------"
213    - export CEED_DIR=/projects/honee/libCEED && git -C $CEED_DIR -c safe.directory=$CEED_DIR describe && make -C $CEED_DIR info
214    # -- PETSc
215    - echo "-------------- PETSc ---------------"
216    - export PETSC_DIR=/projects/honee/petsc
217    - export PETSC_ARCH=arch-parallel-gpu && git -C $PETSC_DIR -c safe.directory=$PETSC_DIR describe && make -C $PETSC_DIR info
218    - export PETSC_OPTIONS='-malloc_debug no' # faster tests
219    - export LD_LIBRARY_PATH=$PETSC_DIR/$PETSC_ARCH/lib PATH="$PATH:$PETSC_DIR/$PETSC_ARCH/bin" # cgnsdiff
220    # HONEE
221    - echo "-------------- HONEE ---------------" && make info
222    - make clean
223    - make -j$NPROC_CPU
224    # Test suite
225    - echo "-------------- HONEE tests ---------"
226    - 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
227    # -- Fastest libCEED HIP backend, serial
228    - NPROC_TEST=1 make -k -j$((NPROC_GPU / NPROC_POOL / 1)) CEED_BACKENDS="/cpu/self" JUNIT_BATCH="hip-serial" junit realsearch=%
229    # Report status
230    - touch .SUCCESS
231  after_script:
232    - |
233      if [ -f .SUCCESS ]; then
234        gcovr --xml-pretty --exclude-unreachable-branches --print-summary -o coverage.xml;
235      fi
236  artifacts:
237    paths:
238      - coverage.xml
239      - build/*.junit
240    reports:
241      coverage_report:
242        coverage_format: cobertura
243        path: coverage.xml
244      junit: build/*.junit
245      performance: performance.json
246    expire_in: 28 days
247