Newer
Older
# #######################################################################################
# ____ ____ __ ______ __________ __ __ __ __
# \ \ | | | | | _ \ |___ ___| | | | | / \ | |
# \ \ | | | | | |_) | | | | | | | / \ | |
# \ \ | | | | | _ / | | | | | | / /\ \ | |
# \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
# \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
# \ \ | | ________________________________________________________________
# \ \ | | | ______________________________________________________________|
# \ \| | | | __ __ __ __ ______ _______
# \ | | |_____ | | | | | | | | | _ \ / _____)
# \ | | _____| | | | | | | | | | | \ \ \_______
# \ | | | | |_____ | \_/ | | | | |_/ / _____ |
# \ _____| |__| |________| \_______/ |__| |______/ (_______/
#
# This file is part of VirtualFluids. VirtualFluids is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License along
# with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>
# #######################################################################################
image: git.rz.tu-bs.de:4567/irmb/virtualfluids/ubuntu22_04:1.1

Soeren Peters
committed
workflow:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: never # disable detached merge request pipelines
- when: always # add all jobs to normal pipeline. This can be overwritten by the rules of the jobs.
###############################################################################
## Builds ##
###############################################################################
.gnu_build_template:

Sören Peters
committed
expire_in: 1 hrs
- export CCACHE_BASEDIR=$CI_PROJECT_DIR
- export CCACHE_DIR=$CI_PROJECT_DIR/cache
- export CCACHE_COMPILERCHECK=content
- ccache --zero-stats
- ccache --show-stats
- $CXX --version
- $CC --version
- cmake --version
- mpirun --version
- mkdir -p $CI_PROJECT_DIR/$BUILD_FOLDER
- cd $CI_PROJECT_DIR/$BUILD_FOLDER

