Skip to content
Snippets Groups Projects
Commit 15627f20 authored by Anna Wellmann's avatar Anna Wellmann
Browse files

Merge branch 'develop' into developAnna

parents 516b1d58 d243c58c
No related branches found
No related tags found
1 merge request!104Add Communication Hiding to GPU version
Showing
with 428 additions and 131 deletions
...@@ -4,7 +4,7 @@ Language: Cpp ...@@ -4,7 +4,7 @@ Language: Cpp
AccessModifierOffset: -4 AccessModifierOffset: -4
AlignAfterOpenBracket: Align AlignAfterOpenBracket: Align
AlignConsecutiveMacros: false AlignConsecutiveMacros: false
AlignConsecutiveAssignments: true AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right AlignEscapedNewlines: Right
AlignOperands: true AlignOperands: true
...@@ -14,7 +14,7 @@ AllowAllConstructorInitializersOnNextLine: true ...@@ -14,7 +14,7 @@ AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: Never AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All AllowShortFunctionsOnASingleLine: None
AllowShortLambdasOnASingleLine: All AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false AllowShortLoopsOnASingleLine: false
......
parse:
additional_commands:
foo:
flags:
- BAR
- BAZ
kwargs:
HEADERS: '*'
SOURCES: '*'
DEPENDS: '*'
override_spec: {}
_help_vartags:
vartags: []
proptags: []
format:
disable: false
line_width: 120
tab_size: 4
use_tabchars: false
fractional_tab_policy: use-space
max_subgroups_hwrap: 2
max_pargs_hwrap: 6
max_rows_cmdline: 2
separate_ctrl_name_with_space: false
separate_fn_name_with_space: false
dangle_parens: false
dangle_align: prefix
min_prefix_chars: 4
max_prefix_chars: 10
max_lines_hwrap: 2
line_ending: unix
command_case: canonical
keyword_case: unchanged
always_wrap: []
enable_sort: true
autosort: false
require_valid_layout: false
layout_passes: {}
markup:
bullet_char: '*'
enum_char: .
first_comment_is_literal: false
literal_comment_pattern: null
fence_pattern: ^\s*([`~]{3}[`~]*)(.*)$
ruler_pattern: ^\s*[^\w\s]{3}.*[^\w\s]{3}$
explicit_trailing_pattern: '#<'
hashruler_min_length: 10
canonicalize_hashrulers: true
enable_markup: true
lint:
disabled_codes: []
function_pattern: '[0-9a-z_]+'
macro_pattern: '[0-9A-Z_]+'
global_var_pattern: '[A-Z][0-9A-Z_]+'
internal_var_pattern: _[A-Z][0-9A-Z_]+
local_var_pattern: '[a-z][a-z0-9_]+'
private_var_pattern: _[0-9a-z_]+
public_var_pattern: '[A-Z][0-9A-Z_]+'
argument_var_pattern: '[a-z][a-z0-9_]+'
keyword_pattern: '[A-Z][0-9A-Z_]+'
max_conditionals_custom_parser: 2
min_statement_spacing: 1
max_statement_spacing: 2
max_returns: 6
max_branches: 12
max_arguments: 5
max_localvars: 15
max_statements: 50
encode:
emit_byteorder_mark: false
input_encoding: utf-8
output_encoding: utf-8
\ No newline at end of file
...@@ -11,10 +11,5 @@ ...@@ -11,10 +11,5 @@
"streetsidesoftware.code-spell-checker" "streetsidesoftware.code-spell-checker"
], ],
"runArgs": ["--gpus","all"], "runArgs": ["--gpus","all"],
"image": "git.rz.tu-bs.de:4567/irmb/virtualfluids/ubuntu20_04:1.2", "image": "git.rz.tu-bs.de:4567/irmb/virtualfluids/ubuntu20_04:1.2"
"containerEnv": {"HOME": "/workspaces/"}, }
"mounts": [
"source=/mnt/d/output,target=/${containerWorkspaceFolder}/output,type=bind",
"source=${localEnv:HOME}/STLs,target=${containerWorkspaceFolder}/stl,type=bind"
]
}
\ No newline at end of file
...@@ -19,6 +19,13 @@ __pycache__/ ...@@ -19,6 +19,13 @@ __pycache__/
# simulation results # simulation results
output/ output/
logs/
# Input files
stl/
# Scripts
scripts/
# scripts # scripts
scripts/ scripts/
......
############################################################################### ###############################################################################
## VirtualFluids CI Pipeline ## ## VirtualFluids CI Pipeline ##
############################################################################### ###############################################################################
image: irmb/virtualfluids-python-deps-ubuntu20.04:latest image: git.rz.tu-bs.de:4567/irmb/virtualfluids/ubuntu20_04:1.3
stages: stages:
- build - build
...@@ -20,8 +20,6 @@ stages: ...@@ -20,8 +20,6 @@ stages:
.gnu_build_template: .gnu_build_template:
stage: build stage: build
image: irmb/virtualfluids-deps-ubuntu20.04
tags: tags:
- gpu - gpu
- linux - linux
...@@ -51,7 +49,7 @@ stages: ...@@ -51,7 +49,7 @@ stages:
- cd $CI_PROJECT_DIR/$BUILD_FOLDER - cd $CI_PROJECT_DIR/$BUILD_FOLDER
- rm -r -f ./* - rm -r -f ./*
- cmake .. -LAH - cmake .. -LAH
--preset=all_make_ccache --preset=all_make
-DBUILD_WARNINGS_AS_ERRORS=ON -DBUILD_WARNINGS_AS_ERRORS=ON
-DCMAKE_CUDA_ARCHITECTURES=60 -DCMAKE_CUDA_ARCHITECTURES=60
- make -j4 - make -j4
...@@ -121,8 +119,6 @@ msvc_16: ...@@ -121,8 +119,6 @@ msvc_16:
gcc_9_python: gcc_9_python:
stage: build_python stage: build_python
image: irmb/virtualfluids-python-deps-ubuntu20.04:latest
needs: ["gcc_9"] needs: ["gcc_9"]
cache: cache:
...@@ -149,8 +145,6 @@ gcc_9_python: ...@@ -149,8 +145,6 @@ gcc_9_python:
build_singularity_image: build_singularity_image:
stage: container_upload stage: container_upload
image: irmb/virtualfluids-python-deps-ubuntu20.04:latest
needs: needs:
- gcc_9_python - gcc_9_python
...@@ -171,8 +165,6 @@ build_singularity_image: ...@@ -171,8 +165,6 @@ build_singularity_image:
gcc_9_unit_tests: gcc_9_unit_tests:
stage: test stage: test
image: irmb/virtualfluids-deps-ubuntu20.04:latest
needs: ["gcc_9"] needs: ["gcc_9"]
before_script: before_script:
...@@ -203,8 +195,6 @@ msvc_16_unit_tests: ...@@ -203,8 +195,6 @@ msvc_16_unit_tests:
gcc_9_python_bindings_test: gcc_9_python_bindings_test:
stage: test stage: test
image: irmb/virtualfluids-python-deps-ubuntu20.04:latest
needs: ["gcc_9_python"] needs: ["gcc_9_python"]
before_script: before_script:
...@@ -220,8 +210,6 @@ gcc_9_python_bindings_test: ...@@ -220,8 +210,6 @@ gcc_9_python_bindings_test:
gcc_9_python_slurm_test: gcc_9_python_slurm_test:
stage: test stage: test
image: irmb/virtualfluids-python-deps-ubuntu20.04:latest
needs: ["gcc_9_python"] needs: ["gcc_9_python"]
rules: rules:
...@@ -281,8 +269,6 @@ nvidia_test: ...@@ -281,8 +269,6 @@ nvidia_test:
gpu_numerical_tests: gpu_numerical_tests:
stage: benchmark stage: benchmark
image: irmb/virtualfluids-deps-ubuntu20.04
when: manual when: manual
needs: [] needs: []
...@@ -301,7 +287,7 @@ gpu_numerical_tests: ...@@ -301,7 +287,7 @@ gpu_numerical_tests:
- cd $CI_PROJECT_DIR/build - cd $CI_PROJECT_DIR/build
- rm -r -f ./* - rm -r -f ./*
- cmake .. - cmake ..
--preset=gpu_numerical_tests_ccache_make --preset=gpu_numerical_tests_make
-DCMAKE_CUDA_ARCHITECTURES=60 -DCMAKE_CUDA_ARCHITECTURES=60
-DPATH_NUMERICAL_TESTS=/tmp/test_data/numerical_tests_gpu -DPATH_NUMERICAL_TESTS=/tmp/test_data/numerical_tests_gpu
- make -j4 - make -j4
...@@ -328,8 +314,6 @@ gpu_numerical_tests: ...@@ -328,8 +314,6 @@ gpu_numerical_tests:
clang_build_analyzer_clang_10: clang_build_analyzer_clang_10:
stage: analyze stage: analyze
image: irmb/virtualfluids-deps-ubuntu20.04
only: ["schedules"] only: ["schedules"]
needs: [] needs: []
...@@ -362,8 +346,6 @@ clang_build_analyzer_clang_10: ...@@ -362,8 +346,6 @@ clang_build_analyzer_clang_10:
include_what_you_use_clang_10: include_what_you_use_clang_10:
stage: analyze stage: analyze
image: irmb/virtualfluids-deps-ubuntu20.04
only: ["schedules"] only: ["schedules"]
needs: [] needs: []
...@@ -391,24 +373,28 @@ include_what_you_use_clang_10: ...@@ -391,24 +373,28 @@ include_what_you_use_clang_10:
- make - make
############################################################################### ###############################################################################
.analyze_template:
rules: # dont create MR pipeline, run always on irmb/develop and manual in all other cases
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
when: never
- if: '$CI_PROJECT_NAMESPACE == "irmb" && $CI_COMMIT_BRANCH == "develop"'
when: always
- when: manual
allow_failure: true
cppcheck: cppcheck:
stage: analyze stage: analyze
image: irmb/virtualfluids-deps-ubuntu20.04 extends: .analyze_template
only:
- develop@irmb/VirtualFluids_dev
needs: [] needs: []
before_script: before_script:
- export DEBIAN_FRONTEND=noninteractive - cppcheck --version
- apt-get update
- apt-get install -y cppcheck
script: script:
- cd $CI_PROJECT_DIR - cd $CI_PROJECT_DIR
- cppcheck --version
- cppcheck src --enable=all --xml 2> cppcheck.xml - cppcheck src --enable=all --xml 2> cppcheck.xml
artifacts: artifacts:
...@@ -422,10 +408,7 @@ cppcheck: ...@@ -422,10 +408,7 @@ cppcheck:
lizard: lizard:
stage: analyze stage: analyze
image: irmb/virtualfluids-python-deps-ubuntu20.04:latest extends: .analyze_template
only:
- develop@irmb/VirtualFluids_dev
needs: [] needs: []
...@@ -450,17 +433,11 @@ lizard: ...@@ -450,17 +433,11 @@ lizard:
gcov_gcc_9: gcov_gcc_9:
stage: analyze stage: analyze
image: irmb/virtualfluids-python-deps-ubuntu20.04:latest extends: .analyze_template
only:
- develop@irmb/VirtualFluids_dev
needs: [] needs: []
before_script: before_script:
- export DEBIAN_FRONTEND=noninteractive
- apt-get update
- pip3 install gcovr
- gcovr --version - gcovr --version
script: script:
...@@ -496,10 +473,7 @@ gcov_gcc_9: ...@@ -496,10 +473,7 @@ gcov_gcc_9:
clang-tidy: clang-tidy:
stage: analyze stage: analyze
image: irmb/virtualfluids-python-deps-ubuntu20.04:latest extends: .analyze_template
only:
- develop@irmb/VirtualFluids_dev
needs: [] needs: []
...@@ -512,7 +486,6 @@ clang-tidy: ...@@ -512,7 +486,6 @@ clang-tidy:
- mkdir -p $CI_PROJECT_DIR/build - mkdir -p $CI_PROJECT_DIR/build
- cd $CI_PROJECT_DIR/build - cd $CI_PROJECT_DIR/build
- cmake .. - cmake ..
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
-DBUILD_VF_CPU=ON -DBUILD_VF_CPU=ON
-DBUILD_VF_GPU=OFF -DBUILD_VF_GPU=OFF
- python3 ../utilities/filterCompileCommands.py compile_commands.json - python3 ../utilities/filterCompileCommands.py compile_commands.json
...@@ -555,7 +528,7 @@ pages: ...@@ -555,7 +528,7 @@ pages:
.deploy_template: .deploy_template:
stage: deploy stage: deploy
image: irmb/virtualfluids-python-deps-ubuntu20.04:latest
before_script: before_script:
- 'command -v ssh-agent >/dev/null || ( apt-get update -y && apt-get install openssh-client -y )' - 'command -v ssh-agent >/dev/null || ( apt-get update -y && apt-get install openssh-client -y )'
...@@ -618,8 +591,6 @@ vf_wheel_to_jupyterhub: ...@@ -618,8 +591,6 @@ vf_wheel_to_jupyterhub:
sonar-scanner: sonar-scanner:
stage: deploy stage: deploy
image: irmb/virtualfluids-python-deps-ubuntu20.04:latest
tags: tags:
- linux - linux
......
# AUTHORS # AUTHORS
VF has been developed essentially over the last fifteen years by various researchers at IRMB including (in alphabetical order): VF has been developed essentially over the last fifteen years by various researchers at IRMB including (in alphabetical order):
Damilola Adekanye, M.Sc.
Dr. Benjamin Ahrenholz Dr. Benjamin Ahrenholz
M. Sc. Hussein Alihussein Dr. Hussein Alihussein
Dr. Sebastian Bindick Dr. Sebastian Bindick
B. Sc. Aileen Brendel Aileen Brendel, B.Sc.
J.Prof. Dr. Martin Geier J.Prof. Dr. Martin Geier
Dr. Sebastian Geller Dr. Sebastian Geller
Dr. Ehsan Goraki Fard Dr. Ehsan Goraki Fard
Dr. Jan Hegewald Dr. Jan Hegewald
Dr. Christian Janßen Dr. Christian Janßen
M. Sc. Konstantin Kutscher Prof. Dr.-Ing. habil. Manfred Krafczyk
M. Sc. Stephan Lenz Dr. Konstantin Kutscher
Dr. Stephan Lenz
Dr. Jan Linxweiler Dr. Jan Linxweiler
B. Sc. Lennard Lux Lennard Lux, B.Sc.
B. Sc. Sven Marcus Sören Peters, M.Sc.
M. Sc. Sören Peters Sven Marcus, M.Sc.
Dr. Hesameddin Safari Dr. Hesameddin Safari
Dr. Martin Schönherr Dr. Martin Schönherr
Dipl.-Ing. Maik Stiebler Dipl.-Ing. Maik Stiebler
Dr. Sören Textor (aka Freudiger) Dr. Sören Textor (aka Freudiger)
PD Dr. Jonas Tölke PD Dr. Jonas Tölke
Dr. Sonja Uphoff Dr. Sonja Uphoff
B. Sc. Anna Wellmann Anna Wellmann, M.Sc.
\ No newline at end of file
...@@ -3,9 +3,8 @@ ...@@ -3,9 +3,8 @@
# VTK_DIR needs to bet set to the VTK build directory in the config file. # VTK_DIR needs to bet set to the VTK build directory in the config file.
######################################################################### #########################################################################
find_package(VTK REQUIRED) find_package(VTK REQUIRED)
vf_get_library_name(library_name) vf_get_library_name(library_name)
include(${VTK_USE_FILE}) target_include_directories(${library_name} PRIVATE ${VTK_INCLUDE_DIRS})
target_include_directories(${library_name} PRIVATE ${VTK_INCLUDE_DIRS})
target_link_libraries(${library_name} PRIVATE ${VTK_LIBRARIES}) target_link_libraries(${library_name} PRIVATE ${VTK_LIBRARIES})
option(ENABLE_CACHE "Enable cache if available" ON)
if(NOT ENABLE_CACHE)
return()
endif()
set(CACHE_OPTION
"ccache"
CACHE STRING "Compiler cache to be used")
set(CACHE_OPTION_VALUES "ccache" "sccache")
set_property(CACHE CACHE_OPTION PROPERTY STRINGS ${CACHE_OPTION_VALUES})
list(
FIND
CACHE_OPTION_VALUES
${CACHE_OPTION}
CACHE_OPTION_INDEX)
if(${CACHE_OPTION_INDEX} EQUAL -1)
message(
STATUS
"Using custom compiler cache system: '${CACHE_OPTION}', explicitly supported entries are ${CACHE_OPTION_VALUES}")
endif()
find_program(CACHE_BINARY ${CACHE_OPTION})
if(CACHE_BINARY)
message(STATUS "${CACHE_OPTION} found and enabled")
set(CMAKE_CXX_COMPILER_LAUNCHER ${CACHE_BINARY})
set(CMAKE_CUDA_COMPILER_LAUNCHER ${CACHE_BINARY})
set(CMAKE_C_COMPILER_LAUNCHER ${CACHE_BINARY})
else()
message(STATUS "${CACHE_OPTION} is enabled but was not found. Not using it")
endif()
# from here:
#
# https://github.com/lefticus/cppbestpractices/blob/master/02-Use_the_Tools_Available.md
function(set_project_warnings project_name)
set(MSVC_WARNINGS
/W4 # Baseline reasonable warnings
/w14242 # 'identifier': conversion from 'type1' to 'type1', possible loss of data
/w14254 # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data
/w14263 # 'function': member function does not override any base class virtual member function
/w14265 # 'classname': class has virtual functions, but destructor is not virtual instances of this class may not
# be destructed correctly
/w14287 # 'operator': unsigned/negative constant mismatch
/we4289 # nonstandard extension used: 'variable': loop control variable declared in the for-loop is used outside
# the for-loop scope
/w14296 # 'operator': expression is always 'boolean_value'
/w14311 # 'variable': pointer truncation from 'type1' to 'type2'
/w14545 # expression before comma evaluates to a function which is missing an argument list
/w14546 # function call before comma missing argument list
/w14547 # 'operator': operator before comma has no effect; expected operator with side-effect
/w14549 # 'operator': operator before comma has no effect; did you intend 'operator'?
/w14555 # expression has no effect; expected expression with side- effect
/w14619 # pragma warning: there is no warning number 'number'
/w14640 # Enable warning on thread un-safe static member initialization
/w14826 # Conversion from 'type1' to 'type_2' is sign-extended. This may cause unexpected runtime behavior.
/w14905 # wide string literal cast to 'LPSTR'
/w14906 # string literal cast to 'LPWSTR'
/w14928 # illegal copy-initialization; more than one user-defined conversion has been implicitly applied
/permissive- # standards conformance mode for MSVC compiler.
)
set(CLANG_WARNINGS
-Wall
-Wextra # reasonable and standard
-Wshadow # warn the user if a variable declaration shadows one from a parent context
-Wnon-virtual-dtor # warn the user if a class with virtual functions has a non-virtual destructor. This helps
# catch hard to track down memory errors
-Wold-style-cast # warn for c-style casts
-Wcast-align # warn for potential performance problem casts
-Wunused # warn on anything being unused
-Woverloaded-virtual # warn if you overload (not override) a virtual function
-Wpedantic # warn if non-standard C++ is used
-Wconversion # warn on type conversions that may lose data
-Wsign-conversion # warn on sign conversions
-Wnull-dereference # warn if a null dereference is detected
-Wdouble-promotion # warn if float is implicit promoted to double
-Wformat=2 # warn on security issues around functions that format output (ie printf)
)
if(BUILD_WARNINGS_AS_ERRORS)
set(CLANG_WARNINGS ${CLANG_WARNINGS} -Werror)
set(MSVC_WARNINGS ${MSVC_WARNINGS} /WX)
endif()
set(GCC_WARNINGS
${CLANG_WARNINGS}
-Wmisleading-indentation # warn if indentation implies blocks where blocks do not exist
-Wduplicated-cond # warn if if / else chain has duplicated conditions
-Wduplicated-branches # warn if if / else branches have duplicated code
-Wlogical-op # warn about logical operations being used where bitwise were probably wanted
-Wuseless-cast # warn if you perform a cast to the same type
)
if(MSVC)
set(PROJECT_WARNINGS ${MSVC_WARNINGS})
elseif(CMAKE_CXX_COMPILER_ID MATCHES ".*Clang")
set(PROJECT_WARNINGS ${CLANG_WARNINGS})
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(PROJECT_WARNINGS ${GCC_WARNINGS})
else()
message(AUTHOR_WARNING "No compiler warnings set for '${CMAKE_CXX_COMPILER_ID}' compiler.")
endif()
target_compile_options(${project_name} INTERFACE ${PROJECT_WARNINGS})
endfunction()
function(enable_sanitizers project_name)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES ".*Clang")
set(SANITIZERS "")
option(ENABLE_SANITIZER_ADDRESS "Enable address sanitizer" FALSE)
if(ENABLE_SANITIZER_ADDRESS)
list(APPEND SANITIZERS "address")
endif()
option(ENABLE_SANITIZER_LEAK "Enable leak sanitizer" FALSE)
if(ENABLE_SANITIZER_LEAK)
list(APPEND SANITIZERS "leak")
endif()
option(ENABLE_SANITIZER_UNDEFINED_BEHAVIOR "Enable undefined behavior sanitizer" FALSE)
if(ENABLE_SANITIZER_UNDEFINED_BEHAVIOR)
list(APPEND SANITIZERS "undefined")
endif()
option(ENABLE_SANITIZER_THREAD "Enable thread sanitizer" FALSE)
if(ENABLE_SANITIZER_THREAD)
if("address" IN_LIST SANITIZERS OR "leak" IN_LIST SANITIZERS)
message(WARNING "Thread sanitizer does not work with Address and Leak sanitizer enabled")
else()
list(APPEND SANITIZERS "thread")
endif()
endif()
option(ENABLE_SANITIZER_MEMORY "Enable memory sanitizer" FALSE)
if(ENABLE_SANITIZER_MEMORY AND CMAKE_CXX_COMPILER_ID MATCHES ".*Clang")
if("address" IN_LIST SANITIZERS
OR "thread" IN_LIST SANITIZERS
OR "leak" IN_LIST SANITIZERS)
message(WARNING "Memory sanitizer does not work with Address, Thread and Leak sanitizer enabled")
else()
list(APPEND SANITIZERS "memory")
endif()
endif()
list(
JOIN
SANITIZERS
","
LIST_OF_SANITIZERS)
endif()
if(LIST_OF_SANITIZERS)
if(NOT
"${LIST_OF_SANITIZERS}"
STREQUAL
"")
target_compile_options(${project_name} INTERFACE -fsanitize=${LIST_OF_SANITIZERS})
target_link_options(${project_name} INTERFACE -fsanitize=${LIST_OF_SANITIZERS})
endif()
endif()
endfunction()
...@@ -21,6 +21,7 @@ endfunction() ...@@ -21,6 +21,7 @@ endfunction()
include(${VF_CMAKE_DIR}/CMakeSetCompilerFlags.cmake) include(${VF_CMAKE_DIR}/CMakeSetCompilerFlags.cmake)
include(${VF_CMAKE_DIR}/FileUtilities.cmake) include(${VF_CMAKE_DIR}/FileUtilities.cmake)
include(${VF_CMAKE_DIR}/3rd.cmake) include(${VF_CMAKE_DIR}/3rd.cmake)
include(${VF_CMAKE_DIR}/Sanitizers.cmake)
############################################################################################################### ###############################################################################################################
# Reset the compiler and linker flags # Reset the compiler and linker flags
...@@ -152,6 +153,9 @@ function(vf_add_library) ...@@ -152,6 +153,9 @@ function(vf_add_library)
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
# sanitizers
enable_sanitizers(${library_name})
# link time optimization # link time optimization
if(BUILD_VF_LTO) if(BUILD_VF_LTO)
if(NOT ${ARG_BUILDTYPE} MATCHES binary) if(NOT ${ARG_BUILDTYPE} MATCHES binary)
......
#################################################################################
# VirtualFluids MACHINE FILE
# Responsible: Soeren Peters
# OS: Windows 10
#################################################################################
#SET(PATH_NUMERICAL_TESTS "E:/temp/numericalTests/")
#LIST(APPEND VF_COMPILER_DEFINITION "PATH_NUMERICAL_TESTS=${PATH_NUMERICAL_TESTS}")
SET(CMAKE_CUDA_ARCHITECTURES 61)
\ No newline at end of file
...@@ -6,13 +6,13 @@ ...@@ -6,13 +6,13 @@
# |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ # |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/
# #
################################################################################# #################################################################################
# required cmake versions
# CMAKE 3.13: target_link_options
# CMAKE 3.15: CMAKE_MSVC_RUNTIME_LIBRARY
#################################################################################
cmake_minimum_required(VERSION 3.15..3.20 FATAL_ERROR) cmake_minimum_required(VERSION 3.15..3.20 FATAL_ERROR)
project(VirtualFluids CXX) project(VirtualFluids
VERSION 1.0.0
DESCRIPTION "CFD code based on the Lattice Boltzmann Method"
HOMEPAGE_URL "https://www.tu-braunschweig.de/irmb/forschung/virtualfluids"
LANGUAGES CXX)
if(NOT CMAKE_BUILD_TYPE) if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release) set(CMAKE_BUILD_TYPE Release)
...@@ -22,6 +22,8 @@ message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") ...@@ -22,6 +22,8 @@ message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set_property(GLOBAL PROPERTY USE_FOLDERS ON) set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER ".cmake") set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER ".cmake")
set(libraryFolder "libs") set(libraryFolder "libs")
...@@ -34,6 +36,11 @@ set (VF_THIRD_DIR ${CMAKE_CURRENT_SOURCE_DIR}/3rdParty) ...@@ -34,6 +36,11 @@ set (VF_THIRD_DIR ${CMAKE_CURRENT_SOURCE_DIR}/3rdParty)
set (VF_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src) set (VF_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
set (VF_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set (VF_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR})
if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(FATAL_ERROR "In-source builds are prohibited. "
"Create a new directory and build there.")
endif ()
################################################################################# #################################################################################
# OPTIONS # OPTIONS
################################################################################# #################################################################################
...@@ -41,10 +48,10 @@ option(BUILD_VF_CPU "Build VirtualFluids cpu variant" OFF) ...@@ -41,10 +48,10 @@ option(BUILD_VF_CPU "Build VirtualFluids cpu variant" OFF)
option(BUILD_VF_GPU "Build VirtualFluids gpu variant" OFF) option(BUILD_VF_GPU "Build VirtualFluids gpu variant" OFF)
option(BUILD_USE_OPENMP "Build VirtualFluids with openmp" ON) option(BUILD_USE_OPENMP "Build VirtualFluids with openmp" ON)
option(BUILD_USE_BOOST "Build VirtualFluids with boost" OFF)
option(BUILD_USE_MPI "include MPI library support" ON)
# vf gpu # vf gpu
option(BUILD_VF_GPU "Build VirtualFluids GPU" ON )
option(BUILD_VF_GKS "Build VirtualFluids GKS" OFF ) option(BUILD_VF_GKS "Build VirtualFluids GKS" OFF )
option(BUILD_VF_TRAFFIC "Build VirtualFluids Traffic" OFF) option(BUILD_VF_TRAFFIC "Build VirtualFluids Traffic" OFF)
option(BUILD_JSONCPP "Builds json cpp " OFF) option(BUILD_JSONCPP "Builds json cpp " OFF)
...@@ -76,6 +83,15 @@ option(BUILD_VF_DOUBLE_ACCURACY "Use double accuracy" OFF) ...@@ -76,6 +83,15 @@ option(BUILD_VF_DOUBLE_ACCURACY "Use double accuracy" OFF)
################################################################################# #################################################################################
# MACROS # MACROS
################################################################################# #################################################################################
add_library(project_warnings INTERFACE)
# standard compiler warnings - Link this 'library' to use the warnings specified in CompilerWarnings.cmake
include(${VF_CMAKE_DIR}/CompilerWarnings.cmake)
set_project_warnings(project_warnings)
# enable cache system
include(${VF_CMAKE_DIR}/Cache.cmake)
include(CMakePrintHelpers) include(CMakePrintHelpers)
include(${VF_CMAKE_DIR}/VirtualFluidsMacros.cmake) include(${VF_CMAKE_DIR}/VirtualFluidsMacros.cmake)
...@@ -83,7 +99,8 @@ IF( BUILD_VF_DOUBLE_ACCURACY ) ...@@ -83,7 +99,8 @@ IF( BUILD_VF_DOUBLE_ACCURACY )
list(APPEND VF_COMPILER_DEFINITION VF_DOUBLE_ACCURACY) list(APPEND VF_COMPILER_DEFINITION VF_DOUBLE_ACCURACY)
ENDIF() ENDIF()
if(BUILD_VF_GPU) # set gpu features
if(BUILD_VF_GPU OR BUILD_VF_GKS)
include(CheckLanguage) include(CheckLanguage)
check_language(CUDA) check_language(CUDA)
...@@ -119,12 +136,28 @@ if(BUILD_VF_GPU) ...@@ -119,12 +136,28 @@ if(BUILD_VF_GPU)
message(STATUS "CMAKE_CUDA_FLAGS: ${CMAKE_CUDA_FLAGS}") message(STATUS "CMAKE_CUDA_FLAGS: ${CMAKE_CUDA_FLAGS}")
message(STATUS "CUDA Architecture: ${CMAKE_CUDA_ARCHITECTURES}") message(STATUS "CUDA Architecture: ${CMAKE_CUDA_ARCHITECTURES}")
set(CMAKE_CUDA_ARCHITECTURES "${CMAKE_CUDA_ARCHITECTURES}" CACHE STRING "Cuda Architecture (compute capabilitiy)")
endif() endif()
################################################################################# #################################################################################
# COMMON LIBRARIES # COMMON LIBRARIES
################################################################################# #################################################################################
include(FetchContent)
set(spdlog_version "v1.9.1")
set(spdlog_url "https://github.com/gabime/spdlog")
message(STATUS "Fetching spdlog: ${spdlog_version}")
FetchContent_Declare(
spdlog
GIT_REPOSITORY ${spdlog_url}
GIT_TAG ${spdlog_version}
)
FetchContent_MakeAvailable(spdlog)
target_compile_options(spdlog PRIVATE "-fPIC")
groupTarget(spdlog ${thirdFolder})
if(BUILD_VF_UNIT_TESTS) if(BUILD_VF_UNIT_TESTS)
add_subdirectory(${VF_THIRD_DIR}/googletest) add_subdirectory(${VF_THIRD_DIR}/googletest)
include(GoogleTest) include(GoogleTest)
...@@ -135,10 +168,29 @@ if(BUILD_USE_OPENMP) ...@@ -135,10 +168,29 @@ if(BUILD_USE_OPENMP)
find_package(OpenMP REQUIRED) find_package(OpenMP REQUIRED)
endif() endif()
find_package(MPI REQUIRED) if(BUILD_USE_MPI)
find_package(MPI REQUIRED)
if(BUILD_VF_CPU)
list(APPEND VF_COMPILER_DEFINITION VF_MPI)
endif()
endif()
# boost
IF(BUILD_USE_BOOST)
list(APPEND VF_COMPILER_DEFINITION BUILD_USE_BOOST)
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME ON)
# minimum boost version: 1.60
# no packages specfied - only headeronly libraries
find_package(Boost 1.60 REQUIRED)
ENDIF()
add_subdirectory(src/logger)
add_subdirectory(src/basics) add_subdirectory(src/basics)
add_subdirectory(src/mpi)
add_subdirectory(src/lbm) add_subdirectory(src/lbm)
...@@ -148,6 +200,12 @@ add_subdirectory(src/lbm) ...@@ -148,6 +200,12 @@ add_subdirectory(src/lbm)
if (BUILD_VF_CPU) if (BUILD_VF_CPU)
include (cpu.cmake) include (cpu.cmake)
endif() endif()
if(BUILD_VF_GPU) if(BUILD_VF_GPU OR BUILD_VF_GKS)
add_subdirectory(src/cuda)
include (gpu.cmake) include (gpu.cmake)
endif() endif()
\ No newline at end of file
if (BUILD_VF_PYTHON_BINDINGS)
add_subdirectory(${VF_THIRD_DIR}/pybind11/pybind11-2.6.0)
add_subdirectory(pythonbindings)
endif()
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"version": 2, "version": 2,
"cmakeMinimumRequired": { "cmakeMinimumRequired": {
"major": 3, "major": 3,
"minor": 19, "minor": 20,
"patch": 0 "patch": 0
}, },
"configurePresets": [ "configurePresets": [
...@@ -20,16 +20,6 @@ ...@@ -20,16 +20,6 @@
"hidden": true, "hidden": true,
"generator": "Unix Makefiles" "generator": "Unix Makefiles"
}, },
{
"name": "default_ccache_make",
"inherits": "default_make",
"hidden": true,
"cacheVariables": {
"CMAKE_CXX_COMPILER_LAUNCHER": "ccache",
"CMAKE_CUDA_COMPILER_LAUNCHER": "ccache",
"CMAKE_C_COMPILER_LAUNCHER": "ccache"
}
},
{ {
"name": "default_msvc", "name": "default_msvc",
"inherits": "default", "inherits": "default",
...@@ -87,14 +77,6 @@ ...@@ -87,14 +77,6 @@
], ],
"displayName": "cpu make configuration" "displayName": "cpu make configuration"
}, },
{
"name": "cpu_make_ccache",
"inherits": [
"default_ccache_make",
"default_cpu"
],
"displayName": "cpu ccache make configuration"
},
{ {
"name": "cpu_msvc", "name": "cpu_msvc",
"inherits": [ "inherits": [
...@@ -111,14 +93,6 @@ ...@@ -111,14 +93,6 @@
], ],
"displayName": "gpu make configuration" "displayName": "gpu make configuration"
}, },
{
"name": "gpu_make_ccache",
"inherits": [
"default_ccache_make",
"default_gpu"
],
"displayName": "gpu ccache make configuration"
},
{ {
"name": "gpu_msvc", "name": "gpu_msvc",
"inherits": [ "inherits": [
...@@ -135,14 +109,6 @@ ...@@ -135,14 +109,6 @@
], ],
"displayName": "all make configuration" "displayName": "all make configuration"
}, },
{
"name": "all_make_ccache",
"inherits": [
"default_ccache_make",
"default_all"
],
"displayName": "all ccache make configuration"
},
{ {
"name": "all_msvc", "name": "all_msvc",
"inherits": [ "inherits": [
...@@ -159,14 +125,6 @@ ...@@ -159,14 +125,6 @@
], ],
"displayName": "gpu numerical tests make configuration" "displayName": "gpu numerical tests make configuration"
}, },
{
"name": "gpu_numerical_tests_ccache_make",
"inherits": [
"default_ccache_make",
"default_gpu_numerical_tests"
],
"displayName": "gpu numerical tests ccache make configuration"
},
{ {
"name": "gpu_numerical_tests_msvc", "name": "gpu_numerical_tests_msvc",
"inherits": [ "inherits": [
......
...@@ -15,7 +15,7 @@ To contribute use a merge request as follows: ...@@ -15,7 +15,7 @@ To contribute use a merge request as follows:
- Run the tests. - Run the tests.
- Write or adapt tests as needed. - Write or adapt tests as needed.
- Add or change the documentation as needed. - Add or change the documentation as needed.
- Push your branch to your fork on gitea, the remote `origin`. - Push your branch to your fork on gitlab, the remote `origin`.
- From your fork open a merge request in the correct branch. Target the project's `develop` or `open_source` branch - From your fork open a merge request in the correct branch. Target the project's `develop` or `open_source` branch
- -
- If we requests further changes just push them to your branch. The MR will be updated automatically. - If we requests further changes just push them to your branch. The MR will be updated automatically.
......
# VirtualFluids BuildDependencies:
# Ubuntu 20.04
# general tools: wget, unzip, git
# CMake 3.22.3
# ccache
# gcc 9.3 (default)
# gdb
# openmpi 4.0.3
# openmp
# cuda 11.3.1 as base image
# freeGLUT
# cppcheck
# clang 10.0 (default)
# python pip3 with modules: setuptools, wheels, scikit-build, pyvista, numpy, ansible, gcovr
FROM nvidia/cuda:11.3.1-devel-ubuntu20.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y \
wget unzip git \
build-essential gdb \
ccache \
ninja-build \
openmpi-bin=4.0.3-0ubuntu1 \
libomp-dev \
clang \
clang-format \
clang-tidy \
clang-tools \
llvm-dev \
libclang-dev \
python3-pip \
freeglut3-dev \
cppcheck \
&& mkdir -p /usr/local/cmake/ && cd /usr/local/cmake/ \
&& version=3.22 && build=3 \
&& wget https://cmake.org/files/v$version/cmake-$version.$build-linux-x86_64.tar.gz \
&& tar -xzvf cmake-$version.$build-linux-x86_64.tar.gz \
&& ln -s /usr/local/cmake/cmake-$version.$build-linux-x86_64/bin/* /usr/local/bin/ \
&& pip3 install \
setuptools \
wheel \
scikit-build \
pyvista \
numpy \
ansible \
'jinja2<3.1' gcovr==5.0
import os import os
from acousticscaling import OneDirectionalAcousticScaling from acousticscaling import OneDirectionalAcousticScaling
from pyfluids.kernel import LBMKernel, KernelType from pyfluids.cpu.kernel import LBMKernel, KernelType
from pyfluids.parameters import RuntimeParameters, GridParameters, PhysicalParameters from pyfluids.cpu.parameters import RuntimeParameters, GridParameters, PhysicalParameters
grid_params = GridParameters() grid_params = GridParameters()
......
...@@ -2,7 +2,7 @@ import os ...@@ -2,7 +2,7 @@ import os
from SlurmTests.poiseuille.settings import Scaling from SlurmTests.poiseuille.settings import Scaling
from poiseuille.simulation import run_simulation from poiseuille.simulation import run_simulation
from pyfluids.writer import Writer, OutputFormat from pyfluids.cpu.writer import Writer, OutputFormat
scale_level = int(os.environ["PYFLUIDS_SCALE_LEVEL"]) scale_level = int(os.environ["PYFLUIDS_SCALE_LEVEL"])
......
from pyfluids.kernel import LBMKernel from pyfluids.cpu.kernel import LBMKernel
from pyfluids.parameters import GridParameters, PhysicalParameters, RuntimeParameters from pyfluids.cpu.parameters import GridParameters, PhysicalParameters, RuntimeParameters
class OneDirectionalAcousticScaling: class OneDirectionalAcousticScaling:
...@@ -13,10 +13,10 @@ class OneDirectionalAcousticScaling: ...@@ -13,10 +13,10 @@ class OneDirectionalAcousticScaling:
self._runtime_params = runtime_parameters self._runtime_params = runtime_parameters
self._kernel = kernel self._kernel = kernel
def configuration_for_scale_level(self, level: int = 1) -> (GridParameters, def configuration_for_scale_level(self, level: int = 1) -> tuple[GridParameters,
PhysicalParameters, PhysicalParameters,
RuntimeParameters, RuntimeParameters,
LBMKernel): LBMKernel]:
if level < 0: if level < 0:
raise ValueError("level must be >= 0") raise ValueError("level must be >= 0")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment