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 - 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