xref: /libCEED/.gitlab-ci.yml (revision dcefb99bf4e43737baea662a94271a0fc9c30aca)
1stages:
2  - test
3
4noether-rocm:
5  stage: test
6  tags:
7    - rocm
8  interruptible: true
9  image: jedbrown/rocm:latest
10  script:
11# Compilers
12    - export COVERAGE=1 CC=gcc CXX=g++ FC=gfortran HIPCC=hipcc
13    - echo "-------------- nproc ---------------" && NPROC_CPU=$(nproc) && NPROC_GPU=$(($(nproc)<8?$(nproc):8)) && echo "NPROC_CPU" $NPROC_CPU && echo "NPROC_GPU" $NPROC_GPU
14    - echo "-------------- CC ------------------" && $CC --version
15    - echo "-------------- CXX -----------------" && $CXX --version
16    - echo "-------------- FC ------------------" && $FC --version
17    - echo "-------------- HIPCC ---------------" && $HIPCC --version
18    - echo "-------------- GCOV ----------------" && gcov --version
19# Libraries for backends
20# -- MAGMA from dev branch
21    - echo "-------------- MAGMA ---------------"
22    - export MAGMA_DIR=/projects/hipMAGMA && git -C $MAGMA_DIR describe
23# -- LIBXSMM v1.16.1
24    - cd .. && export XSMM_VERSION=libxsmm-1.16.1 && { [[ -d $XSMM_VERSION ]] || { git clone --depth 1 --branch 1.16.1 https://github.com/hfp/libxsmm.git $XSMM_VERSION && make -C $XSMM_VERSION -j$(nproc); }; } && export XSMM_DIR=$PWD/$XSMM_VERSION && cd libCEED
25    - echo "-------------- LIBXSMM -------------" && git -C $XSMM_DIR describe --tags
26# -- OCCA v1.1.0
27    - cd .. && export OCCA_VERSION=occa-1.1.0 OCCA_OPENCL_ENABLED=0 && { [[ -d $OCCA_VERSION ]] || { git clone --depth 1 --branch v1.1.0 https://github.com/libocca/occa.git $OCCA_VERSION && make -C $OCCA_VERSION -j$(nproc); }; } && export OCCA_DIR=$PWD/$OCCA_VERSION && cd libCEED
28    - echo "-------------- OCCA ----------------" && make -C $OCCA_DIR info
29# libCEED
30    - make configure HIP_DIR=/opt/rocm OPT='-O -march=native -ffp-contract=fast'
31    - BACKENDS_CPU=$(make info-backends-all | grep -o '/cpu[^ ]*') && BACKENDS_GPU=$(make info-backends | grep -o '/gpu[^ ]*')
32    - echo "-------------- libCEED -------------" && make info
33    - echo "-------------- BACKENDS_CPU---------" && echo $BACKENDS_CPU
34    - echo "-------------- BACKENDS_GPU---------" && echo $BACKENDS_GPU
35    - make -j$NPROC_CPU
36# -- libCEED only tests
37    - echo "-------------- core tests ----------"
38    - 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
39#    Note: PETSC_DIR is set by default in GitLab runner env, unsetting to isolate core tests
40    - export PETSC_DIR= PETSC_ARCH=
41    - make -k -j$NPROC_CPU BACKENDS="$BACKENDS_CPU" junit realsearch=%
42    - make -k -j$NPROC_GPU BACKENDS="$BACKENDS_GPU" junit realsearch=%
43# Libraries for examples
44# -- PETSc with HIP (minimal)
45    - export PETSC_DIR=/projects/petsc PETSC_ARCH=mpich-hip && git -C $PETSC_DIR describe
46    - echo "-------------- PETSc ---------------" && make -C $PETSC_DIR info
47    - make -k -j$NPROC_CPU BACKENDS="$BACKENDS_CPU" junit search="petsc fluids solids"
48    - make -k -j$NPROC_GPU BACKENDS="$BACKENDS_GPU" junit search="petsc fluids solids"
49# -- MFEM v4.2
50    - cd .. && export MFEM_VERSION=mfem-4.2 && { [[ -d $MFEM_VERSION ]] || { git clone --depth 1 --branch v4.2 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
51    - echo "-------------- MFEM ----------------" && make -C $MFEM_DIR info
52    - make -k -j$NPROC_CPU BACKENDS="$BACKENDS_CPU" junit search=mfem
53    - make -k -j$NPROC_GPU BACKENDS="$BACKENDS_GPU" junit search=mfem
54# -- Nek5000 v19.0
55    - export COVERAGE=0
56    - 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
57    - echo "-------------- Nek5000 -------------" && git -C $NEK5K_DIR describe --tags
58    - make -k -j$NPROC_CPU BACKENDS="$BACKENDS_CPU" junit search=nek
59    - make -k -j$NPROC_GPU BACKENDS="$BACKENDS_GPU" junit search=nek
60# Clang-tidy
61    - echo "-------------- clang-tidy ----------" && clang-tidy --version
62    - TIDY_OPTS="-fix-errors" make -j$NPROC_CPU tidy && git diff --exit-code
63# Report status
64    - echo "SUCCESS" > .job_status
65  after_script:
66    - |
67      if [ $(cat .job_status) == "SUCCESS" ]; then
68        lcov --directory . --capture --output-file coverage.info;
69        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F interface;
70        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F gallery;
71        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F backends;
72        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F tests;
73        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F examples;
74      fi
75  artifacts:
76    paths:
77      - build/*.junit
78    reports:
79      junit: build/*.junit
80      performance: performance.json
81
82lv-cuda:
83  stage: test
84  tags:
85    - cuda
86  interruptible: true
87  before_script:
88# Compilers
89    - . /opt/rh/gcc-toolset-10/enable
90    - export COVERAGE=1 CC=gcc CXX=g++ FC=gfortran CUDA_DIR=/usr/local/cuda
91    - echo "-------------- nproc ---------------" && NPROC_CPU=$(nproc) && NPROC_GPU=$(($(nproc)<8?$(nproc):4)) && echo "NPROC_CPU" $NPROC_CPU && echo "NPROC_GPU" $NPROC_GPU
92    - echo "-------------- CC ------------------" && $CC --version
93    - echo "-------------- CXX -----------------" && $CXX --version
94    - echo "-------------- FC ------------------" && $FC --version
95    - echo "-------------- NVCC ----------------" && $CUDA_DIR/bin/nvcc --version
96# libCEED
97    - make configure OPT='-O -march=native -ffp-contract=fast'
98    - echo "-------------- libCEED -------------" && make info
99    - BACKENDS_GPU=$(make info-backends | grep -o '/gpu[^ ]*')
100    - echo "-------------- BACKENDS_GPU---------" && echo $BACKENDS_GPU
101  script:
102    - nice make -k -j$NPROC_GPU -l$NPROC_GPU
103    - echo "-------------- core tests ----------"
104    - export PETSC_DIR= PETSC_ARCH=
105    - nice make -k -j$NPROC_GPU junit BACKENDS="$BACKENDS_GPU" realsearch=%
106# Libraries for examples
107# -- PETSc with CUDA (minimal)
108    - export PETSC_DIR=/home/jeth8984/petsc PETSC_ARCH=cuda-O && git -C $PETSC_DIR describe
109    - echo "-------------- PETSc ---------------" && make -C $PETSC_DIR info
110    - make -k -j$NPROC_GPU BACKENDS="$BACKENDS_GPU" junit search="petsc"
111# Report status
112    - echo "SUCCESS" > .job_status
113  after_script:
114    - |
115      if [ $(cat .job_status) == "SUCCESS" ]; then
116        lcov --directory . --capture --output-file coverage.info;
117        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F interface;
118        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F gallery;
119        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F backends;
120        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F tests;
121        bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${CODECOV_ACCESS_TOKEN} -F examples;
122      fi
123  artifacts:
124    paths:
125      - build/*.junit
126    reports:
127      junit: build/*.junit
128