xref: /libCEED/.gitlab-ci.yml (revision ed721ed881af0c4c392c60e338da4febcd1996ba)
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
826a4920cSJeremy L Thompson
953928bd0SJeremy L Thompson# ----------------------------------------------------------------------------------------
1053928bd0SJeremy L Thompson# Memcheck backends + ASAN
1153928bd0SJeremy L Thompson# ----------------------------------------------------------------------------------------
1253928bd0SJeremy L Thompsonnoether-asan:
1353928bd0SJeremy L Thompson  stage: test:cpu-and-tidy
1453928bd0SJeremy L Thompson  tags:
1553928bd0SJeremy L Thompson    - cpu
1653928bd0SJeremy L Thompson  interruptible: true
1753928bd0SJeremy L Thompson  before_script:
1853928bd0SJeremy L Thompson# Environment
199e9358dcSJeremy L Thompson#    Note: COVERAGE=0 is needed when using ASAN
2053928bd0SJeremy L Thompson    - export COVERAGE=0 CC=gcc CXX=g++ FC=gfortran
2153928bd0SJeremy L Thompson    - export NPROC_POOL=8
2253928bd0SJeremy L Thompson    - echo "-------------- nproc ---------------" && NPROC_CPU=$(nproc) && NPROC_GPU=$(($(nproc)<8?$(nproc):8)) && echo "NPROC_CPU" $NPROC_CPU && echo "NPROC_GPU" $NPROC_GPU
2353928bd0SJeremy L Thompson    - echo "-------------- CC ------------------" && $CC --version
2453928bd0SJeremy L Thompson    - echo "-------------- CXX -----------------" && $CXX --version
2553928bd0SJeremy L Thompson    - echo "-------------- FC ------------------" && $FC --version
2653928bd0SJeremy L Thompson# ASAN
2753928bd0SJeremy L Thompson    - echo "-------------- ASAN ----------------"
2853928bd0SJeremy L Thompson    - export ASAN=1 AFLAGS="-fsanitize=address -fsanitize=leak"
2953928bd0SJeremy L Thompson    - echo $AFLAGS
3053928bd0SJeremy L Thompson  script:
3153928bd0SJeremy L Thompson    - rm -f .SUCCESS
3253928bd0SJeremy L Thompson# libCEED
3353928bd0SJeremy L Thompson    - make configure OPT='-O -march=native -ffp-contract=fast'
34ad037b63SJeremy L Thompson    - BACKENDS_CPU=$(make info-backends-all | grep -o '/cpu[^ ]*' | tr '\n' ' ')
3553928bd0SJeremy L Thompson    - echo "-------------- libCEED -------------" && make info
36ad037b63SJeremy L Thompson    - echo "-------------- BACKENDS_CPU --------" && echo $BACKENDS_CPU
3753928bd0SJeremy L Thompson    - make -j$NPROC_CPU
3853928bd0SJeremy L Thompson# -- libCEED only tests
3953928bd0SJeremy L Thompson    - echo "-------------- core tests ----------"
4053928bd0SJeremy 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
4153928bd0SJeremy L Thompson#    Note: PETSC_DIR is set by default in GitLab runner env, unsetting to isolate core tests
4253928bd0SJeremy L Thompson    - export PETSC_DIR= PETSC_ARCH=
43ad037b63SJeremy L Thompson    - make -k -j$((NPROC_CPU / NPROC_POOL)) BACKENDS="$BACKENDS_CPU" JUNIT_BATCH="memcheck" junit realsearch=%
4453928bd0SJeremy L Thompson# Clang-tidy
4553928bd0SJeremy L Thompson    - echo "-------------- clang-tidy ----------" && clang-tidy --version
469e9358dcSJeremy L Thompson    - TIDY_OPTS="-fix-errors" make -j$NPROC_CPU tidy && git diff --color=always --exit-code
4753928bd0SJeremy L Thompson# Report status
4853928bd0SJeremy L Thompson    - touch .SUCCESS
4953928bd0SJeremy L Thompson  artifacts:
5053928bd0SJeremy L Thompson    paths:
5153928bd0SJeremy L Thompson      - build/*.junit
5253928bd0SJeremy L Thompson    reports:
5353928bd0SJeremy L Thompson      junit: build/*.junit
5453928bd0SJeremy L Thompson      performance: performance.json
5553928bd0SJeremy L Thompson
5653928bd0SJeremy L Thompson
5753928bd0SJeremy L Thompson# ----------------------------------------------------------------------------------------
5853928bd0SJeremy L Thompson# CPU backends only + make tidy
5953928bd0SJeremy L Thompson# ----------------------------------------------------------------------------------------
601e31b501SJeremy L Thompsonnoether-cpu:
611e31b501SJeremy L Thompson  stage: test:cpu-and-tidy
621e31b501SJeremy L Thompson  tags:
631e31b501SJeremy L Thompson    - cpu
641e31b501SJeremy L Thompson  interruptible: true
651e31b501SJeremy L Thompson  before_script:
661e31b501SJeremy L Thompson# Environment
679e9358dcSJeremy L Thompson    - export COVERAGE=1 CC=gcc CXX=g++ FC=gfortran
6819868e18SZach Atkins    - export NPROC_POOL=8
691e31b501SJeremy L Thompson    - echo "-------------- nproc ---------------" && NPROC_CPU=$(nproc) && NPROC_GPU=$(($(nproc)<8?$(nproc):8)) && echo "NPROC_CPU" $NPROC_CPU && echo "NPROC_GPU" $NPROC_GPU
701e31b501SJeremy L Thompson    - echo "-------------- CC ------------------" && $CC --version
711e31b501SJeremy L Thompson    - echo "-------------- CXX -----------------" && $CXX --version
721e31b501SJeremy L Thompson    - echo "-------------- FC ------------------" && $FC --version
731e31b501SJeremy L Thompson    - echo "-------------- GCOV ----------------" && gcov --version
741e31b501SJeremy L Thompson# Libraries for backends
75*ed721ed8SJeremy L Thompson# -- LIBXSMM 7 April 2024
76*ed721ed8SJeremy 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
7768c150f8SJed Brown    - echo "-------------- LIBXSMM -------------" && basename $XSMM_DIR
78a4b1483eSJeremy L Thompson# -- OCCA v1.6.0
79a4b1483eSJeremy 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
800be03a92SJeremy L Thompson    - echo "-------------- OCCA ----------------" && git -C $OCCA_DIR describe --tags && LD_LIBRARY_PATH=$OCCA_DIR/lib $OCCA_DIR/bin/occa info
811e31b501SJeremy L Thompson  script:
821e31b501SJeremy L Thompson    - rm -f .SUCCESS
831e31b501SJeremy L Thompson# libCEED
841e31b501SJeremy L Thompson    - make configure OPT='-O -march=native -ffp-contract=fast'
851b16049aSZach Atkins    - BACKENDS_CPU=$(make info-backends-all | grep -o '/cpu[^ ]*' | tr '\n' ' ')
861e31b501SJeremy L Thompson    - echo "-------------- libCEED -------------" && make info
871e31b501SJeremy L Thompson    - echo "-------------- BACKENDS_CPU --------" && echo $BACKENDS_CPU
882c2ea1dbSJeremy L Thompson    - OCCA_DIR= PEDANTIC=1 make -j$NPROC_CPU
891e31b501SJeremy L Thompson    - make -j$NPROC_CPU
901e31b501SJeremy L Thompson# -- libCEED only tests
911e31b501SJeremy L Thompson    - echo "-------------- core tests ----------"
921e31b501SJeremy 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
931e31b501SJeremy L Thompson#    Note: PETSC_DIR is set by default in GitLab runner env, unsetting to isolate core tests
941e31b501SJeremy L Thompson    - export PETSC_DIR= PETSC_ARCH=
9519868e18SZach Atkins    - make -k -j$((NPROC_CPU / NPROC_POOL)) BACKENDS="$BACKENDS_CPU" JUNIT_BATCH="cpu" junit realsearch=%
961e31b501SJeremy L Thompson# Libraries for examples
971e31b501SJeremy L Thompson# -- PETSc with HIP (minimal)
984d00b080SJeremy L Thompson    - export PETSC_DIR=/projects/petsc PETSC_ARCH=mpich-hip-int64 && git -C $PETSC_DIR -c safe.directory=$PETSC_DIR describe
99e17e35bbSJames Wright    - source /home/jawr8143/SmartSimTestingSoftware/bin/activate && export SMARTREDIS_DIR=/home/jawr8143/SmartSimTestingSoftware/smartredis/install
1001e31b501SJeremy L Thompson    - echo "-------------- PETSc ---------------" && make -C $PETSC_DIR info
10119868e18SZach Atkins    - make -k -j$((NPROC_CPU / NPROC_POOL)) BACKENDS="$BACKENDS_CPU" JUNIT_BATCH="cpu" junit search="petsc fluids solids"
102a4b1483eSJeremy L Thompson# -- MFEM v4.6
103a4b1483eSJeremy L Thompson    - cd .. && export MFEM_VERSION=mfem-4.6 && { [[ -d $MFEM_VERSION ]] || { git clone --depth 1 --branch v4.6 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
1041e31b501SJeremy L Thompson    - echo "-------------- MFEM ----------------" && make -C $MFEM_DIR info
10519868e18SZach Atkins    - make -k -j$((NPROC_CPU / NPROC_POOL)) BACKENDS="$BACKENDS_CPU" JUNIT_BATCH="cpu" junit search=mfem
1061e31b501SJeremy L Thompson# -- Nek5000 v19.0
1071e31b501SJeremy L Thompson    - export COVERAGE=0
1081e31b501SJeremy 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
1091e31b501SJeremy L Thompson    - echo "-------------- Nek5000 -------------" && git -C $NEK5K_DIR describe --tags
11019868e18SZach Atkins    - export NPROC_POOL=1
111b41f14d5SJeremy L Thompson    - make -k -j$NPROC_CPU BACKENDS="$BACKENDS_CPU" JUNIT_BATCH="cpu" junit search=nek NEK5K_DIR=$NEK5K_DIR
1128c81f8b0SPeter Munch# -- deal.II 8bd5c262f13e15793aa206b6eed8774a9b25ce11
1138c81f8b0SPeter Munch    - OCCA_DIR= BACKENDS_CPU=$(make info-backends-all | grep -o '/cpu[^ ]*' | tr '\n' ' ')
1148c81f8b0SPeter Munch    - export DEAL_II_ROOT_DIR=/projects/dealii DEAL_II_DIR=/projects/dealii/install
1158c81f8b0SPeter Munch    - echo "-------------- deal.II -------------" && git -C $DEAL_II_ROOT_DIR -c safe.directory=$DEAL_II_ROOT_DIR describe --always
1168c81f8b0SPeter Munch    - make -k -j$NPROC_CPU BACKENDS="$BACKENDS_CPU" JUNIT_BATCH="cpu" junit search=dealii DEAL_II_DIR=$DEAL_II_DIR
1171e31b501SJeremy L Thompson# Report status
1181e31b501SJeremy L Thompson    - touch .SUCCESS
1191e31b501SJeremy L Thompson  after_script:
1201e31b501SJeremy L Thompson    - |
1211e31b501SJeremy L Thompson      if [ -f .SUCCESS ]; then
1221e31b501SJeremy L Thompson        lcov --directory . --capture --output-file coverage.info;
1231e31b501SJeremy L Thompson        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F interface;
1241e31b501SJeremy L Thompson        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F gallery;
1251e31b501SJeremy L Thompson        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F backends;
1261e31b501SJeremy L Thompson        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F tests;
1271e31b501SJeremy L Thompson        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F examples;
1281e31b501SJeremy L Thompson      fi
1291e31b501SJeremy L Thompson  artifacts:
1301e31b501SJeremy L Thompson    paths:
1311e31b501SJeremy L Thompson      - build/*.junit
1321e31b501SJeremy L Thompson    reports:
1331e31b501SJeremy L Thompson      junit: build/*.junit
1341e31b501SJeremy L Thompson      performance: performance.json
13509f072d1SJed Brown
13626a4920cSJeremy L Thompson
13753928bd0SJeremy L Thompson# ----------------------------------------------------------------------------------------
13853928bd0SJeremy L Thompson# Check SYCL backends build
13953928bd0SJeremy L Thompson# ----------------------------------------------------------------------------------------
14026a4920cSJeremy L Thompsonnoether-sycl:
14126a4920cSJeremy L Thompson  stage: test:gpu-and-float
14226a4920cSJeremy L Thompson  tags:
14326a4920cSJeremy L Thompson    - sycl
14426a4920cSJeremy L Thompson  interruptible: true
14526a4920cSJeremy L Thompson  before_script:
14626a4920cSJeremy L Thompson# Environment
14726a4920cSJeremy L Thompson    - . /opt/intel/oneapi/setvars.sh
14826a4920cSJeremy L Thompson    - export COVERAGE=1 CC=icx CXX=icpx
14926a4920cSJeremy L Thompson    - export NPROC_POOL=8
15026a4920cSJeremy L Thompson    - echo "-------------- nproc ---------------" && NPROC_CPU=$(nproc) && NPROC_GPU=$(($(nproc)<8?$(nproc):8)) && echo "NPROC_CPU" $NPROC_CPU && echo "NPROC_GPU" $NPROC_GPU
15126a4920cSJeremy L Thompson    - echo "-------------- CC ------------------" && $CC --version
15226a4920cSJeremy L Thompson    - echo "-------------- CXX -----------------" && $CXX --version
15326a4920cSJeremy L Thompson  script:
15426a4920cSJeremy L Thompson    - rm -f .SUCCESS
15526a4920cSJeremy L Thompson# libCEED
15638cff5a3SJeremy L Thompson    - make configure SYCL_DIR=/opt/intel/oneapi/compiler/latest OPT='-O -march=native -ffp-contract=fast'
15726a4920cSJeremy L Thompson    - BACKENDS_SYCL=$(make info-backends-all | grep -o '/sycl[^ ]*' | tr '\n' ' ')
15826a4920cSJeremy L Thompson    - echo "-------------- libCEED -------------" && make info
15926a4920cSJeremy L Thompson    - echo "-------------- BACKENDS_SYCL -------" && echo $BACKENDS_SYCL
16026a4920cSJeremy L Thompson    - make -j$NPROC_CPU
16126a4920cSJeremy L Thompson# Report status
16226a4920cSJeremy L Thompson    - touch .SUCCESS
16326a4920cSJeremy L Thompson
16426a4920cSJeremy L Thompson
16553928bd0SJeremy L Thompson# ----------------------------------------------------------------------------------------
16653928bd0SJeremy L Thompson# CUDA backends
16753928bd0SJeremy L Thompson# ----------------------------------------------------------------------------------------
16853928bd0SJeremy L Thompsonnoether-cuda:
16953928bd0SJeremy L Thompson  stage: test:gpu-and-float
17053928bd0SJeremy L Thompson  tags:
17153928bd0SJeremy L Thompson    - cuda
17253928bd0SJeremy L Thompson  interruptible: true
17353928bd0SJeremy L Thompson  before_script:
17453928bd0SJeremy L Thompson# Environment
17553928bd0SJeremy L Thompson    - export COVERAGE=1 CC=gcc CXX=g++ FC=gfortran NVCC=nvcc
17653928bd0SJeremy L Thompson    - export NPROC_POOL=4
17753928bd0SJeremy L Thompson    - echo "-------------- nproc ---------------" && NPROC_CPU=$(nproc) && NPROC_GPU=$(($(nproc)<8?$(nproc):8)) && echo "NPROC_CPU" $NPROC_CPU && echo "NPROC_GPU" $NPROC_GPU
17853928bd0SJeremy L Thompson    - echo "-------------- CC ------------------" && $CC --version
17953928bd0SJeremy L Thompson    - echo "-------------- CXX -----------------" && $CXX --version
18053928bd0SJeremy L Thompson    - echo "-------------- FC ------------------" && $FC --version
18153928bd0SJeremy L Thompson    - echo "-------------- NVCC ----------------" && $NVCC --version
18253928bd0SJeremy L Thompson    - echo "-------------- GCOV ----------------" && gcov --version
18353928bd0SJeremy L Thompson  script:
18453928bd0SJeremy L Thompson    - rm -f .SUCCESS
18553928bd0SJeremy L Thompson# libCEED
18653928bd0SJeremy L Thompson    - make configure OPT='-O -march=native -ffp-contract=fast' CUDA_DIR=/usr
18753928bd0SJeremy L Thompson    - echo "-------------- libCEED -------------" && make info
18853928bd0SJeremy L Thompson    - BACKENDS_GPU=$(make info-backends | grep -o '/gpu[^ ]*' | tr '\n' ' ')
18953928bd0SJeremy L Thompson    - echo "-------------- BACKENDS_GPU --------" && echo $BACKENDS_GPU
19053928bd0SJeremy L Thompson    - PEDANTIC=1 make -k -j$NPROC_CPU -l$NPROC_CPU
19153928bd0SJeremy L Thompson# -- libCEED only tests
19253928bd0SJeremy L Thompson    - echo "-------------- core tests ----------"
19353928bd0SJeremy L Thompson#    Note: PETSC_DIR is set by default in GitLab runner env, unsetting to isolate core tests
19453928bd0SJeremy L Thompson    - export PETSC_DIR= PETSC_ARCH=
19553928bd0SJeremy L Thompson    - make -k -j$((NPROC_GPU / NPROC_POOL)) BACKENDS="$BACKENDS_GPU" JUNIT_BATCH="cuda" junit realsearch=%
19653928bd0SJeremy L Thompson# Libraries for examples
19753928bd0SJeremy L Thompson# -- PETSc with CUDA (minimal)
19853928bd0SJeremy 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
19953928bd0SJeremy L Thompson    - source /home/jawr8143/SmartSimTestingSoftware/bin/activate && export SMARTREDIS_DIR=/home/jawr8143/SmartSimTestingSoftware/smartredis/install
20053928bd0SJeremy L Thompson    - echo "-------------- PETSc ---------------" && make -C $PETSC_DIR info
20153928bd0SJeremy L Thompson    - make -k -j$((NPROC_GPU / NPROC_POOL)) JUNIT_BATCH="cuda" junit BACKENDS="$BACKENDS_GPU" search="petsc fluids solids"
2029e9358dcSJeremy L Thompson# Clang-tidy
2039e9358dcSJeremy L Thompson    - echo "-------------- clang-tidy ----------" && clang-tidy --version
2049e9358dcSJeremy L Thompson    - TIDY_OPTS="-fix-errors" make -j$NPROC_CPU tidy && git diff --color=always --exit-code
20553928bd0SJeremy L Thompson# Report status
20653928bd0SJeremy L Thompson    - touch .SUCCESS
20753928bd0SJeremy L Thompson  after_script:
20853928bd0SJeremy L Thompson    - |
20953928bd0SJeremy L Thompson      if [ -f .SUCCESS ]; then
21053928bd0SJeremy L Thompson        lcov --directory . --capture --output-file coverage.info;
21153928bd0SJeremy L Thompson        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F interface;
21253928bd0SJeremy L Thompson        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F gallery;
21353928bd0SJeremy L Thompson        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F backends;
21453928bd0SJeremy L Thompson        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F tests;
21553928bd0SJeremy L Thompson        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F examples;
21653928bd0SJeremy L Thompson      fi
21753928bd0SJeremy L Thompson  artifacts:
21853928bd0SJeremy L Thompson    paths:
21953928bd0SJeremy L Thompson      - build/*.junit
22053928bd0SJeremy L Thompson    reports:
22153928bd0SJeremy L Thompson      junit: build/*.junit
22253928bd0SJeremy L Thompson
22353928bd0SJeremy L Thompson
22453928bd0SJeremy L Thompson# ----------------------------------------------------------------------------------------
22553928bd0SJeremy L Thompson# ROCm backends
22653928bd0SJeremy L Thompson# ----------------------------------------------------------------------------------------
22709f072d1SJed Brownnoether-rocm:
2281e31b501SJeremy L Thompson  stage: test:gpu-and-float
22909f072d1SJed Brown  tags:
23009f072d1SJed Brown    - rocm
231a3179afaSjeremylt  interruptible: true
2321e31b501SJeremy L Thompson  before_script:
2335221680fSJeremy L Thompson# Environment
23438607094Sjeremylt    - export COVERAGE=1 CC=gcc CXX=g++ FC=gfortran HIPCC=hipcc
23519868e18SZach Atkins    - export NPROC_POOL=4
236de01c4d8Sjeremylt    - echo "-------------- nproc ---------------" && NPROC_CPU=$(nproc) && NPROC_GPU=$(($(nproc)<8?$(nproc):8)) && echo "NPROC_CPU" $NPROC_CPU && echo "NPROC_GPU" $NPROC_GPU
237d758efd3Sjeremylt    - echo "-------------- CC ------------------" && $CC --version
238d758efd3Sjeremylt    - echo "-------------- CXX -----------------" && $CXX --version
239d758efd3Sjeremylt    - echo "-------------- FC ------------------" && $FC --version
240d758efd3Sjeremylt    - echo "-------------- HIPCC ---------------" && $HIPCC --version
241d758efd3Sjeremylt    - echo "-------------- GCOV ----------------" && gcov --version
242d758efd3Sjeremylt# Libraries for backends
243d758efd3Sjeremylt# -- MAGMA from dev branch
244d758efd3Sjeremylt    - echo "-------------- MAGMA ---------------"
245d7cd60dfSJed Brown    - export MAGMA_DIR=/projects/hipMAGMA && git -C $MAGMA_DIR -c safe.directory=$MAGMA_DIR describe
2461e31b501SJeremy L Thompson  script:
2471e31b501SJeremy L Thompson    - rm -f .SUCCESS
24838607094Sjeremylt# libCEED
249628bebf4SJed Brown    - make configure ROCM_DIR=/opt/rocm-5.6.0 OPT='-O -march=native -ffp-contract=fast'
2501b16049aSZach Atkins    - BACKENDS_CPU=$(make info-backends-all | grep -o '/cpu[^ ]*' | tr '\n' ' ') && BACKENDS_GPU=$(make info-backends | grep -o '/gpu[^ ]*' | tr '\n' ' ')
251d758efd3Sjeremylt    - echo "-------------- libCEED -------------" && make info
2525221680fSJeremy L Thompson    - echo "-------------- BACKENDS_GPU --------" && echo $BACKENDS_GPU
253ab25172fSJeremy L Thompson    - make -j$NPROC_CPU
254d758efd3Sjeremylt# -- libCEED only tests
255d758efd3Sjeremylt    - echo "-------------- core tests ----------"
25609f072d1SJed Brown    - 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
257e0e4aa64Sjeremylt#    Note: PETSC_DIR is set by default in GitLab runner env, unsetting to isolate core tests
258e0e4aa64Sjeremylt    - export PETSC_DIR= PETSC_ARCH=
25919868e18SZach Atkins    - make -k -j$((NPROC_GPU / NPROC_POOL)) BACKENDS="$BACKENDS_GPU" JUNIT_BATCH="hip" junit realsearch=%
260d758efd3Sjeremylt# Libraries for examples
261d758efd3Sjeremylt# -- PETSc with HIP (minimal)
262d7cd60dfSJed Brown    - export PETSC_DIR=/projects/petsc PETSC_ARCH=mpich-hip && git -C $PETSC_DIR -c safe.directory=$PETSC_DIR describe
263d758efd3Sjeremylt    - echo "-------------- PETSc ---------------" && make -C $PETSC_DIR info
26419868e18SZach Atkins    - make -k -j$((NPROC_GPU / NPROC_POOL)) BACKENDS="$BACKENDS_GPU" JUNIT_BATCH="hip" junit search="petsc fluids solids"
265a4b1483eSJeremy L Thompson# -- MFEM v4.6
266a4b1483eSJeremy L Thompson    - cd .. && export MFEM_VERSION=mfem-4.6 && { [[ -d $MFEM_VERSION ]] || { git clone --depth 1 --branch v4.6 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
267d758efd3Sjeremylt    - echo "-------------- MFEM ----------------" && make -C $MFEM_DIR info
26819868e18SZach Atkins    - make -k -j$((NPROC_GPU / NPROC_POOL)) BACKENDS="$BACKENDS_GPU" JUNIT_BATCH="hip" junit search=mfem
269d758efd3Sjeremylt# -- Nek5000 v19.0
27038607094Sjeremylt    - export COVERAGE=0
271d758efd3Sjeremylt    - 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
272d758efd3Sjeremylt    - echo "-------------- Nek5000 -------------" && git -C $NEK5K_DIR describe --tags
27319868e18SZach Atkins    - export NPROC_POOL=1
274b41f14d5SJeremy L Thompson    - make -k -j$NPROC_GPU BACKENDS="$BACKENDS_GPU" JUNIT_BATCH="hip" junit search=nek NEK5K_DIR=$NEK5K_DIR
2758c81f8b0SPeter Munch# -- deal.II 8bd5c262f13e15793aa206b6eed8774a9b25ce11
2768c81f8b0SPeter Munch    - export DEAL_II_ROOT_DIR=/projects/dealii DEAL_II_DIR=/projects/dealii/install
2778c81f8b0SPeter Munch    - echo "-------------- deal.II -------------" && git -C $DEAL_II_ROOT_DIR -c safe.directory=$DEAL_II_ROOT_DIR describe --always
2788c81f8b0SPeter Munch    - make -k -j$((NPROC_GPU / NPROC_POOL)) BACKENDS="$BACKENDS_GPU" JUNIT_BATCH="hip" junit search=dealii DEAL_II_DIR=$DEAL_II_DIR
279fd936b74Sjeremylt# Clang-tidy
280d758efd3Sjeremylt    - echo "-------------- clang-tidy ----------" && clang-tidy --version
281db7c0df8SJeremy L Thompson    - TIDY_OPTS="-fix-errors" make -j$NPROC_CPU tidy && git diff --color=always --exit-code
28238607094Sjeremylt# Report status
283b9ce5a03SJed Brown    - touch .SUCCESS
2843d19ba41SJeremy L Thompson  after_script:
2856c1493a0SJeremy L Thompson    - |
286b9ce5a03SJed Brown      if [ -f .SUCCESS ]; then
287752c3701SJeremy L Thompson        lcov --directory . --capture --output-file coverage.info;
288d7f2f9acSJed Brown        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F interface;
289d7f2f9acSJed Brown        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F gallery;
290d7f2f9acSJed Brown        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F backends;
291d7f2f9acSJed Brown        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F tests;
292d7f2f9acSJed Brown        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F examples;
2933d19ba41SJeremy L Thompson      fi
29409f072d1SJed Brown  artifacts:
29509f072d1SJed Brown    paths:
29609f072d1SJed Brown      - build/*.junit
29709f072d1SJed Brown    reports:
29809f072d1SJed Brown      junit: build/*.junit
29909f072d1SJed Brown      performance: performance.json
300422b158fSJed Brown
30126a4920cSJeremy L Thompson
30253928bd0SJeremy L Thompson# ----------------------------------------------------------------------------------------
3039e9358dcSJeremy L Thompson# CPU + ROCm backends with CeedScalar == float (32 bit)
30453928bd0SJeremy L Thompson# ----------------------------------------------------------------------------------------
30580a9ef05SNatalie Beamsnoether-float:
3061e31b501SJeremy L Thompson  stage: test:gpu-and-float
30780a9ef05SNatalie Beams  tags:
3081e31b501SJeremy L Thompson    - cpu
30980a9ef05SNatalie Beams    - rocm
31080a9ef05SNatalie Beams  interruptible: true
3111e31b501SJeremy L Thompson  before_script:
3125221680fSJeremy L Thompson# Environment
31380a9ef05SNatalie Beams    - export COVERAGE=1 CC=gcc CXX=g++ FC= HIPCC=hipcc
31419868e18SZach Atkins    - export NPROC_POOL=8
31580a9ef05SNatalie Beams    - echo "-------------- nproc ---------------" && NPROC_CPU=$(nproc) && NPROC_GPU=$(($(nproc)<8?$(nproc):8)) && echo "NPROC_CPU" $NPROC_CPU && echo "NPROC_GPU" $NPROC_GPU
31680a9ef05SNatalie Beams    - echo "-------------- CC ------------------" && $CC --version
31780a9ef05SNatalie Beams    - echo "-------------- CXX -----------------" && $CXX --version
31880a9ef05SNatalie Beams    - echo "-------------- HIPCC ---------------" && $HIPCC --version
31980a9ef05SNatalie Beams    - echo "-------------- GCOV ----------------" && gcov --version
32080a9ef05SNatalie Beams# Libraries for backends
32180a9ef05SNatalie Beams# -- MAGMA from dev branch
32280a9ef05SNatalie Beams    - echo "-------------- MAGMA ---------------"
323d7cd60dfSJed Brown    - export MAGMA_DIR=/projects/hipMAGMA && git -C $MAGMA_DIR -c safe.directory=$MAGMA_DIR describe
324*ed721ed8SJeremy L Thompson# -- LIBXSMM 7 April 2024
325*ed721ed8SJeremy 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
32668c150f8SJed Brown    - echo "-------------- LIBXSMM -------------" && basename $XSMM_DIR
3271e31b501SJeremy L Thompson  script:
3281e31b501SJeremy L Thompson    - rm -f .SUCCESS
32980a9ef05SNatalie Beams# libCEED
3301e31b501SJeremy L Thompson# Change to single precision
331c9c2c079SJeremy L Thompson    - sed -i 's/ceed-f64/ceed-f32/1' include/ceed/types.h
33280a9ef05SNatalie Beams# Build libCEED
333628bebf4SJed Brown    - make configure ROCM_DIR=/opt/rocm-5.6.0 OPT='-O -march=native -ffp-contract=fast'
3341b16049aSZach Atkins    - BACKENDS_CPU=$(make info-backends-all | grep -o '/cpu[^ ]*' | tr '\n' ' ') && BACKENDS_GPU=$(make info-backends | grep -o '/gpu[^ ]*' | tr '\n' ' ')
33580a9ef05SNatalie Beams    - echo "-------------- libCEED -------------" && make info
3365221680fSJeremy L Thompson    - echo "-------------- BACKENDS_CPU --------" && echo $BACKENDS_CPU
3375221680fSJeremy L Thompson    - echo "-------------- BACKENDS_GPU --------" && echo $BACKENDS_GPU
33880a9ef05SNatalie Beams    - make -j$NPROC_CPU
33980a9ef05SNatalie Beams# -- libCEED only tests
34080a9ef05SNatalie Beams    - echo "-------------- core tests ----------"
34180a9ef05SNatalie 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
34280a9ef05SNatalie Beams#    Note: PETSC_DIR is set by default in GitLab runner env, unsetting to isolate core tests
34380a9ef05SNatalie Beams    - export PETSC_DIR= PETSC_ARCH=
34419868e18SZach Atkins    - make -k -j$((NPROC_CPU / NPROC_POOL)) BACKENDS="$BACKENDS_CPU" JUNIT_BATCH="float-cpu" junit realsearch=%
34519868e18SZach Atkins    - export NPROC_POOL=4
34619868e18SZach Atkins    - make -k -j$((NPROC_GPU / NPROC_POOL)) BACKENDS="$BACKENDS_GPU" JUNIT_BATCH="float-hip" junit realsearch=%
34780a9ef05SNatalie Beams# Report status
34880a9ef05SNatalie Beams    - echo "SUCCESS" > .job_status
34980a9ef05SNatalie Beams  after_script:
35080a9ef05SNatalie Beams    - |
35180a9ef05SNatalie Beams      if [ $(cat .job_status) == "SUCCESS" ]; then
35280a9ef05SNatalie Beams        lcov --directory . --capture --output-file coverage.info;
35380a9ef05SNatalie Beams        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F interface;
35480a9ef05SNatalie Beams        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F gallery;
35580a9ef05SNatalie Beams        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F backends;
35680a9ef05SNatalie Beams        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F tests;
35780a9ef05SNatalie Beams        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F examples;
35880a9ef05SNatalie Beams      fi
359c9c2c079SJeremy L Thompson    - sed -i 's/ceed-f32/ceed-f64/1' include/ceed/types.h
36080a9ef05SNatalie Beams  artifacts:
36180a9ef05SNatalie Beams    paths:
36280a9ef05SNatalie Beams      - build/*.junit
36380a9ef05SNatalie Beams    reports:
36480a9ef05SNatalie Beams      junit: build/*.junit
36580a9ef05SNatalie Beams      performance: performance.json
366