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