Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • irmb/VirtualFluids
1 result
Show changes
Commits on Source (33)
Showing
with 82 additions and 54 deletions
...@@ -50,7 +50,7 @@ BreakConstructorInitializersBeforeComma: false ...@@ -50,7 +50,7 @@ BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true BreakStringLiterals: true
ColumnLimit: 300 ColumnLimit: 125
CommentPragmas: '^ IWYU pragma:' CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false ConstructorInitializerAllOnOneLineOrOnePerLine: false
......
...@@ -53,5 +53,5 @@ cppcoreguidelines-special-member-functions, ...@@ -53,5 +53,5 @@ cppcoreguidelines-special-member-functions,
-cppcoreguidelines-interfaces-global-init -cppcoreguidelines-interfaces-global-init
' '
HeaderFilterRegex: '\.h$' HeaderFilterRegex: '.*/src/.*'
... WarningsAsErrors: 'True'
\ No newline at end of file
CompileFlags:
Add:
- -xc++
- -std=c++17
- --cuda-gpu-arch=sm_70
- --cuda-path=/usr/local/cuda
- -L/usr/local/cuda/lib64
- -I/usr/local/cuda/include
Remove: [-ccbin=*,-rdc=*,--generate-code*,--options-file,-forward*,--extended-lambda,-fopenmp]
...@@ -5,15 +5,14 @@ ...@@ -5,15 +5,14 @@
"extensions": [ "extensions": [
"mhutchie.git-graph", "mhutchie.git-graph",
"donjayamanne.githistory", "donjayamanne.githistory",
"ms-python.python",
"twxs.cmake", "twxs.cmake",
"ms-vscode.cpptools", //"ms-vscode.cpptools",
"visualstudioexptteam.vscodeintellicode", "usernamehw.errorlens", // show warnings in code
"xaver.clang-format",
"notskm.clang-tidy",
"streetsidesoftware.code-spell-checker", "streetsidesoftware.code-spell-checker",
"llvm-vs-code-extensions.vscode-clangd", "xaver.clang-format",
"jbenden.c-cpp-flylint", "msekoranja.clang-format-checker", // currently this extensions results in a lot of warnings
"ms-python.python", "llvm-vs-code-extensions.vscode-clangd" // code index based on clang using the compile_commannds.json
] ]
} }
}, },
...@@ -21,5 +20,5 @@ ...@@ -21,5 +20,5 @@
"runArgs": ["--gpus","all", // remove this line in case you have no gpus available "runArgs": ["--gpus","all", // remove this line in case you have no gpus available
"--hostname=${localEnv:HOSTNAME}"], // HOSTNAME needs to be known by the vscode environment. It is probably necessary to add "export HOSTNAME=<hostname>" to the config file of your host machine's bash. "--hostname=${localEnv:HOSTNAME}"], // HOSTNAME needs to be known by the vscode environment. It is probably necessary to add "export HOSTNAME=<hostname>" to the config file of your host machine's bash.
"image": "git.rz.tu-bs.de:4567/irmb/virtualfluids/ubuntu22_04:1.0" "image": "git.rz.tu-bs.de:4567/irmb/virtualfluids/ubuntu22_04:1.1"
} }
############################################################################### ###############################################################################
## VirtualFluids CI Pipeline ## ## VirtualFluids CI Pipeline ##
############################################################################### ###############################################################################
image: git.rz.tu-bs.de:4567/irmb/virtualfluids/ubuntu22_04:1.0 image: git.rz.tu-bs.de:4567/irmb/virtualfluids/ubuntu22_04:1.1
stages: stages:
- build - build
...@@ -114,18 +114,14 @@ msvc_17: ...@@ -114,18 +114,14 @@ msvc_17:
- $CI_PROJECT_DIR/$env:BUILD_FOLDER/ - $CI_PROJECT_DIR/$env:BUILD_FOLDER/
###############################################################################
## Build Python ##
############################################################################### ###############################################################################
gcc_12_python: gcc_12_python:
stage: build_python stage: build
needs: ["gcc_12"]
cache: cache:
key: "gcc_12-$CI_COMMIT_REF_SLUG" key: "gcc_12-$CI_COMMIT_REF_SLUG"
paths: paths:
- build - pybuild/
artifacts: artifacts:
expire_in: 1 hrs expire_in: 1 hrs
...@@ -138,7 +134,7 @@ gcc_12_python: ...@@ -138,7 +134,7 @@ gcc_12_python:
script: script:
- export SKBUILD_BUILD_DIR="pybuild" - export SKBUILD_BUILD_DIR="pybuild"
- export SKBUILD_CMAKE_ARGS="-DBUILD_VF_CPU=ON;-DBUILD_VF_DOUBLE_ACCURACY=ON;-DCMAKE_CXX_COMPILER_LAUNCHER=ccache;-DCMAKE_CUDA_COMPILER_LAUNCHER=ccache;-DCMAKE_C_COMPILER_LAUNCHER=ccache;-G=Ninja" - export SKBUILD_CMAKE_ARGS="-DBUILD_VF_CPU=ON;-DBUILD_VF_GPU=ON;-DCMAKE_CUDA_ARCHITECTURES=70;-DBUILD_VF_DOUBLE_ACCURACY=ON;-DCMAKE_CXX_COMPILER_LAUNCHER=ccache;-DCMAKE_CUDA_COMPILER_LAUNCHER=ccache;-DCMAKE_C_COMPILER_LAUNCHER=ccache;-G=Ninja"
- pip install . -v - pip install . -v
############################################################################### ###############################################################################
......
{ {
"c-cpp-flylint.flexelint.enable": false, "files.watcherExclude": {
"c-cpp-flylint.flawfinder.enable": false "**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/node_modules/*/**": true,
"**/.cache/**": true
}
} }
\ No newline at end of file
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
set(CMAKE_CUDA_ARCHITECTURES 86) # Nvidia GeForce RTX 3060 set(CMAKE_CUDA_ARCHITECTURES 86) # Nvidia GeForce RTX 3060
# add invidual apps here # add invidual apps here
set(GPU_APP "apps/gpu/LBM/") set(GPU_APP "apps/gpu/")
list(APPEND USER_APPS list(APPEND USER_APPS
"${GPU_APP}DrivenCavityMultiGPU" "${GPU_APP}DrivenCavityMultiGPU"
"${GPU_APP}SphereScaling" "${GPU_APP}SphereScaling"
......
...@@ -9,7 +9,7 @@ set(CMAKE_CUDA_ARCHITECTURES 86) # Nvidia GeForce RTX 3060 ...@@ -9,7 +9,7 @@ set(CMAKE_CUDA_ARCHITECTURES 86) # Nvidia GeForce RTX 3060
set(PATH_NUMERICAL_TESTS "D:/out/numericalTests/") set(PATH_NUMERICAL_TESTS "D:/out/numericalTests/")
list(APPEND VF_COMPILER_DEFINITION "PATH_NUMERICAL_TESTS=${PATH_NUMERICAL_TESTS}") list(APPEND VF_COMPILER_DEFINITION "PATH_NUMERICAL_TESTS=${PATH_NUMERICAL_TESTS}")
set(GPU_APP "apps/gpu/LBM/") set(GPU_APP "apps/gpu/")
list(APPEND USER_APPS list(APPEND USER_APPS
"${GPU_APP}DrivenCavityMultiGPU" "${GPU_APP}DrivenCavityMultiGPU"
"${GPU_APP}SphereScaling" "${GPU_APP}SphereScaling"
......
...@@ -10,7 +10,7 @@ SET(CMAKE_CUDA_ARCHITECTURES 61) # GeForce 1080 Ti ...@@ -10,7 +10,7 @@ SET(CMAKE_CUDA_ARCHITECTURES 61) # GeForce 1080 Ti
set(PATH_NUMERICAL_TESTS "~/output/numericalTests/") set(PATH_NUMERICAL_TESTS "~/output/numericalTests/")
list(APPEND VF_COMPILER_DEFINITION "PATH_NUMERICAL_TESTS=${PATH_NUMERICAL_TESTS}") list(APPEND VF_COMPILER_DEFINITION "PATH_NUMERICAL_TESTS=${PATH_NUMERICAL_TESTS}")
set(GPU_APP "apps/gpu/LBM/") set(GPU_APP "apps/gpu/")
list(APPEND USER_APPS list(APPEND USER_APPS
# "${GPU_APP}DrivenCavityMultiGPU" # "${GPU_APP}DrivenCavityMultiGPU"
# "${GPU_APP}SphereScaling" # "${GPU_APP}SphereScaling"
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
set(CMAKE_CUDA_ARCHITECTURES 80) # Nvidia Tesla A100 set(CMAKE_CUDA_ARCHITECTURES 80) # Nvidia Tesla A100
set(GPU_APP "apps/gpu/LBM/") set(GPU_APP "apps/gpu/")
list(APPEND USER_APPS list(APPEND USER_APPS
"${GPU_APP}ChannelFlow" "${GPU_APP}ChannelFlow"
"${GPU_APP}SphereScaling" "${GPU_APP}SphereScaling"
......
...@@ -12,6 +12,6 @@ set(PATH_NUMERICAL_TESTS "D:/out/numericalTests/") ...@@ -12,6 +12,6 @@ set(PATH_NUMERICAL_TESTS "D:/out/numericalTests/")
list(APPEND VF_COMPILER_DEFINITION "PATH_NUMERICAL_TESTS=${PATH_NUMERICAL_TESTS}") list(APPEND VF_COMPILER_DEFINITION "PATH_NUMERICAL_TESTS=${PATH_NUMERICAL_TESTS}")
# add invidual apps here # add invidual apps here
list(APPEND USER_APPS "apps/gpu/LBM/WTG_RUB") list(APPEND USER_APPS "apps/gpu/WTG_RUB")
list(APPEND USER_APPS "apps/gpu/LBM/TGV_3D_GridRef") list(APPEND USER_APPS "apps/gpu/TGV_3D_GridRef")
list(APPEND USER_APPS "apps/gpu/LBM/SphereRefined") list(APPEND USER_APPS "apps/gpu/SphereRefined")
SET(CMAKE_CUDA_ARCHITECTURES "75") SET(CMAKE_CUDA_ARCHITECTURES "75")
list(APPEND USER_APPS "apps/gpu/LBM/ActuatorLine") list(APPEND USER_APPS "apps/gpu/ActuatorLine")
list(APPEND USER_APPS "apps/gpu/LBM/SphereScaling") list(APPEND USER_APPS "apps/gpu/SphereScaling")
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
## nvidia ## nvidia
set(CMAKE_CUDA_ARCHITECTURES 60) # NVIDIA Tesla P100 set(CMAKE_CUDA_ARCHITECTURES 60) # NVIDIA Tesla P100
set(GPU_APP "apps/gpu/LBM/") set(GPU_APP "apps/gpu/")
list(APPEND USER_APPS list(APPEND USER_APPS
# "${GPU_APP}DrivenCavityMultiGPU" # "${GPU_APP}DrivenCavityMultiGPU"
# "${GPU_APP}SphereScaling" # "${GPU_APP}SphereScaling"
......
...@@ -12,4 +12,4 @@ SET(PATH_NUMERICAL_TESTS "E:/temp/numericalTests/") ...@@ -12,4 +12,4 @@ SET(PATH_NUMERICAL_TESTS "E:/temp/numericalTests/")
list(APPEND VF_COMPILER_DEFINITION "PATH_NUMERICAL_TESTS=${PATH_NUMERICAL_TESTS}") list(APPEND VF_COMPILER_DEFINITION "PATH_NUMERICAL_TESTS=${PATH_NUMERICAL_TESTS}")
# add invidual apps here # add invidual apps here
list(APPEND USER_APPS "apps/gpu/LBM/MusselOyster") list(APPEND USER_APPS "apps/gpu/MusselOyster")
...@@ -138,6 +138,11 @@ if(BUILD_VF_GPU) ...@@ -138,6 +138,11 @@ if(BUILD_VF_GPU)
set(CMAKE_CUDA_ARCHITECTURES "${CMAKE_CUDA_ARCHITECTURES}" CACHE STRING "Cuda Architecture (compute capabilitiy)") set(CMAKE_CUDA_ARCHITECTURES "${CMAKE_CUDA_ARCHITECTURES}" CACHE STRING "Cuda Architecture (compute capabilitiy)")
set(CMAKE_CUDA_FLAGS_DEBUG " -G" CACHE STRING "" FORCE) set(CMAKE_CUDA_FLAGS_DEBUG " -G" CACHE STRING "" FORCE)
# we disable the usage of cuda response files here
# usually CUDA_INCLUDES.rsp is genereated by cmake containing all include paths and is passed in compile_commands.json via the --options-file flag
# this .rsp file can not be parsed by clangd and therefore we disable it
set(CMAKE_CUDA_USE_RESPONSE_FILE_FOR_INCLUDES 0)
endif() endif()
...@@ -205,7 +210,7 @@ ENDIF() ...@@ -205,7 +210,7 @@ ENDIF()
add_subdirectory(src/logger) add_subdirectory(src/logger)
add_subdirectory(src/basics) add_subdirectory(src/basics)
add_subdirectory(src/mpi) add_subdirectory(src/parallel)
add_subdirectory(src/lbm) add_subdirectory(src/lbm)
...@@ -216,7 +221,7 @@ if (BUILD_VF_CPU) ...@@ -216,7 +221,7 @@ if (BUILD_VF_CPU)
include(cpu.cmake) include(cpu.cmake)
endif() endif()
if(BUILD_VF_GPU) if(BUILD_VF_GPU)
add_subdirectory(src/cuda) add_subdirectory(src/gpu/cuda_helper)
include(gpu.cmake) include(gpu.cmake)
endif() endif()
......
# VirtualFluids Development Image: # VirtualFluids Development Image:
# Ubuntu 22.04 # Ubuntu 22.04
FROM nvidia/cuda:12.1.1-devel-ubuntu22.04 FROM nvidia/cuda:12.2.0-devel-ubuntu22.04
# timezone # timezone
ARG TZ ARG TZ
...@@ -16,22 +16,25 @@ RUN apt-get update && \ ...@@ -16,22 +16,25 @@ RUN apt-get update && \
ninja-build \ ninja-build \
openmpi-bin \ openmpi-bin \
libopenmpi-dev \ libopenmpi-dev \
libomp-15-dev \ libomp-15-dev \
clang-15 \ clang-15 \
clang-format-15 \ clang-format-15 \
clang-tidy-15 \ clang-tidy-15 \
clang-tools-15 \ clang-tools-15 \
python3.11 \ python3.11 \
python3-pip \ python3-pip \
python3.11-dev \ python3.11-dev \
cppcheck \ cppcheck \
clangd-12 \
&& update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 100 \ && update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 100 \
&& update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 100 \ && update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 100 \
&& update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-15 100 \ && update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-15 100 \
&& update-alternatives --install /usr/bin/clang clang /usr/bin/clang-15 100 \ && update-alternatives --install /usr/bin/clang clang /usr/bin/clang-15 100 \
&& update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 100 \ && update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 100 \
&& update-alternatives --install /usr/bin/clangd clangd /usr/bin/clangd-12 100 \ && ln -s clang-tidy-15 /usr/bin/clang-tidy \
&& ln -s clang-format-15 /usr/bin/clang-format \
&& wget https://github.com/clangd/clangd/releases/download/16.0.2/clangd-linux-16.0.2.zip && unzip clangd-linux-16.0.2.zip \
&& mv clangd_16.0.2/bin/clangd /usr/bin/clangd-16 && mv clangd_16.0.2/lib/clang/16 /usr/lib/clang/ \
&& update-alternatives --install /usr/bin/clangd clangd /usr/bin/clangd-16 100 \
&& pip3 install \ && pip3 install \
cmake==3.26.3 \ cmake==3.26.3 \
setuptools \ setuptools \
......
# VirtualFluids Development Image:
# Ubuntu 22.04
FROM git.rz.tu-bs.de:4567/irmb/virtualfluids/ubuntu22_04:1.1 as build
# For wiFI https://source.coderefinery.org/Hkorb/wifi.git
RUN pip3 install \
pandas \
cupy-cuda12x \
mpi4py \
&& git clone --recurse-submodules https://source.coderefinery.org/Hkorb/wifi.git \
&& cd wifi \
&& git checkout develop \
&& pip3 install -e . >> log_wifi_install.txt
...@@ -36,7 +36,7 @@ r""" ...@@ -36,7 +36,7 @@ r"""
import numpy as np import numpy as np
from pathlib import Path from pathlib import Path
from mpi4py import MPI from mpi4py import MPI
from pyfluids.bindings import basics, gpu, logger from pyfluids import basics, gpu, logger, communicator
#%% #%%
sim_name = "ABL" sim_name = "ABL"
config_file = Path(__file__).parent/"configActuatorLine.txt" config_file = Path(__file__).parent/"configActuatorLine.txt"
...@@ -47,15 +47,13 @@ output_path.mkdir(exist_ok=True) ...@@ -47,15 +47,13 @@ output_path.mkdir(exist_ok=True)
#%% #%%
logger.Logger.initialize_logger() logger.Logger.initialize_logger()
#%% grid_builder = gpu.grid_generator.MultipleGridBuilder()
grid_factory = gpu.grid_generator.GridFactory.make() communicator = communicator.Communicator.get_instance()
grid_builder = gpu.grid_generator.MultipleGridBuilder.make_shared(grid_factory)
communicator = gpu.Communicator.get_instance()
config = basics.ConfigurationFile() config = basics.ConfigurationFile()
config.load(str(config_file)) config.load(str(config_file))
para = gpu.Parameter(communicator.get_number_of_process(), communicator.get_pid(), config) para = gpu.Parameter(communicator.get_number_of_processes(), communicator.get_number_of_processes(), config)
bc_factory = gpu.BoundaryConditionFactory() bc_factory = gpu.BoundaryConditionFactory()
#%% #%%
......
...@@ -36,7 +36,7 @@ r""" ...@@ -36,7 +36,7 @@ r"""
import numpy as np import numpy as np
from pathlib import Path from pathlib import Path
from mpi4py import MPI from mpi4py import MPI
from pyfluids import basics, gpu, logger from pyfluids import basics, gpu, logger, communicator
#%% #%%
sim_name = "ABL" sim_name = "ABL"
config_file = Path(__file__).parent/"configBoundaryLayer.txt" config_file = Path(__file__).parent/"configBoundaryLayer.txt"
...@@ -48,14 +48,13 @@ output_path.mkdir(exist_ok=True) ...@@ -48,14 +48,13 @@ output_path.mkdir(exist_ok=True)
logger.Logger.initialize_logger() logger.Logger.initialize_logger()
#%% #%%
grid_factory = gpu.grid_generator.GridFactory.make() grid_builder = gpu.grid_generator.MultipleGridBuilder()
grid_builder = gpu.grid_generator.MultipleGridBuilder.make_shared(grid_factory) communicator = communicator.Communicator.get_instance()
communicator = gpu.Communicator.get_instance()
config = basics.ConfigurationFile() config = basics.ConfigurationFile()
config.load(str(config_file)) config.load(str(config_file))
para = gpu.Parameter(communicator.get_number_of_process(), communicator.get_pid(), config) para = gpu.Parameter(communicator.get_number_of_processes(), communicator.get_process_id(), config)
bc_factory = gpu.BoundaryConditionFactory() bc_factory = gpu.BoundaryConditionFactory()
#%% #%%
......
...@@ -10,7 +10,7 @@ void run() ...@@ -10,7 +10,7 @@ void run()
{ {
try try
{ {
SPtr<vf::mpi::Communicator> comm = vf::mpi::MPICommunicator::getInstance(); SPtr<vf::parallel::Communicator> comm = vf::parallel::MPICommunicator::getInstance();
int myid = comm->getProcessID(); int myid = comm->getProcessID();
int numOfThreads = 4; int numOfThreads = 4;
......