1# ---------------------------------------------------------------------------------------- 2# HONEE GitLab CI 3# ---------------------------------------------------------------------------------------- 4stages: 5 - test:stage-lint 6 - test:stage-memcheck 7 - test:stage-cpu 8 - test:stage-gpu 9 10.test-basic: 11 interruptible: true 12 only: 13 refs: 14 - web 15 - merge_requests 16 17.test: 18 extends: .test-basic 19 only: 20 refs: 21 - web 22 - merge_requests 23 - main 24 - release 25 except: 26 variables: 27 # Skip if the No-Code label is attached to a merge request (i.e., documentation only) 28 - $CI_MERGE_REQUEST_LABELS =~ /(^|,)No-Code($|,)/ 29 needs: 30 - job: docker-build 31 optional: true 32 33.docs: 34 image: python:3.10 35 before_script: 36 - pip install -r doc/requirements.txt 37 - apt-get update 38 - apt-get install -y doxygen librsvg2-bin 39 40 41# ---------------------------------------------------------------------------------------- 42# Test formatting and static analysis 43# ---------------------------------------------------------------------------------------- 44noether-lint: 45 stage: test:stage-lint 46 extends: .test 47 tags: 48 - noether 49 - shell 50 needs: [] 51 script: 52 - rm -f .SUCCESS 53 # Environment 54 - export COVERAGE=1 CC=gcc HIPCC=hipcc 55 - echo "-------------- nproc ---------------" && NPROC_CPU=$(nproc) && NPROC_GPU=$(($(nproc)<8?$(nproc):8)) && echo "NPROC_CPU" $NPROC_CPU && echo "NPROC_GPU" $NPROC_GPU 56 - echo "-------------- CC ------------------" && $CC --version 57 - echo "-------------- GCOV ----------------" && gcov --version 58 - echo "-------------- HIPCC ---------------" && $HIPCC --version && export HIP_DIR=/opt/rocm 59 # Libraries 60 # -- libCEED 61 - echo "-------------- libCEED -------------" 62 - export CEED_DIR=/projects/honee/libCEED && git -C $CEED_DIR -c safe.directory=$CEED_DIR describe && make -C $CEED_DIR info 63 # -- PETSc 64 - echo "-------------- PETSc ---------------" 65 - export PETSC_DIR=/projects/honee/petsc 66 - export PETSC_ARCH=arch-serial-gpu && git -C $PETSC_DIR -c safe.directory=$PETSC_DIR describe && make -C $PETSC_DIR info 67 - export PETSC_OPTIONS='-malloc_debug no' # faster tests 68 - export LD_LIBRARY_PATH=$PETSC_DIR/lib PATH="$PATH:$PETSC_DIR/bin" # cgnsdiff 69 # make with Werror, Wall, supress loop vectorization warnings 70 - echo "-------------- make Werror ---------" 71 - PEDANTIC=1 PEDANTICFLAGS="-Werror -Wall -Wno-pass-failed" make -j$NPROC_CPU lib 72 # make format 73 - echo "-------------- make format ---------" && export CLANG_FORMAT=clang-format-15 && $CLANG_FORMAT --version 74 - make -j$NPROC_CPU format && git diff --color=always --exit-code 75 # Clang-tidy 76 - echo "-------------- clang-tidy ----------" && export CLANG_TIDY=clang-tidy-15 && $CLANG_TIDY --version 77 - PETSC_ARCH=arch-serial-gpu make -j$NPROC_CPU tidy 78 # Report status 79 - touch .SUCCESS 80 81 82# ---------------------------------------------------------------------------------------- 83# Test memory access assumptions 84# ---------------------------------------------------------------------------------------- 85noether-memcheck: 86 stage: test:stage-memcheck 87 extends: .test 88 tags: 89 - noether 90 - shell 91 needs: [] 92 script: 93 - rm -f .SUCCESS 94 # Environment 95 # -- NOTE: Coverage disabled because it doesn't play nice with the ASAN options 96 - export CC=clang-15 97 - export NPROC_POOL=8 98 - echo "-------------- nproc ---------------" && NPROC_CPU=$(nproc) && NPROC_GPU=$(($(nproc)<8?$(nproc):8)) && echo "NPROC_CPU" $NPROC_CPU && echo "NPROC_GPU" $NPROC_GPU 99 - echo "-------------- CC ------------------" && $CC --version 100 # Libraries 101 # -- libCEED 102 - echo "-------------- libCEED -------------" 103 - export CEED_DIR=/projects/honee/libCEED-cpu && git -C $CEED_DIR -c safe.directory=$CEED_DIR describe && make -C $CEED_DIR info 104 # -- PETSc 105 - echo "-------------- PETSc ---------------" 106 - export PETSC_DIR=/projects/honee/petsc 107 - export PETSC_ARCH=arch-serial-cpu-clang && git -C $PETSC_DIR -c safe.directory=$PETSC_DIR describe && make -C $PETSC_DIR info 108 - export PETSC_OPTIONS='-malloc_debug no' # faster tests 109 - export LD_LIBRARY_PATH=$PETSC_DIR/lib PATH="$PATH:$PETSC_DIR/bin" # cgnsdiff 110 # ASAN 111 - echo "-------------- ASAN ----------------" 112 - export ASAN=1 AFLAGS="-fsanitize=address -fsanitize=leak" 113 - echo $AFLAGS 114 # HONEE 115 - echo "-------------- HONEE ---------------" && make info 116 - make clean 117 - make lib -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-cpu 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 lib -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-gpu 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 lib -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