xref: /honee/.gitlab-ci.yml (revision a447840acf83d5977ef0d2f01f3c4aaa857c71c0)
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    - echo "Tests intentionally skipped"
76    # - PETSC_ARCH=arch-serial-gpu make -j$NPROC_CPU tidy
77    # Report status
78    - touch .SUCCESS
79
80
81# ----------------------------------------------------------------------------------------
82# Test memory access assumptions
83# ----------------------------------------------------------------------------------------
84noether-memcheck:
85  stage: test:stage-lint
86  extends: .test
87  tags:
88    - noether
89    - shell
90  needs: []
91  script:
92    - rm -f .SUCCESS
93    # Environment
94    # -- NOTE: Coverage disabled because it doesn't play nice with the ASAN options
95    - export CC=clang-15
96    - export NPROC_POOL=8
97    - echo "-------------- nproc ---------------" && NPROC_CPU=$(nproc) && NPROC_GPU=$(($(nproc)<8?$(nproc):8)) && echo "NPROC_CPU" $NPROC_CPU && echo "NPROC_GPU" $NPROC_GPU
98    - echo "-------------- CC ------------------" && $CC --version
99    # Libraries
100    # -- libCEED
101    - echo "-------------- libCEED -------------"
102    - export CEED_DIR=/projects/honee/libCEED-cpu && git -C $CEED_DIR -c safe.directory=$CEED_DIR describe && make -C $CEED_DIR info
103    # -- PETSc
104    - echo "-------------- PETSc ---------------"
105    - export PETSC_DIR=/projects/honee/petsc
106    - export PETSC_ARCH=arch-serial-cpu-clang && git -C $PETSC_DIR -c safe.directory=$PETSC_DIR describe && make -C $PETSC_DIR info
107    - export PETSC_OPTIONS='-malloc_debug no' # faster tests
108    - export LD_LIBRARY_PATH=$PETSC_DIR/lib PATH="$PATH:$PETSC_DIR/bin" # cgnsdiff
109    # ASAN
110    - echo "-------------- ASAN ----------------"
111    - echo "ASAN intentionlly skipped, known leaks"
112    # - export ASAN=1 AFLAGS="-fsanitize=address -fsanitize=leak"
113    - echo $AFLAGS
114    # HONEE
115    - echo "-------------- HONEE ---------------" && make info
116    - make clean
117    - make -j$NPROC_CPU
118    # Test suite
119    - echo "-------------- HONEE tests ---------"
120    - 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
121    # -- Memcheck libCEED CPU backend, serial
122    - NPROC_TEST=1 make -k -j$((NPROC_CPU / NPROC_POOL)) CEED_BACKENDS="/cpu/self/memcheck" JUNIT_BATCH="cpu-serial-memcheck" junit realsearch=%
123    # Report status
124    - touch .SUCCESS
125  artifacts:
126    paths:
127      - build/*.junit
128    reports:
129      junit: build/*.junit
130      performance: performance.json
131    expire_in: 28 days
132
133
134# ----------------------------------------------------------------------------------------
135# CPU testing on Noether
136# ----------------------------------------------------------------------------------------
137noether-cpu:
138  stage: test:stage-full
139  extends: .test
140  tags:
141    - noether
142    - shell
143  script:
144    - rm -f .SUCCESS
145    # Environment
146    - export COVERAGE=1 CC=gcc HIPCC=hipcc
147    - export NPROC_POOL=4
148    - echo "-------------- nproc ---------------" && NPROC_CPU=$(nproc) && NPROC_GPU=$(($(nproc)<8?$(nproc):8)) && echo "NPROC_CPU" $NPROC_CPU && echo "NPROC_GPU" $NPROC_GPU
149    - echo "-------------- CC ------------------" && $CC --version
150    - echo "-------------- GCOV ----------------" && gcov --version
151    - echo "-------------- HIPCC ---------------" && $HIPCC --version && export HIP_DIR=/opt/rocm
152    # Libraries
153    # -- libCEED
154    - echo "-------------- libCEED -------------"
155    - export CEED_DIR=/projects/honee/libCEED && git -C $CEED_DIR -c safe.directory=$CEED_DIR describe && make -C $CEED_DIR info
156    # -- PETSc
157    - echo "-------------- PETSc ---------------"
158    - export PETSC_DIR=/projects/honee/petsc
159    - export PETSC_ARCH=arch-parallel-gpu && git -C $PETSC_DIR -c safe.directory=$PETSC_DIR describe && make -C $PETSC_DIR info
160    - export PETSC_OPTIONS='-malloc_debug no' # faster tests
161    - export LD_LIBRARY_PATH=$PETSC_DIR/$PETSC_ARCH/lib PATH="$PATH:$PETSC_DIR/$PETSC_ARCH/bin" # cgnsdiff
162    # HONEE
163    - echo "-------------- HONEE ---------------" && make info
164    - make clean
165    - make -j$NPROC_CPU
166    # Test suite
167    - echo "-------------- HONEE tests ---------"
168    - 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
169    # -- Fastest libCEED CPU backend, parallel
170    # Note: /shared is faster due to /gen JiT time for CeedOperators overwhelming runtime improvements at these problem sizes
171    - echo "Parallel tests skipped for now"
172    # - NPROC_TEST=2 make -k -j$((NPROC_GPU / NPROC_POOL / 2)) CEED_BACKENDS="/gpu/hip/shared" JUNIT_BATCH="cpu-parallel" junit realsearch=%
173    # Report status
174    - touch .SUCCESS
175  after_script:
176    - |
177      if [ -f .SUCCESS ]; then
178        gcovr --xml-pretty --exclude-unreachable-branches --print-summary -o coverage.xml;
179      fi
180  artifacts:
181    paths:
182      - coverage.xml
183      - build/*.junit
184    reports:
185      coverage_report:
186        coverage_format: cobertura
187        path: coverage.xml
188      junit: build/*.junit
189      performance: performance.json
190    expire_in: 28 days
191
192
193# ----------------------------------------------------------------------------------------
194# GPU testing on Noether
195# ----------------------------------------------------------------------------------------
196noether-gpu:
197  stage: test:stage-full
198  extends: .test
199  tags:
200    - noether
201    - shell
202  script:
203    - rm -f .SUCCESS
204    # Environment
205    - export COVERAGE=1 CC=gcc HIPCC=hipcc
206    - export NPROC_POOL=4
207    - echo "-------------- nproc ---------------" && NPROC_CPU=$(nproc) && NPROC_GPU=$(($(nproc)<8?$(nproc):8)) && echo "NPROC_CPU" $NPROC_CPU && echo "NPROC_GPU" $NPROC_GPU
208    - echo "-------------- CC ------------------" && $CC --version
209    - echo "-------------- GCOV ----------------" && gcov --version
210    - echo "-------------- HIPCC ---------------" && $HIPCC --version && export HIP_DIR=/opt/rocm
211    # Libraries
212    # -- libCEED
213    - echo "-------------- libCEED -------------"
214    - export CEED_DIR=/projects/honee/libCEED && git -C $CEED_DIR -c safe.directory=$CEED_DIR describe && make -C $CEED_DIR info
215    # -- PETSc
216    - echo "-------------- PETSc ---------------"
217    - export PETSC_DIR=/projects/honee/petsc
218    - export PETSC_ARCH=arch-parallel-gpu && git -C $PETSC_DIR -c safe.directory=$PETSC_DIR describe && make -C $PETSC_DIR info
219    - export PETSC_OPTIONS='-malloc_debug no' # faster tests
220    - export LD_LIBRARY_PATH=$PETSC_DIR/$PETSC_ARCH/lib PATH="$PATH:$PETSC_DIR/$PETSC_ARCH/bin" # cgnsdiff
221    # HONEE
222    - echo "-------------- HONEE ---------------" && make info
223    - make clean
224    - make -j$NPROC_CPU
225    # Test suite
226    - echo "-------------- HONEE tests ---------"
227    - 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
228    # -- Fastest libCEED HIP backend, serial
229    - NPROC_TEST=1 make -k -j$((NPROC_GPU / NPROC_POOL / 1)) CEED_BACKENDS="/cpu/self" JUNIT_BATCH="hip-serial" junit realsearch=%
230    # Report status
231    - touch .SUCCESS
232  after_script:
233    - |
234      if [ -f .SUCCESS ]; then
235        gcovr --xml-pretty --exclude-unreachable-branches --print-summary -o coverage.xml;
236      fi
237  artifacts:
238    paths:
239      - coverage.xml
240      - build/*.junit
241    reports:
242      coverage_report:
243        coverage_format: cobertura
244        path: coverage.xml
245      junit: build/*.junit
246      performance: performance.json
247    expire_in: 28 days
248