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