xref: /libCEED/.gitlab-ci.yml (revision 1caccaa9310efa488a472974b0bb3e05a8316d41)
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# ----------------------------------------------------------------------------------------
14526a4920cSJeremy L Thompsonnoether-sycl:
14626a4920cSJeremy L Thompson  stage: test:gpu-and-float
14726a4920cSJeremy L Thompson  tags:
14826a4920cSJeremy L Thompson    - sycl
14926a4920cSJeremy L Thompson  interruptible: true
15026a4920cSJeremy L Thompson  before_script:
15126a4920cSJeremy L Thompson# Environment
15226a4920cSJeremy L Thompson    - . /opt/intel/oneapi/setvars.sh
15326a4920cSJeremy L Thompson    - export COVERAGE=1 CC=icx CXX=icpx
15426a4920cSJeremy L Thompson    - export NPROC_POOL=8
15526a4920cSJeremy L Thompson    - echo "-------------- nproc ---------------" && NPROC_CPU=$(nproc) && NPROC_GPU=$(($(nproc)<8?$(nproc):8)) && echo "NPROC_CPU" $NPROC_CPU && echo "NPROC_GPU" $NPROC_GPU
15626a4920cSJeremy L Thompson    - echo "-------------- CC ------------------" && $CC --version
15726a4920cSJeremy L Thompson    - echo "-------------- CXX -----------------" && $CXX --version
15826a4920cSJeremy L Thompson  script:
15926a4920cSJeremy L Thompson    - rm -f .SUCCESS
16026a4920cSJeremy L Thompson# libCEED
16138cff5a3SJeremy L Thompson    - make configure SYCL_DIR=/opt/intel/oneapi/compiler/latest OPT='-O -march=native -ffp-contract=fast'
16226a4920cSJeremy L Thompson    - BACKENDS_SYCL=$(make info-backends-all | grep -o '/sycl[^ ]*' | tr '\n' ' ')
16326a4920cSJeremy L Thompson    - echo "-------------- libCEED -------------" && make info
16426a4920cSJeremy L Thompson    - echo "-------------- BACKENDS_SYCL -------" && echo $BACKENDS_SYCL
1653bcf805fSJeremy L Thompson    - make clean
16626a4920cSJeremy L Thompson    - make -j$NPROC_CPU
16726a4920cSJeremy L Thompson# Report status
16826a4920cSJeremy L Thompson    - touch .SUCCESS
16926a4920cSJeremy L Thompson
17026a4920cSJeremy L Thompson
17153928bd0SJeremy L Thompson# ----------------------------------------------------------------------------------------
17253928bd0SJeremy L Thompson# CUDA backends
17353928bd0SJeremy L Thompson# ----------------------------------------------------------------------------------------
17453928bd0SJeremy L Thompsonnoether-cuda:
17553928bd0SJeremy L Thompson  stage: test:gpu-and-float
17653928bd0SJeremy L Thompson  tags:
17753928bd0SJeremy L Thompson    - cuda
17853928bd0SJeremy L Thompson  interruptible: true
17953928bd0SJeremy L Thompson  before_script:
18053928bd0SJeremy L Thompson# Environment
18153928bd0SJeremy L Thompson    - export COVERAGE=1 CC=gcc CXX=g++ FC=gfortran NVCC=nvcc
18253928bd0SJeremy L Thompson    - export NPROC_POOL=4
18353928bd0SJeremy L Thompson    - echo "-------------- nproc ---------------" && NPROC_CPU=$(nproc) && NPROC_GPU=$(($(nproc)<8?$(nproc):8)) && echo "NPROC_CPU" $NPROC_CPU && echo "NPROC_GPU" $NPROC_GPU
18453928bd0SJeremy L Thompson    - echo "-------------- CC ------------------" && $CC --version
18553928bd0SJeremy L Thompson    - echo "-------------- CXX -----------------" && $CXX --version
18653928bd0SJeremy L Thompson    - echo "-------------- FC ------------------" && $FC --version
18753928bd0SJeremy L Thompson    - echo "-------------- NVCC ----------------" && $NVCC --version
18853928bd0SJeremy L Thompson    - echo "-------------- GCOV ----------------" && gcov --version
18913da2136SJeremy L Thompson# ASAN
19013da2136SJeremy L Thompson    - echo "-------------- ASAN ----------------"
19113da2136SJeremy L Thompson    - export ASAN=1 AFLAGS="-fsanitize=address -fsanitize=leak" ASAN_OPTIONS=protect_shadow_gap=0
19213da2136SJeremy L Thompson    - echo $AFLAGS
19353928bd0SJeremy L Thompson  script:
19453928bd0SJeremy L Thompson    - rm -f .SUCCESS
19553928bd0SJeremy L Thompson# libCEED
19653928bd0SJeremy L Thompson    - make configure OPT='-O -march=native -ffp-contract=fast' CUDA_DIR=/usr
19753928bd0SJeremy L Thompson    - echo "-------------- libCEED -------------" && make info
19853928bd0SJeremy L Thompson    - BACKENDS_GPU=$(make info-backends | grep -o '/gpu[^ ]*' | tr '\n' ' ')
19953928bd0SJeremy L Thompson    - echo "-------------- BACKENDS_GPU --------" && echo $BACKENDS_GPU
2003bcf805fSJeremy L Thompson    - make clean
20153928bd0SJeremy L Thompson    - PEDANTIC=1 make -k -j$NPROC_CPU -l$NPROC_CPU
20253928bd0SJeremy L Thompson# -- libCEED only tests
20353928bd0SJeremy L Thompson    - echo "-------------- core tests ----------"
20453928bd0SJeremy L Thompson#    Note: PETSC_DIR is set by default in GitLab runner env, unsetting to isolate core tests
20553928bd0SJeremy L Thompson    - export PETSC_DIR= PETSC_ARCH=
20653928bd0SJeremy L Thompson    - make -k -j$((NPROC_GPU / NPROC_POOL)) BACKENDS="$BACKENDS_GPU" JUNIT_BATCH="cuda" junit realsearch=%
20713da2136SJeremy L Thompson# Rebuild without ASAN
208f3296101SJeremy L Thompson    - unset ASAN AFLAGS ASAN_OPTIONS
20913da2136SJeremy L Thompson    - make clean
21013da2136SJeremy L Thompson    - PEDANTIC=1 make -k -j$NPROC_CPU -l$NPROC_CPU
21153928bd0SJeremy L Thompson# Libraries for examples
21253928bd0SJeremy L Thompson# -- PETSc with CUDA (minimal)
21353928bd0SJeremy 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
21453928bd0SJeremy L Thompson    - echo "-------------- PETSc ---------------" && make -C $PETSC_DIR info
21538f1a2a7SJeremy L Thompson    - make -k -j$((NPROC_GPU / NPROC_POOL)) BACKENDS="$BACKENDS_GPU" JUNIT_BATCH="cuda" junit search="petsc fluids solids"
21638f1a2a7SJeremy L Thompson# -- MFEM v4.7
21738f1a2a7SJeremy 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
21838f1a2a7SJeremy L Thompson    - echo "-------------- MFEM ----------------" && make -C $MFEM_DIR info
21938f1a2a7SJeremy L Thompson    - make -k -j$((NPROC_GPU / NPROC_POOL)) BACKENDS="$BACKENDS_GPU" JUNIT_BATCH="cuda" junit search=mfem
22038f1a2a7SJeremy L Thompson# -- Nek5000 v19.0
22138f1a2a7SJeremy L Thompson    - export COVERAGE=0
22238f1a2a7SJeremy 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
22338f1a2a7SJeremy L Thompson    - echo "-------------- Nek5000 -------------" && git -C $NEK5K_DIR describe --tags
22438f1a2a7SJeremy L Thompson    - export NPROC_POOL=1
22538f1a2a7SJeremy L Thompson    - make -k -j$NPROC_GPU BACKENDS="$BACKENDS_GPU" JUNIT_BATCH="cuda" junit search=nek NEK5K_DIR=$NEK5K_DIR
22638f1a2a7SJeremy L Thompson# -- deal.II 8bd5c262f13e15793aa206b6eed8774a9b25ce11
22738f1a2a7SJeremy L Thompson    - export DEAL_II_ROOT_DIR=/projects/dealii DEAL_II_DIR=/projects/dealii/install
22838f1a2a7SJeremy L Thompson    - echo "-------------- deal.II -------------" && git -C $DEAL_II_ROOT_DIR -c safe.directory=$DEAL_II_ROOT_DIR describe --always
22938f1a2a7SJeremy L Thompson    - make -k -j$((NPROC_GPU / NPROC_POOL)) BACKENDS="$BACKENDS_GPU" JUNIT_BATCH="cuda" junit search=dealii DEAL_II_DIR=$DEAL_II_DIR
2309e9358dcSJeremy L Thompson# Clang-tidy
2319e9358dcSJeremy L Thompson    - echo "-------------- clang-tidy ----------" && clang-tidy --version
2329e9358dcSJeremy L Thompson    - TIDY_OPTS="-fix-errors" make -j$NPROC_CPU tidy && git diff --color=always --exit-code
23353928bd0SJeremy L Thompson# Report status
23453928bd0SJeremy L Thompson    - touch .SUCCESS
23553928bd0SJeremy L Thompson  after_script:
23653928bd0SJeremy L Thompson    - |
23753928bd0SJeremy L Thompson      if [ -f .SUCCESS ]; then
23853928bd0SJeremy L Thompson        lcov --directory . --capture --output-file coverage.info;
23953928bd0SJeremy L Thompson        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F interface;
24053928bd0SJeremy L Thompson        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F gallery;
24153928bd0SJeremy L Thompson        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F backends;
24253928bd0SJeremy L Thompson        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F tests;
24353928bd0SJeremy L Thompson        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F examples;
24453928bd0SJeremy L Thompson      fi
24553928bd0SJeremy L Thompson  artifacts:
24653928bd0SJeremy L Thompson    paths:
24753928bd0SJeremy L Thompson      - build/*.junit
24853928bd0SJeremy L Thompson    reports:
24953928bd0SJeremy L Thompson      junit: build/*.junit
25053928bd0SJeremy L Thompson
25153928bd0SJeremy L Thompson
25253928bd0SJeremy L Thompson# ----------------------------------------------------------------------------------------
25353928bd0SJeremy L Thompson# ROCm backends
25453928bd0SJeremy L Thompson# ----------------------------------------------------------------------------------------
255*1caccaa9SJeremy L Thompson
256*1caccaa9SJeremy L Thompson# ROCm tests currently disabled
257*1caccaa9SJeremy L Thompson
258*1caccaa9SJeremy L Thompson#noether-rocm:
259*1caccaa9SJeremy L Thompson#  stage: test:gpu-and-float
260*1caccaa9SJeremy L Thompson#  tags:
261*1caccaa9SJeremy L Thompson#    - rocm
262*1caccaa9SJeremy L Thompson#  interruptible: true
263*1caccaa9SJeremy L Thompson#  before_script:
264*1caccaa9SJeremy L Thompson## Environment
265*1caccaa9SJeremy L Thompson#    - export COVERAGE=1 CC=gcc CXX=g++ FC=gfortran HIPCC=hipcc
266*1caccaa9SJeremy L Thompson#    - export NPROC_POOL=4
267*1caccaa9SJeremy L Thompson#    - echo "-------------- nproc ---------------" && NPROC_CPU=$(nproc) && NPROC_GPU=$(($(nproc)<8?$(nproc):8)) && echo "NPROC_CPU" $NPROC_CPU && echo "NPROC_GPU" $NPROC_GPU
268*1caccaa9SJeremy L Thompson#    - echo "-------------- CC ------------------" && $CC --version
269*1caccaa9SJeremy L Thompson#    - echo "-------------- CXX -----------------" && $CXX --version
270*1caccaa9SJeremy L Thompson#    - echo "-------------- FC ------------------" && $FC --version
271*1caccaa9SJeremy L Thompson#    - echo "-------------- HIPCC ---------------" && $HIPCC --version
272*1caccaa9SJeremy L Thompson#    - echo "-------------- GCOV ----------------" && gcov --version
273*1caccaa9SJeremy L Thompson## Libraries for backends
274*1caccaa9SJeremy L Thompson## -- MAGMA from dev branch
275*1caccaa9SJeremy L Thompson#    - echo "-------------- MAGMA ---------------"
276*1caccaa9SJeremy L Thompson#    - export MAGMA_DIR=/projects/hipMAGMA && git -C $MAGMA_DIR -c safe.directory=$MAGMA_DIR describe
277*1caccaa9SJeremy L Thompson#  script:
278*1caccaa9SJeremy L Thompson#    - rm -f .SUCCESS
279*1caccaa9SJeremy L Thompson## libCEED
280*1caccaa9SJeremy L Thompson#    - make configure ROCM_DIR=/opt/rocm-6.1.0 OPT='-O -march=native -ffp-contract=fast'
281*1caccaa9SJeremy L Thompson#    - BACKENDS_CPU=$(make info-backends-all | grep -o '/cpu[^ ]*' | tr '\n' ' ') && BACKENDS_GPU=$(make info-backends | grep -o '/gpu[^ ]*' | tr '\n' ' ')
282*1caccaa9SJeremy L Thompson#    - echo "-------------- libCEED -------------" && make info
283*1caccaa9SJeremy L Thompson#    - echo "-------------- BACKENDS_GPU --------" && echo $BACKENDS_GPU
284*1caccaa9SJeremy L Thompson#    - make clean
285*1caccaa9SJeremy L Thompson#    - make -j$NPROC_CPU
286*1caccaa9SJeremy L Thompson## -- libCEED only tests
287*1caccaa9SJeremy L Thompson#    - echo "-------------- core tests ----------"
288*1caccaa9SJeremy 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
289*1caccaa9SJeremy L Thompson##    Note: PETSC_DIR is set by default in GitLab runner env, unsetting to isolate core tests
290*1caccaa9SJeremy L Thompson#    - export PETSC_DIR= PETSC_ARCH=
291*1caccaa9SJeremy L Thompson#    - make -k -j$((NPROC_GPU / NPROC_POOL)) BACKENDS="$BACKENDS_GPU" JUNIT_BATCH="hip" junit realsearch=%
292*1caccaa9SJeremy L Thompson## Libraries for examples
293*1caccaa9SJeremy L Thompson## -- PETSc with HIP (minimal)
294*1caccaa9SJeremy L Thompson#    - export PETSC_DIR=/projects/petsc PETSC_ARCH=mpich-hip && git -C $PETSC_DIR -c safe.directory=$PETSC_DIR describe
295*1caccaa9SJeremy L Thompson#    - echo "-------------- PETSc ---------------" && make -C $PETSC_DIR info
296*1caccaa9SJeremy L Thompson#    - make -k -j$((NPROC_GPU / NPROC_POOL)) BACKENDS="$BACKENDS_GPU" JUNIT_BATCH="hip" junit search="petsc fluids solids"
297*1caccaa9SJeremy L Thompson## Clang-tidy
298*1caccaa9SJeremy L Thompson#    - echo "-------------- clang-tidy ----------" && clang-tidy --version
299*1caccaa9SJeremy L Thompson#    - TIDY_OPTS="-fix-errors" make -j$NPROC_CPU tidy && git diff --color=always --exit-code
300*1caccaa9SJeremy L Thompson## Report status
301*1caccaa9SJeremy L Thompson#    - touch .SUCCESS
302*1caccaa9SJeremy L Thompson#  after_script:
303*1caccaa9SJeremy L Thompson#    - |
304*1caccaa9SJeremy L Thompson#      if [ -f .SUCCESS ]; then
305*1caccaa9SJeremy L Thompson#        lcov --directory . --capture --output-file coverage.info;
306*1caccaa9SJeremy L Thompson#        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F interface;
307*1caccaa9SJeremy L Thompson#        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F gallery;
308*1caccaa9SJeremy L Thompson#        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F backends;
309*1caccaa9SJeremy L Thompson#        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F tests;
310*1caccaa9SJeremy L Thompson#        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F examples;
311*1caccaa9SJeremy L Thompson#      fi
312*1caccaa9SJeremy L Thompson#  artifacts:
313*1caccaa9SJeremy L Thompson#    paths:
314*1caccaa9SJeremy L Thompson#      - build/*.junit
315*1caccaa9SJeremy L Thompson#    reports:
316*1caccaa9SJeremy L Thompson#      junit: build/*.junit
317*1caccaa9SJeremy L Thompson#      performance: performance.json
318422b158fSJed Brown
31926a4920cSJeremy L Thompson
32053928bd0SJeremy L Thompson# ----------------------------------------------------------------------------------------
321*1caccaa9SJeremy L Thompson# CPU + CUDA backends with CeedScalar == float (32 bit)
32253928bd0SJeremy L Thompson# ----------------------------------------------------------------------------------------
32380a9ef05SNatalie Beamsnoether-float:
3241e31b501SJeremy L Thompson  stage: test:gpu-and-float
32580a9ef05SNatalie Beams  tags:
3261e31b501SJeremy L Thompson    - cpu
327*1caccaa9SJeremy L Thompson    - cuda
32880a9ef05SNatalie Beams  interruptible: true
3291e31b501SJeremy L Thompson  before_script:
3305221680fSJeremy L Thompson# Environment
331*1caccaa9SJeremy L Thompson    - export COVERAGE=1 CC=gcc CXX=g++ FC= NVCC=nvcc
33219868e18SZach Atkins    - export NPROC_POOL=8
33380a9ef05SNatalie Beams    - echo "-------------- nproc ---------------" && NPROC_CPU=$(nproc) && NPROC_GPU=$(($(nproc)<8?$(nproc):8)) && echo "NPROC_CPU" $NPROC_CPU && echo "NPROC_GPU" $NPROC_GPU
33480a9ef05SNatalie Beams    - echo "-------------- CC ------------------" && $CC --version
33580a9ef05SNatalie Beams    - echo "-------------- CXX -----------------" && $CXX --version
336*1caccaa9SJeremy L Thompson    - echo "-------------- NVCC ----------------" && $NVCC --version
33780a9ef05SNatalie Beams    - echo "-------------- GCOV ----------------" && gcov --version
33880a9ef05SNatalie Beams# Libraries for backends
339*1caccaa9SJeremy L Thompson# ROCm tests currently disabled
34080a9ef05SNatalie Beams# -- MAGMA from dev branch
341*1caccaa9SJeremy L Thompson#    - echo "-------------- MAGMA ---------------"
342*1caccaa9SJeremy L Thompson#    - export MAGMA_DIR=/projects/hipMAGMA && git -C $MAGMA_DIR -c safe.directory=$MAGMA_DIR describe
343ed721ed8SJeremy L Thompson# -- LIBXSMM 7 April 2024
344ed721ed8SJeremy 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
34568c150f8SJed Brown    - echo "-------------- LIBXSMM -------------" && basename $XSMM_DIR
3461e31b501SJeremy L Thompson  script:
3471e31b501SJeremy L Thompson    - rm -f .SUCCESS
34880a9ef05SNatalie Beams# libCEED
3491e31b501SJeremy L Thompson# Change to single precision
350c9c2c079SJeremy L Thompson    - sed -i 's/ceed-f64/ceed-f32/1' include/ceed/types.h
35180a9ef05SNatalie Beams# Build libCEED
352*1caccaa9SJeremy L Thompson    - make configure OPT='-O -march=native -ffp-contract=fast' CUDA_DIR=/usr
3531b16049aSZach Atkins    - BACKENDS_CPU=$(make info-backends-all | grep -o '/cpu[^ ]*' | tr '\n' ' ') && BACKENDS_GPU=$(make info-backends | grep -o '/gpu[^ ]*' | tr '\n' ' ')
35480a9ef05SNatalie Beams    - echo "-------------- libCEED -------------" && make info
3555221680fSJeremy L Thompson    - echo "-------------- BACKENDS_CPU --------" && echo $BACKENDS_CPU
3565221680fSJeremy L Thompson    - echo "-------------- BACKENDS_GPU --------" && echo $BACKENDS_GPU
3573bcf805fSJeremy L Thompson    - make clean
35880a9ef05SNatalie Beams    - make -j$NPROC_CPU
35980a9ef05SNatalie Beams# -- libCEED only tests
36080a9ef05SNatalie Beams    - echo "-------------- core tests ----------"
36180a9ef05SNatalie 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
36280a9ef05SNatalie Beams#    Note: PETSC_DIR is set by default in GitLab runner env, unsetting to isolate core tests
36380a9ef05SNatalie Beams    - export PETSC_DIR= PETSC_ARCH=
36419868e18SZach Atkins    - make -k -j$((NPROC_CPU / NPROC_POOL)) BACKENDS="$BACKENDS_CPU" JUNIT_BATCH="float-cpu" junit realsearch=%
36519868e18SZach Atkins    - export NPROC_POOL=4
366*1caccaa9SJeremy L Thompson    - make -k -j$((NPROC_GPU / NPROC_POOL)) BACKENDS="$BACKENDS_GPU" JUNIT_BATCH="float-cuda" junit realsearch=%
36780a9ef05SNatalie Beams# Report status
36880a9ef05SNatalie Beams    - echo "SUCCESS" > .job_status
36980a9ef05SNatalie Beams  after_script:
37080a9ef05SNatalie Beams    - |
37180a9ef05SNatalie Beams      if [ $(cat .job_status) == "SUCCESS" ]; then
37280a9ef05SNatalie Beams        lcov --directory . --capture --output-file coverage.info;
37380a9ef05SNatalie Beams        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F interface;
37480a9ef05SNatalie Beams        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F gallery;
37580a9ef05SNatalie Beams        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F backends;
37680a9ef05SNatalie Beams        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F tests;
37780a9ef05SNatalie Beams        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F examples;
37880a9ef05SNatalie Beams      fi
379c9c2c079SJeremy L Thompson    - sed -i 's/ceed-f32/ceed-f64/1' include/ceed/types.h
38080a9ef05SNatalie Beams  artifacts:
38180a9ef05SNatalie Beams    paths:
38280a9ef05SNatalie Beams      - build/*.junit
38380a9ef05SNatalie Beams    reports:
38480a9ef05SNatalie Beams      junit: build/*.junit
38580a9ef05SNatalie Beams      performance: performance.json
386