Skip to content

Commit

Permalink
Resolve "Implement CI for unitests"
Browse files Browse the repository at this point in the history
  • Loading branch information
brunowu authored and nidode committed Sep 27, 2024
1 parent 7a94ddc commit abc0170
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 22 deletions.
121 changes: 104 additions & 17 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,111 @@
default:
tags: [ public-docker ]
variables:
SCHEDULER_PARAMETERS: '-Aslai -N1'

stages:
- build
- test
- coverage

build_cpu:
stage: build
tags: [ docker-proton ]
image:
name: gitlab.version.fz-juelich.de:5555/sharedrunner/opensuse
name: opensuse:jsc-gcc12

build:
stage: build
script:
- cmake --version
- mkdir -p build
- cd build
- FC=gfortran CC=gcc CXX=g++ cmake -DENABLE_TESTS=ON -DMPI_RUN_ARGS="--allow-run-as-root" ..
- make VERBOSE=1
- cmake --version
- mkdir -p build_cpu
- cd build_cpu
- export CFLAGS='-Wextra -Wall -pedantic'
- export CXXFLAGS='-Wextra -Wall -pedantic'
- export FFLAGS='-Wextra -Wall -pedantic'
- env CFLAGS="$CFLAGS --coverage" CXXFLAGS="$CXXFLAGS --coverage" FFLAGS="$FFLAGS --coverage" FC=gfortran CC=gcc CXX=g++ cmake -DENABLE_TESTS=ON -DMPI_RUN_ARGS="--allow-run-as-root" .. -DCMAKE_EXE_LINKER_FLAGS="--coverage"
- make VERBOSE=1
artifacts:
paths:
- build/Makefile
- build/chase_driver
- build/CTestTestfile.cmake
- build/tests
test:
- build_cpu/Makefile
- build_cpu/CTestTestfile.cmake
- build_cpu/tests
expire_in: 1 week

