xref: /libCEED/.gitlab-ci.yml (revision 7ad93db142e270d25656527d7e9abc8dac4a6205)
153928bd0SJeremy L Thompson# ----------------------------------------------------------------------------------------
253928bd0SJeremy L Thompson# libCEED GitLab CI
353928bd0SJeremy L Thompson# ----------------------------------------------------------------------------------------
409f072d1SJed Brownstages:
51e31b501SJeremy L Thompson  - test:cpu-and-tidy
61e31b501SJeremy L Thompson  - test:gpu-and-float
71e31b501SJeremy L Thompson
853af4701SJeremy L Thompsonworkflow:
953af4701SJeremy L Thompson  auto_cancel:
1053af4701SJeremy L Thompson    on_job_failure: all
1153af4701SJeremy L Thompson
1226a4920cSJeremy L Thompson
1353928bd0SJeremy L Thompson# ----------------------------------------------------------------------------------------
1453928bd0SJeremy L Thompson# Memcheck backends + ASAN
1553928bd0SJeremy L Thompson# ----------------------------------------------------------------------------------------
1653928bd0SJeremy L Thompsonnoether-asan:
1753928bd0SJeremy L Thompson  stage: test:cpu-and-tidy
1853928bd0SJeremy L Thompson  tags:
1953928bd0SJeremy L Thompson    - cpu
2053928bd0SJeremy L Thompson  interruptible: true
2153928bd0SJeremy L Thompson  before_script:
2253928bd0SJeremy L Thompson    # Environment
239e9358dcSJeremy L Thompson    #    Note: COVERAGE=0 is needed when using ASAN
2453928bd0SJeremy L Thompson    - export COVERAGE=0 CC=gcc CXX=g++ FC=gfortran
2553928bd0SJeremy L Thompson    - export NPROC_POOL=8
2653928bd0SJeremy L Thompson    - echo "-------------- nproc ---------------" && NPROC_CPU=$(nproc) && NPROC_GPU=$(($(nproc)<8?$(nproc):8)) && echo "NPROC_CPU" $NPROC_CPU && echo "NPROC_GPU" $NPROC_GPU
2753928bd0SJeremy L Thompson    - echo "-------------- CC ------------------" && $CC --version
2853928bd0SJeremy L Thompson    - echo "-------------- CXX -----------------" && $CXX --version
2953928bd0SJeremy L Thompson    - echo "-------------- FC ------------------" && $FC --version
3053928bd0SJeremy L Thompson    # ASAN
3153928bd0SJeremy L Thompson    - echo "-------------- ASAN ----------------"
3253928bd0SJeremy L Thompson    - export ASAN=1 AFLAGS="-fsanitize=address -fsanitize=leak"
3353928bd0SJeremy L Thompson    - echo $AFLAGS
3453928bd0SJeremy L Thompson  script:
3553928bd0SJeremy L Thompson    - rm -f .SUCCESS
3653928bd0SJeremy L Thompson    # libCEED
3753928bd0SJeremy L Thompson    - make configure OPT='-O -march=native -ffp-contract=fast'
38ad037b63SJeremy L Thompson    - BACKENDS_CPU=$(make info-backends-all | grep -o '/cpu[^ ]*' | tr '\n' ' ')
3953928bd0SJeremy L Thompson    - echo "-------------- libCEED -------------" && make info
40ad037b63SJeremy L Thompson    - echo "-------------- BACKENDS_CPU --------" && echo $BACKENDS_CPU
413bcf805fSJeremy L Thompson    - make clean
4253928bd0SJeremy L Thompson    - make -j$NPROC_CPU
4353928bd0SJeremy L Thompson    # -- libCEED only tests
4453928bd0SJeremy L Thompson    - echo "-------------- core tests ----------"
4553928bd0SJeremy L Thompson    - 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
4653928bd0SJeremy L Thompson    #    Note: PETSC_DIR is set by default in GitLab runner env, unsetting to isolate core tests
4753928bd0SJeremy L Thompson    - export PETSC_DIR= PETSC_ARCH=
48ad037b63SJeremy L Thompson    - make -k -j$((NPROC_CPU / NPROC_POOL)) BACKENDS="$BACKENDS_CPU" JUNIT_BATCH="memcheck" junit realsearch=%
4953928bd0SJeremy L Thompson    # Clang-tidy
5053928bd0SJeremy L Thompson    - echo "-------------- clang-tidy ----------" && clang-tidy --version
519e9358dcSJeremy L Thompson    - TIDY_OPTS="-fix-errors" make -j$NPROC_CPU tidy && git diff --color=always --exit-code
5253928bd0SJeremy L Thompson    # Report status
5353928bd0SJeremy L Thompson    - touch .SUCCESS
5453928bd0SJeremy L Thompson  artifacts:
5553928bd0SJeremy L Thompson    paths:
5653928bd0SJeremy L Thompson      - build/*.junit
5753928bd0SJeremy L Thompson    reports:
5853928bd0SJeremy L Thompson      junit: build/*.junit
5953928bd0SJeremy L Thompson      performance: performance.json
6053928bd0SJeremy L Thompson
6153928bd0SJeremy L Thompson
6253928bd0SJeremy L Thompson# ----------------------------------------------------------------------------------------
6353928bd0SJeremy L Thompson# CPU backends only + make tidy
6453928bd0SJeremy L Thompson# ----------------------------------------------------------------------------------------
651e31b501SJeremy L Thompsonnoether-cpu:
661e31b501SJeremy L Thompson  stage: test:cpu-and-tidy
671e31b501SJeremy L Thompson  tags:
681e31b501SJeremy L Thompson    - cpu
691e31b501SJeremy L Thompson  interruptible: true
701e31b501SJeremy L Thompson  before_script:
711e31b501SJeremy L Thompson    # Environment
729e9358dcSJeremy L Thompson    - export COVERAGE=1 CC=gcc CXX=g++ FC=gfortran
7319868e18SZach Atkins    - export NPROC_POOL=8
741e31b501SJeremy L Thompson    - echo "-------------- nproc ---------------" && NPROC_CPU=$(nproc) && NPROC_GPU=$(($(nproc)<8?$(nproc):8)) && echo "NPROC_CPU" $NPROC_CPU && echo "NPROC_GPU" $NPROC_GPU
751e31b501SJeremy L Thompson    - echo "-------------- CC ------------------" && $CC --version
761e31b501SJeremy L Thompson    - echo "-------------- CXX -----------------" && $CXX --version
771e31b501SJeremy L Thompson    - echo "-------------- FC ------------------" && $FC --version
781e31b501SJeremy L Thompson    - echo "-------------- GCOV ----------------" && gcov --version
791e31b501SJeremy L Thompson    # Libraries for backends
80ed721ed8SJeremy L Thompson    # -- LIBXSMM 7 April 2024
81ed721ed8SJeremy L Thompson    - cd .. && export XSMM_HASH=94ee71576870152feb62f3f0cf6b061d036dcdb5 && { [[ -d libxsmm-$XSMM_HASH ]] || { curl -L https://github.com/libxsmm/libxsmm/archive/$XSMM_HASH.tar.gz -o xsmm.tar.gz && tar zvxf xsmm.tar.gz && rm xsmm.tar.gz && make -C libxsmm-$XSMM_HASH -j$(nproc); }; } && export XSMM_DIR=$PWD/libxsmm-$XSMM_HASH && cd libCEED
8268c150f8SJed Brown    - echo "-------------- LIBXSMM -------------" && basename $XSMM_DIR
83a4b1483eSJeremy L Thompson    # -- OCCA v1.6.0
84a4b1483eSJeremy L Thompson    - cd .. && export OCCA_VERSION=occa-1.6.0 && { [[ -d $OCCA_VERSION ]] || { git clone --depth 1 --branch v1.6.0 https://github.com/libocca/occa.git $OCCA_VERSION && cd $OCCA_VERSION && export ENABLE_OPENCL="OFF" ENABLE_DPCPP="OFF" ENABLE_HIP="OFF" ENABLE_CUDA="OFF" && ./configure-cmake.sh && cmake --build build --parallel $NPROC_CPU && cmake --install build && cd ..; }; } && export OCCA_DIR=$PWD/$OCCA_VERSION/install && cd libCEED
850be03a92SJeremy L Thompson    - echo "-------------- OCCA ----------------" && git -C $OCCA_DIR describe --tags && LD_LIBRARY_PATH=$OCCA_DIR/lib $OCCA_DIR/bin/occa info
861e31b501SJeremy L Thompson  script:
871e31b501SJeremy L Thompson    - rm -f .SUCCESS
881e31b501SJeremy L Thompson    # libCEED
891e31b501SJeremy L Thompson    - make configure OPT='-O -march=native -ffp-contract=fast'
901b16049aSZach Atkins    - BACKENDS_CPU=$(make info-backends-all | grep -o '/cpu[^ ]*' | tr '\n' ' ')
911e31b501SJeremy L Thompson    - echo "-------------- libCEED -------------" && make info
921e31b501SJeremy L Thompson    - echo "-------------- BACKENDS_CPU --------" && echo $BACKENDS_CPU
933bcf805fSJeremy L Thompson    - make clean
942c2ea1dbSJeremy L Thompson    - OCCA_DIR= PEDANTIC=1 make -j$NPROC_CPU
951e31b501SJeremy L Thompson    - make -j$NPROC_CPU
961e31b501SJeremy L Thompson    # -- libCEED only tests
971e31b501SJeremy L Thompson    - echo "-------------- core tests ----------"
981e31b501SJeremy L Thompson    - 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
991e31b501SJeremy L Thompson    #    Note: PETSC_DIR is set by default in GitLab runner env, unsetting to isolate core tests
1001e31b501SJeremy L Thompson    - export PETSC_DIR= PETSC_ARCH=
10119868e18SZach Atkins    - make -k -j$((NPROC_CPU / NPROC_POOL)) BACKENDS="$BACKENDS_CPU" JUNIT_BATCH="cpu" junit realsearch=%
1021e31b501SJeremy L Thompson    # Libraries for examples
103e5422a12SJeremy L Thompson    # -- PETSc (minimal)
1043472baabSJeremy L Thompson    - export PETSC_DIR=/projects/petsc PETSC_ARCH=mpich-cpu-int64 && git -C $PETSC_DIR -c safe.directory=$PETSC_DIR describe
1051e31b501SJeremy L Thompson    - echo "-------------- PETSc ---------------" && make -C $PETSC_DIR info
106637c7b11SJames Wright    - make -k -j$((NPROC_CPU / NPROC_POOL)) BACKENDS="$BACKENDS_CPU" JUNIT_BATCH="cpu" junit search="petsc fluids-navierstokes solids"
107a64df932SJeremy L Thompson    # -- MFEM v4.7
108a64df932SJeremy L Thompson    - cd .. && export MFEM_VERSION=mfem-4.7 && { [[ -d $MFEM_VERSION ]] || { git clone --depth 1 --branch v4.7 https://github.com/mfem/mfem.git $MFEM_VERSION && make -C $MFEM_VERSION -j$(nproc) serial CXXFLAGS="-O -std=c++11"; }; } && export MFEM_DIR=$PWD/$MFEM_VERSION && cd libCEED
1091e31b501SJeremy L Thompson    - echo "-------------- MFEM ----------------" && make -C $MFEM_DIR info
11019868e18SZach Atkins    - make -k -j$((NPROC_CPU / NPROC_POOL)) BACKENDS="$BACKENDS_CPU" JUNIT_BATCH="cpu" junit search=mfem
1111e31b501SJeremy L Thompson    # -- Nek5000 v19.0
1121e31b501SJeremy L Thompson    - export COVERAGE=0
1131e31b501SJeremy L Thompson    - cd .. && export NEK5K_VERSION=Nek5000-19.0 && { [[ -d $NEK5K_VERSION ]] || { git clone --depth 1 --branch v19.0 https://github.com/Nek5000/Nek5000.git $NEK5K_VERSION && cd $NEK5K_VERSION/tools && ./maketools genbox genmap reatore2 && cd ../..; }; } && export NEK5K_DIR=$PWD/$NEK5K_VERSION && export PATH=$NEK5K_DIR/bin:$PATH MPI=0 && cd libCEED
1141e31b501SJeremy L Thompson    - echo "-------------- Nek5000 -------------" && git -C $NEK5K_DIR describe --tags
11519868e18SZach Atkins    - export NPROC_POOL=1
116b41f14d5SJeremy L Thompson    - make -k -j$NPROC_CPU BACKENDS="$BACKENDS_CPU" JUNIT_BATCH="cpu" junit search=nek NEK5K_DIR=$NEK5K_DIR
1178c81f8b0SPeter Munch    # -- deal.II 8bd5c262f13e15793aa206b6eed8774a9b25ce11
1188c81f8b0SPeter Munch    - OCCA_DIR= BACKENDS_CPU=$(make info-backends-all | grep -o '/cpu[^ ]*' | tr '\n' ' ')
1198c81f8b0SPeter Munch    - export DEAL_II_ROOT_DIR=/projects/dealii DEAL_II_DIR=/projects/dealii/install
1208c81f8b0SPeter Munch    - echo "-------------- deal.II -------------" && git -C $DEAL_II_ROOT_DIR -c safe.directory=$DEAL_II_ROOT_DIR describe --always
1218c81f8b0SPeter Munch    - make -k -j$NPROC_CPU BACKENDS="$BACKENDS_CPU" JUNIT_BATCH="cpu" junit search=dealii DEAL_II_DIR=$DEAL_II_DIR
1221e31b501SJeremy L Thompson    # Report status
1231e31b501SJeremy L Thompson    - touch .SUCCESS
1241e31b501SJeremy L Thompson  after_script:
1251e31b501SJeremy L Thompson    - |
1261e31b501SJeremy L Thompson      if [ -f .SUCCESS ]; then
1271e31b501SJeremy L Thompson        lcov --directory . --capture --output-file coverage.info;
1281e31b501SJeremy L Thompson        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F interface;
1291e31b501SJeremy L Thompson        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F gallery;
1301e31b501SJeremy L Thompson        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F backends;
1311e31b501SJeremy L Thompson        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F tests;
1321e31b501SJeremy L Thompson        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F examples;
1331e31b501SJeremy L Thompson      fi
1341e31b501SJeremy L Thompson  artifacts:
1351e31b501SJeremy L Thompson    paths:
1361e31b501SJeremy L Thompson      - build/*.junit
1371e31b501SJeremy L Thompson    reports:
1381e31b501SJeremy L Thompson      junit: build/*.junit
1391e31b501SJeremy L Thompson      performance: performance.json
14009f072d1SJed Brown
14126a4920cSJeremy L Thompson
14253928bd0SJeremy L Thompson# ----------------------------------------------------------------------------------------
14353928bd0SJeremy L Thompson# Check SYCL backends build
14453928bd0SJeremy L Thompson# ----------------------------------------------------------------------------------------
145ff186337SJeremy L Thompson
146ff186337SJeremy L Thompson# SYCL tests currently disabled
147ff186337SJeremy L Thompson
148ff186337SJeremy L Thompson#noether-sycl:
149ff186337SJeremy L Thompson#  stage: test:gpu-and-float
150ff186337SJeremy L Thompson#  tags:
151ff186337SJeremy L Thompson#    - sycl
152ff186337SJeremy L Thompson#  interruptible: true
153ff186337SJeremy L Thompson#  before_script:
154ff186337SJeremy L Thompson#    # Environment
155ff186337SJeremy L Thompson#    - . /opt/intel/oneapi/setvars.sh
156ff186337SJeremy L Thompson#    - export COVERAGE=1 CC=icx CXX=icpx
157ff186337SJeremy L Thompson#    - export NPROC_POOL=8
158ff186337SJeremy L Thompson#    - echo "-------------- nproc ---------------" && NPROC_CPU=$(nproc) && NPROC_GPU=$(($(nproc)<8?$(nproc):8)) && echo "NPROC_CPU" $NPROC_CPU && echo "NPROC_GPU" $NPROC_GPU
159ff186337SJeremy L Thompson#    - echo "-------------- CC ------------------" && $CC --version
160ff186337SJeremy L Thompson#    - echo "-------------- CXX -----------------" && $CXX --version
161ff186337SJeremy L Thompson#  script:
162ff186337SJeremy L Thompson#    - rm -f .SUCCESS
163ff186337SJeremy L Thompson#    # libCEED
164ff186337SJeremy L Thompson#    - make configure SYCL_DIR=/opt/intel/oneapi/compiler/latest OPT='-O -march=native -ffp-contract=fast'
165ff186337SJeremy L Thompson#    - BACKENDS_SYCL=$(make info-backends-all | grep -o '/sycl[^ ]*' | tr '\n' ' ')
166ff186337SJeremy L Thompson#    - echo "-------------- libCEED -------------" && make info
167ff186337SJeremy L Thompson#    - echo "-------------- BACKENDS_SYCL -------" && echo $BACKENDS_SYCL
168ff186337SJeremy L Thompson#    - make clean
169ff186337SJeremy L Thompson#    - make -j$NPROC_CPU
170ff186337SJeremy L Thompson#    # Report status
171ff186337SJeremy L Thompson#    - touch .SUCCESS
17226a4920cSJeremy L Thompson
17326a4920cSJeremy L Thompson
17453928bd0SJeremy L Thompson# ----------------------------------------------------------------------------------------
17553928bd0SJeremy L Thompson# CUDA backends
17653928bd0SJeremy L Thompson# ----------------------------------------------------------------------------------------
17753928bd0SJeremy L Thompsonnoether-cuda:
17853928bd0SJeremy L Thompson  stage: test:gpu-and-float
17953928bd0SJeremy L Thompson  tags:
18053928bd0SJeremy L Thompson    - cuda
18153928bd0SJeremy L Thompson  interruptible: true
18253928bd0SJeremy L Thompson  before_script:
18353928bd0SJeremy L Thompson    # Environment
18453928bd0SJeremy L Thompson    - export COVERAGE=1 CC=gcc CXX=g++ FC=gfortran NVCC=nvcc
18553928bd0SJeremy L Thompson    - export NPROC_POOL=4
18653928bd0SJeremy L Thompson    - echo "-------------- nproc ---------------" && NPROC_CPU=$(nproc) && NPROC_GPU=$(($(nproc)<8?$(nproc):8)) && echo "NPROC_CPU" $NPROC_CPU && echo "NPROC_GPU" $NPROC_GPU
18753928bd0SJeremy L Thompson    - echo "-------------- CC ------------------" && $CC --version
18853928bd0SJeremy L Thompson    - echo "-------------- CXX -----------------" && $CXX --version
18953928bd0SJeremy L Thompson    - echo "-------------- FC ------------------" && $FC --version
19053928bd0SJeremy L Thompson    - echo "-------------- NVCC ----------------" && $NVCC --version
19153928bd0SJeremy L Thompson    - echo "-------------- GCOV ----------------" && gcov --version
19213da2136SJeremy L Thompson    # ASAN
19313da2136SJeremy L Thompson    - echo "-------------- ASAN ----------------"
19413da2136SJeremy L Thompson    - export ASAN=1 AFLAGS="-fsanitize=address -fsanitize=leak" ASAN_OPTIONS=protect_shadow_gap=0
19513da2136SJeremy L Thompson    - echo $AFLAGS
19653928bd0SJeremy L Thompson  script:
19753928bd0SJeremy L Thompson    - rm -f .SUCCESS
19853928bd0SJeremy L Thompson    # libCEED
199*7ad93db1SJed Brown    - make configure OPT='-O -march=native -ffp-contract=fast' CUDA_DIR=/usr/local/cuda-12.9
20053928bd0SJeremy L Thompson    - echo "-------------- libCEED -------------" && make info
20153928bd0SJeremy L Thompson    - BACKENDS_GPU=$(make info-backends | grep -o '/gpu[^ ]*' | tr '\n' ' ')
20253928bd0SJeremy L Thompson    - echo "-------------- BACKENDS_GPU --------" && echo $BACKENDS_GPU
2033bcf805fSJeremy L Thompson    - make clean
20453928bd0SJeremy L Thompson    - PEDANTIC=1 make -k -j$NPROC_CPU -l$NPROC_CPU
20553928bd0SJeremy L Thompson    # -- libCEED only tests
20653928bd0SJeremy L Thompson    - echo "-------------- core tests ----------"
20753928bd0SJeremy L Thompson    #    Note: PETSC_DIR is set by default in GitLab runner env, unsetting to isolate core tests
20853928bd0SJeremy L Thompson    - export PETSC_DIR= PETSC_ARCH=
20953928bd0SJeremy L Thompson    - make -k -j$((NPROC_GPU / NPROC_POOL)) BACKENDS="$BACKENDS_GPU" JUNIT_BATCH="cuda" junit realsearch=%
21013da2136SJeremy L Thompson    # Rebuild without ASAN
211f3296101SJeremy L Thompson    - unset ASAN AFLAGS ASAN_OPTIONS
21213da2136SJeremy L Thompson    - make clean
21313da2136SJeremy L Thompson    - PEDANTIC=1 make -k -j$NPROC_CPU -l$NPROC_CPU
21453928bd0SJeremy L Thompson    # Libraries for examples
21553928bd0SJeremy L Thompson    # -- PETSc with CUDA (minimal)
21653928bd0SJeremy L Thompson    - export PETSC_DIR=/projects/petsc PETSC_ARCH=mpich-cuda-O PETSC_OPTIONS='-use_gpu_aware_mpi 0' && git -C $PETSC_DIR -c safe.directory=$PETSC_DIR describe
21753928bd0SJeremy L Thompson    - echo "-------------- PETSc ---------------" && make -C $PETSC_DIR info
21838f1a2a7SJeremy L Thompson    - make -k -j$((NPROC_GPU / NPROC_POOL)) BACKENDS="$BACKENDS_GPU" JUNIT_BATCH="cuda" junit search="petsc fluids solids"
21938f1a2a7SJeremy L Thompson    # -- MFEM v4.7
22038f1a2a7SJeremy L Thompson    - cd .. && export MFEM_VERSION=mfem-4.7 && { [[ -d $MFEM_VERSION ]] || { git clone --depth 1 --branch v4.7 https://github.com/mfem/mfem.git $MFEM_VERSION && make -C $MFEM_VERSION -j$(nproc) serial CXXFLAGS="-O -std=c++11"; }; } && export MFEM_DIR=$PWD/$MFEM_VERSION && cd libCEED
22138f1a2a7SJeremy L Thompson    - echo "-------------- MFEM ----------------" && make -C $MFEM_DIR info
22238f1a2a7SJeremy L Thompson    - make -k -j$((NPROC_GPU / NPROC_POOL)) BACKENDS="$BACKENDS_GPU" JUNIT_BATCH="cuda" junit search=mfem
22338f1a2a7SJeremy L Thompson    # -- Nek5000 v19.0
22438f1a2a7SJeremy L Thompson    - export COVERAGE=0
22538f1a2a7SJeremy L Thompson    - cd .. && export NEK5K_VERSION=Nek5000-19.0 && { [[ -d $NEK5K_VERSION ]] || { git clone --depth 1 --branch v19.0 https://github.com/Nek5000/Nek5000.git $NEK5K_VERSION && cd $NEK5K_VERSION/tools && ./maketools genbox genmap reatore2 && cd ../..; }; } && export NEK5K_DIR=$PWD/$NEK5K_VERSION && export PATH=$NEK5K_DIR/bin:$PATH MPI=0 && cd libCEED
22638f1a2a7SJeremy L Thompson    - echo "-------------- Nek5000 -------------" && git -C $NEK5K_DIR describe --tags
22738f1a2a7SJeremy L Thompson    - export NPROC_POOL=1
22838f1a2a7SJeremy L Thompson    - make -k -j$NPROC_GPU BACKENDS="$BACKENDS_GPU" JUNIT_BATCH="cuda" junit search=nek NEK5K_DIR=$NEK5K_DIR
22938f1a2a7SJeremy L Thompson    # -- deal.II 8bd5c262f13e15793aa206b6eed8774a9b25ce11
23038f1a2a7SJeremy L Thompson    - export DEAL_II_ROOT_DIR=/projects/dealii DEAL_II_DIR=/projects/dealii/install
23138f1a2a7SJeremy L Thompson    - echo "-------------- deal.II -------------" && git -C $DEAL_II_ROOT_DIR -c safe.directory=$DEAL_II_ROOT_DIR describe --always
23238f1a2a7SJeremy L Thompson    - make -k -j$((NPROC_GPU / NPROC_POOL)) BACKENDS="$BACKENDS_GPU" JUNIT_BATCH="cuda" junit search=dealii DEAL_II_DIR=$DEAL_II_DIR
2339e9358dcSJeremy L Thompson    # Clang-tidy
2349e9358dcSJeremy L Thompson    - echo "-------------- clang-tidy ----------" && clang-tidy --version
2359e9358dcSJeremy L Thompson    - TIDY_OPTS="-fix-errors" make -j$NPROC_CPU tidy && git diff --color=always --exit-code
23653928bd0SJeremy L Thompson    # Report status
23753928bd0SJeremy L Thompson    - touch .SUCCESS
23853928bd0SJeremy L Thompson  after_script:
23953928bd0SJeremy L Thompson    - |
24053928bd0SJeremy L Thompson      if [ -f .SUCCESS ]; then
24153928bd0SJeremy L Thompson        lcov --directory . --capture --output-file coverage.info;
24253928bd0SJeremy L Thompson        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F interface;
24353928bd0SJeremy L Thompson        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F gallery;
24453928bd0SJeremy L Thompson        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F backends;
24553928bd0SJeremy L Thompson        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F tests;
24653928bd0SJeremy L Thompson        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F examples;
24753928bd0SJeremy L Thompson      fi
24853928bd0SJeremy L Thompson  artifacts:
24953928bd0SJeremy L Thompson    paths:
25053928bd0SJeremy L Thompson      - build/*.junit
25153928bd0SJeremy L Thompson    reports:
25253928bd0SJeremy L Thompson      junit: build/*.junit
25353928bd0SJeremy L Thompson
25453928bd0SJeremy L Thompson
25553928bd0SJeremy L Thompson# ----------------------------------------------------------------------------------------
25653928bd0SJeremy L Thompson# ROCm backends
25753928bd0SJeremy L Thompson# ----------------------------------------------------------------------------------------
2581caccaa9SJeremy L Thompson
259527d8beaSJeremy L Thompson# ROCm test execution currently disabled
2601caccaa9SJeremy L Thompson
2611caccaa9SJeremy L Thompson#noether-rocm:
2621caccaa9SJeremy L Thompson#  stage: test:gpu-and-float
2631caccaa9SJeremy L Thompson#  tags:
2641caccaa9SJeremy L Thompson#    - rocm
2651caccaa9SJeremy L Thompson#  interruptible: true
2661caccaa9SJeremy L Thompson#  before_script:
2671caccaa9SJeremy L Thompson#    # Environment
2681caccaa9SJeremy L Thompson#    - export COVERAGE=1 CC=gcc CXX=g++ FC=gfortran HIPCC=hipcc
2691caccaa9SJeremy L Thompson#    - export NPROC_POOL=4
2701caccaa9SJeremy L Thompson#    - echo "-------------- nproc ---------------" && NPROC_CPU=$(nproc) && NPROC_GPU=$(($(nproc)<8?$(nproc):8)) && echo "NPROC_CPU" $NPROC_CPU && echo "NPROC_GPU" $NPROC_GPU
2711caccaa9SJeremy L Thompson#    - echo "-------------- CC ------------------" && $CC --version
2721caccaa9SJeremy L Thompson#    - echo "-------------- CXX -----------------" && $CXX --version
2731caccaa9SJeremy L Thompson#    - echo "-------------- FC ------------------" && $FC --version
2741caccaa9SJeremy L Thompson#    - echo "-------------- HIPCC ---------------" && $HIPCC --version
2751caccaa9SJeremy L Thompson#    - echo "-------------- GCOV ----------------" && gcov --version
2761caccaa9SJeremy L Thompson#    # Libraries for backends
2771caccaa9SJeremy L Thompson#    # -- MAGMA from dev branch
2781caccaa9SJeremy L Thompson#    - echo "-------------- MAGMA ---------------"
2791caccaa9SJeremy L Thompson#    - export MAGMA_DIR=/projects/hipMAGMA && git -C $MAGMA_DIR -c safe.directory=$MAGMA_DIR describe
2801caccaa9SJeremy L Thompson#  script:
2811caccaa9SJeremy L Thompson#    - rm -f .SUCCESS
2821caccaa9SJeremy L Thompson#    # libCEED
2831caccaa9SJeremy L Thompson#    - make configure ROCM_DIR=/opt/rocm-6.1.0 OPT='-O -march=native -ffp-contract=fast'
2841caccaa9SJeremy L Thompson#    - BACKENDS_CPU=$(make info-backends-all | grep -o '/cpu[^ ]*' | tr '\n' ' ') && BACKENDS_GPU=$(make info-backends | grep -o '/gpu[^ ]*' | tr '\n' ' ')
2851caccaa9SJeremy L Thompson#    - echo "-------------- libCEED -------------" && make info
2861caccaa9SJeremy L Thompson#    - echo "-------------- BACKENDS_GPU --------" && echo $BACKENDS_GPU
2871caccaa9SJeremy L Thompson#    - make clean
2881caccaa9SJeremy L Thompson#    - make -j$NPROC_CPU
2891caccaa9SJeremy L Thompson#    # -- libCEED only tests
2901caccaa9SJeremy L Thompson#    - echo "-------------- core tests ----------"
2911caccaa9SJeremy L Thompson#    - 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
2921caccaa9SJeremy L Thompson#    #    Note: PETSC_DIR is set by default in GitLab runner env, unsetting to isolate core tests
2931caccaa9SJeremy L Thompson#    - export PETSC_DIR= PETSC_ARCH=
2941caccaa9SJeremy L Thompson#    - make -k -j$((NPROC_GPU / NPROC_POOL)) BACKENDS="$BACKENDS_GPU" JUNIT_BATCH="hip" junit realsearch=%
2951caccaa9SJeremy L Thompson#    # Libraries for examples
2961caccaa9SJeremy L Thompson#    # -- PETSc with HIP (minimal)
2971caccaa9SJeremy L Thompson#    - export PETSC_DIR=/projects/petsc PETSC_ARCH=mpich-hip && git -C $PETSC_DIR -c safe.directory=$PETSC_DIR describe
2981caccaa9SJeremy L Thompson#    - echo "-------------- PETSc ---------------" && make -C $PETSC_DIR info
2991caccaa9SJeremy L Thompson#    - make -k -j$((NPROC_GPU / NPROC_POOL)) BACKENDS="$BACKENDS_GPU" JUNIT_BATCH="hip" junit search="petsc fluids solids"
3001caccaa9SJeremy L Thompson#    # Clang-tidy
3011caccaa9SJeremy L Thompson#    - echo "-------------- clang-tidy ----------" && clang-tidy --version
3021caccaa9SJeremy L Thompson#    - TIDY_OPTS="-fix-errors" make -j$NPROC_CPU tidy && git diff --color=always --exit-code
3031caccaa9SJeremy L Thompson#    # Report status
3041caccaa9SJeremy L Thompson#    - touch .SUCCESS
3051caccaa9SJeremy L Thompson#  after_script:
3061caccaa9SJeremy L Thompson#    - |
3071caccaa9SJeremy L Thompson#      if [ -f .SUCCESS ]; then
3081caccaa9SJeremy L Thompson#        lcov --directory . --capture --output-file coverage.info;
3091caccaa9SJeremy L Thompson#        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F interface;
3101caccaa9SJeremy L Thompson#        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F gallery;
3111caccaa9SJeremy L Thompson#        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F backends;
3121caccaa9SJeremy L Thompson#        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F tests;
3131caccaa9SJeremy L Thompson#        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F examples;
3141caccaa9SJeremy L Thompson#      fi
3151caccaa9SJeremy L Thompson#  artifacts:
3161caccaa9SJeremy L Thompson#    paths:
3171caccaa9SJeremy L Thompson#      - build/*.junit
3181caccaa9SJeremy L Thompson#    reports:
3191caccaa9SJeremy L Thompson#      junit: build/*.junit
3201caccaa9SJeremy L Thompson#      performance: performance.json
321422b158fSJed Brown
32226a4920cSJeremy L Thompson
323527d8beaSJeremy L Thompsonnoether-rocm:
324527d8beaSJeremy L Thompson  stage: test:gpu-and-float
325527d8beaSJeremy L Thompson  tags:
326527d8beaSJeremy L Thompson    - rocm
327527d8beaSJeremy L Thompson  interruptible: true
328527d8beaSJeremy L Thompson  before_script:
329527d8beaSJeremy L Thompson    # Environment
330527d8beaSJeremy L Thompson    - export COVERAGE=1 CC=gcc CXX=g++ FC=gfortran HIPCC=hipcc
331527d8beaSJeremy L Thompson    - export NPROC_POOL=4
332527d8beaSJeremy L Thompson    - echo "-------------- nproc ---------------" && NPROC_CPU=$(nproc) && NPROC_GPU=$(($(nproc)<8?$(nproc):8)) && echo "NPROC_CPU" $NPROC_CPU && echo "NPROC_GPU" $NPROC_GPU
333527d8beaSJeremy L Thompson    - echo "-------------- CC ------------------" && $CC --version
334527d8beaSJeremy L Thompson    - echo "-------------- CXX -----------------" && $CXX --version
335527d8beaSJeremy L Thompson    - echo "-------------- FC ------------------" && $FC --version
336527d8beaSJeremy L Thompson    - echo "-------------- HIPCC ---------------" && $HIPCC --version
337527d8beaSJeremy L Thompson    - echo "-------------- GCOV ----------------" && gcov --version
338527d8beaSJeremy L Thompson    # Libraries for backends
339527d8beaSJeremy L Thompson    # -- MAGMA from dev branch
340527d8beaSJeremy L Thompson    - echo "-------------- MAGMA ---------------"
341527d8beaSJeremy L Thompson    - export MAGMA_DIR=/projects/hipMAGMA && git -C $MAGMA_DIR -c safe.directory=$MAGMA_DIR describe
342527d8beaSJeremy L Thompson  script:
343527d8beaSJeremy L Thompson    - rm -f .SUCCESS
344527d8beaSJeremy L Thompson    # libCEED
345527d8beaSJeremy L Thompson    - make configure ROCM_DIR=/opt/rocm-6.1.0 OPT='-O -march=native -ffp-contract=fast'
346527d8beaSJeremy L Thompson    - BACKENDS_CPU=$(make info-backends-all | grep -o '/cpu[^ ]*' | tr '\n' ' ') && BACKENDS_GPU=$(make info-backends | grep -o '/gpu[^ ]*' | tr '\n' ' ')
347527d8beaSJeremy L Thompson    - echo "-------------- libCEED -------------" && make info
348527d8beaSJeremy L Thompson    - echo "-------------- BACKENDS_GPU --------" && echo $BACKENDS_GPU
349527d8beaSJeremy L Thompson    - make clean
350527d8beaSJeremy L Thompson    - make -j$NPROC_CPU
351527d8beaSJeremy L Thompson    # Clang-tidy
352527d8beaSJeremy L Thompson    - echo "-------------- clang-tidy ----------" && clang-tidy --version
353527d8beaSJeremy L Thompson    - make clean
354527d8beaSJeremy L Thompson    - TIDY_OPTS="-fix-errors" make -j$NPROC_CPU tidy && git diff --color=always --exit-code
355527d8beaSJeremy L Thompson    # Report status
356527d8beaSJeremy L Thompson    - touch .SUCCESS
357527d8beaSJeremy L Thompson
358527d8beaSJeremy L Thompson
35953928bd0SJeremy L Thompson# ----------------------------------------------------------------------------------------
3601caccaa9SJeremy L Thompson# CPU + CUDA backends with CeedScalar == float (32 bit)
36153928bd0SJeremy L Thompson# ----------------------------------------------------------------------------------------
36280a9ef05SNatalie Beamsnoether-float:
3631e31b501SJeremy L Thompson  stage: test:gpu-and-float
36480a9ef05SNatalie Beams  tags:
3651e31b501SJeremy L Thompson    - cpu
3661caccaa9SJeremy L Thompson    - cuda
36780a9ef05SNatalie Beams  interruptible: true
3681e31b501SJeremy L Thompson  before_script:
3695221680fSJeremy L Thompson    # Environment
3701caccaa9SJeremy L Thompson    - export COVERAGE=1 CC=gcc CXX=g++ FC= NVCC=nvcc
37119868e18SZach Atkins    - export NPROC_POOL=8
37280a9ef05SNatalie Beams    - echo "-------------- nproc ---------------" && NPROC_CPU=$(nproc) && NPROC_GPU=$(($(nproc)<8?$(nproc):8)) && echo "NPROC_CPU" $NPROC_CPU && echo "NPROC_GPU" $NPROC_GPU
37380a9ef05SNatalie Beams    - echo "-------------- CC ------------------" && $CC --version
37480a9ef05SNatalie Beams    - echo "-------------- CXX -----------------" && $CXX --version
3751caccaa9SJeremy L Thompson    - echo "-------------- NVCC ----------------" && $NVCC --version
37680a9ef05SNatalie Beams    - echo "-------------- GCOV ----------------" && gcov --version
37780a9ef05SNatalie Beams    # Libraries for backends
3781caccaa9SJeremy L Thompson# ROCm tests currently disabled
37980a9ef05SNatalie Beams# -- MAGMA from dev branch
3801caccaa9SJeremy L Thompson#    - echo "-------------- MAGMA ---------------"
3811caccaa9SJeremy L Thompson#    - export MAGMA_DIR=/projects/hipMAGMA && git -C $MAGMA_DIR -c safe.directory=$MAGMA_DIR describe
382ed66640aSJeremy L Thompson    # -- LIBXSMM 19 March 2025
383ed66640aSJeremy L Thompson    - cd .. && export XSMM_HASH=ba9d6bc69c421c10f0597d582ea1ace6a6126308 && { [[ -d libxsmm-$XSMM_HASH ]] || { curl -L https://github.com/libxsmm/libxsmm/archive/$XSMM_HASH.tar.gz -o xsmm.tar.gz && tar zvxf xsmm.tar.gz && rm xsmm.tar.gz && make -C libxsmm-$XSMM_HASH -j$(nproc); }; } && export XSMM_DIR=$PWD/libxsmm-$XSMM_HASH && cd libCEED
38468c150f8SJed Brown    - echo "-------------- LIBXSMM -------------" && basename $XSMM_DIR
3851e31b501SJeremy L Thompson  script:
3861e31b501SJeremy L Thompson    - rm -f .SUCCESS
38780a9ef05SNatalie Beams    # libCEED
3881e31b501SJeremy L Thompson    # Change to single precision
389c9c2c079SJeremy L Thompson    - sed -i 's/ceed-f64/ceed-f32/1' include/ceed/types.h
39080a9ef05SNatalie Beams    # Build libCEED
391*7ad93db1SJed Brown    - make configure OPT='-O -march=native -ffp-contract=fast' CUDA_DIR=/usr/local/cuda-12.9
3921b16049aSZach Atkins    - BACKENDS_CPU=$(make info-backends-all | grep -o '/cpu[^ ]*' | tr '\n' ' ') && BACKENDS_GPU=$(make info-backends | grep -o '/gpu[^ ]*' | tr '\n' ' ')
39380a9ef05SNatalie Beams    - echo "-------------- libCEED -------------" && make info
3945221680fSJeremy L Thompson    - echo "-------------- BACKENDS_CPU --------" && echo $BACKENDS_CPU
3955221680fSJeremy L Thompson    - echo "-------------- BACKENDS_GPU --------" && echo $BACKENDS_GPU
3963bcf805fSJeremy L Thompson    - make clean
39780a9ef05SNatalie Beams    - make -j$NPROC_CPU
39880a9ef05SNatalie Beams    # -- libCEED only tests
39980a9ef05SNatalie Beams    - echo "-------------- core tests ----------"
40080a9ef05SNatalie Beams    - 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
40180a9ef05SNatalie Beams    #    Note: PETSC_DIR is set by default in GitLab runner env, unsetting to isolate core tests
40280a9ef05SNatalie Beams    - export PETSC_DIR= PETSC_ARCH=
40319868e18SZach Atkins    - make -k -j$((NPROC_CPU / NPROC_POOL)) BACKENDS="$BACKENDS_CPU" JUNIT_BATCH="float-cpu" junit realsearch=%
40419868e18SZach Atkins    - export NPROC_POOL=4
4051caccaa9SJeremy L Thompson    - make -k -j$((NPROC_GPU / NPROC_POOL)) BACKENDS="$BACKENDS_GPU" JUNIT_BATCH="float-cuda" junit realsearch=%
40680a9ef05SNatalie Beams    # Report status
40780a9ef05SNatalie Beams    - echo "SUCCESS" > .job_status
40880a9ef05SNatalie Beams  after_script:
40980a9ef05SNatalie Beams    - |
41080a9ef05SNatalie Beams      if [ $(cat .job_status) == "SUCCESS" ]; then
41180a9ef05SNatalie Beams        lcov --directory . --capture --output-file coverage.info;
41280a9ef05SNatalie Beams        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F interface;
41380a9ef05SNatalie Beams        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F gallery;
41480a9ef05SNatalie Beams        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F backends;
41580a9ef05SNatalie Beams        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F tests;
41680a9ef05SNatalie Beams        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F examples;
41780a9ef05SNatalie Beams      fi
418c9c2c079SJeremy L Thompson    - sed -i 's/ceed-f32/ceed-f64/1' include/ceed/types.h
41980a9ef05SNatalie Beams  artifacts:
42080a9ef05SNatalie Beams    paths:
42180a9ef05SNatalie Beams      - build/*.junit
42280a9ef05SNatalie Beams    reports:
42380a9ef05SNatalie Beams      junit: build/*.junit
42480a9ef05SNatalie Beams      performance: performance.json
425