Soeren Peters
committed
-DVF_ENABLE_WARNINGS_AS_ERRORS=ON
###############################################################################
before_script:
- export CC=gcc
- export CXX=g++
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
###############################################################################
gcc_12_float:
extends: .gnu_build_template
before_script:
- export CC=gcc
- export CXX=g++
script:
- export CCACHE_BASEDIR=$CI_PROJECT_DIR
- export CCACHE_DIR=$CI_PROJECT_DIR/cache
- export CCACHE_COMPILERCHECK=content
- ccache --zero-stats
- ccache --show-stats
- $CXX --version
- $CC --version
- cmake --version
- mpirun --version
- mkdir -p $CI_PROJECT_DIR/$BUILD_FOLDER
- cd $CI_PROJECT_DIR/$BUILD_FOLDER
- rm -r -f ./*
- cmake .. -LAH
--preset=make_all
-DVF_ENABLE_DOUBLE_ACCURACY=OFF
-DVF_ENABLE_WARNINGS_AS_ERRORS=ON
-DCMAKE_CUDA_ARCHITECTURES=70
- make -j4
- ccache --show-stats
###############################################################################

Soeren Peters
committed
- export CXX=clang++
###############################################################################
stage: build
tags:
- win
- gpu
variables:
BUILD_CONFIGURATION: "Release"
BUILD_FOLDER: "build"
# add cmake and MSBuild.exe to the path.
# This Needs to be adapted when moved to a new build machine.
before_script:
- git --version
- $env:Path += ";C:\Program Files\CMake\bin\"
- cmake --version
- $env:Path += ";C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin"
- MSBuild.exe -version
script:
- cd $CI_PROJECT_DIR
- md -force $env:BUILD_FOLDER
- cd $env:BUILD_FOLDER

Soeren Peters
committed
- cmake .. --preset=msvc_all -DVF_ENABLE_PYTHON_BINDINGS=OFF -DCMAKE_CUDA_ARCHITECTURES=61 -DVF_ENABLE_WARNINGS_AS_ERRORS=ON
- MSBuild.exe VirtualFluids.sln /property:Configuration=$env:BUILD_CONFIGURATION /verbosity:minimal /maxcpucount:4
artifacts:

Sören Peters
committed
expire_in: 1 hrs
paths:
- $CI_PROJECT_DIR/$env:BUILD_FOLDER/
###############################################################################

Sören Peters
committed
expire_in: 1 hrs
- pybuild/ # build in separate folder to avoid conflicts with c++ build
before_script:
- export CCACHE_BASEDIR=$CI_PROJECT_DIR
- export CCACHE_DIR=$CI_PROJECT_DIR/cache

Soeren Peters
committed
- export SKBUILD_CMAKE_ARGS="--preset=make_all;-G=Ninja"
###############################################################################
## Tests ##
###############################################################################
- cd $CI_PROJECT_DIR/build

Soeren Peters
committed
###############################################################################
- $env:Path += ";C:\Program Files\CMake\bin\"
- ctest --version
- cd $CI_PROJECT_DIR/build
- ctest --output-on-failure -C Release

Soeren Peters
committed
###############################################################################
- pip3 install -r Python/requirements.txt
- python3 -m unittest discover -s Python -v
###############################################################################
build-regression-tests-ci:
image: python:3.10
stage: test
before_script:
- pip install -r utilities/ci-regression-tests/requirements.txt
script:
- python3 utilities/ci-regression-tests/generate-ci.py
artifacts:
expire_in: 1 week
paths:
- generated/
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
when: always
- when: manual
allow_failure: true
needs: []
trigger-regression-tests:
stage: test
needs:
- build-regression-tests-ci
trigger:
include:
- artifact: generated/regression-tests-ci.yml
job: build-regression-tests-ci
strategy: depend
variables:
PARENT_PIPELINE_ID: $CI_PIPELINE_ID
###############################################################################
image: python:latest
stage: test
needs: []
rules:
- if: $REMOTE_USER && $REMOTE_HOST && $PRIVATE_KEY && $CI_PIPELINE_SOURCE == "schedule"
when: always
- when: manual
allow_failure: true
before_script:
- pip install hpc-rocket==0.6.0
- pip install "fieldcompare[all]"
script:
- hpc-rocket launch regression-tests/multigpu_test/rocket4GPU.yml --watch --save-jobid hpcrocket4GPU.log
- cat output/4GPU/slurm4GPU.out
- git clone --depth 1 --filter=blob:none --sparse https://github.com/irmb/test_data
- cd test_data
- git sparse-checkout set regression_tests/gpu/DrivenCavity_4GPU_2Levels regression_tests/gpu/SphereMultiGPU_4GPU_2Levels
- fieldcompare dir output/4GPU test_data/regression_tests/gpu/DrivenCavity_4GPU_2Levels --include-files "DrivenCavityMultiGPU*.vtu"
- fieldcompare dir output/4GPU test_data/regression_tests/gpu/SphereMultiGPU_4GPU_2Levels --include-files "SphereMultiGPU*.vtu"
- hpc-rocket cancel regression-tests/multigpu_test/rocket4GPU.yml --read-jobid-from hpcrocket4GPU.log
- output/4GPU/*
- hpcrocket4GPU.log
expire_in: 1 week
###############################################################################
regression_test_8gpu:
image: python:latest
stage: test
needs: []
rules:
- if: $REMOTE_USER && $REMOTE_HOST && $PRIVATE_KEY && $CI_PIPELINE_SOURCE == "schedule"
when: always
- when: manual
allow_failure: true
before_script:
- pip install hpc-rocket==0.6.0
- pip install "fieldcompare[all]"
script:
- hpc-rocket launch regression-tests/multigpu_test/rocket8GPU.yml --watch --save-jobid hpcrocket8GPU.log
- cat output/8GPU/slurm8GPU.out
- git clone --depth 1 --filter=blob:none --sparse https://github.com/irmb/test_data
- cd test_data
- git sparse-checkout set regression_tests/gpu/DrivenCavity_8GPU_2Levels regression_tests/gpu/SphereMultiGPU_8GPU_2Levels
- cd ..
- fieldcompare dir output/8GPU test_data/regression_tests/gpu/DrivenCavity_8GPU_2Levels --include-files "DrivenCavityMultiGPU*.vtu"
- fieldcompare dir output/8GPU test_data/regression_tests/gpu/SphereMultiGPU_8GPU_2Levels --include-files "SphereMultiGPU*.vtu"
after_script:
- hpc-rocket cancel regression-tests/multigpu_test/rocket8GPU.yml --read-jobid-from hpcrocket8GPU.log
- output/8GPU/*
- hpcrocket8GPU.log
expire_in: 1 week

Soeren Peters
committed
###############################################################################

Soeren Peters
committed
nvidia_env_test:
stage: test
image: nvidia/cuda:12.1.1-devel-ubuntu22.04
needs: []
tags:
- gpu
- linux
script:
- echo NVIDIA_VISIBLE_DEVICES=${NVIDIA_VISIBLE_DEVICES}
- nvidia-smi
###############################################################################

Soeren Peters
committed
stage: test

Sven Marcus
committed
rules:
when: always
- when: manual
needs: []
tags:
- gpu
- linux
before_script:

Soeren Peters
committed
- git clone --depth 1 --filter=blob:none --sparse https://github.com/irmb/test_data
- cd test_data
- git sparse-checkout set numerical_tests_gpu/grids numerical_tests_gpu/grids
- export CCACHE_BASEDIR=$CI_PROJECT_DIR
- export CCACHE_DIR=$CI_PROJECT_DIR/cache
- ccache -s
- mkdir -p $CI_PROJECT_DIR/build
- cd $CI_PROJECT_DIR/build

Soeren Peters
committed
- rm -rf ./*
-DCMAKE_CUDA_ARCHITECTURES=60
- make -j4

Soeren Peters
committed
- echo 'Numerical Tests execution is disabled, because the K17CompressibleNavierStokes produces NaNs in the tests. https://git.rz.tu-bs.de/irmb/VirtualFluids_dev/-/issues/168'
# - $CI_PROJECT_DIR/build/bin/NumericalTests $CI_PROJECT_DIR/apps/gpu/tests/NumericalTests/configK17chim_nu10tm3.txt /tmp/test_data/numerical_tests_gpu/ 2>&1 | tee -a numerical_tests_gpu_results.txt
cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths:
- $CI_PROJECT_DIR/cache
artifacts:
paths:
- $CI_PROJECT_DIR/numerical_tests_gpu_results.txt

Soeren Peters
committed
###############################################################################
trigger-hpc-regression-tests:
stage: test
needs: []
rules:
- when: manual
allow_failure: true
trigger:
include:
- local: regression-tests/hpc-test/.gitlab-ci-hpc-test.yml
variables:
PARENT_PIPELINE_ID: $CI_PIPELINE_ID
###############################################################################
###############################################################################

Soeren Peters
committed
.analyze_template:

Soeren Peters
committed
rules:
- if: '$CI_PROJECT_NAMESPACE == "irmb"'

Soeren Peters
committed
when: always
- if: '$CI_PROJECT_NAMESPACE != "irmb"'
when: manual
allow_failure: true
clang_build_analyzer:

Soeren Peters
committed
extends: .analyze_template
before_script:
- export CC=clang
- export CXX=clang++
- $CXX --version
- cd /tmp
- git clone https://github.com/aras-p/ClangBuildAnalyzer.git
- cd ClangBuildAnalyzer
- cmake .
- make
- export PATH+=:$(pwd)
script:
- cd $CI_PROJECT_DIR/build

Soeren Peters
committed
- cmake ..
-DCMAKE_CUDA_ARCHITECTURES=60

Soeren Peters
committed
-DCMAKE_CXX_FLAGS=-ftime-trace
- ClangBuildAnalyzer --start .
- make
- ClangBuildAnalyzer --stop . CBA

Soeren Peters
committed
###############################################################################

Soeren Peters
committed
extends: .analyze_template
- apt-get update && apt-get install -y libclang-15-dev llvm-15-dev

Soeren Peters
committed
- export CC=clang
- export CXX=clang++
- $CXX --version
- cd /tmp
- git clone https://github.com/include-what-you-use/include-what-you-use.git
- cd include-what-you-use
- git checkout clang_15
- cmake . -DCMAKE_PREFIX_PATH=/usr/lib/llvm-15
- make
- export PATH+=:$(pwd)/bin
script:

Soeren Peters
committed
- cmake ..
-DCMAKE_CUDA_ARCHITECTURES=60

Soeren Peters
committed
-DVF_ENABLE_INCLUDE_WHAT_YOU_USE=ON
- make

Soeren Peters
committed
###############################################################################
cppcheck:
extends: .analyze_template
before_script:
- apt-get update && apt-get install -y libpcre3-dev
- chmod +x utilities/install-cppcheck.sh
- ./utilities/install-cppcheck.sh
script:
- cd $CI_PROJECT_DIR
- cppcheck src --enable=all --xml 2> cppcheck.xml

Soeren Peters
committed
###############################################################################
# lizard - Cyclomatic Complexity Analyzer
# Ignore warnings is manually set to 185. This job will fail when new warnings are added.

Soeren Peters
committed
before_script:
- lizard --version
script:
- cd $CI_PROJECT_DIR
- lizard -l cpp src/ > lizard.txt --warnings_only --ignore_warnings 187

Soeren Peters
committed
###############################################################################

Soeren Peters
committed
before_script:
- gcovr --version
script:

Soeren Peters
committed
- cd $CI_PROJECT_DIR/build
- cmake ..

Soeren Peters
committed
- gcovr -r $CI_PROJECT_DIR -k build -f "src" --print-summary --html coverage/coverage.html --html-details --xml coverage/coverage.xml

Soeren Peters
committed
coverage_report:
coverage_format: cobertura
path: coverage/coverage.xml

Soeren Peters
committed
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"

Soeren Peters
committed
- build

Soeren Peters
committed
###############################################################################

Soeren Peters
committed
# this job also produces a compile commands json file.

Soeren Peters
committed

Soeren Peters
committed
- mkdir -p $CI_PROJECT_DIR/build
- cd $CI_PROJECT_DIR/build
- cmake ..

Soeren Peters
committed
-DVF_ENABLE_CPU=ON
-DVF_ENABLE_DOUBLE_ACCURACY=ON
-DVF_ENABLE_GPU=OFF
- python3 ../utilities/filterCompileCommands.py compile_commands.json

Soeren Peters
committed
- build/clangtidy.txt
- build/compile_commands.json
###############################################################################
## Sanitizer ##
###############################################################################
sanitizer-address-leak-ub:
extends: .analyze_template
script:
- mkdir -p build && cd build
- cmake ..

Soeren Peters
committed
-DVF_ENABLE_PYTHON_BINDINGS=OFF

Soeren Peters
committed
-DVF_ENABLE_SANITIZER_ADDRESS=ON
-DVF_ENABLE_SANITIZER_LEAK=ON
-DVF_ENABLE_SANITIZER_UNDEFINED_BEHAVIOR=ON
sanitizer-memory:
extends: .analyze_template
script:
- mkdir -p build && cd build
- cmake ..

Soeren Peters
committed
-DVF_ENABLE_SANITIZER_MEMORY=ON

Soeren Peters
committed
###############################################################################
## Deploy ##
###############################################################################
# doxgen
# This job only runs on the main branch of the parent repository, not on forks!

Sören Peters
committed
pages:

Soeren Peters
committed
stage: deploy
image: alpine
- main@irmb/VirtualFluids
needs: []
script:
- apk update && apk add doxygen
- doxygen docs/Doxyfile

Soeren Peters
committed
###############################################################################
# the reports in this file need to match the artifacts.
# This job only runs on the main branch of the parent repository, not on forks!
- main@irmb/VirtualFluids

Soeren Peters
committed
SONAR_HOST_URL: "http://gitlab-runner01.irmb.bau.tu-bs.de/sonarqube/"
before_script:
- cd /tmp
- apt-get install unzip
- wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.0.0.1744-linux.zip
- unzip sonar-scanner-cli-4.0.0.1744-linux.zip
- cd sonar-scanner-4.0.0.1744-linux/
- echo "sonar.host.url=$SONAR_HOST_URL" >> conf/sonar-scanner.properties
- echo "sonar.sourceEncoding=UTF-8" >> conf/sonar-scanner.properties
- cat conf/sonar-scanner.properties
- export PATH+=:$(pwd)/bin
- sonar-scanner -X -Dsonar.verbose=true -Dsonar.login=$SONAR_SECURITY_TOKEN