test_cpu:
stage: test
dependencies:
- build_cpu
tags: [ docker-proton ]
image:
name: opensuse:jsc-gcc12
script:
- cd build_cpu
- CTEST_OUTPUT_ON_FAILURE=1 make test
- rm -rf _deps
artifacts:
paths:
- build_cpu/*
expire_in: 1 week

build_gpu:
stage: build
tags:
- juwels_booster
- jacamar
- login
- shell
id_tokens:
SITE_ID_TOKEN:
aud: https://gitlab.jsc.fz-juelich.de
script:
- echo $SYSTEMNAME
- module load Stages/2024 GCC/12.3.0 OpenMPI imkl CMake CUDA
- cmake --version
- mkdir -p build_gpu
- cd build_gpu
- export CFLAGS='-Wextra -Wall -pedantic'
- export CXXFLAGS='-Wextra -Wall -pedantic'
- export FFLAGS='-Wextra -Wall -pedantic'
- env CFLAGS="$CFLAGS --coverage" CXXFLAGS="$CXXFLAGS --coverage" FFLAGS="$FFLAGS --coverage" cmake -DENABLE_TESTS=ON -DMPI_RUN="srun" .. -DCMAKE_EXE_LINKER_FLAGS="--coverage"
- make VERBOSE=1
artifacts:
paths:
- build_gpu/Makefile
- build_gpu/CTestTestfile.cmake
- build_gpu/tests

test_gpu:
stage: test
dependencies:
- build_gpu
tags:
- juwels_booster
- jacamar
- compute
- slurm
id_tokens:
SITE_ID_TOKEN:
aud: https://gitlab.jsc.fz-juelich.de
script:
- echo $SYSTEMNAME
- module load Stages/2024 GCC/12.3.0 OpenMPI imkl CMake CUDA
- export CUDA_VISIBLE_DEVICES=0,1,2,3
- cd build_gpu
- CTEST_OUTPUT_ON_FAILURE=1 make test
- rm -rf _deps
artifacts:
paths:
- build_gpu/*

coverage:
stage: coverage
coverage: '/lines......: (\d+[.]\d+)/'
dependencies:
- test_cpu
- test_gpu
tags: [ docker-proton ]
image:
name: opensuse:jsc-gcc12
script:
- cd build
- CTEST_OUTPUT_ON_FAILURE=1 make test
# Merge the two coverage files
- lcov --capture --directory ./build_cpu --output-file coverage_cpu.info
- lcov --capture --directory ./build_gpu --output-file coverage_gpu.info
- lcov --add-tracefile coverage_cpu.info --add-tracefile coverage_gpu.info --output-file coverage.info
- lcov --summary coverage.info
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![License](https://img.shields.io/github/license/ChASE-library/ChASE)](https://github.com/ChASE-library/ChASE/blob/master/LICENSE) [![DOI](https://zenodo.org/badge/349075288.svg)](https://zenodo.org/badge/latestdoi/349075288) [![Latest Version](https://img.shields.io/github/v/release/ChASE-library/ChASE)](https://github.com/ChASE-library/ChASE/releases/latest) [![DOI](https://img.shields.io/badge/DOI-10.1145%2F3313828%20-orange)](https://doi.org/10.1145/3313828) [![DOI](https://img.shields.io/badge/DOI-10.1002%2Fcpe.3394%20-orange)](https://doi.org/10.1002/cpe.3394)
[![License](https://img.shields.io/github/license/ChASE-library/ChASE)](https://github.com/ChASE-library/ChASE/blob/master/LICENSE) [![DOI](https://zenodo.org/badge/349075288.svg)](https://zenodo.org/badge/latestdoi/349075288) [![Latest Version](https://img.shields.io/github/v/release/ChASE-library/ChASE)](https://github.com/ChASE-library/ChASE/releases/latest) [![DOI](https://img.shields.io/badge/DOI-10.1145%2F3313828%20-orange)](https://doi.org/10.1145/3313828) [![DOI](https://img.shields.io/badge/DOI-10.1002%2Fcpe.3394%20-orange)](https://doi.org/10.1002/cpe.3394) [![coverage](https://gitlab.jsc.fz-juelich.de/chase/chase-library/ChASE/badges/master/coverage.svg?job=coverage)](https://gitlab.jsc.fz-juelich.de/chase/chase-library/ChASE/badges/master/coverage.svg)
<img src="docs/images/ChASE_Logo_RGB.png" alt="Matrix Generation Pattern" style="zoom:40%;" />
# ChASE: a Chebyshev Accelerated Subspace Eigensolver for Dense Eigenproblems

Expand Down Expand Up @@ -114,7 +114,7 @@ cmake .. -DBUILD_WITH_EXAMPLES=ON
### Current contributors
- Davor Davidović – Advanced parallel GPU implementation and optimization
- Nenad Mijić – ARM-based implementation and optimization
- Nenad Mijić – ARM-based implementation and optimization, CholeskyQR, unitests, parallel IO
### Past contributors
Expand Down
6 changes: 3 additions & 3 deletions tests/QR/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
file(COPY QR_matrices DESTINATION ${CMAKE_BINARY_DIR}/tests/QR)

setup_test(QRTest QR_test.cpp LIBRARIES chase_mpi)
setup_test(QRTestIntegration QR_integration.cpp LIBRARIES chase_mpi GTest::gmock)

setup_test_serial(QRTestSerial QR_test.cpp LIBRARIES chase_seq)

if(TARGET chase_cuda )
setup_test(QRTestCuda QR_test.cpp LIBRARIES chase_mpi chase_cuda)
setup_test_serial(QRTestCudaSerial QR_test.cpp LIBRARIES chase_seq chase_cuda)
else()
setup_test(QRTest QR_test.cpp LIBRARIES chase_mpi)
setup_test_serial(QRTestSerial QR_test.cpp LIBRARIES chase_seq)
endif()

0 comments on commit abc0170

Please sign in to comment.