diff --git a/.github/workflows/push_pull.yml b/.github/workflows/push_pull.yml index e319d166ab..624da63d35 100644 --- a/.github/workflows/push_pull.yml +++ b/.github/workflows/push_pull.yml @@ -48,7 +48,6 @@ jobs: with_gsl: 'true' with_walberla: 'true' with_walberla_avx: 'false' - with_shared_memory_parallelism: 'true' debian: runs-on: ubuntu-latest @@ -85,7 +84,6 @@ jobs: with_gsl: 'false' with_scafacos: 'false' with_stokesian_dynamics: 'false' - with_shared_memory_parallelism: 'false' make_check_unit_tests: 'true' make_check_python: 'false' OMPI_ALLOW_RUN_AS_ROOT: 1 @@ -127,9 +125,9 @@ jobs: with_gsl: 'false' with_scafacos: 'false' with_stokesian_dynamics: 'false' - with_shared_memory_parallelism: 'false' make_check_unit_tests: 'false' make_check_python: 'false' + cmake_params: '-D ESPRESSO_TEST_NT=1' OMPI_ALLOW_RUN_AS_ROOT: 1 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1 @@ -167,10 +165,9 @@ jobs: with_hdf5: 'true' with_fftw: 'true' with_fpe: 'true' - with_gsl: 'false' + with_gsl: 'true' with_scafacos: 'false' with_walberla: 'true' with_walberla_avx: 'false' with_stokesian_dynamics: 'true' - with_shared_memory_parallelism: 'false' - cmake_params: '-D CMAKE_CXX_STANDARD=23 -D CMAKE_INCLUDE_PATH=/usr/include/mpich-x86_64 -D CMAKE_PREFIX_PATH=/usr/lib64/mpich/lib/' + cmake_params: '-D CMAKE_CXX_STANDARD=23 -D CMAKE_INCLUDE_PATH=/usr/include/mpich-x86_64 -D CMAKE_PREFIX_PATH=/usr/lib64/mpich/lib/ -D ESPRESSO_TEST_NT=1' diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3b551af1e5..8959167738 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -47,7 +47,7 @@ style: - cd build - cp ../style.patch . - cp ../maintainer/configs/maxset.hpp myconfig.hpp - - cmake .. -D ESPRESSO_BUILD_WITH_CUDA=ON -D ESPRESSO_BUILD_WITH_FFTW=ON -D ESPRESSO_BUILD_WITH_GSL=ON -D ESPRESSO_BUILD_WITH_HDF5=ON -D ESPRESSO_BUILD_WITH_SCAFACOS=ON -D ESPRESSO_BUILD_WITH_WALBERLA=ON -D ESPRESSO_BUILD_WITH_STOKESIAN_DYNAMICS=ON -D ESPRESSO_BUILD_WITH_CALIPER=ON -D ESPRESSO_BUILD_WITH_FPE=ON -D ESPRESSO_BUILD_WITH_SHARED_MEMORY_PARALLELISM=ON -D ESPRESSO_BUILD_WITH_NLOPT=ON + - cmake .. -D ESPRESSO_BUILD_WITH_CUDA=ON -D ESPRESSO_BUILD_WITH_FFTW=ON -D ESPRESSO_BUILD_WITH_GSL=ON -D ESPRESSO_BUILD_WITH_HDF5=ON -D ESPRESSO_BUILD_WITH_SCAFACOS=ON -D ESPRESSO_BUILD_WITH_WALBERLA=ON -D ESPRESSO_BUILD_WITH_STOKESIAN_DYNAMICS=ON -D ESPRESSO_BUILD_WITH_CALIPER=ON -D ESPRESSO_BUILD_WITH_FPE=ON -D ESPRESSO_BUILD_WITH_NLOPT=ON - sh ../maintainer/CI/dox_warnings.sh tags: - espresso @@ -146,7 +146,6 @@ clang-sanitizer: with_scafacos: 'true' with_walberla: 'true' with_stokesian_dynamics: 'true' - with_shared_memory_parallelism: 'true' with_nlopt: 'true' with_coverage: 'false' with_coverage_python: 'false' @@ -193,7 +192,6 @@ cuda12-coverage: with_scafacos: 'true' with_walberla: 'true' with_stokesian_dynamics: 'true' - with_shared_memory_parallelism: 'true' with_nlopt: 'true' script: - bash maintainer/CI/build_cmake.sh @@ -221,7 +219,6 @@ cuda12-maxset: with_walberla: 'true' with_walberla_avx: 'true' with_stokesian_dynamics: 'true' - with_shared_memory_parallelism: 'true' with_nlopt: 'true' script: - bash maintainer/CI/build_cmake.sh @@ -367,7 +364,6 @@ installation: with_walberla: 'true' with_walberla_avx: 'true' with_stokesian_dynamics: 'true' - with_shared_memory_parallelism: 'true' with_nlopt: 'true' srcdir: '${CI_PROJECT_DIR}' build_type: 'Release' diff --git a/CMakeLists.txt b/CMakeLists.txt index f74b1427cb..9396182516 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -111,8 +111,6 @@ option(ESPRESSO_BUILD_WITH_WALBERLA "Build with waLBerla support" ON) option(ESPRESSO_BUILD_WITH_WALBERLA_AVX "Build waLBerla kernels with AVX2 vectorization" ${ESPRESSO_BUILD_WITH_WALBERLA_AVX_DEFAULT}) -option(ESPRESSO_BUILD_WITH_SHARED_MEMORY_PARALLELISM - "Build with shared memory parallelism support" OFF) option(ESPRESSO_BUILD_BENCHMARKS "Enable benchmarks" OFF) option(ESPRESSO_BUILD_WITH_VALGRIND "Build with Valgrind instrumentation" OFF) option(ESPRESSO_BUILD_WITH_CALIPER "Build with Caliper instrumentation" OFF) @@ -441,13 +439,6 @@ target_compile_options( $<$:-Wno-cast-function-type> $<$:-diag-disable=592> $<$:-Wno-global-constructors> - $<$,$>:-Wno-format-nonliteral> - $<$,$>:-Wno-float-conversion> - $<$,$>:-Wno-implicit-int-float-conversion> - $<$,$>:-Wno-implicit-float-conversion> - $<$,$>:-Wno-tautological-constant-compare> - $<$,$>:-Wno-ctad-maybe-unsupported> - $<$,$>:-Wno-extra-semi> $<$,$>:-Wno-extra-semi> $<$,$>:-Wno-extra-semi> $<$,$>:-Wno-cast-qual> @@ -632,11 +623,18 @@ endif() # Libraries # +set(ESPRESSO_OPENMP_COMPONENTS CXX) +if(ESPRESSO_BUILD_WITH_CUDA) + list(APPEND ESPRESSO_OPENMP_COMPONENTS CUDA) +endif() +# ESPResSo and Kokkos require some of the new features from OpenMP 5.0, but a +# version check cannot be enforced here, since GCC versions 12 to 15 report 4.5 +# support for the CXX component, and NVHPC versions <= 26.3 report 4.5 support +# for the CUDA component +find_package(OpenMP REQUIRED COMPONENTS ${ESPRESSO_OPENMP_COMPONENTS}) + if(ESPRESSO_BUILD_WITH_FFTW) - if(ESPRESSO_BUILD_WITH_SHARED_MEMORY_PARALLELISM) - list(APPEND FFTW3_COMPONENTS omp) - endif() - find_package(fftw3 REQUIRED COMPONENTS ${FFTW3_COMPONENTS}) + find_package(fftw3 REQUIRED COMPONENTS omp) if(NOT EXISTS ${FETCHCONTENT_BASE_DIR}/heffte-src) find_package(Heffte 2.4.1 QUIET) @@ -669,79 +667,67 @@ if(ESPRESSO_BUILD_WITH_FFTW) endif() endif() -if(ESPRESSO_BUILD_WITH_SHARED_MEMORY_PARALLELISM) - set(ESPRESSO_OPENMP_COMPONENTS CXX) - if(ESPRESSO_BUILD_WITH_CUDA) - list(APPEND ESPRESSO_OPENMP_COMPONENTS CUDA) - endif() - # ESPResSo and Kokkos require some of the new features from OpenMP 5.0, but a - # version check cannot be enforced here, since GCC versions 12 to 15 report - # 4.5 support for the CXX component, and NVHPC versions <= 26.3 report 4.5 - # support for the CUDA component - find_package(OpenMP REQUIRED COMPONENTS ${ESPRESSO_OPENMP_COMPONENTS}) - - if(NOT EXISTS ${FETCHCONTENT_BASE_DIR}/kokkos-src) - find_package(Kokkos 4.6 QUIET) - endif() - if(NOT DEFINED Kokkos_FOUND OR NOT ${Kokkos_FOUND}) - # cmake-format: off - FetchContent_Declare( - kokkos - GIT_REPOSITORY https://github.com/kokkos/kokkos.git - GIT_TAG 5.0.2 - OVERRIDE_FIND_PACKAGE - ) - # cmake-format: on - set(BUILD_SHARED_LIBS ON) - set(CMAKE_SHARED_LIBRARY_PREFIX "lib") - set(Kokkos_ENABLE_SERIAL ON CACHE BOOL "") - set(Kokkos_ENABLE_OPENMP ON CACHE BOOL "") - set(Kokkos_ENABLE_IMPL_VIEW_LEGACY ON CACHE BOOL "") - set(Kokkos_ENABLE_COMPLEX_ALIGN ON CACHE BOOL "") - set(Kokkos_ENABLE_AGGRESSIVE_VECTORIZATION ON CACHE BOOL "") - set(Kokkos_ENABLE_HWLOC ON CACHE BOOL "") - set(Kokkos_ENABLE_DEPRECATED_CODE_5 OFF CACHE BOOL "") - FetchContent_MakeAvailable(kokkos) - set(BUILD_SHARED_LIBS ${ESPRESSO_BUILD_SHARED_LIBS_DEFAULT}) - set(CMAKE_SHARED_LIBRARY_PREFIX "${ESPRESSO_SHARED_LIBRARY_PREFIX}") - install(TARGETS kokkos LIBRARY DESTINATION "${ESPRESSO_INSTALL_LIBDIR}") - # install all kokkos shared objects - get_target_property(ESPRESSO_KOKKOS_LIBS kokkos INTERFACE_LINK_LIBRARIES) - foreach(target_name IN LISTS ESPRESSO_KOKKOS_LIBS) - get_target_property(target_type ${target_name} TYPE) - if(${target_type} STREQUAL "SHARED_LIBRARY" AND ${target_name} MATCHES - "^kokkos[a-zA-Z0-9_]+$") - install(TARGETS ${target_name} - LIBRARY DESTINATION "${ESPRESSO_INSTALL_LIBDIR}") - endif() - endforeach() - # mark kokkos headers as system headers to disable compiler diagnostics - set_property( - TARGET kokkos APPEND - PROPERTY INTERFACE_SYSTEM_INCLUDE_DIRECTORIES - $) - endif() +if(NOT EXISTS ${FETCHCONTENT_BASE_DIR}/kokkos-src) + find_package(Kokkos 4.6 QUIET) +endif() +if(NOT DEFINED Kokkos_FOUND OR NOT ${Kokkos_FOUND}) + # cmake-format: off + FetchContent_Declare( + kokkos + GIT_REPOSITORY https://github.com/kokkos/kokkos.git + GIT_TAG 5.0.2 + OVERRIDE_FIND_PACKAGE + ) + # cmake-format: on + set(BUILD_SHARED_LIBS ON) + set(CMAKE_SHARED_LIBRARY_PREFIX "lib") + set(Kokkos_ENABLE_SERIAL ON CACHE BOOL "") + set(Kokkos_ENABLE_OPENMP ON CACHE BOOL "") + set(Kokkos_ENABLE_IMPL_VIEW_LEGACY ON CACHE BOOL "") + set(Kokkos_ENABLE_COMPLEX_ALIGN ON CACHE BOOL "") + set(Kokkos_ENABLE_AGGRESSIVE_VECTORIZATION ON CACHE BOOL "") + set(Kokkos_ENABLE_HWLOC ON CACHE BOOL "") + set(Kokkos_ENABLE_DEPRECATED_CODE_5 OFF CACHE BOOL "") + FetchContent_MakeAvailable(kokkos) + set(BUILD_SHARED_LIBS ${ESPRESSO_BUILD_SHARED_LIBS_DEFAULT}) + set(CMAKE_SHARED_LIBRARY_PREFIX "${ESPRESSO_SHARED_LIBRARY_PREFIX}") + install(TARGETS kokkos LIBRARY DESTINATION "${ESPRESSO_INSTALL_LIBDIR}") + # install all kokkos shared objects + get_target_property(ESPRESSO_KOKKOS_LIBS kokkos INTERFACE_LINK_LIBRARIES) + foreach(target_name IN LISTS ESPRESSO_KOKKOS_LIBS) + get_target_property(target_type ${target_name} TYPE) + if(${target_type} STREQUAL "SHARED_LIBRARY" AND ${target_name} MATCHES + "^kokkos[a-zA-Z0-9_]+$") + install(TARGETS ${target_name} + LIBRARY DESTINATION "${ESPRESSO_INSTALL_LIBDIR}") + endif() + endforeach() + # mark kokkos headers as system headers to disable compiler diagnostics + set_property( + TARGET kokkos APPEND + PROPERTY INTERFACE_SYSTEM_INCLUDE_DIRECTORIES + $) +endif() - if(NOT EXISTS ${FETCHCONTENT_BASE_DIR}/cabana-src) - find_package(Cabana 0.7.0 QUIET) - endif() - if(NOT DEFINED Cabana_FOUND OR NOT ${Cabana_FOUND}) - # cmake-format: off - FetchContent_Declare( - cabana - GIT_REPOSITORY https://github.com/ECP-copa/Cabana.git - GIT_TAG e76c1a1 # 0.7.0 with patches - PATCH_COMMAND patch -p0 < ${CMAKE_CURRENT_SOURCE_DIR}/cmake/cabana.patch - ) - # cmake-format: on - set(Cabana_REQUIRE_HEFFTE ${ESPRESSO_BUILD_WITH_FFTW} CACHE BOOL "") - FetchContent_MakeAvailable(cabana) - # mark Cabana headers as system headers to disable compiler diagnostics - set_property( - TARGET Core APPEND - PROPERTY INTERFACE_SYSTEM_INCLUDE_DIRECTORIES - $) - endif() +if(NOT EXISTS ${FETCHCONTENT_BASE_DIR}/cabana-src) + find_package(Cabana 0.7.0 QUIET) +endif() +if(NOT DEFINED Cabana_FOUND OR NOT ${Cabana_FOUND}) + # cmake-format: off + FetchContent_Declare( + cabana + GIT_REPOSITORY https://github.com/ECP-copa/Cabana.git + GIT_TAG e76c1a1 # 0.7.0 with patches + PATCH_COMMAND patch -p0 < ${CMAKE_CURRENT_SOURCE_DIR}/cmake/cabana.patch + ) + # cmake-format: on + set(Cabana_REQUIRE_HEFFTE ${ESPRESSO_BUILD_WITH_FFTW} CACHE BOOL "") + FetchContent_MakeAvailable(cabana) + # mark Cabana headers as system headers to disable compiler diagnostics + set_property( + TARGET Core APPEND + PROPERTY INTERFACE_SYSTEM_INCLUDE_DIRECTORIES + $) endif() # We need the parallel hdf5 version! @@ -1017,9 +1003,7 @@ if(ESPRESSO_BUILD_WITH_WALBERLA) endif() endif() set(WALBERLA_BUILD_WITH_FFTW off CACHE BOOL "") - if(ESPRESSO_BUILD_WITH_SHARED_MEMORY_PARALLELISM) - set(WALBERLA_BUILD_WITH_OPENMP on CACHE BOOL "") - endif() + set(WALBERLA_BUILD_WITH_OPENMP on CACHE BOOL "") set(WALBERLA_BUILD_WITH_FASTMATH off CACHE BOOL "") set(BUILD_SHARED_LIBS OFF) FetchContent_MakeAvailable(walberla) diff --git a/cmake/espresso_cmake_config.cmakein b/cmake/espresso_cmake_config.cmakein index 1bd76a3f03..113f1e735d 100644 --- a/cmake/espresso_cmake_config.cmakein +++ b/cmake/espresso_cmake_config.cmakein @@ -23,8 +23,6 @@ #cmakedefine ESPRESSO_BUILD_WITH_FPE -#cmakedefine ESPRESSO_BUILD_WITH_SHARED_MEMORY_PARALLELISM - #define PACKAGE_NAME "${PROJECT_NAME}" /** diff --git a/cmake/espresso_unit_test.cmake b/cmake/espresso_unit_test.cmake index d0a44f30f6..dfbec9bf84 100644 --- a/cmake/espresso_unit_test.cmake +++ b/cmake/espresso_unit_test.cmake @@ -64,11 +64,10 @@ function(espresso_unit_test_register) if(NOT DEFINED TEST_TARGET) set(TEST_TARGET ${TEST_NAME}) endif() - if(NOT DEFINED TEST_NUM_PROC AND "${TEST_DEPENDS}" MATCHES "(^|;)([Bb]oost::mpi|MPI::MPI_CXX)($|;)") + if(NOT DEFINED TEST_NUM_PROC) set(TEST_NUM_PROC 1) endif() - # If NUM_PROC is given, set up MPI parallel test case - if(TEST_NUM_PROC) + if(TEST_NUM_PROC GREATER 1) if(${TEST_NUM_PROC} GREATER ${ESPRESSO_TEST_NP}) set(TEST_NUM_PROC ${ESPRESSO_TEST_NP}) endif() @@ -79,6 +78,9 @@ function(espresso_unit_test_register) ${MPIEXEC_POSTFLAGS}) else() add_test(NAME ${TEST_NAME} COMMAND ${TEST_TARGET}) + if(ESPRESSO_MPIEXEC_GUARD_SINGLETON_NUMA) + list(APPEND TEST_ENV_VARIABLES "OMPI_MCA_hwloc_base_binding_policy=none") + endif() endif() if(NOT DEFINED TEST_NUM_THREADS) set(TEST_NUM_THREADS 2) @@ -86,6 +88,7 @@ function(espresso_unit_test_register) if(${TEST_NUM_THREADS} GREATER ${ESPRESSO_TEST_NT}) set(TEST_NUM_THREADS ${ESPRESSO_TEST_NT}) endif() + list(APPEND TEST_ENV_VARIABLES "OMP_PROC_BIND=false" "OMP_NUM_THREADS=${TEST_NUM_THREADS}") if(ESPRESSO_WARNINGS_ARE_ERRORS) set(SANITIZERS_HALT_ON_ERROR "halt_on_error=1") @@ -95,17 +98,7 @@ function(espresso_unit_test_register) list(APPEND TEST_ENV_VARIABLES "UBSAN_OPTIONS=suppressions=${CMAKE_SOURCE_DIR}/maintainer/CI/ubsan.supp:${SANITIZERS_HALT_ON_ERROR}:print_stacktrace=1") list(APPEND TEST_ENV_VARIABLES "ASAN_OPTIONS=${SANITIZERS_HALT_ON_ERROR}:detect_leaks=0:allocator_may_return_null=1") list(APPEND TEST_ENV_VARIABLES "MSAN_OPTIONS=${SANITIZERS_HALT_ON_ERROR}") - if(NOT DEFINED TEST_NUM_PROC AND ESPRESSO_MPIEXEC_GUARD_SINGLETON_NUMA) - list(APPEND TEST_ENV_VARIABLES "OMPI_MCA_hwloc_base_binding_policy=none") - endif() - list(APPEND TEST_ENV_VARIABLES "OMP_PROC_BIND=false" "OMP_NUM_THREADS=${TEST_NUM_THREADS}") - set(TEST_NUM_CORES 1) - if(DEFINED TEST_NUM_PROC) - set(TEST_NUM_CORES ${TEST_NUM_PROC}) - endif() - if(ESPRESSO_BUILD_WITH_SHARED_MEMORY_PARALLELISM) - math(EXPR TEST_NUM_CORES "${TEST_NUM_CORES} * ${TEST_NUM_THREADS}") - endif() + math(EXPR TEST_NUM_CORES "${TEST_NUM_PROC} * ${TEST_NUM_THREADS}") set_tests_properties( ${TEST_NAME} PROPERTIES ENVIRONMENT "${TEST_ENV_VARIABLES}" PROCESSORS ${TEST_NUM_CORES} diff --git a/doc/sphinx/installation.rst b/doc/sphinx/installation.rst index 8939526d38..bf7121028d 100644 --- a/doc/sphinx/installation.rst +++ b/doc/sphinx/installation.rst @@ -791,9 +791,6 @@ using a CMake flag (see :ref:`Options and Variables`). - ``STOKESIAN_DYNAMICS``: enable the Stokesian Dynamics propagator (see :ref:`Stokesian Dynamics`). Requires BLAS and LAPACK. -- ``SHARED_MEMORY_PARALLELISM``: enable shared-memory parallelism - (OpenMP, Kokkos, Cabana) - - ``CALIPER``, ``VALGRIND``, ``FPE``: enable various instrumentation tools (see :ref:`Instrumentation`) @@ -957,7 +954,6 @@ The following options control features from external libraries: * ``ESPRESSO_BUILD_WITH_SCAFACOS``: Build with ScaFaCoS support. * ``ESPRESSO_BUILD_WITH_GSL``: Build with GSL support. * ``ESPRESSO_BUILD_WITH_STOKESIAN_DYNAMICS`` Build with Stokesian Dynamics support. -* ``ESPRESSO_BUILD_WITH_SHARED_MEMORY_PARALLELISM``: Build with shared-memory parallelism support (OpenMP, Cabana, Kokkos, etc.) * ``ESPRESSO_BUILD_WITH_WALBERLA``: Build with waLBerla support. * ``ESPRESSO_BUILD_WITH_WALBERLA_AVX``: Build waLBerla with AVX kernels instead of regular kernels. * ``ESPRESSO_BUILD_WITH_PYTHON``: Build with the Python interface. diff --git a/doc/sphinx/running.rst b/doc/sphinx/running.rst index 60d8512095..e25862bc87 100644 --- a/doc/sphinx/running.rst +++ b/doc/sphinx/running.rst @@ -262,9 +262,8 @@ extra arguments are passed to the ``mpiexec`` program. On cluster computers, it might be necessary to load the MPI library with ``module load openmpi`` or similar. -On modern NUMA architectures, |es| can leverage shared-memory parallelism -(SMP) using the `OpenMP `__ programming model. -This is enabled via the CMake option ``-D SHARED_MEMORY_PARALLELISM=ON``. +|es| leverages shared-memory parallelism (SMP) using +the `OpenMP `__ programming model. To run a simulation with 4 OpenMP threads, use the following syntax: .. code-block:: bash diff --git a/maintainer/CI/build_cmake.sh b/maintainer/CI/build_cmake.sh index d04ddc2f6e..3f2f5dd2a4 100755 --- a/maintainer/CI/build_cmake.sh +++ b/maintainer/CI/build_cmake.sh @@ -107,7 +107,6 @@ set_default_value with_asan false set_default_value with_static_analysis false set_default_value with_caliper false set_default_value with_fpe false -set_default_value with_shared_memory_parallelism false set_default_value myconfig "default" set_default_value build_procs ${default_build_procs} set_default_value check_procs ${default_check_procs} @@ -159,7 +158,6 @@ cmake_param_list+=( -D ESPRESSO_BUILD_WITH_CCACHE:BOOL=${with_ccache} -D ESPRESSO_BUILD_WITH_CALIPER:BOOL=${with_caliper} -D ESPRESSO_BUILD_WITH_FPE:BOOL=${with_fpe} - -D ESPRESSO_BUILD_WITH_SHARED_MEMORY_PARALLELISM:BOOL=${with_shared_memory_parallelism} -D ESPRESSO_BUILD_WITH_HDF5:BOOL=${with_hdf5} -D ESPRESSO_BUILD_WITH_FFTW:BOOL=${with_fftw} -D ESPRESSO_BUILD_WITH_GSL:BOOL=${with_gsl} diff --git a/maintainer/walberla_kernels/generate_ek_kernels.py b/maintainer/walberla_kernels/generate_ek_kernels.py index d6e69c81c0..670091eacc 100644 --- a/maintainer/walberla_kernels/generate_ek_kernels.py +++ b/maintainer/walberla_kernels/generate_ek_kernels.py @@ -59,13 +59,6 @@ np2cpp_t = pystencils_espresso.numpy_types_to_cpp_types -def patch_openmp_kernels(content): - # surrounds omp pragmas with ifdefs - content = re.sub("^( *#pragma omp .*)$", - r"#ifdef _OPENMP\n\1\n#endif", content, flags=re.MULTILINE) - return content - - def patch_unused_direction_arrays_kernel(content, variables): for name in variables: content = walberla_ek_generation.remove_intermediate_variable( @@ -245,8 +238,6 @@ def get_ext_source(target_suffix): staggered=True, block_offset=block_offsets if fluctuation else None, **params) - ctx.patch_file(class_name, get_ext_source( - processor_suffix), patch_openmp_kernels) cpu_vectorize_info["cpu_prepend_opt_remove_conditionals"] = False class_name = f"DiffusiveFluxKernelWithElectrostatic{midfix}_{precision_suffix}{processor_suffix}" # nopep8 pystencils_walberla.generate_sweep( @@ -257,8 +248,6 @@ def get_ext_source(target_suffix): block_offset=block_offsets if fluctuation else None, **params) ctx.patch_file(class_name, "h", patch_diffusive_flux_elec_kernel) - ctx.patch_file(class_name, get_ext_source( - processor_suffix), patch_openmp_kernels) if "advection" in args.kernels: def patch_advection_kernel(content, target_suffix): @@ -282,8 +271,6 @@ def patch_advection_kernel(content, target_suffix): **params) ctx.patch_file(class_name, get_ext_source(processor_suffix), patch_advection_kernel, processor_suffix) - ctx.patch_file(class_name, get_ext_source( - processor_suffix), patch_openmp_kernels) if "continuity" in args.kernels: class_name = f"ContinuityKernel_{precision_suffix}{processor_suffix}" @@ -292,18 +279,13 @@ def patch_advection_kernel(content, target_suffix): class_name, ek.continuity(), **params) - ctx.patch_file(class_name, get_ext_source( - processor_suffix), patch_openmp_kernels) if "friction_coupling" in args.kernels: - class_name = f"FrictionCouplingKernel_{ - precision_suffix}{processor_suffix}" + class_name = f"FrictionCouplingKernel_{precision_suffix}{processor_suffix}" # nopep8 pystencils_walberla.generate_sweep( ctx, class_name, ek.friction_coupling(), **params) - ctx.patch_file(class_name, get_ext_source( - processor_suffix), patch_openmp_kernels) if "boundary" in args.kernels: # pylint: disable=unused-argument @@ -348,8 +330,6 @@ def patch_boundary_kernel(content, processor_suffix): patch_boundary_header, processor_suffix) ctx.patch_file(class_name, get_ext_source(processor_suffix), patch_boundary_kernel, processor_suffix) - ctx.patch_file(class_name, get_ext_source( - processor_suffix), patch_openmp_kernels) # generate dynamic fixed density class_name = f"Dirichlet_{precision_suffix}{processor_suffix}" @@ -369,8 +349,6 @@ def patch_boundary_kernel(content, processor_suffix): patch_boundary_kernel, processor_suffix) ctx.patch_file(class_name, get_ext_source(processor_suffix), patch_dirichlet_boundary_kernel, processor_suffix) - ctx.patch_file(class_name, get_ext_source( - processor_suffix), patch_openmp_kernels) if "reactions" in args.kernels: # ek reactions @@ -382,8 +360,6 @@ def patch_boundary_kernel(content, processor_suffix): class_name=class_name, target=target, assignments=assignments) - ctx.patch_file(class_name, get_ext_source( - processor_suffix), patch_openmp_kernels) class_name = f"ReactionKernelIndexed_{i}_{precision_suffix}{processor_suffix}" # nopep8 custom_additional_extensions.generate_boundary( @@ -399,8 +375,6 @@ def patch_boundary_kernel(content, processor_suffix): template_file="templates/Boundary.tmpl.h") ctx.patch_file(class_name, file_suffix, patch_reaction_indexed_kernel, processor_suffix) - ctx.patch_file(class_name, get_ext_source( - processor_suffix), patch_openmp_kernels) # ek reactions helper functions custom_additional_extensions.generate_kernel_selector( diff --git a/maintainer/walberla_kernels/generate_lb_kernels.py b/maintainer/walberla_kernels/generate_lb_kernels.py index e4eec71fb8..b8adcc8dc0 100644 --- a/maintainer/walberla_kernels/generate_lb_kernels.py +++ b/maintainer/walberla_kernels/generate_lb_kernels.py @@ -125,13 +125,6 @@ def get_ext_source(target_suffix): return {"CUDA": "cu"}.get(target_suffix, "cpp") -def patch_openmp_kernels(content): - # surrounds omp pragmas with ifdefs - content = re.sub("^( *#pragma omp .*)$", - r"#ifdef _OPENMP\n\1\n#endif", content, flags=re.MULTILINE) - return content - - def generate_init_kernels(ctx, method): precision_prefix = pystencils_espresso.precision_prefix[ctx.double_accuracy] for params, target_suffix in paramlist(parameters, (default_key,)): @@ -141,8 +134,6 @@ def generate_init_kernels(ctx, method): stem, pystencils_espresso.generate_setters(method, data_type), **params) - ctx.patch_file(stem, get_ext_source(target_suffix), - patch_openmp_kernels) def generate_stream_collide_kernels(ctx, method, data_type, fields): @@ -180,8 +171,6 @@ def generate_stream_collide_kernels(ctx, method, data_type, fields): params, block_offset=block_offsets, ) - ctx.patch_file(stem, get_ext_source(target_suffix), - patch_openmp_kernels) # Unthermalized Lees-Edwards Stream-Collide Kernels shear_dir_normal = 1 # y-axis for params, target_suffix in paramlist(parameters, ("GPU", "CPU", "AVX")): @@ -205,8 +194,6 @@ def generate_stream_collide_kernels(ctx, method, data_type, fields): optimization, params ) - ctx.patch_file(stem, get_ext_source(target_suffix), - patch_openmp_kernels) def generate_vel_update_kernels(ctx, method, fields): @@ -221,8 +208,6 @@ def generate_vel_update_kernels(ctx, method, fields): stem, assignments, **params) - ctx.patch_file(stem, get_ext_source(target_suffix), - patch_openmp_kernels) def generate_accessors_kernels(ctx, method): @@ -327,8 +312,6 @@ def patch_boundary_kernel(content, target_suffix): patch_boundary_header, target_suffix) ctx.patch_file(class_name, get_ext_source(target_suffix), patch_boundary_kernel, target_suffix) - ctx.patch_file(class_name, get_ext_source(target_suffix), - patch_openmp_kernels) with code_generation_context.CodeGeneration() as ctx: diff --git a/src/config/features.def b/src/config/features.def index 34566add01..2045216378 100644 --- a/src/config/features.def +++ b/src/config/features.def @@ -103,4 +103,3 @@ WALBERLA external VALGRIND external CALIPER external FPE external -SHARED_MEMORY_PARALLELISM external diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 611efca04f..b0c6d58931 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -76,17 +76,13 @@ install(TARGETS espresso_core target_link_libraries( espresso_core - PRIVATE - espresso::config - espresso::utils::mpi - espresso::shapes - espresso::compiler_flags - $<$:OpenMP::OpenMP_CXX> - $<$:Kokkos::kokkos> - $<$:Cabana::Core> - $<$:espresso::walberla> - $<$:nlopt> - $<$:GSL::gsl> + PRIVATE espresso::config espresso::utils::mpi espresso::shapes + espresso::compiler_flags OpenMP::OpenMP_CXX + $<$:OpenMP::OpenMP_CUDA> + Kokkos::kokkos Cabana::Core + $<$:espresso::walberla> + $<$:nlopt> + $<$:GSL::gsl> PUBLIC espresso::utils MPI::MPI_CXX Random123 espresso::particle_observables Boost::serialization Boost::mpi espresso::instrumentation) diff --git a/src/core/aosoa_pack.hpp b/src/core/aosoa_pack.hpp index c2aae8af0e..6660287894 100644 --- a/src/core/aosoa_pack.hpp +++ b/src/core/aosoa_pack.hpp @@ -21,8 +21,6 @@ #include -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM - #include "cell_system/CellStructure.hpp" #include @@ -151,5 +149,3 @@ struct CellStructure::AoSoA_pack { bool has_exclusion(std::size_t i) const { return flags(i) == uint8_t{1}; } }; - -#endif // ESPRESSO_SHARED_MEMORY_PARALLELISM diff --git a/src/core/bond_breakage/bond_breakage.cpp b/src/core/bond_breakage/bond_breakage.cpp index 445bcb418f..296eec5282 100644 --- a/src/core/bond_breakage/bond_breakage.cpp +++ b/src/core/bond_breakage/bond_breakage.cpp @@ -17,8 +17,10 @@ * along with this program. If not, see . */ -#include "bond_breakage/bond_breakage.hpp" +#include + #include "bond_breakage/actions.hpp" +#include "bond_breakage/bond_breakage.hpp" #include "cell_system/CellStructure.hpp" #include "communication.hpp" @@ -54,9 +56,7 @@ void BondBreakage::queue_breakage(int particle_id, BondPartners const &bond_partners, int bond_type) { { -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM std::lock_guard lock(queue_mtx); -#endif m_queue.emplace_back(QueueEntry{particle_id, bond_partners, bond_type}); } } diff --git a/src/core/bond_breakage/bond_breakage.hpp b/src/core/bond_breakage/bond_breakage.hpp index e679c8f776..dfdb7a5e93 100644 --- a/src/core/bond_breakage/bond_breakage.hpp +++ b/src/core/bond_breakage/bond_breakage.hpp @@ -19,6 +19,8 @@ #pragma once +#include + #include "system/System.hpp" #include @@ -106,9 +108,7 @@ class BondBreakage { } private: -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM std::mutex queue_mtx; -#endif void process_queue_impl(System::System &system); diff --git a/src/core/bond_forces_kokkos.hpp b/src/core/bond_forces_kokkos.hpp index e6bf57f55a..a1be170841 100644 --- a/src/core/bond_forces_kokkos.hpp +++ b/src/core/bond_forces_kokkos.hpp @@ -21,8 +21,6 @@ #include -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM - #include "aosoa_pack.hpp" #include "cell_system/LocalBondState.hpp" #include "forces_inline.hpp" @@ -277,5 +275,3 @@ struct DihedralBondsKernel { } } }; - -#endif // ESPRESSO_SHARED_MEMORY_PARALLELISM diff --git a/src/core/cell_system/CellStructure.cpp b/src/core/cell_system/CellStructure.cpp index 009318f266..16d8ede17a 100644 --- a/src/core/cell_system/CellStructure.cpp +++ b/src/core/cell_system/CellStructure.cpp @@ -52,12 +52,10 @@ #include -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM #include #include #include #include -#endif #include #include @@ -78,14 +76,11 @@ #include CellStructure::~CellStructure() { -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM clear_local_properties(); // Kokkos handle can only be freed after all Cabana containers have been freed m_kokkos_handle.reset(); -#endif } -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM void CellStructure::clear_local_properties() { m_local_force.reset(); #ifdef ESPRESSO_ROTATION @@ -312,8 +307,6 @@ void CellStructure::set_index_map() { m_num_local_particles_cached = unique_particles.size(); } -#endif // ESPRESSO_SHARED_MEMORY_PARALLELISM - CellStructure::CellStructure(BoxGeometry const &box) : m_decomposition{std::make_unique(box)} {} @@ -418,7 +411,6 @@ int CellStructure::get_max_local_particle_id() const { return (it != m_particle_index.rend()) ? (*it)->id() : -1; } -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM int CellStructure::get_local_pair_bond_numbers() const { return m_bond_state->pair_count; } @@ -440,7 +432,6 @@ void CellStructure::add_new_bond(int bond_id, } void CellStructure::rebuild_bond_list() { m_bond_state->rebuild(); } #endif // ESPRESSO_COLLISION_DETECTION -#endif // ESPRESSO_SHARED_MEMORY_PARALLELISM void CellStructure::remove_all_particles() { for (auto cell : decomposition().local_cells()) { @@ -448,9 +439,7 @@ void CellStructure::remove_all_particles() { } m_particle_index.clear(); -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM clear_bond_properties(); -#endif } /* Map the data parts flags from cells to those used internally @@ -617,7 +606,6 @@ void CellStructure::update_ghosts_and_resort_particle(unsigned data_parts) { } } -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM void CellStructure::parallel_for_each_particle_impl( std::span cells, ParticleUnaryOp &f) const { if (cells.size() > 1) { @@ -633,7 +621,6 @@ void CellStructure::parallel_for_each_particle_impl( [&](auto part_idx) { f(*(particles.begin() + part_idx)); }); } } -#endif // ESPRESSO_SHARED_MEMORY_PARALLELISM bool CellStructure::check_resort_required( Utils::Vector3d const &additional_offset) const { diff --git a/src/core/cell_system/CellStructure.hpp b/src/core/cell_system/CellStructure.hpp index 8074a0ea9c..3ca6383f77 100644 --- a/src/core/cell_system/CellStructure.hpp +++ b/src/core/cell_system/CellStructure.hpp @@ -62,7 +62,6 @@ #endif // forward declarations -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM namespace Kokkos { template class View; class HostSpace; @@ -81,7 +80,6 @@ struct KokkosHandle; template class CustomVerletList; struct LocalBondState; -#endif // ESPRESSO_SHARED_MEMORY_PARALLELISM template concept ParticleCallback = requires(Callable c, Particle &p) { @@ -169,7 +167,6 @@ struct EuclidianDistance { * be stored in separate structures. */ class CellStructure : public System::Leaf { -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM public: static constexpr auto vector_length = 1; struct AoSoA_pack; @@ -180,7 +177,6 @@ class CellStructure : public System::Leaf { using ListType = CustomVerletList; -#endif // ESPRESSO_SHARED_MEMORY_PARALLELISM private: /** The local id-to-particle index */ @@ -200,7 +196,6 @@ class CellStructure : public System::Leaf { /** @brief Verlet list skin. */ double m_verlet_skin = 0.; double m_verlet_reuse = 0.; -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM int m_cached_max_local_particle_id = 0; std::size_t m_num_local_particles_cached = 0; int m_max_id = 0; @@ -219,7 +214,6 @@ class CellStructure : public System::Leaf { /** The local id-to-index for aosoa data */ std::vector m_unique_particles; std::shared_ptr m_kokkos_handle; -#endif // ESPRESSO_SHARED_MEMORY_PARALLELISM public: CellStructure(BoxGeometry const &box); @@ -356,13 +350,7 @@ class CellStructure : public System::Leaf { } /** @brief whether to use parallel version of @ref for_each_local_particle */ - bool use_parallel_for_each_local_particle() const { -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM - return true; -#else - return false; -#endif - } + bool use_parallel_for_each_local_particle() const { return true; } /** * @brief Run a kernel on all local particles. @@ -370,12 +358,10 @@ class CellStructure : public System::Leaf { */ void for_each_local_particle(ParticleUnaryOp &&f, bool parallel = true) const { -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM if (parallel and use_parallel_for_each_local_particle()) { parallel_for_each_particle_impl(decomposition().local_cells(), f); return; } -#endif for (auto &p : local_particles()) { f(p); } @@ -405,10 +391,8 @@ class CellStructure : public System::Leaf { return decomposition().particle_to_cell(p); } -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM void parallel_for_each_particle_impl(std::span cells, ParticleUnaryOp &f) const; -#endif public: /** @@ -458,7 +442,6 @@ class CellStructure : public System::Leaf { * this node, or -1 if there are no particles on this node. */ int get_max_local_particle_id() const; -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM int get_cached_max_local_particle_id() const { return m_cached_max_local_particle_id; } @@ -474,7 +457,6 @@ class CellStructure : public System::Leaf { void add_new_bond(int bond_id, std::vector const &particle_ids); void rebuild_bond_list(); #endif // ESPRESSO_COLLISION_DETECTION -#endif /** * @brief Remove all particles from the cell system. @@ -739,7 +721,6 @@ class CellStructure : public System::Leaf { } } -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM public: auto get_max_id() const { return m_max_id; } @@ -811,7 +792,6 @@ class CellStructure : public System::Leaf { inline void cell_list_loop(auto &&kernel) { kernel(m_decomposition->local_cells(), m_decomposition->box()); } -#endif private: /** Non-bonded pair loop with verlet lists. diff --git a/src/core/cell_system/LocalBondState.cpp b/src/core/cell_system/LocalBondState.cpp index e82f2cd139..0eec20a411 100644 --- a/src/core/cell_system/LocalBondState.cpp +++ b/src/core/cell_system/LocalBondState.cpp @@ -21,8 +21,6 @@ #include "LocalBondState.hpp" -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM - void LocalBondState::allocate() { if (pair_list.is_allocated()) { Kokkos::realloc(Kokkos::view_alloc(Kokkos::WithoutInitializing), pair_list, @@ -175,4 +173,3 @@ void LocalBondState::rebuild() { clear_new_bonds(); } #endif // ESPRESSO_COLLISION_DETECTION -#endif // ESPRESSO_SHARED_MEMORY_PARALLELISM diff --git a/src/core/cell_system/LocalBondState.hpp b/src/core/cell_system/LocalBondState.hpp index dc42f33238..4dc09c2594 100644 --- a/src/core/cell_system/LocalBondState.hpp +++ b/src/core/cell_system/LocalBondState.hpp @@ -21,9 +21,8 @@ #include -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM - #include + #include struct LocalBondState { @@ -81,5 +80,3 @@ struct LocalBondState { void rebuild(); #endif }; - -#endif // ESPRESSO_SHARED_MEMORY_PARALLELISM diff --git a/src/core/cell_system/particle_enumeration.hpp b/src/core/cell_system/particle_enumeration.hpp index 82482699d5..73c6cf2bd6 100644 --- a/src/core/cell_system/particle_enumeration.hpp +++ b/src/core/cell_system/particle_enumeration.hpp @@ -24,9 +24,7 @@ #include "Cell.hpp" #include "CellStructure.hpp" -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM #include -#endif #include #include @@ -43,7 +41,6 @@ template inline void enumerate_local_particles(CellStructure const &cs, Kernel &&kernel) { -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM if (cs.use_parallel_for_each_local_particle()) { auto const local_cells = cs.decomposition().local_cells(); @@ -66,7 +63,6 @@ inline void enumerate_local_particles(CellStructure const &cs, }); return; } -#endif // ESPRESSO_SHARED_MEMORY_PARALLELISM // Sequential fallback std::size_t index = 0; for (auto &p : cs.local_particles()) { diff --git a/src/core/collision_detection/CollisionDetection.cpp b/src/core/collision_detection/CollisionDetection.cpp index 3acb29006f..a2690bdac8 100644 --- a/src/core/collision_detection/CollisionDetection.cpp +++ b/src/core/collision_detection/CollisionDetection.cpp @@ -51,9 +51,7 @@ void CollisionDetection::initialize() { *m_protocol); } system.on_short_range_ia_change(); -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM system.cell_structure->clear_local_properties(); -#endif } void CollisionDetection::set_protocol( @@ -66,9 +64,7 @@ void CollisionDetection::unset_protocol() { m_protocol = nullptr; auto &system = get_system(); system.on_short_range_ia_change(); -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM system.cell_structure->clear_local_properties(); -#endif } } // namespace CollisionDetection diff --git a/src/core/collision_detection/utils.hpp b/src/core/collision_detection/utils.hpp index 43128982e7..b15f9a44cd 100644 --- a/src/core/collision_detection/utils.hpp +++ b/src/core/collision_detection/utils.hpp @@ -94,9 +94,7 @@ inline void add_bind_centers(std::vector &collision_queue, // Once we change bond storage, some syncing has to be done. assert(use_one_sided_bond_storage); ::add_bond(system, bond_id, {c.first, c.second}); -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM system.cell_structure->add_new_bond(bond_id, {c.first, c.second}); -#endif } } diff --git a/src/core/communication.cpp b/src/core/communication.cpp index e5d30ee4ff..7be6a9c4bb 100644 --- a/src/core/communication.cpp +++ b/src/core/communication.cpp @@ -31,11 +31,9 @@ #include #endif -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM #include #include #include -#endif #include #include @@ -57,19 +55,15 @@ #include #include -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM struct KokkosHandle { KokkosHandle() { Kokkos::initialize(); } ~KokkosHandle() { Kokkos::finalize(); } }; -#endif boost::mpi::communicator comm_cart; Communicator communicator{}; std::unique_ptr communication_environment{}; -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM std::shared_ptr kokkos_handle{}; -#endif int this_node = -1; [[maybe_unused]] static auto get_env_variable(char const *const name) { @@ -93,12 +87,10 @@ CommunicationEnvironment::CommunicationEnvironment() CommunicationEnvironment::CommunicationEnvironment( std::shared_ptr mpi_env) : m_mpi_env{std::move(mpi_env)} { -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM auto const num_threads_env = get_env_variable("OMP_NUM_THREADS"); if (not num_threads_env or num_threads_env->empty()) { omp_set_num_threads(1); } -#endif m_is_mpi_gpu_aware = false; @@ -140,16 +132,12 @@ CommunicationEnvironment::CommunicationEnvironment( fft_on_program_start(); #endif -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM kokkos_handle = std::make_shared(); -#endif } CommunicationEnvironment::~CommunicationEnvironment() { -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM Kokkos::fence(); kokkos_handle.reset(); -#endif #ifdef ESPRESSO_WALBERLA walberla::mpi_deinit(); diff --git a/src/core/communication.hpp b/src/core/communication.hpp index 322c6a710f..4dd02f2c0c 100644 --- a/src/core/communication.hpp +++ b/src/core/communication.hpp @@ -59,10 +59,8 @@ extern int this_node; /** The communicator */ extern boost::mpi::communicator comm_cart; -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM struct KokkosHandle; extern std::shared_ptr kokkos_handle; -#endif class CommunicationEnvironment { std::shared_ptr m_mpi_env; diff --git a/src/core/custom_verlet_list.hpp b/src/core/custom_verlet_list.hpp index 0de3c6d83a..3a6dc2ec96 100644 --- a/src/core/custom_verlet_list.hpp +++ b/src/core/custom_verlet_list.hpp @@ -21,8 +21,6 @@ #include -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM - #include #include @@ -224,5 +222,3 @@ class Cabana::NeighborList -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM #include -#endif #include #include @@ -1129,12 +1127,8 @@ void charge_assign(elc_data const &elc, CoulombP3M &solver, solver.prepare_fft_mesh(protocol == ChargeProtocol::BOTH or protocol == ChargeProtocol::IMAGE); -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM // multi-threading -> cache sizes must be equal to the number of particles auto constexpr include_neutral_particles = true; -#else - auto constexpr include_neutral_particles = false; -#endif for (auto zipped : p_q_pos_range) { auto const p_q = boost::get<0>(zipped); diff --git a/src/core/electrostatics/elc.hpp b/src/core/electrostatics/elc.hpp index 0ca479d053..8fd9f09440 100644 --- a/src/core/electrostatics/elc.hpp +++ b/src/core/electrostatics/elc.hpp @@ -116,7 +116,6 @@ struct elc_data { /** The space that is finally left. */ double space_box; -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM /// pairwise contributions from lower and upper layers void dielectric_layers_contribution(BoxGeometry const &box_geo, std::size_t p1, std::size_t p2, @@ -140,7 +139,6 @@ struct elc_data { kernel(q_eff, d); } } -#endif // ESPRESSO_SHARED_MEMORY_PARALLELISM /// pairwise contributions from lower and upper layers void dielectric_layers_contribution(BoxGeometry const &box_geo, @@ -281,7 +279,6 @@ struct ElectrostaticLayerCorrection base_solver); } -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM /** @brief Calculate short-range pair energy correction. */ double pair_energy_correction(std::size_t p1, std::size_t p2, auto &aosoa, double q1q2) const { @@ -307,7 +304,6 @@ struct ElectrostaticLayerCorrection } return energy; } -#endif // ESPRESSO_SHARED_MEMORY_PARALLELISM /** @brief Calculate short-range pair energy correction. */ double pair_energy_correction(Utils::Vector3d const &pos1, diff --git a/src/core/electrostatics/icc.cpp b/src/core/electrostatics/icc.cpp index cb792fa668..4bf3ee056c 100644 --- a/src/core/electrostatics/icc.cpp +++ b/src/core/electrostatics/icc.cpp @@ -48,10 +48,8 @@ #include #include -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM #include #include -#endif #include #include @@ -77,9 +75,7 @@ static void force_calc_icc( auto const reset_kernel = [](Particle &p) { p.force_and_torque() = {}; }; cell_structure.for_each_local_particle(reset_kernel); cell_structure.for_each_ghost_particle(reset_kernel); -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM cell_structure.reset_local_force(); -#endif // calc ICC forces cell_structure.non_bonded_loop( @@ -120,11 +116,9 @@ void ICCStar::iteration() { auto const elc_kernel = coulomb.pair_force_elc_kernel(); icc_cfg.citeration = 0; -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM using execution_space = Kokkos::DefaultExecutionSpace; auto const &unique_particles = cell_structure.get_unique_particles(); auto const &local_force = cell_structure.get_local_force(); -#endif // ESPRESSO_SHARED_MEMORY_PARALLELISM auto global_max_rel_diff = 0.; @@ -135,7 +129,6 @@ void ICCStar::iteration() { force_calc_icc(cell_structure, kernel, elc_kernel); system.coulomb.calc_long_range_force(); cell_structure.ghosts_reduce_forces(); -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM // force reduction int num_threads = execution_space().concurrency(); kokkos_parallel_range_for>( @@ -149,7 +142,6 @@ void ICCStar::iteration() { } }); Kokkos::fence(); -#endif // ESPRESSO_SHARED_MEMORY_PARALLELISM auto max_rel_diff = 0.; @@ -217,10 +209,8 @@ void ICCStar::iteration() { /* Update charges on ghosts. */ cell_structure.ghosts_update(Cells::DATA_PART_PROPERTIES); -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM // refresh local properties update_aosoa_charges(cell_structure); -#endif icc_cfg.citeration++; diff --git a/src/core/electrostatics/p3m_heffte.hpp b/src/core/electrostatics/p3m_heffte.hpp index 777862be8b..bf7af121df 100644 --- a/src/core/electrostatics/p3m_heffte.hpp +++ b/src/core/electrostatics/p3m_heffte.hpp @@ -36,10 +36,8 @@ #include #include -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM #include #include -#endif #include #include @@ -86,7 +84,6 @@ struct CoulombP3MState : public P3MStateCommon { std::array, 3> rs_E_fields_no_halo; p3m_send_mesh halo_comm; std::shared_ptr> fft; -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM Kokkos::View rs_charge_density_kokkos; @@ -95,7 +92,6 @@ struct CoulombP3MState : public P3MStateCommon { rs_charge_density_kokkos = decltype(rs_charge_density_kokkos)( "CoulombP3MState::rs_charge_density_kokkos", 0, 0); } -#endif }; #ifdef ESPRESSO_CUDA @@ -111,10 +107,8 @@ struct CoulombP3MHeffte : public CoulombP3M { CoulombP3MStateClass &p3m; private: -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM // kokkos handle must outlive kokkos data structures from other class members std::shared_ptr m_kokkos_handle; -#endif std::unique_ptr p3m_state_ptr; TuningParameters tuning; bool m_is_tuned; @@ -131,10 +125,8 @@ struct CoulombP3MHeffte : public CoulombP3M { CoulombP3MHeffte(std::unique_ptr &&p3m_state, TuningParameters tuning_params, double prefactor) : CoulombP3M(p3m_state->params), p3m{*p3m_state}, -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM - m_kokkos_handle{::kokkos_handle}, -#endif - p3m_state_ptr{std::move(p3m_state)}, tuning{std::move(tuning_params)} { + m_kokkos_handle{::kokkos_handle}, p3m_state_ptr{std::move(p3m_state)}, + tuning{std::move(tuning_params)} { if (tuning.timings <= 0) { throw std::domain_error("Parameter 'timings' must be > 0"); @@ -142,9 +134,7 @@ struct CoulombP3MHeffte : public CoulombP3M { m_is_tuned = not p3m.params.tuning; p3m.params.tuning = false; set_prefactor(prefactor); -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM p3m.init_labels(); -#endif } void init() override { @@ -217,13 +207,11 @@ struct CoulombP3MHeffte : public CoulombP3M { p3m.inter_weights.reset(p3m.params.cao); } p3m.rs_charge_density.resize(p3m.local_mesh.size); -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM using execution_space = Kokkos::DefaultExecutionSpace; auto const num_threads = execution_space().concurrency(); Kokkos::realloc(Kokkos::WithoutInitializing, p3m.rs_charge_density_kokkos, num_threads, p3m.local_mesh.size); Kokkos::deep_copy(p3m.rs_charge_density_kokkos, FloatType{0}); -#endif // ESPRESSO_SHARED_MEMORY_PARALLELISM std::ranges::fill(p3m.rs_charge_density, FloatType{0}); } diff --git a/src/core/electrostatics/p3m_heffte.impl.hpp b/src/core/electrostatics/p3m_heffte.impl.hpp index bfd1b7239f..8c81d7dd85 100644 --- a/src/core/electrostatics/p3m_heffte.impl.hpp +++ b/src/core/electrostatics/p3m_heffte.impl.hpp @@ -77,10 +77,8 @@ #include #include -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM #include #include -#endif #include #include @@ -368,7 +366,6 @@ template struct AssignCharge { this->operator()(p3m, q, weights); } -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM void operator()(auto &p3m, auto &cell_structure) { using CoulombP3MState = std::remove_reference_t; using value_type = CoulombP3MState::value_type; @@ -405,17 +402,6 @@ template struct AssignCharge { }); Kokkos::fence(); } -#else // ESPRESSO_SHARED_MEMORY_PARALLELISM - void operator()(auto &p3m, auto const &p_q_pos_range) { - for (auto zipped : p_q_pos_range) { - auto const p_q = boost::get<0>(zipped); - if (p_q != 0.0) { - auto const &p_pos = boost::get<1>(zipped); - this->operator()(p3m, p_q, p_pos, p3m.inter_weights); - } - } - } -#endif // ESPRESSO_SHARED_MEMORY_PARALLELISM }; } // namespace @@ -423,18 +409,8 @@ template void CoulombP3MHeffte::charge_assign() { prepare_fft_mesh(true); -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM Utils::integral_parameter( p3m.params.cao, p3m, *get_system().cell_structure); -#else // ESPRESSO_SHARED_MEMORY_PARALLELISM - auto const &system = get_system(); - auto const particles = system.cell_structure->local_particles(); - auto p_q_range = ParticlePropertyRange::charge_range(particles); - auto p_pos_range = ParticlePropertyRange::pos_range(particles); - - Utils::integral_parameter( - p3m.params.cao, p3m, boost::combine(p_q_range, p_pos_range)); -#endif // ESPRESSO_SHARED_MEMORY_PARALLELISM } template @@ -452,12 +428,7 @@ void CoulombP3MHeffte::assign_charge( namespace { template struct AssignForces { void operator()(auto &p3m, auto force_prefac, -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM - CellStructure &cell_structure -#else - auto const &p_q_force_range -#endif - ) const { + CellStructure &cell_structure) const { assert(cao == p3m.inter_weights.cao()); @@ -472,17 +443,12 @@ template struct AssignForces { force[2u] += w * double(p3m.rs_E_fields[2u][ind]); }); -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM auto const thread_id = omp_get_thread_num(); p_force(p_index, thread_id, 0) -= pref * force[0]; p_force(p_index, thread_id, 1) -= pref * force[1]; p_force(p_index, thread_id, 2) -= pref * force[2]; -#else - p_force -= pref * force; -#endif }; -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM auto const n_part = cell_structure.count_local_particles(); auto const &aosoa = cell_structure.get_aosoa(); auto &local_force = cell_structure.get_local_force(); @@ -492,24 +458,10 @@ template struct AssignForces { kernel(pref, local_force, p_index); } }); -#else // ESPRESSO_SHARED_MEMORY_PARALLELISM - /* charged particle counter */ - std::size_t p_index{0ul}; - - for (auto zipped : p_q_force_range) { - auto p_q = boost::get<0>(zipped); - if (p_q != 0.) { - auto &p_force = boost::get<1>(zipped); - kernel(p_q * force_prefac, p_force, p_index); - ++p_index; - } - } -#endif // ESPRESSO_SHARED_MEMORY_PARALLELISM } }; } // namespace -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM inline auto calc_dipole_moment(boost::mpi::communicator const &comm, auto const &cs, auto const &box_geo) { auto const local_dip = reduce_over_local_particles( @@ -520,19 +472,6 @@ inline auto calc_dipole_moment(boost::mpi::communicator const &comm, [](Utils::Vector3d &a, Utils::Vector3d const &b) { a = a + b; }); return boost::mpi::all_reduce(comm, local_dip, std::plus<>()); } -#else // ESPRESSO_SHARED_MEMORY_PARALLELISM -inline auto calc_dipole_moment(boost::mpi::communicator const &comm, - auto const &p_q_unfolded_pos_range) { - auto const local_dip = - boost::accumulate(p_q_unfolded_pos_range, Utils::Vector3d{}, - [](Utils::Vector3d const &dip, auto const &q_pos) { - auto const p_q = boost::get<0>(q_pos); - auto const &p_unfolded_pos = boost::get<1>(q_pos); - return dip + p_q * p_unfolded_pos; - }); - return boost::mpi::all_reduce(comm, local_dip, std::plus<>()); -} -#endif // ESPRESSO_SHARED_MEMORY_PARALLELISM template void CoulombP3MHeffte::long_range_kernel( kernel_ks_charge_density(); -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM auto const &local_force = cell_structure.get_local_force(); auto const &aosoa = cell_structure.get_aosoa(); -#else - auto const particles = cell_structure.local_particles(); - auto p_q_range = ParticlePropertyRange::charge_range(particles); - auto p_force_range = ParticlePropertyRange::force_range(particles); - auto p_unfolded_pos_range = - ParticlePropertyRange::unfolded_pos_range(particles, box_geo); -#endif // ESPRESSO_SHARED_MEMORY_PARALLELISM // The dipole moment is only needed if we don't have metallic boundaries auto const box_dipole = (p3m.params.epsilon != P3M_EPSILON_METALLIC) ? std::make_optional(calc_dipole_moment( -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM comm_cart, cell_structure, box_geo)) -#else - comm_cart, - boost::combine(p_q_range, - p_unfolded_pos_range))) -#endif : std::nullopt; auto const volume = box_geo.volume(); auto const pref = @@ -742,11 +667,7 @@ double CoulombP3MHeffte::long_range_kernel( // assign particle forces auto const force_prefac = prefactor / volume; -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM auto &particle_data = cell_structure; -#else - auto const particle_data = boost::combine(p_q_range, p_force_range); -#endif Utils::integral_parameter( p3m.params.cao, p3m, force_prefac, particle_data); @@ -754,7 +675,6 @@ double CoulombP3MHeffte::long_range_kernel( // Eq. (3.19) @cite deserno00b if (box_dipole) { auto const dm = prefactor * pref * box_dipole.value(); -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM auto const n_part = cell_structure.count_local_particles(); kokkos_parallel_range_for( "AssignForcesBoxDipole", std::size_t{0u}, n_part, @@ -765,13 +685,6 @@ double CoulombP3MHeffte::long_range_kernel( local_force(p_index, thread_id, 1) -= q * dm[1]; local_force(p_index, thread_id, 2) -= q * dm[2]; }); -#else // ESPRESSO_SHARED_MEMORY_PARALLELISM - for (auto zipped : boost::combine(p_q_range, p_force_range)) { - auto p_q = boost::get<0>(zipped); - auto &p_force = boost::get<1>(zipped); - p_force -= p_q * dm; - } -#endif // ESPRESSO_SHARED_MEMORY_PARALLELISM } } diff --git a/src/core/fft/fft.cpp b/src/core/fft/fft.cpp index 3f066d1f7e..3ef8b0b6f5 100644 --- a/src/core/fft/fft.cpp +++ b/src/core/fft/fft.cpp @@ -40,9 +40,7 @@ #include -#ifdef _OPENMP #include -#endif #include #include @@ -681,19 +679,15 @@ int fft_data_struct::initialize_fft( /* === FFT Routines (Using FFTW / RFFTW package)=== */ for (int i = 1; i < 4; i++) { if (init_tag) { -#ifdef _OPENMP #pragma omp critical(fftw_destroy_plan_forward) forw[i].destroy_plan(); -#endif } forw[i].dir = FFTW_FORWARD; -#ifdef _OPENMP #pragma omp critical(fftw_create_plan_forward) forw[i].plan_handle = fftw::plan_many_dft( 1, &forw[i].new_mesh[2], forw[i].n_ffts, c_data, nullptr, 1, forw[i].new_mesh[2], c_data, nullptr, 1, forw[i].new_mesh[2], forw[i].dir, FFTW_PATIENT); -#endif assert(forw[i].plan_handle); } @@ -701,19 +695,15 @@ int fft_data_struct::initialize_fft( /* this is needed because slightly different functions are used */ for (int i = 1; i < 4; i++) { if (init_tag) { -#ifdef _OPENMP #pragma omp critical(fftw_destroy_plan_backward) back[i].destroy_plan(); -#endif } back[i].dir = FFTW_BACKWARD; -#ifdef _OPENMP #pragma omp critical(fftw_create_plan_backward) back[i].plan_handle = fftw::plan_many_dft( 1, &forw[i].new_mesh[2], forw[i].n_ffts, c_data, nullptr, 1, forw[i].new_mesh[2], c_data, nullptr, 1, forw[i].new_mesh[2], back[i].dir, FFTW_PATIENT); -#endif back[i].pack_function = pack_block_permute1; assert(back[i].plan_handle); } diff --git a/src/core/fft/init.cpp b/src/core/fft/init.cpp index 44cb1b1bb5..d3df7c7cda 100644 --- a/src/core/fft/init.cpp +++ b/src/core/fft/init.cpp @@ -19,19 +19,16 @@ #include "init.hpp" -#include "config/config.hpp" +#include #include #include -#ifdef _OPENMP #include -#endif #ifdef ESPRESSO_FFTW void fft_on_program_start() { -#ifdef _OPENMP int omp_num_threads = 1; #pragma omp parallel { @@ -41,6 +38,5 @@ void fft_on_program_start() { [[maybe_unused]] auto const init_status_success = fftw_init_threads(); assert(init_status_success); fftw_plan_with_nthreads(omp_num_threads); -#endif // _OPENMP } #endif // ESPRESSO_FFTW diff --git a/src/core/forces.cpp b/src/core/forces.cpp index cf9a54fe5b..bc2ec11481 100644 --- a/src/core/forces.cpp +++ b/src/core/forces.cpp @@ -57,9 +57,7 @@ #include #endif -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM #include -#endif #include #include @@ -125,9 +123,7 @@ static void init_forces_and_thermostat(System::System const &system) { #endif } }); -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM cell_structure.reset_local_force(); -#endif // Initialize ghost forces (unchanged) cell_structure.ghosts_reset_forces(); @@ -153,7 +149,6 @@ static void reinit_dip_fld(CellStructure const &cell_structure) { } #endif -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM static BondsKernelData create_kokkos_bonds_kernel_data(System::System const &system) { @@ -262,7 +257,6 @@ static void reduce_cabana_forces_and_torques(System::System const &system, } #endif } -#endif // ESPRESSO_SHARED_MEMORY_PARALLELISM void System::System::calculate_forces() { #ifdef ESPRESSO_CALIPER @@ -313,10 +307,9 @@ void System::System::calculate_forces() { coulomb.cutoff(), dipoles.cutoff(), collision_detection_cutoff}; -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM + update_cabana_state(*cell_structure, verlet_criterion, get_interaction_range(), propagation->integ_switch); -#endif #ifdef ESPRESSO_ELECTROSTATICS if (coulomb.impl->extension) { update_icc_particles(); @@ -336,7 +329,6 @@ void System::System::calculate_forces() { CALI_MARK_END("calc_long_range_forces"); #endif -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM #ifdef ESPRESSO_CALIPER CALI_MARK_BEGIN("cabana_short_range"); #endif @@ -377,56 +369,6 @@ void System::System::calculate_forces() { CALI_MARK_END("cabana_short_range"); #endif -#else // ESPRESSO_SHARED_MEMORY_PARALLELISM - -#ifdef ESPRESSO_CALIPER - CALI_MARK_BEGIN("serial_short_range"); -#endif - auto bond_kernel = [coulomb_kernel_ptr = get_ptr(coulomb_kernel), - &bonded_ias = *bonded_ias, - &bond_breakage = *bond_breakage, virial, - &box_geo = *box_geo](Particle &p1, int bond_id, - std::span partners) { - return add_bonded_force(p1, bond_id, partners, bonded_ias, bond_breakage, - box_geo, virial, coulomb_kernel_ptr); - }; - - auto pair_kernel = [coulomb_kernel_ptr = get_ptr(coulomb_kernel), - dipoles_kernel_ptr = get_ptr(dipoles_kernel), - elc_kernel_ptr = get_ptr(elc_kernel), - coulomb_u_kernel_ptr = get_ptr(coulomb_u_kernel), - &nonbonded_ias = *nonbonded_ias, - &thermostat = *thermostat, &bonded_ias = *bonded_ias, - virial, -#ifdef ESPRESSO_COLLISION_DETECTION - &collision_detection = *collision_detection, -#endif - &box_geo = *box_geo, - system_max_cutoff2 = Utils::sqr(maximal_cutoff())]( - Particle &p1, Particle &p2, Distance const &d) { - if (d.dist2 > system_max_cutoff2) - return; - auto const &ia_params = nonbonded_ias.get_ia_param(p1.type(), p2.type()); - add_non_bonded_pair_force( - p1, p2, d.vec21, sqrt(d.dist2), d.dist2, p1.q() * p2.q(), ia_params, - thermostat, box_geo, bonded_ias, virial, coulomb_kernel_ptr, - dipoles_kernel_ptr, elc_kernel_ptr, coulomb_u_kernel_ptr); -#ifdef ESPRESSO_COLLISION_DETECTION - if (not collision_detection.is_off()) { - collision_detection.detect_collision(p1, p2, d.dist2); - } -#endif - }; - - short_range_loop(bond_kernel, pair_kernel, *cell_structure, maximal_cutoff(), - bonded_ias->maximal_cutoff(), verlet_criterion); - -#ifdef ESPRESSO_CALIPER - CALI_MARK_END("serial_short_range"); -#endif - -#endif // ESPRESSO_SHARED_MEMORY_PARALLELISM - constraints->add_forces(particles, get_sim_time()); oif_global->calculate_forces(); diff --git a/src/core/forces_cabana.hpp b/src/core/forces_cabana.hpp index 881da285e7..53a8c7aaf5 100644 --- a/src/core/forces_cabana.hpp +++ b/src/core/forces_cabana.hpp @@ -21,8 +21,6 @@ #include -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM - #include "aosoa_pack.hpp" #include "forces_inline.hpp" @@ -324,5 +322,3 @@ struct ForcesKernel { #endif } }; - -#endif // ESPRESSO_SHARED_MEMORY_PARALLELISM diff --git a/src/core/forces_inline.hpp b/src/core/forces_inline.hpp index a9d28162d1..382b28446d 100644 --- a/src/core/forces_inline.hpp +++ b/src/core/forces_inline.hpp @@ -73,9 +73,7 @@ #include #include -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM ESPRESSO_ATTR_ALWAYS_INLINE -#endif inline Utils::Vector3d calc_central_radial_force(IA_parameters const &ia_params, Utils::Vector3d const &d, double const dist) { @@ -168,162 +166,6 @@ inline ParticleForce calc_opposing_force(ParticleForce const &pf, return out; } -/** - * @brief For interactions which need particle information. - */ -inline void add_non_bonded_pair_force_with_p( - Particle &p1, Particle &p2, ParticleForce &pf, ParticleForce &p1f_asym, - ParticleForce &p2f_asym, Utils::Vector3d const &d, double dist, - double dist2, double q1q2, IA_parameters const &ia_params, - [[maybe_unused]] bool do_nonbonded_flag, - Thermostat::Thermostat const &thermostat, BoxGeometry const &box_geo, - [[maybe_unused]] BondedInteractionsMap const &bonded_ias, - [[maybe_unused]] Utils::Vector3d *const virial, - Coulomb::ShortRangeForceKernel::kernel_type const *coulomb_kernel, - Dipoles::ShortRangeForceKernel::kernel_type const *dipoles_kernel, - Coulomb::ShortRangeForceCorrectionsKernel::kernel_type const *elc_kernel, - Coulomb::ShortRangeEnergyKernel::kernel_type const *coulomb_u_kernel) { - - /***********************************************/ - /* non-bonded pair potentials */ - /***********************************************/ - - if (dist < ia_params.max_cut) { -#ifdef ESPRESSO_EXCLUSIONS - if (do_nonbonded_flag) { -#endif -#ifdef ESPRESSO_THOLE - pf.f += thole_pair_force(p1, p2, ia_params, d, dist, bonded_ias, - coulomb_kernel); -#endif - pf += calc_non_central_force(p1, p2, ia_params, d, dist); -#ifdef ESPRESSO_EXCLUSIONS - } -#endif - } - - /*********************************************************************/ - /* everything before this contributes to the virial pressure in NpT, */ - /* but nothing afterwards, since the contribution to pressure from */ - /* electrostatic is calculated by energy */ - /*********************************************************************/ -#ifdef ESPRESSO_NPT - if (virial) { - *virial += hadamard_product(pf.f, d); - } -#endif // ESPRESSO_NPT - - /***********************************************/ - /* short-range electrostatics */ - /***********************************************/ - -#ifdef ESPRESSO_ELECTROSTATICS - // real-space electrostatic charge-charge interaction - if (q1q2 != 0. and coulomb_kernel != nullptr) { - pf.f += (*coulomb_kernel)(q1q2, d, dist); -#ifdef ESPRESSO_NPT - if (virial) { - (*virial)[0] += (*coulomb_u_kernel)(p1.pos(), p2.pos(), q1q2, d, dist); - } -#endif // ESPRESSO_NPT - if (elc_kernel) { - (*elc_kernel)(p1.pos(), p2.pos(), p1f_asym.f, p2f_asym.f, q1q2); - } - } -#endif // ESPRESSO_ELECTROSTATICS - - /***********************************************/ - /* thermostat */ - /***********************************************/ - - /* The inter dpd force should not be part of the virial */ -#ifdef ESPRESSO_DPD - if (thermostat.thermo_switch & THERMO_DPD) { - auto const force = - dpd_pair_force(p1.pos(), p1.v(), p1.id(), p2.pos(), p2.v(), p2.id(), - *thermostat.dpd, box_geo, ia_params, d, dist, dist2); - pf += force; - } -#endif - - /***********************************************/ - /* short-range magnetostatics */ - /***********************************************/ - -#ifdef ESPRESSO_DIPOLES - // real-space magnetic dipole-dipole - if (dipoles_kernel) { - auto const d1d2 = p1.dipm() * p2.dipm(); - if (d1d2 != 0.) { - pf += - (*dipoles_kernel)(d1d2, p1.calc_dip(), p2.calc_dip(), d, dist, dist2); - } - } -#endif -} - -/** Calculate non-bonded forces between a pair of particles and update their - * forces and torques. - * @param[in,out] p1 particle 1. - * @param[in,out] p2 particle 2. - * @param[in] d vector between @p p1 and @p p2. - * @param[in] dist distance between @p p1 and @p p2. - * @param[in] dist2 distance squared between @p p1 and @p p2. - * @param[in] q1q2 charge x charge between @p p1 and @p p2. - * @param[in] ia_params non-bonded interaction kernels. - * @param[in] thermostat thermostat. - * @param[in] box_geo box geometry. - * @param[in] bonded_ias bonded interaction kernels. - * @param[out] virial NpT virial. - * @param[in] coulomb_kernel Coulomb force kernel. - * @param[in] dipoles_kernel Dipolar force kernel. - * @param[in] elc_kernel ELC force correction kernel. - * @param[in] coulomb_u_kernel Coulomb energy kernel. - */ -inline void add_non_bonded_pair_force( - Particle &p1, Particle &p2, Utils::Vector3d const &d, double dist, - double dist2, double q1q2, IA_parameters const &ia_params, - Thermostat::Thermostat const &thermostat, BoxGeometry const &box_geo, - [[maybe_unused]] BondedInteractionsMap const &bonded_ias, - [[maybe_unused]] Utils::Vector3d *const virial, - Coulomb::ShortRangeForceKernel::kernel_type const *coulomb_kernel, - Dipoles::ShortRangeForceKernel::kernel_type const *dipoles_kernel, - Coulomb::ShortRangeForceCorrectionsKernel::kernel_type const *elc_kernel, - Coulomb::ShortRangeEnergyKernel::kernel_type const *coulomb_u_kernel) { - - ParticleForce pf{}; - ParticleForce p1f_asym{}; - ParticleForce p2f_asym{}; - -#ifdef ESPRESSO_EXCLUSIONS - auto const do_nonbonded_flag = do_nonbonded(p1, p2); -#else - auto constexpr do_nonbonded_flag = true; -#endif - - if (dist < ia_params.max_cut) { -#ifdef ESPRESSO_EXCLUSIONS - if (do_nonbonded_flag) { -#endif - pf.f += calc_central_radial_force(ia_params, d, dist); -#ifdef ESPRESSO_EXCLUSIONS - } -#endif - } - - add_non_bonded_pair_force_with_p( - p1, p2, pf, p1f_asym, p2f_asym, d, dist, dist2, q1q2, ia_params, - do_nonbonded_flag, thermostat, box_geo, bonded_ias, virial, - coulomb_kernel, dipoles_kernel, elc_kernel, coulomb_u_kernel); - - /***********************************************/ - /* add total non-bonded forces to particles */ - /***********************************************/ - - p1.force_and_torque() += pf + p1f_asym; - p2.force_and_torque() += calc_opposing_force(pf, d) + p2f_asym; -} - /** Compute the bonded interaction force between particle pairs. * * @param[in] iaparams Bonded parameters for the interaction. @@ -331,9 +173,7 @@ inline void add_non_bonded_pair_force( * @param[in] dx Vector between @p p1 and @p p2. * @param[in] kernel Coulomb force kernel. */ -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM ESPRESSO_ATTR_ALWAYS_INLINE -#endif inline std::optional calc_bond_pair_force( Bonded_IA_Parameters const &iaparams, Utils::Vector3d const &dx, double const q1q2, @@ -371,48 +211,7 @@ inline std::optional calc_bond_pair_force( throw BondUnknownTypeError(); } -inline bool add_bonded_two_body_force( - Bonded_IA_Parameters const &iaparams, BoxGeometry const &box_geo, - Particle &p1, Particle &p2, [[maybe_unused]] Utils::Vector3d *const virial, - Coulomb::ShortRangeForceKernel::kernel_type const *kernel) { - auto const dx = box_geo.get_mi_vector(p1.pos(), p2.pos()); - - if (auto const *iap = std::get_if(&iaparams)) { - auto result = iap->forces(p1, p2, dx); - if (result) { - auto const &forces = result.value(); - - p1.force() += std::get<0>(forces); - p2.force() += std::get<1>(forces); - - return false; - } - } else { - auto result = calc_bond_pair_force(iaparams, dx, -#ifdef ESPRESSO_ELECTROSTATICS - p1.q() * p2.q(), kernel -#else - 0.0, nullptr -#endif - ); - if (result) { - p1.force() += result.value(); - p2.force() -= result.value(); - -#ifdef ESPRESSO_NPT - if (virial) { - *virial += hadamard_product(result.value(), dx); - } -#endif - return false; - } - } - return true; -} - -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM ESPRESSO_ATTR_ALWAYS_INLINE -#endif inline std::optional< std::tuple> calc_bonded_three_body_force(Bonded_IA_Parameters const &iaparams, @@ -438,31 +237,7 @@ calc_bonded_three_body_force(Bonded_IA_Parameters const &iaparams, throw BondUnknownTypeError(); } -inline bool add_bonded_three_body_force(Bonded_IA_Parameters const &iaparams, - BoxGeometry const &box_geo, - Particle &p1, Particle &p2, - Particle &p3) { - if (std::get_if(&iaparams)) { - return false; - } - auto const vec1 = box_geo.get_mi_vector(p2.pos(), p1.pos()); - auto const vec2 = box_geo.get_mi_vector(p3.pos(), p1.pos()); - auto const result = calc_bonded_three_body_force(iaparams, vec1, vec2); - if (result) { - auto const &forces = result.value(); - - p1.force() += std::get<0>(forces); - p2.force() += std::get<1>(forces); - p3.force() += std::get<2>(forces); - - return false; - } - return true; -} - -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM ESPRESSO_ATTR_ALWAYS_INLINE -#endif inline std::optional> calc_bonded_four_body_force( @@ -496,76 +271,3 @@ calc_bonded_four_body_force( #endif throw BondUnknownTypeError(); } - -inline bool add_bonded_four_body_force(Bonded_IA_Parameters const &iaparams, - BoxGeometry const &box_geo, Particle &p1, - Particle &p2, Particle &p3, - Particle &p4) { - auto const pos1 = p1.pos(); - auto const pos2 = p2.pos(); - auto const pos3 = p3.pos(); - auto const pos4 = p4.pos(); - auto const vel1 = p1.v(); - auto const vel3 = p3.v(); - auto const image1 = p1.image_box(); - auto const result = calc_bonded_four_body_force( - iaparams, box_geo, pos1, pos2, pos3, pos4, vel1, vel3, image1); - if (result) { - auto const &forces = result.value(); - - p1.force() += std::get<0>(forces); - p2.force() += std::get<1>(forces); - p3.force() += std::get<2>(forces); - p4.force() += std::get<3>(forces); - - return false; - } - - return true; -} - -inline bool -add_bonded_force(Particle &p1, int bond_id, std::span partners, - BondedInteractionsMap const &bonded_ia_params, - BondBreakage::BondBreakage &bond_breakage, - BoxGeometry const &box_geo, - [[maybe_unused]] Utils::Vector3d *const virial, - Coulomb::ShortRangeForceKernel::kernel_type const *kernel) { - - auto const n_partners = static_cast(partners.size()); - - // Consider for bond breakage - if (n_partners == 1) { // pair bonds - auto d = box_geo.get_mi_vector(p1.pos(), partners[0]->pos()).norm(); - if (bond_breakage.check_and_handle_breakage( - p1.id(), {{partners[0]->id(), std::nullopt}}, bond_id, d)) { - return false; - } - } - if (n_partners == 2) { // angle bond - auto d = - box_geo.get_mi_vector(partners[0]->pos(), partners[1]->pos()).norm(); - if (bond_breakage.check_and_handle_breakage( - p1.id(), {{partners[0]->id(), partners[1]->id()}}, bond_id, d)) { - return false; - } - } - - auto const &iaparams = *bonded_ia_params.at(bond_id); - - switch (n_partners) { - case 0: - return false; - case 1: - return add_bonded_two_body_force(iaparams, box_geo, p1, *partners[0], - virial, kernel); - case 2: - return add_bonded_three_body_force(iaparams, box_geo, p1, *partners[0], - *partners[1]); - case 3: - return add_bonded_four_body_force(iaparams, box_geo, p1, *partners[0], - *partners[1], *partners[2]); - default: - throw BondInvalidSizeError{n_partners}; - } -} diff --git a/src/core/integrate.cpp b/src/core/integrate.cpp index e638c5f712..c796a1b766 100644 --- a/src/core/integrate.cpp +++ b/src/core/integrate.cpp @@ -62,6 +62,8 @@ #include "virtual_sites/lb_tracers.hpp" #include "virtual_sites/relative.hpp" +#include + #include #ifdef ESPRESSO_CALIPER @@ -752,6 +754,8 @@ int System::System::integrate(int n_steps, int reuse_forces) { lb.ghost_communication_vel(); #ifdef ESPRESSO_CALIPER CALI_MARK_END("lb_propagation"); +#endif +#ifdef ESPRESSO_CALIPER CALI_MARK_BEGIN("ek_propagation"); #endif ek.propagate(); @@ -808,13 +812,9 @@ int System::System::integrate(int n_steps, int reuse_forces) { #endif #ifdef ESPRESSO_COLLISION_DETECTION -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM cell_structure->clear_new_bonds(); -#endif // ESPRESSO_SHARED_MEMORY_PARALLELISM collision_detection->handle_collisions(); -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM cell_structure->rebuild_bond_list(); -#endif // ESPRESSO_SHARED_MEMORY_PARALLELISM #endif bond_breakage->process_queue(*this); } @@ -871,12 +871,10 @@ int System::System::integrate(int n_steps, int reuse_forces) { if (caught_error) { return INTEG_ERROR_RUNTIME; } -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM if (boost::mpi::all_reduce(::comm_cart, not cell_structure->use_verlet_list, std::logical_or<>())) { cell_structure->use_verlet_list = false; } -#endif return integrated_steps; } diff --git a/src/core/magnetostatics/dp3m_heffte.hpp b/src/core/magnetostatics/dp3m_heffte.hpp index 6e53b64a80..2e9f7ed669 100644 --- a/src/core/magnetostatics/dp3m_heffte.hpp +++ b/src/core/magnetostatics/dp3m_heffte.hpp @@ -36,10 +36,8 @@ #include -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM #include #include -#endif #include #include @@ -137,7 +135,6 @@ struct DipolarP3MState : public P3MStateCommon { void resize_heffte_buffers(); #endif // ESPRESSO_DP3M_HEFFTE_CROSS_CHECKS -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM Kokkos::View rs_fields_kokkos; @@ -151,7 +148,6 @@ struct DipolarP3MState : public P3MStateCommon { rs_fields_kokkos = decltype(rs_fields_kokkos)( "DipolarP3MState::rs_fields_kokkos", 0, 0, 0); } -#endif // ESPRESSO_SHARED_MEMORY_PARALLELISM }; template @@ -167,10 +163,8 @@ struct DipolarP3MHeffte : public DipolarP3M { DipolarP3MStateClass &dp3m; private: -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM // kokkos handle must outlive kokkos data structures from other class members std::shared_ptr m_kokkos_handle; -#endif /** @brief Dipolar P3M meshes and FFT algorithm. */ std::unique_ptr dp3m_impl; TuningParameters tuning; @@ -180,10 +174,8 @@ struct DipolarP3MHeffte : public DipolarP3M { DipolarP3MHeffte(std::unique_ptr &&dp3m_state, TuningParameters tuning_params, double prefactor) : DipolarP3M(dp3m_state->params), dp3m{*dp3m_state}, -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM - m_kokkos_handle{::kokkos_handle}, -#endif - dp3m_impl{std::move(dp3m_state)}, tuning{std::move(tuning_params)} { + m_kokkos_handle{::kokkos_handle}, dp3m_impl{std::move(dp3m_state)}, + tuning{std::move(tuning_params)} { if (tuning.timings <= 0) { throw std::domain_error("Parameter 'timings' must be > 0"); @@ -194,9 +186,7 @@ struct DipolarP3MHeffte : public DipolarP3M { m_is_tuned = not dp3m.params.tuning; dp3m.params.tuning = false; set_prefactor(prefactor); -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM dp3m.init_labels(); -#endif } void init() override { @@ -233,13 +223,11 @@ struct DipolarP3MHeffte : public DipolarP3M { private: void prepare_fft_mesh() { dp3m.inter_weights.reset(dp3m.params.cao); -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM using execution_space = Kokkos::DefaultExecutionSpace; auto const num_threads = execution_space().concurrency(); Kokkos::realloc(Kokkos::WithoutInitializing, dp3m.rs_fields_kokkos, num_threads, 3, dp3m.local_mesh.size); Kokkos::deep_copy(dp3m.rs_fields_kokkos, FloatType{0}); -#endif // ESPRESSO_SHARED_MEMORY_PARALLELISM for (auto &rs_mesh_field : dp3m.mesh.rs_fields) { std::ranges::fill(rs_mesh_field, FloatType{0}); } diff --git a/src/core/magnetostatics/dp3m_heffte.impl.hpp b/src/core/magnetostatics/dp3m_heffte.impl.hpp index 3914856df4..bff6562ee6 100644 --- a/src/core/magnetostatics/dp3m_heffte.impl.hpp +++ b/src/core/magnetostatics/dp3m_heffte.impl.hpp @@ -61,10 +61,8 @@ #include #include -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM #include #include -#endif #include #include @@ -181,7 +179,6 @@ void DipolarP3MHeffte::init_cpu_kernels() { namespace { template struct AssignDipole { -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM void operator()(auto &dp3m, auto &cell_structure) { using DipolarP3MState = std::remove_reference_t; using value_type = DipolarP3MState::value_type; @@ -226,29 +223,6 @@ template struct AssignDipole { }); Kokkos::fence(); } -#else // ESPRESSO_SHARED_MEMORY_PARALLELISM - void operator()(auto &dp3m, Utils::Vector3d const &real_pos, - Utils::Vector3d const &dip) const { - using DipolarP3MState = std::remove_reference_t; - using value_type = DipolarP3MState::value_type; - auto constexpr memory_order = Utils::MemoryOrder::ROW_MAJOR; - auto const weights = p3m_calculate_interpolation_weights( - real_pos.as_span(), dp3m.params.ai, dp3m.local_mesh); - p3m_interpolate( - dp3m.local_mesh, weights, [&dip, &dp3m](int ind, double w) { - dp3m.mesh.rs_fields[0u][ind] += value_type(w * dip[0u]); - dp3m.mesh.rs_fields[1u][ind] += value_type(w * dip[1u]); - dp3m.mesh.rs_fields[2u][ind] += value_type(w * dip[2u]); -#ifdef ESPRESSO_DP3M_HEFFTE_CROSS_CHECKS - dp3m.heffte.rs_dipole_density[0u][ind] += value_type(w * dip[0u]); - dp3m.heffte.rs_dipole_density[1u][ind] += value_type(w * dip[1u]); - dp3m.heffte.rs_dipole_density[2u][ind] += value_type(w * dip[2u]); -#endif - }); - - dp3m.inter_weights.template store(weights); - } -#endif // ESPRESSO_SHARED_MEMORY_PARALLELISM }; } // namespace @@ -256,17 +230,8 @@ template void DipolarP3MHeffte::dipole_assign() { prepare_fft_mesh(); -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM Utils::integral_parameter( dp3m.params.cao, dp3m, *get_system().cell_structure); -#else // ESPRESSO_SHARED_MEMORY_PARALLELISM - for (auto const &p : get_system().cell_structure->local_particles()) { - if (p.dipm() != 0.) { - Utils::integral_parameter( - dp3m.params.cao, dp3m, p.pos(), p.calc_dip()); - } - } -#endif // ESPRESSO_SHARED_MEMORY_PARALLELISM } namespace { @@ -287,17 +252,12 @@ template struct AssignTorques { }); auto const torque = vector_product(pref, E); -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM auto const thread_id = omp_get_thread_num(); p_torque(p_index, thread_id, 0) -= torque[0]; p_torque(p_index, thread_id, 1) -= torque[1]; p_torque(p_index, thread_id, 2) -= torque[2]; -#else - p_torque -= torque; -#endif }; -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM auto const n_part = dp3m.inter_weights.size(); auto const &unique_particles = cell_structure.get_unique_particles(); auto &local_torque = cell_structure.get_local_torque(); @@ -308,17 +268,6 @@ template struct AssignTorques { kernel(p.calc_dip() * prefac, local_torque, p_index); } }); -#else // ESPRESSO_SHARED_MEMORY_PARALLELISM - /* magnetic particle index */ - auto p_index = std::size_t{0ul}; - - for (auto &p : cell_structure.local_particles()) { - if (p.dipm() != 0.) { - kernel(p.calc_dip() * prefac, p.torque(), p_index); - ++p_index; - } - } -#endif // ESPRESSO_SHARED_MEMORY_PARALLELISM } }; @@ -340,15 +289,10 @@ template struct AssignForcesDip { E[2u] += w * double(dp3m.mesh.rs_fields[2u][ind]); }); -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM auto const thread_id = omp_get_thread_num(); p_force(p_index, thread_id, d_rs) += pref * E; -#else - p_force[d_rs] += pref * E; -#endif }; -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM auto const n_part = dp3m.inter_weights.size(); auto const &unique_particles = cell_structure.get_unique_particles(); auto &local_force = cell_structure.get_local_force(); @@ -359,17 +303,6 @@ template struct AssignForcesDip { kernel(p.calc_dip() * prefac, local_force, p_index); } }); -#else // ESPRESSO_SHARED_MEMORY_PARALLELISM - /* magnetic particle index */ - auto p_index = std::size_t{0ul}; - - for (auto &p : cell_structure.local_particles()) { - if (p.dipm() != 0.) { - kernel(p.calc_dip() * prefac, p.force(), p_index); - ++p_index; - } - } -#endif // ESPRESSO_SHARED_MEMORY_PARALLELISM } }; } // namespace diff --git a/src/core/p3m/CMakeLists.txt b/src/core/p3m/CMakeLists.txt index 6b55c2ad6f..6954c018ca 100644 --- a/src/core/p3m/CMakeLists.txt +++ b/src/core/p3m/CMakeLists.txt @@ -33,19 +33,19 @@ if(ESPRESSO_BUILD_WITH_FFTW) ) target_link_libraries( espresso_p3m - PRIVATE - espresso::compiler_flags - espresso::p3m::compiler_flags - espresso::instrumentation - espresso::utils - espresso::config - Random123 - Boost::mpi - MPI::MPI_CXX - Heffte::Heffte - $<$:OpenMP::OpenMP_CXX> - $<$:Kokkos::kokkos> - $<$:Cabana::Core>) + PRIVATE espresso::compiler_flags + espresso::p3m::compiler_flags + espresso::instrumentation + espresso::utils + espresso::config + Random123 + Boost::mpi + MPI::MPI_CXX + Heffte::Heffte + OpenMP::OpenMP_CXX + $<$:OpenMP::OpenMP_CUDA> + Kokkos::kokkos + Cabana::Core) set_target_properties(espresso_p3m PROPERTIES POSITION_INDEPENDENT_CODE ON) target_link_libraries(espresso_core PRIVATE espresso_p3m) target_sources( diff --git a/src/core/p3m/for_each_3d.hpp b/src/core/p3m/for_each_3d.hpp index cc96f48d5e..b5f8c7a601 100644 --- a/src/core/p3m/for_each_3d.hpp +++ b/src/core/p3m/for_each_3d.hpp @@ -23,9 +23,7 @@ #include -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM #include -#endif #include #include @@ -123,14 +121,12 @@ void for_each_3d_order(detail::IndexVectorConcept auto &&start, } } -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM /** @brief Mapping between ESPResSo and Kokkos tags for memory order */ template using LayoutIterate = std::conditional_t< Order == Utils::MemoryOrder::COLUMN_MAJOR, std::integral_constant, std::integral_constant>; -#endif /** * @brief Run a kernel(index_3d, linear_index) over the given 3d range with @@ -139,7 +135,6 @@ using LayoutIterate = std::conditional_t< template void for_each_3d_lin(detail::IndexVectorConcept auto &&start, detail::IndexVectorConcept auto &&stop, Kernel &&kernel) { -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM if (Kokkos::num_threads() > 1) { auto const size = stop - start; constexpr Kokkos::Iterate iter = LayoutIterate::value; @@ -153,7 +148,6 @@ void for_each_3d_lin(detail::IndexVectorConcept auto &&start, }); return; } -#endif int linear_loop_index = 0u; if constexpr (memory_order == Utils::MemoryOrder::ROW_MAJOR) { diff --git a/src/core/p3m/interpolation.hpp b/src/core/p3m/interpolation.hpp index 0fe8425d48..ca44965eca 100644 --- a/src/core/p3m/interpolation.hpp +++ b/src/core/p3m/interpolation.hpp @@ -26,9 +26,7 @@ #include #include -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM #include -#endif #include #include @@ -69,38 +67,22 @@ template struct InterpolationWeightsView { class p3m_interpolation_cache { int m_cao = 0; /** Charge fractions for mesh assignment. */ -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM Kokkos::View ca_frac; std::vector ca_frac_spillover; -#else - std::vector ca_frac; -#endif /** index of first mesh point for charge assignment. */ -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM Kokkos::View ca_fmp; std::vector ca_fmp_spillover; -#else - std::vector ca_fmp; -#endif public: -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM p3m_interpolation_cache() : ca_frac("p3m_interpolation_cache::ca_frac", 0, 0), ca_fmp("p3m_interpolation_cache::ca_fmp", 0, 0) {} -#endif /** * @brief Number of points in the cache. * @return Number of points currently in the cache. */ - auto size() const { -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM - return ca_fmp.size() + ca_fmp_spillover.size(); -#else - return ca_fmp.size(); -#endif - } + auto size() const { return ca_fmp.size() + ca_fmp_spillover.size(); } /** * @brief Charge assignment order the weights are for. @@ -115,7 +97,6 @@ class p3m_interpolation_cache { */ void zfill(std::size_t size) { auto const size_frac = size * static_cast(m_cao * 3); -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM if (ca_fmp.size() != size or ca_frac.size() != size_frac) { Kokkos::realloc(Kokkos::WithoutInitializing, ca_fmp, size); Kokkos::realloc(Kokkos::WithoutInitializing, ca_frac, size_frac); @@ -125,12 +106,6 @@ class p3m_interpolation_cache { // data must be contiguous in memory assert(size == 0 or (std::distance(&ca_fmp(0), &ca_fmp(size - 1)) == size - 1)); -#else - assert(ca_frac.empty()); - assert(ca_fmp.empty()); - ca_fmp.resize(size); - ca_frac.resize(size_frac); -#endif } /** @@ -143,19 +118,11 @@ class p3m_interpolation_cache { template void store(InterpolationWeights const &weights) { assert(cao == m_cao); -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM ca_fmp_spillover.emplace_back(weights.ind); auto it = std::back_inserter(ca_frac_spillover); std::ranges::copy(weights.w_x, it); std::ranges::copy(weights.w_y, it); std::ranges::copy(weights.w_z, it); -#else - ca_fmp.emplace_back(weights.ind); - auto it = std::back_inserter(ca_frac); - std::ranges::copy(weights.w_x, it); - std::ranges::copy(weights.w_y, it); - std::ranges::copy(weights.w_z, it); -#endif } /** @@ -179,11 +146,7 @@ class p3m_interpolation_cache { std::copy_n(src.w_z.data(), cao, dst); }; -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM ca_fmp(p_index) = weights.ind; -#else - ca_fmp[p_index] = weights.ind; -#endif auto const offset = p_index * static_cast(cao * 3); copy_weights(weights, ca_frac.data() + offset); } @@ -206,7 +169,6 @@ class p3m_interpolation_cache { int index = -1; double const *ptr = nullptr; -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM if (p_index >= ca_fmp.size()) { p_index -= ca_fmp.size(); index = ca_fmp_spillover[p_index]; @@ -217,11 +179,6 @@ class p3m_interpolation_cache { auto const offset = p_index * static_cast(cao * 3); ptr = std::as_const(ca_frac).data() + offset; } -#else - index = ca_fmp[p_index]; - auto const offset = p_index * static_cast(cao * 3); - ptr = std::as_const(ca_frac).data() + offset; -#endif std::span w_x(ptr, cao); std::advance(ptr, cao); std::span w_y(ptr, cao); @@ -237,15 +194,10 @@ class p3m_interpolation_cache { */ void reset(int cao) { m_cao = cao; -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM Kokkos::realloc(Kokkos::WithoutInitializing, ca_fmp, 0ul); Kokkos::realloc(Kokkos::WithoutInitializing, ca_frac, 0ul); ca_frac_spillover.clear(); ca_fmp_spillover.clear(); -#else - ca_frac.clear(); - ca_fmp.clear(); -#endif } }; diff --git a/src/core/particle_reduction.hpp b/src/core/particle_reduction.hpp index 2850feeb93..223cd5bf70 100644 --- a/src/core/particle_reduction.hpp +++ b/src/core/particle_reduction.hpp @@ -24,9 +24,7 @@ #include "Particle.hpp" #include "cell_system/CellStructure.hpp" -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM #include -#endif #include #include @@ -43,8 +41,6 @@ using AddPartialResultKernel = template using ReductionOp = std::function; -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM - /** @brief Custom reduction in the form required by Kokkos */ template class KokkosReducer { public: @@ -62,7 +58,7 @@ template class KokkosReducer { KokkosReducer(Kernel kernel, ReductionOp reduction_op) : reduction_op(std::move(reduction_op)), kernel(std::move(kernel)) {} KokkosReducer(KokkosReducer const &other) - : reduction_op(other.reduction_op), kernel(other.kernel) {}; + : reduction_op(other.reduction_op), kernel(other.kernel) {} KOKKOS_INLINE_FUNCTION void operator()(std::integral auto const i, value_type &update) const { @@ -84,8 +80,6 @@ make_kokkos_reducer(Kernel k, ReductionOp reduce_op) { return KokkosReducer(k, reduce_op); } -#endif // ESPRESSO_SHARED_MEMORY_PARALLELISM - } // namespace Reduction /** @brief performs a reduction over all particles @@ -105,7 +99,6 @@ ResultType reduce_over_local_particles( ResultType result{}; -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM auto const &cells = cs.decomposition().local_cells(); if (cells.size() > 1) { // parallel loop over cells auto reducer = Reduction::make_kokkos_reducer( @@ -129,10 +122,4 @@ ResultType reduce_over_local_particles( Kokkos::parallel_reduce( // loop over particles "reduce_on_local_particle", particles.size(), reducer, result); return result; -#else // ESPRESSO_SHARED_MEMORY_PARALLELISM - for (auto const &p : cs.local_particles()) { - add_partial(result, p); - } - return result; -#endif } diff --git a/src/core/short_range_cabana.hpp b/src/core/short_range_cabana.hpp index b27e0b98c5..ca11866e57 100644 --- a/src/core/short_range_cabana.hpp +++ b/src/core/short_range_cabana.hpp @@ -21,8 +21,6 @@ #include -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM - #include "cell_system/CellStructure.hpp" #include "aosoa_pack.hpp" @@ -375,5 +373,3 @@ void cabana_short_range(auto const &pair_bonds_kernel, #endif } } - -#endif // ESPRESSO_SHARED_MEMORY_PARALLELISM diff --git a/src/core/system/System.cpp b/src/core/system/System.cpp index 87b9738cda..644b780980 100644 --- a/src/core/system/System.cpp +++ b/src/core/system/System.cpp @@ -73,9 +73,7 @@ System::System(Private) { box_geo = std::make_shared(); local_geo = std::make_shared(); cell_structure = std::make_shared(*box_geo); -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM cell_structure->set_kokkos_handle(::kokkos_handle); -#endif #ifdef ESPRESSO_CUDA gpu = std::make_shared(); #endif @@ -358,9 +356,7 @@ void System::on_particle_change() { /* the particle information is no longer valid */ invalidate_fetch_cache(); -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM cell_structure->clear_local_properties(); -#endif } void System::on_particle_charge_change() { @@ -392,9 +388,7 @@ void System::update_dependent_particles() { #ifdef ESPRESSO_ELECTROSTATICS if (has_icc_enabled()) { -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM rebuild_aosoa(); -#endif update_icc_particles(); } #endif @@ -420,12 +414,9 @@ void System::on_observable_calc() { #endif clear_particle_node(); -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM rebuild_aosoa(); -#endif } -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM void System::rebuild_aosoa() { #ifdef ESPRESSO_COLLISION_DETECTION auto const collision_detection_cutoff = collision_detection->cutoff(); @@ -443,7 +434,6 @@ void System::rebuild_aosoa() { update_cabana_state(*cell_structure, verlet_criterion, get_interaction_range(), propagation->integ_switch); } -#endif // ESPRESSO_SHARED_MEMORY_PARALLELISM void System::on_lees_edwards_change() { lb.on_lees_edwards_change(); } @@ -520,9 +510,7 @@ void System::on_integration_start() { } invalidate_fetch_cache(); -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM cell_structure->clear_local_properties(); -#endif #ifdef ESPRESSO_ADDITIONAL_CHECKS if (!Utils::Mpi::all_compare(::comm_cart, cell_structure->use_verlet_list)) { diff --git a/src/core/system/System.hpp b/src/core/system/System.hpp index 3628f28e38..cfa15d44c4 100644 --- a/src/core/system/System.hpp +++ b/src/core/system/System.hpp @@ -137,9 +137,7 @@ class System : public std::enable_shared_from_this { /** @brief Rebuild cell lists. Use e.g. after a skin change. */ void rebuild_cell_structure(); -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM void rebuild_aosoa(); -#endif /** @brief Calculate the maximal cutoff of all interactions. */ double maximal_cutoff() const; diff --git a/src/core/unit_tests/CMakeLists.txt b/src/core/unit_tests/CMakeLists.txt index 9030b5aaea..59d9122368 100644 --- a/src/core/unit_tests/CMakeLists.txt +++ b/src/core/unit_tests/CMakeLists.txt @@ -31,16 +31,14 @@ espresso_unit_test_executable( MPI::MPI_CXX) foreach(TEST_NUM_PROC 1 3 4) foreach(TEST_NUM_THREADS 1 2) - if(${ESPRESSO_BUILD_WITH_SHARED_MEMORY_PARALLELISM} OR ${TEST_NUM_THREADS} - EQUAL 1) - if(${ESPRESSO_TEST_NP} GREATER_EQUAL ${TEST_NUM_PROC}) + if(${TEST_NUM_THREADS} LESS_EQUAL ${ESPRESSO_TEST_NT}) + if(${TEST_NUM_PROC} LESS_EQUAL ${ESPRESSO_TEST_NP}) set(TEST_NAME EspressoSystemStandAlone_test_${TEST_NUM_PROC}_mpi_ranks_${TEST_NUM_THREADS}_omp_threads ) espresso_unit_test_register( - NAME ${TEST_NAME} TARGET EspressoSystemStandAlone_test_matrix DEPENDS - espresso::core Boost::mpi MPI::MPI_CXX NUM_PROC ${TEST_NUM_PROC} - NUM_THREADS ${TEST_NUM_THREADS}) + NAME ${TEST_NAME} TARGET EspressoSystemStandAlone_test_matrix + NUM_PROC ${TEST_NUM_PROC} NUM_THREADS ${TEST_NUM_THREADS}) endif() endif() endforeach() @@ -63,13 +61,10 @@ espresso_unit_test(SRC field_coupling_couplings_test.cpp DEPENDS espresso_unit_test(SRC field_coupling_fields_test.cpp DEPENDS espresso::utils) espresso_unit_test(SRC field_coupling_force_field_test.cpp DEPENDS espresso::utils) -espresso_unit_test( - SRC field_layout_helpers_test.cpp DEPENDS espresso::utils espresso::core - $<$:Kokkos::kokkos>) -espresso_unit_test( - SRC particle_reduction_test.cpp DEPENDS espresso::utils espresso::core - Boost::mpi - $<$:Kokkos::kokkos>) +espresso_unit_test(SRC field_layout_helpers_test.cpp DEPENDS espresso::utils + espresso::core Kokkos::kokkos) +espresso_unit_test(SRC particle_reduction_test.cpp DEPENDS espresso::utils + espresso::core Boost::mpi Kokkos::kokkos) espresso_unit_test(SRC periodic_fold_test.cpp) espresso_unit_test(SRC grid_test.cpp DEPENDS espresso::core) espresso_unit_test(SRC lees_edwards_test.cpp DEPENDS espresso::core) @@ -101,27 +96,24 @@ if(ESPRESSO_BUILD_WITH_FFTW) NAME p3m_test_matrix SRC p3m_test.cpp DEPENDS espresso::core Boost::mpi MPI::MPI_CXX $<$:espresso::p3m::compiler_flags> - $<$:Heffte::Heffte> - $<$:Cabana::Core> - $<$:Kokkos::kokkos>) + $<$:Heffte::Heffte> Cabana::Core + Kokkos::kokkos) foreach(TEST_NUM_PROC 1 3 4) foreach(TEST_NUM_THREADS 1 2) - if(${ESPRESSO_BUILD_WITH_SHARED_MEMORY_PARALLELISM} OR ${TEST_NUM_THREADS} - EQUAL 1) - if(${ESPRESSO_TEST_NP} GREATER_EQUAL ${TEST_NUM_PROC}) + if(${TEST_NUM_THREADS} LESS_EQUAL ${ESPRESSO_TEST_NT}) + if(${TEST_NUM_PROC} LESS_EQUAL ${ESPRESSO_TEST_NP}) set(TEST_NAME p3m_test_${TEST_NUM_PROC}_mpi_ranks_${TEST_NUM_THREADS}_omp_threads ) espresso_unit_test_register( - NAME ${TEST_NAME} TARGET p3m_test_matrix DEPENDS MPI::MPI_CXX - NUM_PROC ${TEST_NUM_PROC} NUM_THREADS ${TEST_NUM_THREADS}) + NAME ${TEST_NAME} TARGET p3m_test_matrix NUM_PROC ${TEST_NUM_PROC} + NUM_THREADS ${TEST_NUM_THREADS}) endif() endif() endforeach() endforeach() - espresso_unit_test( - SRC fft_test.cpp DEPENDS espresso::utils espresso::core - $<$:Kokkos::kokkos>) + espresso_unit_test(SRC fft_test.cpp DEPENDS espresso::utils espresso::core + Kokkos::kokkos) espresso_unit_test(SRC math_test.cpp DEPENDS espresso::utils espresso::core) endif() diff --git a/src/core/unit_tests/EspressoSystemStandAlone_test.cpp b/src/core/unit_tests/EspressoSystemStandAlone_test.cpp index 3e9ace6fa8..4a6b3f082c 100644 --- a/src/core/unit_tests/EspressoSystemStandAlone_test.cpp +++ b/src/core/unit_tests/EspressoSystemStandAlone_test.cpp @@ -551,7 +551,6 @@ BOOST_FIXTURE_TEST_CASE(espresso_system_stand_alone, ParticleFactory) { // check bond counting { -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM auto &cs = *system.cell_structure; auto init_n_pairs = 0; auto init_n_angles = 0; @@ -584,7 +583,6 @@ BOOST_FIXTURE_TEST_CASE(espresso_system_stand_alone, ParticleFactory) { BOOST_CHECK_EQUAL(cs.get_local_angle_bond_numbers(), init_n_angles); BOOST_CHECK_EQUAL(cs.get_local_dihedral_bond_numbers(), init_n_dihes); #endif // ESPRESSO_COLLISION_DETECTION -#endif // ESPRESSO_SHARED_MEMORY_PARALLELISM } // check exceptions from sanity checks @@ -712,11 +710,6 @@ BOOST_FIXTURE_TEST_CASE(espresso_system_stand_alone, ParticleFactory) { BOOST_CHECK_THROW(force_kernel(1u), BondUnknownTypeError); BOOST_CHECK_THROW(force_kernel(2u), BondUnknownTypeError); BOOST_CHECK_THROW(force_kernel(3u), BondUnknownTypeError); - BOOST_CHECK_THROW(add_bonded_force(plist[0], 0, {plist_ptr.begin(), 5ul}, - *system.bonded_ias, - *system.bond_breakage, *system.box_geo, - nullptr, nullptr), - BondInvalidSizeError); #ifdef ESPRESSO_CUDA BOOST_CHECK_THROW( invoke_skip_cuda_exceptions([]() { throw std::runtime_error(""); }), diff --git a/src/core/unit_tests/field_layout_helpers_test.cpp b/src/core/unit_tests/field_layout_helpers_test.cpp index cc8ffbf06a..df0fdbcde4 100644 --- a/src/core/unit_tests/field_layout_helpers_test.cpp +++ b/src/core/unit_tests/field_layout_helpers_test.cpp @@ -23,9 +23,7 @@ #include "p3m/field_layout_helpers.hpp" -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM #include -#endif #include #include @@ -36,10 +34,8 @@ #include struct GlobalConfig { -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM GlobalConfig() { Kokkos::initialize(); } ~GlobalConfig() { Kokkos::finalize(); } -#endif }; BOOST_TEST_GLOBAL_CONFIGURATION(GlobalConfig); diff --git a/src/core/unit_tests/particle_reduction_test.cpp b/src/core/unit_tests/particle_reduction_test.cpp index 455c4fc9cb..c738d8c753 100644 --- a/src/core/unit_tests/particle_reduction_test.cpp +++ b/src/core/unit_tests/particle_reduction_test.cpp @@ -55,11 +55,7 @@ struct GlobalConfig : public EspressoCoreGlobalConfig { // Decorator to skip tests if shared-memory parallelism isn't compiled in boost::test_tools::assertion_result has_shm(boost::unit_test::test_unit_id) { -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM return true; -#else - return false; -#endif } BOOST_TEST_GLOBAL_CONFIGURATION(GlobalConfig); @@ -69,7 +65,6 @@ auto const reduce_op = [](T &a, T const &b) { a = a + b; }; BOOST_TEST_DECORATOR(*boost::unit_test::precondition(has_shm)) BOOST_AUTO_TEST_CASE(test_make_kokkos_reduction) { -#ifdef ESPRESSO_SHARED_MEMORY_PARALLELISM auto &system = System::get_system(); auto const &cell_structure = *system.cell_structure; auto const &cells = cell_structure.decomposition().local_cells(); @@ -90,7 +85,6 @@ BOOST_AUTO_TEST_CASE(test_make_kokkos_reduction) { // so make sure that both results are equal. BOOST_CHECK_EQUAL(res, ref); } -#endif // ESPRESSO_SHARED_MEMORY_PARALLELISM } BOOST_AUTO_TEST_CASE(test_reduce_over_local_particles) { diff --git a/src/instrumentation/include/instrumentation/fe_trap.hpp b/src/instrumentation/include/instrumentation/fe_trap.hpp index 009e5dc76a..b7677a1ef6 100644 --- a/src/instrumentation/include/instrumentation/fe_trap.hpp +++ b/src/instrumentation/include/instrumentation/fe_trap.hpp @@ -173,7 +173,7 @@ class fe_trap { /** * @brief Generate a shared handle to temporarily disable any currently * active exception trap for the lifetime of the current scope. - * If exception trap is currently active, return a null pointer. + * If no exception trap is currently active, return a null pointer. */ static std::shared_ptr make_shared_pause_scoped(); diff --git a/src/instrumentation/tests/fe_trap_test.cpp b/src/instrumentation/tests/fe_trap_test.cpp index 82f6679fde..8a823085b3 100644 --- a/src/instrumentation/tests/fe_trap_test.cpp +++ b/src/instrumentation/tests/fe_trap_test.cpp @@ -155,6 +155,50 @@ BOOST_AUTO_TEST_CASE(trap_by_signal) { ::last_signal_code = 0; } } + { + auto trap = fe_trap::make_unique_scoped(); + BOOST_REQUIRE(trap.is_unique()); + BOOST_REQUIRE(trap.is_active()); + { + // temporarily deactivate trap + auto trap_pause = fe_trap::make_shared_pause_scoped(); + BOOST_REQUIRE(not trap.is_active()); + // without instrumentation, abnormal operations are allowed + value = 1. / bad_denominator; + value = std::exp(bad_exponent); + } + BOOST_REQUIRE(trap.is_active()); + { + // manually deactivate trap + trap.get_trap().deactivate(); + BOOST_REQUIRE(not trap.is_active()); + // without instrumentation, abnormal operations are allowed + value = 1. / bad_denominator; + value = std::exp(bad_exponent); + // deactivating twice is safe (no-op) + trap.get_trap().deactivate(); + BOOST_REQUIRE(!trap.is_active()); + // manually reactivate trap + trap.get_trap().activate(); + BOOST_REQUIRE(trap.is_active()); + // reactivating twice is safe (no-op) + trap.get_trap().activate(); + BOOST_REQUIRE(trap.is_active()); + } + value = 0.; + while (sigsetjmp(::jmp_env, 1) == 0) { + // LCOV_EXCL_START + value = 2.; + value = 0. / bad_denominator; + // LCOV_EXCL_STOP + } + BOOST_CHECK_EQUAL(::last_signal_status, SIGFPE); + BOOST_CHECK_EQUAL(::last_signal_code, FPE_FLTINV); + BOOST_REQUIRE(not std::isnan(value)); + BOOST_REQUIRE_EQUAL(value, 2.); + ::last_signal_status = 0; + ::last_signal_code = 0; + } // check trap deactivation { diff --git a/src/python/espressomd/CMakeLists.txt b/src/python/espressomd/CMakeLists.txt index 378f8895f6..0c5fac514f 100644 --- a/src/python/espressomd/CMakeLists.txt +++ b/src/python/espressomd/CMakeLists.txt @@ -116,16 +116,14 @@ foreach(cython_file ${cython_SRC}) ${target} PROPERTIES SUFFIX ".so" LINK_FLAGS "-undefined dynamic_lookup") endif() set_target_properties(${target} PROPERTIES CXX_CLANG_TIDY "") - if(ESPRESSO_BUILD_WITH_SHARED_MEMORY_PARALLELISM) - if(CMAKE_CXX_COMPILER_ID STREQUAL CrayClang AND target STREQUAL - espressomd__init - AND DEFINED OpenMP_craymp_LIBRARY AND EXISTS ${OpenMP_craymp_LIBRARY}) - # the Cray OpenMP library must be loaded before dependent Cray libraries, - # including those imported from target OpenMP::OpenMP_CXX, so as to avoid - # "ImportError: cannot allocate memory in static TLS block" - target_link_libraries(${target} PRIVATE ${OpenMP_craymp_LIBRARY} - OpenMP::OpenMP_CXX) - endif() + if(CMAKE_CXX_COMPILER_ID STREQUAL CrayClang AND target STREQUAL + espressomd__init + AND DEFINED OpenMP_craymp_LIBRARY AND EXISTS ${OpenMP_craymp_LIBRARY}) + # the Cray OpenMP library must be loaded before dependent Cray libraries, + # including those imported from target OpenMP::OpenMP_CXX, so as to avoid + # "ImportError: cannot allocate memory in static TLS block" + target_link_libraries(${target} PRIVATE ${OpenMP_craymp_LIBRARY} + OpenMP::OpenMP_CXX) endif() target_link_libraries(${target} PRIVATE espresso::config espresso::core espresso::script_interface) diff --git a/src/walberla_bridge/CMakeLists.txt b/src/walberla_bridge/CMakeLists.txt index d3042f6a18..5a9a6c2dd8 100644 --- a/src/walberla_bridge/CMakeLists.txt +++ b/src/walberla_bridge/CMakeLists.txt @@ -126,27 +126,20 @@ espresso_configure_walberla_target(espresso_walberla) espresso_configure_walberla_target(espresso_walberla_codegen) target_link_libraries( - espresso_walberla - PUBLIC MPI::MPI_CXX espresso::utils - PRIVATE - espresso::compiler_flags - espresso::walberla::compiler_flags - espresso::walberla_codegen - $<$:Heffte::Heffte> - $<$:espresso::avx_flags> - $<$:OpenMP::OpenMP_CXX> - $<$,$>:OpenMP::OpenMP_CUDA> -) + espresso_walberla PUBLIC MPI::MPI_CXX espresso::utils + PRIVATE espresso::compiler_flags espresso::walberla::compiler_flags + espresso::walberla_codegen + $<$:Heffte::Heffte> + $<$:espresso::avx_flags> + $<$:OpenMP::OpenMP_CUDA> + OpenMP::OpenMP_CXX) target_link_libraries( espresso_walberla_codegen - PRIVATE - espresso::compiler_flags - espresso::walberla::compiler_flags - espresso::walberla_codegen::compiler_flags - $<$:espresso::avx_flags> - $<$:OpenMP::OpenMP_CXX> - $<$,$>:OpenMP::OpenMP_CUDA> -) + PRIVATE espresso::compiler_flags espresso::walberla::compiler_flags + espresso::walberla_codegen::compiler_flags + $<$:espresso::avx_flags> + $<$:OpenMP::OpenMP_CUDA> + OpenMP::OpenMP_CXX) function(espresso_set_walberla_codegen_kernel_source_properties source_file) # disable sanitizers on kernels due to excessive runtime and VRAM usage diff --git a/src/walberla_bridge/src/BoundaryPackInfo.hpp b/src/walberla_bridge/src/BoundaryPackInfo.hpp index ffc2479576..57f48f2b3c 100644 --- a/src/walberla_bridge/src/BoundaryPackInfo.hpp +++ b/src/walberla_bridge/src/BoundaryPackInfo.hpp @@ -74,9 +74,7 @@ class BoundaryPackInfo : public PackInfo { void communicateLocal(IBlock const *sender, IBlock *receiver, stencil::Direction dir) override { -#ifdef _OPENMP #pragma omp critical -#endif { mpi::SendBuffer sBuffer; packDataImpl(sender, dir, sBuffer); diff --git a/src/walberla_bridge/src/electrokinetics/generated_kernels/AdvectiveFluxKernel_double_precision.cpp b/src/walberla_bridge/src/electrokinetics/generated_kernels/AdvectiveFluxKernel_double_precision.cpp index bd2f4e5e76..2707e614e6 100644 --- a/src/walberla_bridge/src/electrokinetics/generated_kernels/AdvectiveFluxKernel_double_precision.cpp +++ b/src/walberla_bridge/src/electrokinetics/generated_kernels/AdvectiveFluxKernel_double_precision.cpp @@ -47,13 +47,9 @@ namespace pystencils { namespace internal_5255e1c780a944d646f270232511968b { static FUNC_PREFIX void advectivefluxkernel_double_precision_advectivefluxkernel_double_precision(double *RESTRICT const _data_j, double *RESTRICT const _data_rho, double *RESTRICT const _data_u, int64_t const _size_j_0, int64_t const _size_j_1, int64_t const _size_j_2, int64_t const _stride_j_0, int64_t const _stride_j_1, int64_t const _stride_j_2, int64_t const _stride_j_3, int64_t const _stride_rho_0, int64_t const _stride_rho_1, int64_t const _stride_rho_2, int64_t const _stride_u_0, int64_t const _stride_u_1, int64_t const _stride_u_2, int64_t const _stride_u_3) { -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_2 = 0; ctr_2 < _size_j_2; ctr_2 += 1) { for (int64_t ctr_1 = 0; ctr_1 < _size_j_1; ctr_1 += 1) { for (int64_t ctr_0 = 1; ctr_0 < _size_j_0; ctr_0 += 1) { diff --git a/src/walberla_bridge/src/electrokinetics/generated_kernels/AdvectiveFluxKernel_single_precision.cpp b/src/walberla_bridge/src/electrokinetics/generated_kernels/AdvectiveFluxKernel_single_precision.cpp index 423503ae6b..0d5c3b34b9 100644 --- a/src/walberla_bridge/src/electrokinetics/generated_kernels/AdvectiveFluxKernel_single_precision.cpp +++ b/src/walberla_bridge/src/electrokinetics/generated_kernels/AdvectiveFluxKernel_single_precision.cpp @@ -47,13 +47,9 @@ namespace pystencils { namespace internal_47df4b171f276b8c3a55fc08d45e245e { static FUNC_PREFIX void advectivefluxkernel_single_precision_advectivefluxkernel_single_precision(float *RESTRICT const _data_j, float *RESTRICT const _data_rho, float *RESTRICT const _data_u, int64_t const _size_j_0, int64_t const _size_j_1, int64_t const _size_j_2, int64_t const _stride_j_0, int64_t const _stride_j_1, int64_t const _stride_j_2, int64_t const _stride_j_3, int64_t const _stride_rho_0, int64_t const _stride_rho_1, int64_t const _stride_rho_2, int64_t const _stride_u_0, int64_t const _stride_u_1, int64_t const _stride_u_2, int64_t const _stride_u_3) { -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_2 = 0; ctr_2 < _size_j_2; ctr_2 += 1) { for (int64_t ctr_1 = 0; ctr_1 < _size_j_1; ctr_1 += 1) { for (int64_t ctr_0 = 1; ctr_0 < _size_j_0; ctr_0 += 1) { diff --git a/src/walberla_bridge/src/electrokinetics/generated_kernels/ContinuityKernel_double_precision.cpp b/src/walberla_bridge/src/electrokinetics/generated_kernels/ContinuityKernel_double_precision.cpp index a024dd0b09..5dbc9a234b 100644 --- a/src/walberla_bridge/src/electrokinetics/generated_kernels/ContinuityKernel_double_precision.cpp +++ b/src/walberla_bridge/src/electrokinetics/generated_kernels/ContinuityKernel_double_precision.cpp @@ -47,13 +47,9 @@ namespace pystencils { namespace internal_5c5e903f8ea7925cf790d7c2318b2c56 { static FUNC_PREFIX void continuitykernel_double_precision_continuitykernel_double_precision(double *RESTRICT const _data_j, double *RESTRICT _data_rho, int64_t const _size_j_0, int64_t const _size_j_1, int64_t const _size_j_2, int64_t const _stride_j_0, int64_t const _stride_j_1, int64_t const _stride_j_2, int64_t const _stride_j_3, int64_t const _stride_rho_0, int64_t const _stride_rho_1, int64_t const _stride_rho_2) { -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_2 = 1; ctr_2 < _size_j_2 - 1; ctr_2 += 1) { for (int64_t ctr_1 = 1; ctr_1 < _size_j_1 - 1; ctr_1 += 1) { for (int64_t ctr_0 = 1; ctr_0 < _size_j_0 - 1; ctr_0 += 1) { diff --git a/src/walberla_bridge/src/electrokinetics/generated_kernels/ContinuityKernel_single_precision.cpp b/src/walberla_bridge/src/electrokinetics/generated_kernels/ContinuityKernel_single_precision.cpp index 6d0721702f..46802942e7 100644 --- a/src/walberla_bridge/src/electrokinetics/generated_kernels/ContinuityKernel_single_precision.cpp +++ b/src/walberla_bridge/src/electrokinetics/generated_kernels/ContinuityKernel_single_precision.cpp @@ -47,13 +47,9 @@ namespace pystencils { namespace internal_990034b4e4dd57d2802b4bcb5f716e46 { static FUNC_PREFIX void continuitykernel_single_precision_continuitykernel_single_precision(float *RESTRICT const _data_j, float *RESTRICT _data_rho, int64_t const _size_j_0, int64_t const _size_j_1, int64_t const _size_j_2, int64_t const _stride_j_0, int64_t const _stride_j_1, int64_t const _stride_j_2, int64_t const _stride_j_3, int64_t const _stride_rho_0, int64_t const _stride_rho_1, int64_t const _stride_rho_2) { -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_2 = 1; ctr_2 < _size_j_2 - 1; ctr_2 += 1) { for (int64_t ctr_1 = 1; ctr_1 < _size_j_1 - 1; ctr_1 += 1) { for (int64_t ctr_0 = 1; ctr_0 < _size_j_0 - 1; ctr_0 += 1) { diff --git a/src/walberla_bridge/src/electrokinetics/generated_kernels/DiffusiveFluxKernelThermalized_double_precision.cpp b/src/walberla_bridge/src/electrokinetics/generated_kernels/DiffusiveFluxKernelThermalized_double_precision.cpp index af46735c1f..c604fe957a 100644 --- a/src/walberla_bridge/src/electrokinetics/generated_kernels/DiffusiveFluxKernelThermalized_double_precision.cpp +++ b/src/walberla_bridge/src/electrokinetics/generated_kernels/DiffusiveFluxKernelThermalized_double_precision.cpp @@ -49,13 +49,9 @@ namespace pystencils { namespace internal_0f4fef9c62f0d4e3c1700727b32f958f { static FUNC_PREFIX void diffusivefluxkernelthermalized_double_precision_diffusivefluxkernelthermalized_double_precision(double D, double *RESTRICT const _data_j, double *RESTRICT const _data_rho, int64_t const _size_j_0, int64_t const _size_j_1, int64_t const _size_j_2, int64_t const _stride_j_0, int64_t const _stride_j_1, int64_t const _stride_j_2, int64_t const _stride_j_3, int64_t const _stride_rho_0, int64_t const _stride_rho_1, int64_t const _stride_rho_2, uint32_t block_offset_0, uint32_t block_offset_1, uint32_t block_offset_2, uint32_t field_size_0, uint32_t field_size_1, uint32_t field_size_2, uint32_t seed, uint32_t time_step) { -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_2 = 0; ctr_2 < _size_j_2; ctr_2 += 1) { for (int64_t ctr_1 = 0; ctr_1 < _size_j_1; ctr_1 += 1) { for (int64_t ctr_0 = 1; ctr_0 < _size_j_0; ctr_0 += 1) { diff --git a/src/walberla_bridge/src/electrokinetics/generated_kernels/DiffusiveFluxKernelThermalized_single_precision.cpp b/src/walberla_bridge/src/electrokinetics/generated_kernels/DiffusiveFluxKernelThermalized_single_precision.cpp index 1291332307..2464add8cb 100644 --- a/src/walberla_bridge/src/electrokinetics/generated_kernels/DiffusiveFluxKernelThermalized_single_precision.cpp +++ b/src/walberla_bridge/src/electrokinetics/generated_kernels/DiffusiveFluxKernelThermalized_single_precision.cpp @@ -49,13 +49,9 @@ namespace pystencils { namespace internal_13067439141d91943f586adb1c937d5b { static FUNC_PREFIX void diffusivefluxkernelthermalized_single_precision_diffusivefluxkernelthermalized_single_precision(float D, float *RESTRICT const _data_j, float *RESTRICT const _data_rho, int64_t const _size_j_0, int64_t const _size_j_1, int64_t const _size_j_2, int64_t const _stride_j_0, int64_t const _stride_j_1, int64_t const _stride_j_2, int64_t const _stride_j_3, int64_t const _stride_rho_0, int64_t const _stride_rho_1, int64_t const _stride_rho_2, uint32_t block_offset_0, uint32_t block_offset_1, uint32_t block_offset_2, uint32_t field_size_0, uint32_t field_size_1, uint32_t field_size_2, uint32_t seed, uint32_t time_step) { -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_2 = 0; ctr_2 < _size_j_2; ctr_2 += 1) { for (int64_t ctr_1 = 0; ctr_1 < _size_j_1; ctr_1 += 1) { for (int64_t ctr_0 = 1; ctr_0 < _size_j_0; ctr_0 += 1) { diff --git a/src/walberla_bridge/src/electrokinetics/generated_kernels/DiffusiveFluxKernelWithElectrostaticThermalized_double_precision.cpp b/src/walberla_bridge/src/electrokinetics/generated_kernels/DiffusiveFluxKernelWithElectrostaticThermalized_double_precision.cpp index 6c8aeba745..9e2074c7c6 100644 --- a/src/walberla_bridge/src/electrokinetics/generated_kernels/DiffusiveFluxKernelWithElectrostaticThermalized_double_precision.cpp +++ b/src/walberla_bridge/src/electrokinetics/generated_kernels/DiffusiveFluxKernelWithElectrostaticThermalized_double_precision.cpp @@ -49,13 +49,9 @@ namespace pystencils { namespace internal_1ba80591fca01bd4852b82a8b7a2ca49 { static FUNC_PREFIX void diffusivefluxkernelwithelectrostaticthermalized_double_precision_diffusivefluxkernelwithelectrostaticthermalized_double_precision(double D, double *RESTRICT const _data_j, double *RESTRICT const _data_phi, double *RESTRICT const _data_rho, int64_t const _size_j_0, int64_t const _size_j_1, int64_t const _size_j_2, int64_t const _stride_j_0, int64_t const _stride_j_1, int64_t const _stride_j_2, int64_t const _stride_j_3, int64_t const _stride_phi_0, int64_t const _stride_phi_1, int64_t const _stride_phi_2, int64_t const _stride_rho_0, int64_t const _stride_rho_1, int64_t const _stride_rho_2, uint32_t block_offset_0, uint32_t block_offset_1, uint32_t block_offset_2, double f_ext_0, double f_ext_1, double f_ext_2, uint32_t field_size_0, uint32_t field_size_1, uint32_t field_size_2, double kT, uint32_t seed, uint32_t time_step, double z) { -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_2 = 0; ctr_2 < _size_j_2; ctr_2 += 1) { for (int64_t ctr_1 = 0; ctr_1 < _size_j_1; ctr_1 += 1) { for (int64_t ctr_0 = 1; ctr_0 < _size_j_0; ctr_0 += 1) { diff --git a/src/walberla_bridge/src/electrokinetics/generated_kernels/DiffusiveFluxKernelWithElectrostaticThermalized_single_precision.cpp b/src/walberla_bridge/src/electrokinetics/generated_kernels/DiffusiveFluxKernelWithElectrostaticThermalized_single_precision.cpp index 2a831d8697..8bbe0fd7fb 100644 --- a/src/walberla_bridge/src/electrokinetics/generated_kernels/DiffusiveFluxKernelWithElectrostaticThermalized_single_precision.cpp +++ b/src/walberla_bridge/src/electrokinetics/generated_kernels/DiffusiveFluxKernelWithElectrostaticThermalized_single_precision.cpp @@ -49,13 +49,9 @@ namespace pystencils { namespace internal_e04f3d5b3f93f09e4de6aba968e70d10 { static FUNC_PREFIX void diffusivefluxkernelwithelectrostaticthermalized_single_precision_diffusivefluxkernelwithelectrostaticthermalized_single_precision(float D, float *RESTRICT const _data_j, float *RESTRICT const _data_phi, float *RESTRICT const _data_rho, int64_t const _size_j_0, int64_t const _size_j_1, int64_t const _size_j_2, int64_t const _stride_j_0, int64_t const _stride_j_1, int64_t const _stride_j_2, int64_t const _stride_j_3, int64_t const _stride_phi_0, int64_t const _stride_phi_1, int64_t const _stride_phi_2, int64_t const _stride_rho_0, int64_t const _stride_rho_1, int64_t const _stride_rho_2, uint32_t block_offset_0, uint32_t block_offset_1, uint32_t block_offset_2, float f_ext_0, float f_ext_1, float f_ext_2, uint32_t field_size_0, uint32_t field_size_1, uint32_t field_size_2, float kT, uint32_t seed, uint32_t time_step, float z) { -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_2 = 0; ctr_2 < _size_j_2; ctr_2 += 1) { for (int64_t ctr_1 = 0; ctr_1 < _size_j_1; ctr_1 += 1) { for (int64_t ctr_0 = 1; ctr_0 < _size_j_0; ctr_0 += 1) { diff --git a/src/walberla_bridge/src/electrokinetics/generated_kernels/DiffusiveFluxKernelWithElectrostatic_double_precision.cpp b/src/walberla_bridge/src/electrokinetics/generated_kernels/DiffusiveFluxKernelWithElectrostatic_double_precision.cpp index a8494e9f7c..8735d2ca64 100644 --- a/src/walberla_bridge/src/electrokinetics/generated_kernels/DiffusiveFluxKernelWithElectrostatic_double_precision.cpp +++ b/src/walberla_bridge/src/electrokinetics/generated_kernels/DiffusiveFluxKernelWithElectrostatic_double_precision.cpp @@ -47,13 +47,9 @@ namespace pystencils { namespace internal_32fac7f834b08f4a768ccef85dadf7a1 { static FUNC_PREFIX void diffusivefluxkernelwithelectrostatic_double_precision_diffusivefluxkernelwithelectrostatic_double_precision(double D, double *RESTRICT const _data_j, double *RESTRICT const _data_phi, double *RESTRICT const _data_rho, int64_t const _size_j_0, int64_t const _size_j_1, int64_t const _size_j_2, int64_t const _stride_j_0, int64_t const _stride_j_1, int64_t const _stride_j_2, int64_t const _stride_j_3, int64_t const _stride_phi_0, int64_t const _stride_phi_1, int64_t const _stride_phi_2, int64_t const _stride_rho_0, int64_t const _stride_rho_1, int64_t const _stride_rho_2, double f_ext_0, double f_ext_1, double f_ext_2, double kT, double z) { -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_2 = 0; ctr_2 < _size_j_2; ctr_2 += 1) { for (int64_t ctr_1 = 0; ctr_1 < _size_j_1; ctr_1 += 1) { for (int64_t ctr_0 = 1; ctr_0 < _size_j_0; ctr_0 += 1) { diff --git a/src/walberla_bridge/src/electrokinetics/generated_kernels/DiffusiveFluxKernelWithElectrostatic_single_precision.cpp b/src/walberla_bridge/src/electrokinetics/generated_kernels/DiffusiveFluxKernelWithElectrostatic_single_precision.cpp index 54cbc09bd0..5428d6e8cf 100644 --- a/src/walberla_bridge/src/electrokinetics/generated_kernels/DiffusiveFluxKernelWithElectrostatic_single_precision.cpp +++ b/src/walberla_bridge/src/electrokinetics/generated_kernels/DiffusiveFluxKernelWithElectrostatic_single_precision.cpp @@ -47,13 +47,9 @@ namespace pystencils { namespace internal_823ab2463d465630661d5edc8f90930c { static FUNC_PREFIX void diffusivefluxkernelwithelectrostatic_single_precision_diffusivefluxkernelwithelectrostatic_single_precision(float D, float *RESTRICT const _data_j, float *RESTRICT const _data_phi, float *RESTRICT const _data_rho, int64_t const _size_j_0, int64_t const _size_j_1, int64_t const _size_j_2, int64_t const _stride_j_0, int64_t const _stride_j_1, int64_t const _stride_j_2, int64_t const _stride_j_3, int64_t const _stride_phi_0, int64_t const _stride_phi_1, int64_t const _stride_phi_2, int64_t const _stride_rho_0, int64_t const _stride_rho_1, int64_t const _stride_rho_2, float f_ext_0, float f_ext_1, float f_ext_2, float kT, float z) { -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_2 = 0; ctr_2 < _size_j_2; ctr_2 += 1) { for (int64_t ctr_1 = 0; ctr_1 < _size_j_1; ctr_1 += 1) { for (int64_t ctr_0 = 1; ctr_0 < _size_j_0; ctr_0 += 1) { diff --git a/src/walberla_bridge/src/electrokinetics/generated_kernels/DiffusiveFluxKernel_double_precision.cpp b/src/walberla_bridge/src/electrokinetics/generated_kernels/DiffusiveFluxKernel_double_precision.cpp index 755df2043e..54d3197196 100644 --- a/src/walberla_bridge/src/electrokinetics/generated_kernels/DiffusiveFluxKernel_double_precision.cpp +++ b/src/walberla_bridge/src/electrokinetics/generated_kernels/DiffusiveFluxKernel_double_precision.cpp @@ -47,13 +47,9 @@ namespace pystencils { namespace internal_e5e04d1215f19faa51f3c55db6d456a2 { static FUNC_PREFIX void diffusivefluxkernel_double_precision_diffusivefluxkernel_double_precision(double D, double *RESTRICT const _data_j, double *RESTRICT const _data_rho, int64_t const _size_j_0, int64_t const _size_j_1, int64_t const _size_j_2, int64_t const _stride_j_0, int64_t const _stride_j_1, int64_t const _stride_j_2, int64_t const _stride_j_3, int64_t const _stride_rho_0, int64_t const _stride_rho_1, int64_t const _stride_rho_2) { -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_2 = 0; ctr_2 < _size_j_2; ctr_2 += 1) { for (int64_t ctr_1 = 0; ctr_1 < _size_j_1; ctr_1 += 1) { for (int64_t ctr_0 = 1; ctr_0 < _size_j_0; ctr_0 += 1) { diff --git a/src/walberla_bridge/src/electrokinetics/generated_kernels/DiffusiveFluxKernel_single_precision.cpp b/src/walberla_bridge/src/electrokinetics/generated_kernels/DiffusiveFluxKernel_single_precision.cpp index 8c07240329..0dfcdd22cc 100644 --- a/src/walberla_bridge/src/electrokinetics/generated_kernels/DiffusiveFluxKernel_single_precision.cpp +++ b/src/walberla_bridge/src/electrokinetics/generated_kernels/DiffusiveFluxKernel_single_precision.cpp @@ -47,13 +47,9 @@ namespace pystencils { namespace internal_2fab63cfdbacde4ac630f257442231a8 { static FUNC_PREFIX void diffusivefluxkernel_single_precision_diffusivefluxkernel_single_precision(float D, float *RESTRICT const _data_j, float *RESTRICT const _data_rho, int64_t const _size_j_0, int64_t const _size_j_1, int64_t const _size_j_2, int64_t const _stride_j_0, int64_t const _stride_j_1, int64_t const _stride_j_2, int64_t const _stride_j_3, int64_t const _stride_rho_0, int64_t const _stride_rho_1, int64_t const _stride_rho_2) { -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_2 = 0; ctr_2 < _size_j_2; ctr_2 += 1) { for (int64_t ctr_1 = 0; ctr_1 < _size_j_1; ctr_1 += 1) { for (int64_t ctr_0 = 1; ctr_0 < _size_j_0; ctr_0 += 1) { diff --git a/src/walberla_bridge/src/electrokinetics/generated_kernels/Dirichlet_double_precision.cpp b/src/walberla_bridge/src/electrokinetics/generated_kernels/Dirichlet_double_precision.cpp index 55f56a17d3..e053e6b37e 100644 --- a/src/walberla_bridge/src/electrokinetics/generated_kernels/Dirichlet_double_precision.cpp +++ b/src/walberla_bridge/src/electrokinetics/generated_kernels/Dirichlet_double_precision.cpp @@ -48,13 +48,9 @@ namespace pystencils { // NOLINTBEGIN(readability-non-const-parameter*) namespace internal_74da74b67a122b7887d3d21c7ea5f414 { static FUNC_PREFIX void dirichlet_double_precision_boundary_Dirichlet_double_precision(double *RESTRICT _data_field, uint8_t *RESTRICT const _data_indexVector, int64_t const _stride_field_0, int64_t const _stride_field_1, int64_t const _stride_field_2, int32_t indexVectorSize) { -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_0 = 0; ctr_0 < indexVectorSize; ctr_0 += 1) { const int32_t x = *((int32_t *)(&_data_indexVector[24 * ctr_0])); const int32_t y = *((int32_t *)(&_data_indexVector[24 * ctr_0 + 4])); diff --git a/src/walberla_bridge/src/electrokinetics/generated_kernels/Dirichlet_single_precision.cpp b/src/walberla_bridge/src/electrokinetics/generated_kernels/Dirichlet_single_precision.cpp index 03553d09c7..c2adcd77ed 100644 --- a/src/walberla_bridge/src/electrokinetics/generated_kernels/Dirichlet_single_precision.cpp +++ b/src/walberla_bridge/src/electrokinetics/generated_kernels/Dirichlet_single_precision.cpp @@ -48,13 +48,9 @@ namespace pystencils { // NOLINTBEGIN(readability-non-const-parameter*) namespace internal_43f4eae176e72ad2d9db0f0468064c30 { static FUNC_PREFIX void dirichlet_single_precision_boundary_Dirichlet_single_precision(float *RESTRICT _data_field, uint8_t *RESTRICT const _data_indexVector, int64_t const _stride_field_0, int64_t const _stride_field_1, int64_t const _stride_field_2, int32_t indexVectorSize) { -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_0 = 0; ctr_0 < indexVectorSize; ctr_0 += 1) { const int32_t x = *((int32_t *)(&_data_indexVector[20 * ctr_0])); const int32_t y = *((int32_t *)(&_data_indexVector[20 * ctr_0 + 4])); diff --git a/src/walberla_bridge/src/electrokinetics/generated_kernels/FixedFlux_double_precision.cpp b/src/walberla_bridge/src/electrokinetics/generated_kernels/FixedFlux_double_precision.cpp index 47ada80214..02a9b3094a 100644 --- a/src/walberla_bridge/src/electrokinetics/generated_kernels/FixedFlux_double_precision.cpp +++ b/src/walberla_bridge/src/electrokinetics/generated_kernels/FixedFlux_double_precision.cpp @@ -48,13 +48,9 @@ namespace pystencils { // NOLINTBEGIN(readability-non-const-parameter*) namespace internal_bdec58bfeb737088cd218660bd069d85 { static FUNC_PREFIX void fixedflux_double_precision_boundary_FixedFlux_double_precision(double *RESTRICT const _data_flux, uint8_t *RESTRICT const _data_indexVector, int64_t const _stride_flux_0, int64_t const _stride_flux_1, int64_t const _stride_flux_2, int64_t const _stride_flux_3, int32_t indexVectorSize) { -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_0 = 0; ctr_0 < indexVectorSize; ctr_0 += 1) { const int32_t x = *((int32_t *)(&_data_indexVector[40 * ctr_0])); const int32_t y = *((int32_t *)(&_data_indexVector[40 * ctr_0 + 4])); diff --git a/src/walberla_bridge/src/electrokinetics/generated_kernels/FixedFlux_single_precision.cpp b/src/walberla_bridge/src/electrokinetics/generated_kernels/FixedFlux_single_precision.cpp index 34290da483..d10dfc320b 100644 --- a/src/walberla_bridge/src/electrokinetics/generated_kernels/FixedFlux_single_precision.cpp +++ b/src/walberla_bridge/src/electrokinetics/generated_kernels/FixedFlux_single_precision.cpp @@ -48,13 +48,9 @@ namespace pystencils { // NOLINTBEGIN(readability-non-const-parameter*) namespace internal_11b127eed0b5044a0a655e8444f26034 { static FUNC_PREFIX void fixedflux_single_precision_boundary_FixedFlux_single_precision(float *RESTRICT const _data_flux, uint8_t *RESTRICT const _data_indexVector, int64_t const _stride_flux_0, int64_t const _stride_flux_1, int64_t const _stride_flux_2, int64_t const _stride_flux_3, int32_t indexVectorSize) { -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_0 = 0; ctr_0 < indexVectorSize; ctr_0 += 1) { const int32_t x = *((int32_t *)(&_data_indexVector[28 * ctr_0])); const int32_t y = *((int32_t *)(&_data_indexVector[28 * ctr_0 + 4])); diff --git a/src/walberla_bridge/src/electrokinetics/generated_kernels/FrictionCouplingKernel_double_precision.cpp b/src/walberla_bridge/src/electrokinetics/generated_kernels/FrictionCouplingKernel_double_precision.cpp index 13b17edf12..2f9c749b88 100644 --- a/src/walberla_bridge/src/electrokinetics/generated_kernels/FrictionCouplingKernel_double_precision.cpp +++ b/src/walberla_bridge/src/electrokinetics/generated_kernels/FrictionCouplingKernel_double_precision.cpp @@ -47,13 +47,9 @@ namespace pystencils { namespace internal_828cb3fbc90c26a23ae54639862a1401 { static FUNC_PREFIX void frictioncouplingkernel_double_precision_frictioncouplingkernel_double_precision(double D, double *RESTRICT _data_f, double *RESTRICT const _data_j, int64_t const _size_f_0, int64_t const _size_f_1, int64_t const _size_f_2, int64_t const _stride_f_0, int64_t const _stride_f_1, int64_t const _stride_f_2, int64_t const _stride_f_3, int64_t const _stride_j_0, int64_t const _stride_j_1, int64_t const _stride_j_2, int64_t const _stride_j_3, double kT, double rho_lb) { -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_2 = 1; ctr_2 < _size_f_2 - 1; ctr_2 += 1) { for (int64_t ctr_1 = 1; ctr_1 < _size_f_1 - 1; ctr_1 += 1) { for (int64_t ctr_0 = 1; ctr_0 < _size_f_0 - 1; ctr_0 += 1) { diff --git a/src/walberla_bridge/src/electrokinetics/generated_kernels/FrictionCouplingKernel_single_precision.cpp b/src/walberla_bridge/src/electrokinetics/generated_kernels/FrictionCouplingKernel_single_precision.cpp index 7d938a53b7..1d14810f9a 100644 --- a/src/walberla_bridge/src/electrokinetics/generated_kernels/FrictionCouplingKernel_single_precision.cpp +++ b/src/walberla_bridge/src/electrokinetics/generated_kernels/FrictionCouplingKernel_single_precision.cpp @@ -47,13 +47,9 @@ namespace pystencils { namespace internal_910e9429dc8b77dbed969a16d3f227fb { static FUNC_PREFIX void frictioncouplingkernel_single_precision_frictioncouplingkernel_single_precision(float D, float *RESTRICT _data_f, float *RESTRICT const _data_j, int64_t const _size_f_0, int64_t const _size_f_1, int64_t const _size_f_2, int64_t const _stride_f_0, int64_t const _stride_f_1, int64_t const _stride_f_2, int64_t const _stride_f_3, int64_t const _stride_j_0, int64_t const _stride_j_1, int64_t const _stride_j_2, int64_t const _stride_j_3, float kT, float rho_lb) { -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_2 = 1; ctr_2 < _size_f_2 - 1; ctr_2 += 1) { for (int64_t ctr_1 = 1; ctr_1 < _size_f_1 - 1; ctr_1 += 1) { for (int64_t ctr_0 = 1; ctr_0 < _size_f_0 - 1; ctr_0 += 1) { diff --git a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelBulk_1_double_precision.cpp b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelBulk_1_double_precision.cpp index ca35c9e105..5c28b3985b 100644 --- a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelBulk_1_double_precision.cpp +++ b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelBulk_1_double_precision.cpp @@ -47,13 +47,9 @@ namespace pystencils { namespace internal_a94c3c474646ee6905a4b90e8ccc47e6 { static FUNC_PREFIX void reactionkernelbulk_1_double_precision_reactionkernelbulk_1_double_precision(double *RESTRICT _data_rho_0, int64_t const _size_rho_0_0, int64_t const _size_rho_0_1, int64_t const _size_rho_0_2, int64_t const _stride_rho_0_0, int64_t const _stride_rho_0_1, int64_t const _stride_rho_0_2, double order_0, double rate_coefficient, double stoech_0) { -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_2 = 0; ctr_2 < _size_rho_0_2; ctr_2 += 1) { for (int64_t ctr_1 = 0; ctr_1 < _size_rho_0_1; ctr_1 += 1) { for (int64_t ctr_0 = 0; ctr_0 < _size_rho_0_0; ctr_0 += 1) { diff --git a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelBulk_1_single_precision.cpp b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelBulk_1_single_precision.cpp index f3d25c1abe..2af982b33c 100644 --- a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelBulk_1_single_precision.cpp +++ b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelBulk_1_single_precision.cpp @@ -47,13 +47,9 @@ namespace pystencils { namespace internal_2510542a202e1c11a0d58a7e565459bb { static FUNC_PREFIX void reactionkernelbulk_1_single_precision_reactionkernelbulk_1_single_precision(float *RESTRICT _data_rho_0, int64_t const _size_rho_0_0, int64_t const _size_rho_0_1, int64_t const _size_rho_0_2, int64_t const _stride_rho_0_0, int64_t const _stride_rho_0_1, int64_t const _stride_rho_0_2, float order_0, float rate_coefficient, float stoech_0) { -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_2 = 0; ctr_2 < _size_rho_0_2; ctr_2 += 1) { for (int64_t ctr_1 = 0; ctr_1 < _size_rho_0_1; ctr_1 += 1) { for (int64_t ctr_0 = 0; ctr_0 < _size_rho_0_0; ctr_0 += 1) { diff --git a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelBulk_2_double_precision.cpp b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelBulk_2_double_precision.cpp index 1e0c9dfc8b..d4b98ecb43 100644 --- a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelBulk_2_double_precision.cpp +++ b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelBulk_2_double_precision.cpp @@ -47,13 +47,9 @@ namespace pystencils { namespace internal_2cb10021ef8890fa965cb94996ae1510 { static FUNC_PREFIX void reactionkernelbulk_2_double_precision_reactionkernelbulk_2_double_precision(double *RESTRICT _data_rho_0, double *RESTRICT _data_rho_1, int64_t const _size_rho_0_0, int64_t const _size_rho_0_1, int64_t const _size_rho_0_2, int64_t const _stride_rho_0_0, int64_t const _stride_rho_0_1, int64_t const _stride_rho_0_2, int64_t const _stride_rho_1_0, int64_t const _stride_rho_1_1, int64_t const _stride_rho_1_2, double order_0, double order_1, double rate_coefficient, double stoech_0, double stoech_1) { -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_2 = 0; ctr_2 < _size_rho_0_2; ctr_2 += 1) { for (int64_t ctr_1 = 0; ctr_1 < _size_rho_0_1; ctr_1 += 1) { for (int64_t ctr_0 = 0; ctr_0 < _size_rho_0_0; ctr_0 += 1) { diff --git a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelBulk_2_single_precision.cpp b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelBulk_2_single_precision.cpp index b3ae607030..97308b941c 100644 --- a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelBulk_2_single_precision.cpp +++ b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelBulk_2_single_precision.cpp @@ -47,13 +47,9 @@ namespace pystencils { namespace internal_6de92b64acc501777cd14903620af26b { static FUNC_PREFIX void reactionkernelbulk_2_single_precision_reactionkernelbulk_2_single_precision(float *RESTRICT _data_rho_0, float *RESTRICT _data_rho_1, int64_t const _size_rho_0_0, int64_t const _size_rho_0_1, int64_t const _size_rho_0_2, int64_t const _stride_rho_0_0, int64_t const _stride_rho_0_1, int64_t const _stride_rho_0_2, int64_t const _stride_rho_1_0, int64_t const _stride_rho_1_1, int64_t const _stride_rho_1_2, float order_0, float order_1, float rate_coefficient, float stoech_0, float stoech_1) { -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_2 = 0; ctr_2 < _size_rho_0_2; ctr_2 += 1) { for (int64_t ctr_1 = 0; ctr_1 < _size_rho_0_1; ctr_1 += 1) { for (int64_t ctr_0 = 0; ctr_0 < _size_rho_0_0; ctr_0 += 1) { diff --git a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelBulk_3_double_precision.cpp b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelBulk_3_double_precision.cpp index 9fef5432ad..8f97c2f9da 100644 --- a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelBulk_3_double_precision.cpp +++ b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelBulk_3_double_precision.cpp @@ -47,13 +47,9 @@ namespace pystencils { namespace internal_d3ec035b42efecb474f5d17499de6537 { static FUNC_PREFIX void reactionkernelbulk_3_double_precision_reactionkernelbulk_3_double_precision(double *RESTRICT _data_rho_0, double *RESTRICT _data_rho_1, double *RESTRICT _data_rho_2, int64_t const _size_rho_0_0, int64_t const _size_rho_0_1, int64_t const _size_rho_0_2, int64_t const _stride_rho_0_0, int64_t const _stride_rho_0_1, int64_t const _stride_rho_0_2, int64_t const _stride_rho_1_0, int64_t const _stride_rho_1_1, int64_t const _stride_rho_1_2, int64_t const _stride_rho_2_0, int64_t const _stride_rho_2_1, int64_t const _stride_rho_2_2, double order_0, double order_1, double order_2, double rate_coefficient, double stoech_0, double stoech_1, double stoech_2) { -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_2 = 0; ctr_2 < _size_rho_0_2; ctr_2 += 1) { for (int64_t ctr_1 = 0; ctr_1 < _size_rho_0_1; ctr_1 += 1) { for (int64_t ctr_0 = 0; ctr_0 < _size_rho_0_0; ctr_0 += 1) { diff --git a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelBulk_3_single_precision.cpp b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelBulk_3_single_precision.cpp index d62192a62e..d6542d28bf 100644 --- a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelBulk_3_single_precision.cpp +++ b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelBulk_3_single_precision.cpp @@ -47,13 +47,9 @@ namespace pystencils { namespace internal_54fb5dcfe8687c5ab8c7b22acb6d285f { static FUNC_PREFIX void reactionkernelbulk_3_single_precision_reactionkernelbulk_3_single_precision(float *RESTRICT _data_rho_0, float *RESTRICT _data_rho_1, float *RESTRICT _data_rho_2, int64_t const _size_rho_0_0, int64_t const _size_rho_0_1, int64_t const _size_rho_0_2, int64_t const _stride_rho_0_0, int64_t const _stride_rho_0_1, int64_t const _stride_rho_0_2, int64_t const _stride_rho_1_0, int64_t const _stride_rho_1_1, int64_t const _stride_rho_1_2, int64_t const _stride_rho_2_0, int64_t const _stride_rho_2_1, int64_t const _stride_rho_2_2, float order_0, float order_1, float order_2, float rate_coefficient, float stoech_0, float stoech_1, float stoech_2) { -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_2 = 0; ctr_2 < _size_rho_0_2; ctr_2 += 1) { for (int64_t ctr_1 = 0; ctr_1 < _size_rho_0_1; ctr_1 += 1) { for (int64_t ctr_0 = 0; ctr_0 < _size_rho_0_0; ctr_0 += 1) { diff --git a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelBulk_4_double_precision.cpp b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelBulk_4_double_precision.cpp index cd99501b2e..6b130a2a4a 100644 --- a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelBulk_4_double_precision.cpp +++ b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelBulk_4_double_precision.cpp @@ -47,13 +47,9 @@ namespace pystencils { namespace internal_49f1aaa6789b7fa16fb103a21ce6fe12 { static FUNC_PREFIX void reactionkernelbulk_4_double_precision_reactionkernelbulk_4_double_precision(double *RESTRICT _data_rho_0, double *RESTRICT _data_rho_1, double *RESTRICT _data_rho_2, double *RESTRICT _data_rho_3, int64_t const _size_rho_0_0, int64_t const _size_rho_0_1, int64_t const _size_rho_0_2, int64_t const _stride_rho_0_0, int64_t const _stride_rho_0_1, int64_t const _stride_rho_0_2, int64_t const _stride_rho_1_0, int64_t const _stride_rho_1_1, int64_t const _stride_rho_1_2, int64_t const _stride_rho_2_0, int64_t const _stride_rho_2_1, int64_t const _stride_rho_2_2, int64_t const _stride_rho_3_0, int64_t const _stride_rho_3_1, int64_t const _stride_rho_3_2, double order_0, double order_1, double order_2, double order_3, double rate_coefficient, double stoech_0, double stoech_1, double stoech_2, double stoech_3) { -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_2 = 0; ctr_2 < _size_rho_0_2; ctr_2 += 1) { for (int64_t ctr_1 = 0; ctr_1 < _size_rho_0_1; ctr_1 += 1) { for (int64_t ctr_0 = 0; ctr_0 < _size_rho_0_0; ctr_0 += 1) { diff --git a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelBulk_4_single_precision.cpp b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelBulk_4_single_precision.cpp index a4db4bacb3..fe2b0b2125 100644 --- a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelBulk_4_single_precision.cpp +++ b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelBulk_4_single_precision.cpp @@ -47,13 +47,9 @@ namespace pystencils { namespace internal_716e8e56e191f2f523734cd5e32cecbb { static FUNC_PREFIX void reactionkernelbulk_4_single_precision_reactionkernelbulk_4_single_precision(float *RESTRICT _data_rho_0, float *RESTRICT _data_rho_1, float *RESTRICT _data_rho_2, float *RESTRICT _data_rho_3, int64_t const _size_rho_0_0, int64_t const _size_rho_0_1, int64_t const _size_rho_0_2, int64_t const _stride_rho_0_0, int64_t const _stride_rho_0_1, int64_t const _stride_rho_0_2, int64_t const _stride_rho_1_0, int64_t const _stride_rho_1_1, int64_t const _stride_rho_1_2, int64_t const _stride_rho_2_0, int64_t const _stride_rho_2_1, int64_t const _stride_rho_2_2, int64_t const _stride_rho_3_0, int64_t const _stride_rho_3_1, int64_t const _stride_rho_3_2, float order_0, float order_1, float order_2, float order_3, float rate_coefficient, float stoech_0, float stoech_1, float stoech_2, float stoech_3) { -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_2 = 0; ctr_2 < _size_rho_0_2; ctr_2 += 1) { for (int64_t ctr_1 = 0; ctr_1 < _size_rho_0_1; ctr_1 += 1) { for (int64_t ctr_0 = 0; ctr_0 < _size_rho_0_0; ctr_0 += 1) { diff --git a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelBulk_5_double_precision.cpp b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelBulk_5_double_precision.cpp index fab6d5e34c..1ec62fea34 100644 --- a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelBulk_5_double_precision.cpp +++ b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelBulk_5_double_precision.cpp @@ -47,13 +47,9 @@ namespace pystencils { namespace internal_5119d69793e3096feaaca816d627c080 { static FUNC_PREFIX void reactionkernelbulk_5_double_precision_reactionkernelbulk_5_double_precision(double *RESTRICT _data_rho_0, double *RESTRICT _data_rho_1, double *RESTRICT _data_rho_2, double *RESTRICT _data_rho_3, double *RESTRICT _data_rho_4, int64_t const _size_rho_0_0, int64_t const _size_rho_0_1, int64_t const _size_rho_0_2, int64_t const _stride_rho_0_0, int64_t const _stride_rho_0_1, int64_t const _stride_rho_0_2, int64_t const _stride_rho_1_0, int64_t const _stride_rho_1_1, int64_t const _stride_rho_1_2, int64_t const _stride_rho_2_0, int64_t const _stride_rho_2_1, int64_t const _stride_rho_2_2, int64_t const _stride_rho_3_0, int64_t const _stride_rho_3_1, int64_t const _stride_rho_3_2, int64_t const _stride_rho_4_0, int64_t const _stride_rho_4_1, int64_t const _stride_rho_4_2, double order_0, double order_1, double order_2, double order_3, double order_4, double rate_coefficient, double stoech_0, double stoech_1, double stoech_2, double stoech_3, double stoech_4) { -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_2 = 0; ctr_2 < _size_rho_0_2; ctr_2 += 1) { for (int64_t ctr_1 = 0; ctr_1 < _size_rho_0_1; ctr_1 += 1) { for (int64_t ctr_0 = 0; ctr_0 < _size_rho_0_0; ctr_0 += 1) { diff --git a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelBulk_5_single_precision.cpp b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelBulk_5_single_precision.cpp index e110f1561f..b4bf14d6fb 100644 --- a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelBulk_5_single_precision.cpp +++ b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelBulk_5_single_precision.cpp @@ -47,13 +47,9 @@ namespace pystencils { namespace internal_737d6904f7c65dcfc320d619f189641b { static FUNC_PREFIX void reactionkernelbulk_5_single_precision_reactionkernelbulk_5_single_precision(float *RESTRICT _data_rho_0, float *RESTRICT _data_rho_1, float *RESTRICT _data_rho_2, float *RESTRICT _data_rho_3, float *RESTRICT _data_rho_4, int64_t const _size_rho_0_0, int64_t const _size_rho_0_1, int64_t const _size_rho_0_2, int64_t const _stride_rho_0_0, int64_t const _stride_rho_0_1, int64_t const _stride_rho_0_2, int64_t const _stride_rho_1_0, int64_t const _stride_rho_1_1, int64_t const _stride_rho_1_2, int64_t const _stride_rho_2_0, int64_t const _stride_rho_2_1, int64_t const _stride_rho_2_2, int64_t const _stride_rho_3_0, int64_t const _stride_rho_3_1, int64_t const _stride_rho_3_2, int64_t const _stride_rho_4_0, int64_t const _stride_rho_4_1, int64_t const _stride_rho_4_2, float order_0, float order_1, float order_2, float order_3, float order_4, float rate_coefficient, float stoech_0, float stoech_1, float stoech_2, float stoech_3, float stoech_4) { -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_2 = 0; ctr_2 < _size_rho_0_2; ctr_2 += 1) { for (int64_t ctr_1 = 0; ctr_1 < _size_rho_0_1; ctr_1 += 1) { for (int64_t ctr_0 = 0; ctr_0 < _size_rho_0_0; ctr_0 += 1) { diff --git a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_1_double_precision.cpp b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_1_double_precision.cpp index 21cea87447..36e818e612 100644 --- a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_1_double_precision.cpp +++ b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_1_double_precision.cpp @@ -48,13 +48,9 @@ namespace pystencils { // NOLINTBEGIN(readability-non-const-parameter*) namespace internal_8dfd6fd44211225f575bfd4fd9f8b4cc { static FUNC_PREFIX void reactionkernelindexed_1_double_precision_boundary_ReactionKernelIndexed_1_double_precision(uint8_t *RESTRICT const _data_indexVector, double *RESTRICT _data_rho_0, int64_t const _stride_rho_0_0, int64_t const _stride_rho_0_1, int64_t const _stride_rho_0_2, int32_t indexVectorSize, double order_0, double rate_coefficient, double stoech_0) { -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_0 = 0; ctr_0 < indexVectorSize; ctr_0 += 1) { const int32_t x = *((int32_t *)(&_data_indexVector[12 * ctr_0])); const int32_t y = *((int32_t *)(&_data_indexVector[12 * ctr_0 + 4])); diff --git a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_1_single_precision.cpp b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_1_single_precision.cpp index c238878ef3..c188efa47c 100644 --- a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_1_single_precision.cpp +++ b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_1_single_precision.cpp @@ -48,13 +48,9 @@ namespace pystencils { // NOLINTBEGIN(readability-non-const-parameter*) namespace internal_6780d252234f1c174ca455eaed762815 { static FUNC_PREFIX void reactionkernelindexed_1_single_precision_boundary_ReactionKernelIndexed_1_single_precision(uint8_t *RESTRICT const _data_indexVector, float *RESTRICT _data_rho_0, int64_t const _stride_rho_0_0, int64_t const _stride_rho_0_1, int64_t const _stride_rho_0_2, int32_t indexVectorSize, float order_0, float rate_coefficient, float stoech_0) { -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_0 = 0; ctr_0 < indexVectorSize; ctr_0 += 1) { const int32_t x = *((int32_t *)(&_data_indexVector[12 * ctr_0])); const int32_t y = *((int32_t *)(&_data_indexVector[12 * ctr_0 + 4])); diff --git a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_2_double_precision.cpp b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_2_double_precision.cpp index 32a4309236..3be74b1131 100644 --- a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_2_double_precision.cpp +++ b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_2_double_precision.cpp @@ -48,13 +48,9 @@ namespace pystencils { // NOLINTBEGIN(readability-non-const-parameter*) namespace internal_1955c52e82759b23ee69574de97d7a03 { static FUNC_PREFIX void reactionkernelindexed_2_double_precision_boundary_ReactionKernelIndexed_2_double_precision(uint8_t *RESTRICT const _data_indexVector, double *RESTRICT _data_rho_0, double *RESTRICT _data_rho_1, int64_t const _stride_rho_0_0, int64_t const _stride_rho_0_1, int64_t const _stride_rho_0_2, int64_t const _stride_rho_1_0, int64_t const _stride_rho_1_1, int64_t const _stride_rho_1_2, int32_t indexVectorSize, double order_0, double order_1, double rate_coefficient, double stoech_0, double stoech_1) { -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_0 = 0; ctr_0 < indexVectorSize; ctr_0 += 1) { const int32_t x = *((int32_t *)(&_data_indexVector[12 * ctr_0])); const int32_t y = *((int32_t *)(&_data_indexVector[12 * ctr_0 + 4])); diff --git a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_2_single_precision.cpp b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_2_single_precision.cpp index 66c687bfa2..2e4601b667 100644 --- a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_2_single_precision.cpp +++ b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_2_single_precision.cpp @@ -48,13 +48,9 @@ namespace pystencils { // NOLINTBEGIN(readability-non-const-parameter*) namespace internal_65f3f69877a34020919311605a374bf2 { static FUNC_PREFIX void reactionkernelindexed_2_single_precision_boundary_ReactionKernelIndexed_2_single_precision(uint8_t *RESTRICT const _data_indexVector, float *RESTRICT _data_rho_0, float *RESTRICT _data_rho_1, int64_t const _stride_rho_0_0, int64_t const _stride_rho_0_1, int64_t const _stride_rho_0_2, int64_t const _stride_rho_1_0, int64_t const _stride_rho_1_1, int64_t const _stride_rho_1_2, int32_t indexVectorSize, float order_0, float order_1, float rate_coefficient, float stoech_0, float stoech_1) { -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_0 = 0; ctr_0 < indexVectorSize; ctr_0 += 1) { const int32_t x = *((int32_t *)(&_data_indexVector[12 * ctr_0])); const int32_t y = *((int32_t *)(&_data_indexVector[12 * ctr_0 + 4])); diff --git a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_3_double_precision.cpp b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_3_double_precision.cpp index 472553f795..e70b853247 100644 --- a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_3_double_precision.cpp +++ b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_3_double_precision.cpp @@ -48,13 +48,9 @@ namespace pystencils { // NOLINTBEGIN(readability-non-const-parameter*) namespace internal_8edace03832e2e7c5856c1019b5b9697 { static FUNC_PREFIX void reactionkernelindexed_3_double_precision_boundary_ReactionKernelIndexed_3_double_precision(uint8_t *RESTRICT const _data_indexVector, double *RESTRICT _data_rho_0, double *RESTRICT _data_rho_1, double *RESTRICT _data_rho_2, int64_t const _stride_rho_0_0, int64_t const _stride_rho_0_1, int64_t const _stride_rho_0_2, int64_t const _stride_rho_1_0, int64_t const _stride_rho_1_1, int64_t const _stride_rho_1_2, int64_t const _stride_rho_2_0, int64_t const _stride_rho_2_1, int64_t const _stride_rho_2_2, int32_t indexVectorSize, double order_0, double order_1, double order_2, double rate_coefficient, double stoech_0, double stoech_1, double stoech_2) { -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_0 = 0; ctr_0 < indexVectorSize; ctr_0 += 1) { const int32_t x = *((int32_t *)(&_data_indexVector[12 * ctr_0])); const int32_t y = *((int32_t *)(&_data_indexVector[12 * ctr_0 + 4])); diff --git a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_3_single_precision.cpp b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_3_single_precision.cpp index f920957b6d..8cc106defa 100644 --- a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_3_single_precision.cpp +++ b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_3_single_precision.cpp @@ -48,13 +48,9 @@ namespace pystencils { // NOLINTBEGIN(readability-non-const-parameter*) namespace internal_a841832271ac54f2c38b03966a739283 { static FUNC_PREFIX void reactionkernelindexed_3_single_precision_boundary_ReactionKernelIndexed_3_single_precision(uint8_t *RESTRICT const _data_indexVector, float *RESTRICT _data_rho_0, float *RESTRICT _data_rho_1, float *RESTRICT _data_rho_2, int64_t const _stride_rho_0_0, int64_t const _stride_rho_0_1, int64_t const _stride_rho_0_2, int64_t const _stride_rho_1_0, int64_t const _stride_rho_1_1, int64_t const _stride_rho_1_2, int64_t const _stride_rho_2_0, int64_t const _stride_rho_2_1, int64_t const _stride_rho_2_2, int32_t indexVectorSize, float order_0, float order_1, float order_2, float rate_coefficient, float stoech_0, float stoech_1, float stoech_2) { -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_0 = 0; ctr_0 < indexVectorSize; ctr_0 += 1) { const int32_t x = *((int32_t *)(&_data_indexVector[12 * ctr_0])); const int32_t y = *((int32_t *)(&_data_indexVector[12 * ctr_0 + 4])); diff --git a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_4_double_precision.cpp b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_4_double_precision.cpp index 9eff95b6bb..95b9fef678 100644 --- a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_4_double_precision.cpp +++ b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_4_double_precision.cpp @@ -48,13 +48,9 @@ namespace pystencils { // NOLINTBEGIN(readability-non-const-parameter*) namespace internal_7ded543b40ca402e5e3102728843f000 { static FUNC_PREFIX void reactionkernelindexed_4_double_precision_boundary_ReactionKernelIndexed_4_double_precision(uint8_t *RESTRICT const _data_indexVector, double *RESTRICT _data_rho_0, double *RESTRICT _data_rho_1, double *RESTRICT _data_rho_2, double *RESTRICT _data_rho_3, int64_t const _stride_rho_0_0, int64_t const _stride_rho_0_1, int64_t const _stride_rho_0_2, int64_t const _stride_rho_1_0, int64_t const _stride_rho_1_1, int64_t const _stride_rho_1_2, int64_t const _stride_rho_2_0, int64_t const _stride_rho_2_1, int64_t const _stride_rho_2_2, int64_t const _stride_rho_3_0, int64_t const _stride_rho_3_1, int64_t const _stride_rho_3_2, int32_t indexVectorSize, double order_0, double order_1, double order_2, double order_3, double rate_coefficient, double stoech_0, double stoech_1, double stoech_2, double stoech_3) { -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_0 = 0; ctr_0 < indexVectorSize; ctr_0 += 1) { const int32_t x = *((int32_t *)(&_data_indexVector[12 * ctr_0])); const int32_t y = *((int32_t *)(&_data_indexVector[12 * ctr_0 + 4])); diff --git a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_4_single_precision.cpp b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_4_single_precision.cpp index 68808656a5..bc41081c7a 100644 --- a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_4_single_precision.cpp +++ b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_4_single_precision.cpp @@ -48,13 +48,9 @@ namespace pystencils { // NOLINTBEGIN(readability-non-const-parameter*) namespace internal_62195c7636fc531694c87493561447d7 { static FUNC_PREFIX void reactionkernelindexed_4_single_precision_boundary_ReactionKernelIndexed_4_single_precision(uint8_t *RESTRICT const _data_indexVector, float *RESTRICT _data_rho_0, float *RESTRICT _data_rho_1, float *RESTRICT _data_rho_2, float *RESTRICT _data_rho_3, int64_t const _stride_rho_0_0, int64_t const _stride_rho_0_1, int64_t const _stride_rho_0_2, int64_t const _stride_rho_1_0, int64_t const _stride_rho_1_1, int64_t const _stride_rho_1_2, int64_t const _stride_rho_2_0, int64_t const _stride_rho_2_1, int64_t const _stride_rho_2_2, int64_t const _stride_rho_3_0, int64_t const _stride_rho_3_1, int64_t const _stride_rho_3_2, int32_t indexVectorSize, float order_0, float order_1, float order_2, float order_3, float rate_coefficient, float stoech_0, float stoech_1, float stoech_2, float stoech_3) { -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_0 = 0; ctr_0 < indexVectorSize; ctr_0 += 1) { const int32_t x = *((int32_t *)(&_data_indexVector[12 * ctr_0])); const int32_t y = *((int32_t *)(&_data_indexVector[12 * ctr_0 + 4])); diff --git a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_5_double_precision.cpp b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_5_double_precision.cpp index 9590e1b6ab..1147f1dc95 100644 --- a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_5_double_precision.cpp +++ b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_5_double_precision.cpp @@ -48,13 +48,9 @@ namespace pystencils { // NOLINTBEGIN(readability-non-const-parameter*) namespace internal_714956d26e6eb81c5dec60e7ab7da8ab { static FUNC_PREFIX void reactionkernelindexed_5_double_precision_boundary_ReactionKernelIndexed_5_double_precision(uint8_t *RESTRICT const _data_indexVector, double *RESTRICT _data_rho_0, double *RESTRICT _data_rho_1, double *RESTRICT _data_rho_2, double *RESTRICT _data_rho_3, double *RESTRICT _data_rho_4, int64_t const _stride_rho_0_0, int64_t const _stride_rho_0_1, int64_t const _stride_rho_0_2, int64_t const _stride_rho_1_0, int64_t const _stride_rho_1_1, int64_t const _stride_rho_1_2, int64_t const _stride_rho_2_0, int64_t const _stride_rho_2_1, int64_t const _stride_rho_2_2, int64_t const _stride_rho_3_0, int64_t const _stride_rho_3_1, int64_t const _stride_rho_3_2, int64_t const _stride_rho_4_0, int64_t const _stride_rho_4_1, int64_t const _stride_rho_4_2, int32_t indexVectorSize, double order_0, double order_1, double order_2, double order_3, double order_4, double rate_coefficient, double stoech_0, double stoech_1, double stoech_2, double stoech_3, double stoech_4) { -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_0 = 0; ctr_0 < indexVectorSize; ctr_0 += 1) { const int32_t x = *((int32_t *)(&_data_indexVector[12 * ctr_0])); const int32_t y = *((int32_t *)(&_data_indexVector[12 * ctr_0 + 4])); diff --git a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_5_single_precision.cpp b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_5_single_precision.cpp index a3bafc0174..13b826d5d4 100644 --- a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_5_single_precision.cpp +++ b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_5_single_precision.cpp @@ -48,13 +48,9 @@ namespace pystencils { // NOLINTBEGIN(readability-non-const-parameter*) namespace internal_c656da8359b8f47f0007107280d91a58 { static FUNC_PREFIX void reactionkernelindexed_5_single_precision_boundary_ReactionKernelIndexed_5_single_precision(uint8_t *RESTRICT const _data_indexVector, float *RESTRICT _data_rho_0, float *RESTRICT _data_rho_1, float *RESTRICT _data_rho_2, float *RESTRICT _data_rho_3, float *RESTRICT _data_rho_4, int64_t const _stride_rho_0_0, int64_t const _stride_rho_0_1, int64_t const _stride_rho_0_2, int64_t const _stride_rho_1_0, int64_t const _stride_rho_1_1, int64_t const _stride_rho_1_2, int64_t const _stride_rho_2_0, int64_t const _stride_rho_2_1, int64_t const _stride_rho_2_2, int64_t const _stride_rho_3_0, int64_t const _stride_rho_3_1, int64_t const _stride_rho_3_2, int64_t const _stride_rho_4_0, int64_t const _stride_rho_4_1, int64_t const _stride_rho_4_2, int32_t indexVectorSize, float order_0, float order_1, float order_2, float order_3, float order_4, float rate_coefficient, float stoech_0, float stoech_1, float stoech_2, float stoech_3, float stoech_4) { -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_0 = 0; ctr_0 < indexVectorSize; ctr_0 += 1) { const int32_t x = *((int32_t *)(&_data_indexVector[12 * ctr_0])); const int32_t y = *((int32_t *)(&_data_indexVector[12 * ctr_0 + 4])); diff --git a/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/DynamicUBBDoublePrecision.cpp b/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/DynamicUBBDoublePrecision.cpp index 379fef2715..40cd049a37 100644 --- a/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/DynamicUBBDoublePrecision.cpp +++ b/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/DynamicUBBDoublePrecision.cpp @@ -60,13 +60,9 @@ static FUNC_PREFIX void dynamicubbdoubleprecision_boundary_DynamicUBBDoublePreci const int32_t neighbour_offset_y[] = {0, 1, -1, 0, 0, 0, 0, 1, 1, -1, -1, 1, -1, 0, 0, 1, -1, 0, 0}; const int32_t neighbour_offset_z[] = {0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 1, 1, 1, 1, -1, -1, -1, -1}; -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_0 = 0; ctr_0 < indexVectorSize; ctr_0 += 1) { const int32_t x = *((int32_t *)(&_data_indexVector[40 * ctr_0])); const int32_t y = *((int32_t *)(&_data_indexVector[40 * ctr_0 + 4])); diff --git a/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/DynamicUBBSinglePrecision.cpp b/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/DynamicUBBSinglePrecision.cpp index 823f9fe0d3..6638136a9f 100644 --- a/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/DynamicUBBSinglePrecision.cpp +++ b/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/DynamicUBBSinglePrecision.cpp @@ -60,13 +60,9 @@ static FUNC_PREFIX void dynamicubbsingleprecision_boundary_DynamicUBBSinglePreci const int32_t neighbour_offset_y[] = {0, 1, -1, 0, 0, 0, 0, 1, 1, -1, -1, 1, -1, 0, 0, 1, -1, 0, 0}; const int32_t neighbour_offset_z[] = {0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 1, 1, 1, 1, -1, -1, -1, -1}; -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_0 = 0; ctr_0 < indexVectorSize; ctr_0 += 1) { const int32_t x = *((int32_t *)(&_data_indexVector[28 * ctr_0])); const int32_t y = *((int32_t *)(&_data_indexVector[28 * ctr_0 + 4])); diff --git a/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/InitialPDFsSetterDoublePrecision.cpp b/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/InitialPDFsSetterDoublePrecision.cpp index cf6f563735..5d20bdbfd0 100644 --- a/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/InitialPDFsSetterDoublePrecision.cpp +++ b/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/InitialPDFsSetterDoublePrecision.cpp @@ -47,15 +47,11 @@ namespace pystencils { namespace internal_2df07fce91f5444fc18533f996cd1a79 { static FUNC_PREFIX void initialpdfssetterdoubleprecision_initialpdfssetterdoubleprecision(double *RESTRICT const _data_force, double *RESTRICT _data_pdfs, double *RESTRICT const _data_velocity, int64_t const _size_force_0, int64_t const _size_force_1, int64_t const _size_force_2, int64_t const _stride_force_0, int64_t const _stride_force_1, int64_t const _stride_force_2, int64_t const _stride_force_3, int64_t const _stride_pdfs_0, int64_t const _stride_pdfs_1, int64_t const _stride_pdfs_2, int64_t const _stride_pdfs_3, int64_t const _stride_velocity_0, int64_t const _stride_velocity_1, int64_t const _stride_velocity_2, int64_t const _stride_velocity_3, double rho_0) { -#ifdef _OPENMP #pragma omp parallel -#endif { const double rho = rho_0; const double delta_rho = rho - 1.0; -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_2 = 0; ctr_2 < _size_force_2; ctr_2 += 1) { for (int64_t ctr_1 = 0; ctr_1 < _size_force_1; ctr_1 += 1) { for (int64_t ctr_0 = 0; ctr_0 < _size_force_0; ctr_0 += 1) { diff --git a/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/InitialPDFsSetterSinglePrecision.cpp b/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/InitialPDFsSetterSinglePrecision.cpp index 2d0fc665d7..4f23975148 100644 --- a/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/InitialPDFsSetterSinglePrecision.cpp +++ b/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/InitialPDFsSetterSinglePrecision.cpp @@ -47,15 +47,11 @@ namespace pystencils { namespace internal_b8085d63d6b7e842485134abbac511e8 { static FUNC_PREFIX void initialpdfssettersingleprecision_initialpdfssettersingleprecision(float *RESTRICT const _data_force, float *RESTRICT _data_pdfs, float *RESTRICT const _data_velocity, int64_t const _size_force_0, int64_t const _size_force_1, int64_t const _size_force_2, int64_t const _stride_force_0, int64_t const _stride_force_1, int64_t const _stride_force_2, int64_t const _stride_force_3, int64_t const _stride_pdfs_0, int64_t const _stride_pdfs_1, int64_t const _stride_pdfs_2, int64_t const _stride_pdfs_3, int64_t const _stride_velocity_0, int64_t const _stride_velocity_1, int64_t const _stride_velocity_2, int64_t const _stride_velocity_3, float rho_0) { -#ifdef _OPENMP #pragma omp parallel -#endif { const float rho = rho_0; const float delta_rho = rho - 1.0f; -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_2 = 0; ctr_2 < _size_force_2; ctr_2 += 1) { for (int64_t ctr_1 = 0; ctr_1 < _size_force_1; ctr_1 += 1) { for (int64_t ctr_0 = 0; ctr_0 < _size_force_0; ctr_0 += 1) { diff --git a/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/StreamCollideSweepLeesEdwardsDoublePrecision.cpp b/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/StreamCollideSweepLeesEdwardsDoublePrecision.cpp index b87904598b..d7ecdb6b2e 100644 --- a/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/StreamCollideSweepLeesEdwardsDoublePrecision.cpp +++ b/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/StreamCollideSweepLeesEdwardsDoublePrecision.cpp @@ -47,9 +47,7 @@ namespace pystencils { namespace internal_1215ae06312aaf63d726636be94fdda3 { static FUNC_PREFIX void streamcollidesweepleesedwardsdoubleprecision_streamcollidesweepleesedwardsdoubleprecision(double *RESTRICT const _data_force, double *RESTRICT const _data_pdfs, double *RESTRICT _data_pdfs_tmp, int64_t const _size_force_0, int64_t const _size_force_1, int64_t const _size_force_2, int64_t const _stride_force_0, int64_t const _stride_force_1, int64_t const _stride_force_2, int64_t const _stride_force_3, int64_t const _stride_pdfs_0, int64_t const _stride_pdfs_1, int64_t const _stride_pdfs_2, int64_t const _stride_pdfs_3, int64_t const _stride_pdfs_tmp_0, int64_t const _stride_pdfs_tmp_1, int64_t const _stride_pdfs_tmp_2, int64_t const _stride_pdfs_tmp_3, int64_t lebc_bot_index, int64_t lebc_top_index, double omega_bulk, double omega_even, double omega_odd, double omega_shear, double v_s) { -#ifdef _OPENMP #pragma omp parallel -#endif { const double xi_20 = omega_bulk * 0.5; const double xi_47 = omega_shear * 0.041666666666666664; @@ -62,9 +60,7 @@ static FUNC_PREFIX void streamcollidesweepleesedwardsdoubleprecision_streamcolli const double xi_175 = omega_odd * 0.125; const double rr_0 = 0.0; const double xi_45 = rr_0 * 0.041666666666666664; -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_2 = 1; ctr_2 < _size_force_2 - 1; ctr_2 += 1) { for (int64_t ctr_1 = 1; ctr_1 < _size_force_1 - 1; ctr_1 += 1) { for (int64_t ctr_0 = 1; ctr_0 < _size_force_0 - 1; ctr_0 += 1) { diff --git a/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/StreamCollideSweepLeesEdwardsDoublePrecisionAVX.cpp b/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/StreamCollideSweepLeesEdwardsDoublePrecisionAVX.cpp index 6d20dacd85..edcf1578f6 100644 --- a/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/StreamCollideSweepLeesEdwardsDoublePrecisionAVX.cpp +++ b/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/StreamCollideSweepLeesEdwardsDoublePrecisionAVX.cpp @@ -49,9 +49,7 @@ namespace pystencils { namespace internal_08be08b6e7ea45132a735524ef494de6 { static FUNC_PREFIX void streamcollidesweepleesedwardsdoubleprecisionavx_streamcollidesweepleesedwardsdoubleprecisionavx(double *RESTRICT const _data_force, double *RESTRICT const _data_pdfs, double *RESTRICT _data_pdfs_tmp, int64_t const _size_force_0, int64_t const _size_force_1, int64_t const _size_force_2, int64_t const _stride_force_1, int64_t const _stride_force_2, int64_t const _stride_force_3, int64_t const _stride_pdfs_1, int64_t const _stride_pdfs_2, int64_t const _stride_pdfs_3, int64_t const _stride_pdfs_tmp_1, int64_t const _stride_pdfs_tmp_2, int64_t const _stride_pdfs_tmp_3, int64_t lebc_bot_index, int64_t lebc_top_index, double omega_bulk, double omega_even, double omega_odd, double omega_shear, double v_s) { -#ifdef _OPENMP #pragma omp parallel -#endif { const double xi_20 = omega_bulk * 0.5; const double xi_47 = omega_shear * 0.041666666666666664; @@ -64,9 +62,7 @@ static FUNC_PREFIX void streamcollidesweepleesedwardsdoubleprecisionavx_streamco const double xi_175 = omega_odd * 0.125; const double rr_0 = 0.0; const double xi_45 = rr_0 * 0.041666666666666664; -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_2 = 1; ctr_2 < _size_force_2 - 1; ctr_2 += 1) { for (int64_t ctr_1 = 1; ctr_1 < _size_force_1 - 1; ctr_1 += 1) { { diff --git a/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/StreamCollideSweepLeesEdwardsSinglePrecision.cpp b/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/StreamCollideSweepLeesEdwardsSinglePrecision.cpp index 7e6a0ad0b1..0f05aacc21 100644 --- a/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/StreamCollideSweepLeesEdwardsSinglePrecision.cpp +++ b/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/StreamCollideSweepLeesEdwardsSinglePrecision.cpp @@ -47,9 +47,7 @@ namespace pystencils { namespace internal_a263151a09bd9903959d48e17aef88f9 { static FUNC_PREFIX void streamcollidesweepleesedwardssingleprecision_streamcollidesweepleesedwardssingleprecision(float *RESTRICT const _data_force, float *RESTRICT const _data_pdfs, float *RESTRICT _data_pdfs_tmp, int64_t const _size_force_0, int64_t const _size_force_1, int64_t const _size_force_2, int64_t const _stride_force_0, int64_t const _stride_force_1, int64_t const _stride_force_2, int64_t const _stride_force_3, int64_t const _stride_pdfs_0, int64_t const _stride_pdfs_1, int64_t const _stride_pdfs_2, int64_t const _stride_pdfs_3, int64_t const _stride_pdfs_tmp_0, int64_t const _stride_pdfs_tmp_1, int64_t const _stride_pdfs_tmp_2, int64_t const _stride_pdfs_tmp_3, int64_t lebc_bot_index, int64_t lebc_top_index, float omega_bulk, float omega_even, float omega_odd, float omega_shear, float v_s) { -#ifdef _OPENMP #pragma omp parallel -#endif { const float xi_20 = omega_bulk * 0.5f; const float xi_47 = omega_shear * 0.041666666666666664f; @@ -62,9 +60,7 @@ static FUNC_PREFIX void streamcollidesweepleesedwardssingleprecision_streamcolli const float xi_175 = omega_odd * 0.125f; const float rr_0 = 0.0f; const float xi_45 = rr_0 * 0.041666666666666664f; -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_2 = 1; ctr_2 < _size_force_2 - 1; ctr_2 += 1) { for (int64_t ctr_1 = 1; ctr_1 < _size_force_1 - 1; ctr_1 += 1) { for (int64_t ctr_0 = 1; ctr_0 < _size_force_0 - 1; ctr_0 += 1) { diff --git a/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/StreamCollideSweepLeesEdwardsSinglePrecisionAVX.cpp b/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/StreamCollideSweepLeesEdwardsSinglePrecisionAVX.cpp index 3e17747448..cbff434b00 100644 --- a/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/StreamCollideSweepLeesEdwardsSinglePrecisionAVX.cpp +++ b/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/StreamCollideSweepLeesEdwardsSinglePrecisionAVX.cpp @@ -49,9 +49,7 @@ namespace pystencils { namespace internal_c275fa5bef4a1b9f30058dc82d50d3cf { static FUNC_PREFIX void streamcollidesweepleesedwardssingleprecisionavx_streamcollidesweepleesedwardssingleprecisionavx(float *RESTRICT const _data_force, float *RESTRICT const _data_pdfs, float *RESTRICT _data_pdfs_tmp, int64_t const _size_force_0, int64_t const _size_force_1, int64_t const _size_force_2, int64_t const _stride_force_1, int64_t const _stride_force_2, int64_t const _stride_force_3, int64_t const _stride_pdfs_1, int64_t const _stride_pdfs_2, int64_t const _stride_pdfs_3, int64_t const _stride_pdfs_tmp_1, int64_t const _stride_pdfs_tmp_2, int64_t const _stride_pdfs_tmp_3, int64_t lebc_bot_index, int64_t lebc_top_index, float omega_bulk, float omega_even, float omega_odd, float omega_shear, float v_s) { -#ifdef _OPENMP #pragma omp parallel -#endif { const float xi_20 = omega_bulk * 0.5f; const float xi_47 = omega_shear * 0.041666666666666664f; @@ -64,9 +62,7 @@ static FUNC_PREFIX void streamcollidesweepleesedwardssingleprecisionavx_streamco const float xi_175 = omega_odd * 0.125f; const float rr_0 = 0.0f; const float xi_45 = rr_0 * 0.041666666666666664f; -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_2 = 1; ctr_2 < _size_force_2 - 1; ctr_2 += 1) { for (int64_t ctr_1 = 1; ctr_1 < _size_force_1 - 1; ctr_1 += 1) { { diff --git a/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/StreamCollideSweepThermalizedDoublePrecision.cpp b/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/StreamCollideSweepThermalizedDoublePrecision.cpp index ac4c18e4d3..92251efebb 100644 --- a/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/StreamCollideSweepThermalizedDoublePrecision.cpp +++ b/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/StreamCollideSweepThermalizedDoublePrecision.cpp @@ -49,9 +49,7 @@ namespace pystencils { namespace internal_fa53b6994358d65dbc792fd71884c2e7 { static FUNC_PREFIX void streamcollidesweepthermalizeddoubleprecision_streamcollidesweepthermalizeddoubleprecision(double *RESTRICT const _data_force, double *RESTRICT const _data_pdfs, double *RESTRICT _data_pdfs_tmp, int64_t const _size_force_0, int64_t const _size_force_1, int64_t const _size_force_2, int64_t const _stride_force_0, int64_t const _stride_force_1, int64_t const _stride_force_2, int64_t const _stride_force_3, int64_t const _stride_pdfs_0, int64_t const _stride_pdfs_1, int64_t const _stride_pdfs_2, int64_t const _stride_pdfs_3, int64_t const _stride_pdfs_tmp_0, int64_t const _stride_pdfs_tmp_1, int64_t const _stride_pdfs_tmp_2, int64_t const _stride_pdfs_tmp_3, uint32_t block_offset_0, uint32_t block_offset_1, uint32_t block_offset_2, double kT, double omega_bulk, double omega_even, double omega_odd, double omega_shear, uint32_t seed, uint32_t time_step) { -#ifdef _OPENMP #pragma omp parallel -#endif { const double xi_20 = omega_bulk * 0.5; const double xi_47 = omega_shear * 0.041666666666666664; @@ -69,9 +67,7 @@ static FUNC_PREFIX void streamcollidesweepthermalizeddoubleprecision_streamcolli const double xi_226 = omega_odd * 0.125; const double rr_0 = 0.0; const double xi_45 = rr_0 * 0.041666666666666664; -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_2 = 1; ctr_2 < _size_force_2 - 1; ctr_2 += 1) { for (int64_t ctr_1 = 1; ctr_1 < _size_force_1 - 1; ctr_1 += 1) { for (int64_t ctr_0 = 1; ctr_0 < _size_force_0 - 1; ctr_0 += 1) { diff --git a/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/StreamCollideSweepThermalizedDoublePrecisionAVX.cpp b/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/StreamCollideSweepThermalizedDoublePrecisionAVX.cpp index b1475b7e40..fe51f48a87 100644 --- a/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/StreamCollideSweepThermalizedDoublePrecisionAVX.cpp +++ b/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/StreamCollideSweepThermalizedDoublePrecisionAVX.cpp @@ -51,9 +51,7 @@ namespace pystencils { namespace internal_b312c2da0affb0ff73dd81300a784e62 { static FUNC_PREFIX void streamcollidesweepthermalizeddoubleprecisionavx_streamcollidesweepthermalizeddoubleprecisionavx(double *RESTRICT const _data_force, double *RESTRICT const _data_pdfs, double *RESTRICT _data_pdfs_tmp, int64_t const _size_force_0, int64_t const _size_force_1, int64_t const _size_force_2, int64_t const _stride_force_1, int64_t const _stride_force_2, int64_t const _stride_force_3, int64_t const _stride_pdfs_1, int64_t const _stride_pdfs_2, int64_t const _stride_pdfs_3, int64_t const _stride_pdfs_tmp_1, int64_t const _stride_pdfs_tmp_2, int64_t const _stride_pdfs_tmp_3, uint32_t block_offset_0, uint32_t block_offset_1, uint32_t block_offset_2, double kT, double omega_bulk, double omega_even, double omega_odd, double omega_shear, uint32_t seed, uint32_t time_step) { -#ifdef _OPENMP #pragma omp parallel -#endif { const double xi_20 = omega_bulk * 0.5; const double xi_47 = omega_shear * 0.041666666666666664; @@ -71,9 +69,7 @@ static FUNC_PREFIX void streamcollidesweepthermalizeddoubleprecisionavx_streamco const double xi_226 = omega_odd * 0.125; const double rr_0 = 0.0; const double xi_45 = rr_0 * 0.041666666666666664; -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_2 = 1; ctr_2 < _size_force_2 - 1; ctr_2 += 1) { for (int64_t ctr_1 = 1; ctr_1 < _size_force_1 - 1; ctr_1 += 1) { { diff --git a/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/StreamCollideSweepThermalizedSinglePrecision.cpp b/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/StreamCollideSweepThermalizedSinglePrecision.cpp index 844570ad5e..7cde68b978 100644 --- a/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/StreamCollideSweepThermalizedSinglePrecision.cpp +++ b/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/StreamCollideSweepThermalizedSinglePrecision.cpp @@ -49,9 +49,7 @@ namespace pystencils { namespace internal_117eb60e8d249794b47e39bf52c9e4fe { static FUNC_PREFIX void streamcollidesweepthermalizedsingleprecision_streamcollidesweepthermalizedsingleprecision(float *RESTRICT const _data_force, float *RESTRICT const _data_pdfs, float *RESTRICT _data_pdfs_tmp, int64_t const _size_force_0, int64_t const _size_force_1, int64_t const _size_force_2, int64_t const _stride_force_0, int64_t const _stride_force_1, int64_t const _stride_force_2, int64_t const _stride_force_3, int64_t const _stride_pdfs_0, int64_t const _stride_pdfs_1, int64_t const _stride_pdfs_2, int64_t const _stride_pdfs_3, int64_t const _stride_pdfs_tmp_0, int64_t const _stride_pdfs_tmp_1, int64_t const _stride_pdfs_tmp_2, int64_t const _stride_pdfs_tmp_3, uint32_t block_offset_0, uint32_t block_offset_1, uint32_t block_offset_2, float kT, float omega_bulk, float omega_even, float omega_odd, float omega_shear, uint32_t seed, uint32_t time_step) { -#ifdef _OPENMP #pragma omp parallel -#endif { const float xi_20 = omega_bulk * 0.5f; const float xi_47 = omega_shear * 0.041666666666666664f; @@ -69,9 +67,7 @@ static FUNC_PREFIX void streamcollidesweepthermalizedsingleprecision_streamcolli const float xi_226 = omega_odd * 0.125f; const float rr_0 = 0.0f; const float xi_45 = rr_0 * 0.041666666666666664f; -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_2 = 1; ctr_2 < _size_force_2 - 1; ctr_2 += 1) { for (int64_t ctr_1 = 1; ctr_1 < _size_force_1 - 1; ctr_1 += 1) { for (int64_t ctr_0 = 1; ctr_0 < _size_force_0 - 1; ctr_0 += 1) { diff --git a/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/StreamCollideSweepThermalizedSinglePrecisionAVX.cpp b/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/StreamCollideSweepThermalizedSinglePrecisionAVX.cpp index c914735cfc..bb767e5422 100644 --- a/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/StreamCollideSweepThermalizedSinglePrecisionAVX.cpp +++ b/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/StreamCollideSweepThermalizedSinglePrecisionAVX.cpp @@ -51,9 +51,7 @@ namespace pystencils { namespace internal_482af0085ade5d86c474548ac4b32084 { static FUNC_PREFIX void streamcollidesweepthermalizedsingleprecisionavx_streamcollidesweepthermalizedsingleprecisionavx(float *RESTRICT const _data_force, float *RESTRICT const _data_pdfs, float *RESTRICT _data_pdfs_tmp, int64_t const _size_force_0, int64_t const _size_force_1, int64_t const _size_force_2, int64_t const _stride_force_1, int64_t const _stride_force_2, int64_t const _stride_force_3, int64_t const _stride_pdfs_1, int64_t const _stride_pdfs_2, int64_t const _stride_pdfs_3, int64_t const _stride_pdfs_tmp_1, int64_t const _stride_pdfs_tmp_2, int64_t const _stride_pdfs_tmp_3, uint32_t block_offset_0, uint32_t block_offset_1, uint32_t block_offset_2, float kT, float omega_bulk, float omega_even, float omega_odd, float omega_shear, uint32_t seed, uint32_t time_step) { -#ifdef _OPENMP #pragma omp parallel -#endif { const float xi_20 = omega_bulk * 0.5f; const float xi_47 = omega_shear * 0.041666666666666664f; @@ -71,9 +69,7 @@ static FUNC_PREFIX void streamcollidesweepthermalizedsingleprecisionavx_streamco const float xi_226 = omega_odd * 0.125f; const float rr_0 = 0.0f; const float xi_45 = rr_0 * 0.041666666666666664f; -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_2 = 1; ctr_2 < _size_force_2 - 1; ctr_2 += 1) { for (int64_t ctr_1 = 1; ctr_1 < _size_force_1 - 1; ctr_1 += 1) { { diff --git a/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/UpdateVelFromPDFDoublePrecision.cpp b/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/UpdateVelFromPDFDoublePrecision.cpp index 50d054b40c..7fe6b2aa31 100644 --- a/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/UpdateVelFromPDFDoublePrecision.cpp +++ b/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/UpdateVelFromPDFDoublePrecision.cpp @@ -47,13 +47,9 @@ namespace pystencils { namespace internal_de8af14df5055eb4add5a44e06cbe9b5 { static FUNC_PREFIX void updatevelfrompdfdoubleprecision_updatevelfrompdfdoubleprecision(double *RESTRICT const _data_force, double *RESTRICT const _data_pdfs, double *RESTRICT _data_velocity, int64_t const _size_force_0, int64_t const _size_force_1, int64_t const _size_force_2, int64_t const _stride_force_0, int64_t const _stride_force_1, int64_t const _stride_force_2, int64_t const _stride_force_3, int64_t const _stride_pdfs_0, int64_t const _stride_pdfs_1, int64_t const _stride_pdfs_2, int64_t const _stride_pdfs_3, int64_t const _stride_velocity_0, int64_t const _stride_velocity_1, int64_t const _stride_velocity_2, int64_t const _stride_velocity_3) { -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_2 = 1; ctr_2 < _size_force_2 - 1; ctr_2 += 1) { for (int64_t ctr_1 = 1; ctr_1 < _size_force_1 - 1; ctr_1 += 1) { for (int64_t ctr_0 = 1; ctr_0 < _size_force_0 - 1; ctr_0 += 1) { diff --git a/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/UpdateVelFromPDFDoublePrecisionAVX.cpp b/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/UpdateVelFromPDFDoublePrecisionAVX.cpp index 1a2e9a6a23..f81339ae10 100644 --- a/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/UpdateVelFromPDFDoublePrecisionAVX.cpp +++ b/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/UpdateVelFromPDFDoublePrecisionAVX.cpp @@ -49,13 +49,9 @@ namespace pystencils { namespace internal_fb7a198ee8d4b87d3091e088a14673a2 { static FUNC_PREFIX void updatevelfrompdfdoubleprecisionavx_updatevelfrompdfdoubleprecisionavx(double *RESTRICT const _data_force, double *RESTRICT const _data_pdfs, double *RESTRICT _data_velocity, int64_t const _size_force_0, int64_t const _size_force_1, int64_t const _size_force_2, int64_t const _stride_force_1, int64_t const _stride_force_2, int64_t const _stride_force_3, int64_t const _stride_pdfs_1, int64_t const _stride_pdfs_2, int64_t const _stride_pdfs_3, int64_t const _stride_velocity_1, int64_t const _stride_velocity_2, int64_t const _stride_velocity_3) { -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_2 = 1; ctr_2 < _size_force_2 - 1; ctr_2 += 1) { for (int64_t ctr_1 = 1; ctr_1 < _size_force_1 - 1; ctr_1 += 1) { { diff --git a/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/UpdateVelFromPDFSinglePrecision.cpp b/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/UpdateVelFromPDFSinglePrecision.cpp index 0be8ef7aec..0d55ca84b7 100644 --- a/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/UpdateVelFromPDFSinglePrecision.cpp +++ b/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/UpdateVelFromPDFSinglePrecision.cpp @@ -47,13 +47,9 @@ namespace pystencils { namespace internal_01ae0f7ae02292b7985da3bf4f45d4c4 { static FUNC_PREFIX void updatevelfrompdfsingleprecision_updatevelfrompdfsingleprecision(float *RESTRICT const _data_force, float *RESTRICT const _data_pdfs, float *RESTRICT _data_velocity, int64_t const _size_force_0, int64_t const _size_force_1, int64_t const _size_force_2, int64_t const _stride_force_0, int64_t const _stride_force_1, int64_t const _stride_force_2, int64_t const _stride_force_3, int64_t const _stride_pdfs_0, int64_t const _stride_pdfs_1, int64_t const _stride_pdfs_2, int64_t const _stride_pdfs_3, int64_t const _stride_velocity_0, int64_t const _stride_velocity_1, int64_t const _stride_velocity_2, int64_t const _stride_velocity_3) { -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_2 = 1; ctr_2 < _size_force_2 - 1; ctr_2 += 1) { for (int64_t ctr_1 = 1; ctr_1 < _size_force_1 - 1; ctr_1 += 1) { for (int64_t ctr_0 = 1; ctr_0 < _size_force_0 - 1; ctr_0 += 1) { diff --git a/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/UpdateVelFromPDFSinglePrecisionAVX.cpp b/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/UpdateVelFromPDFSinglePrecisionAVX.cpp index 37d78020f6..e08b763495 100644 --- a/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/UpdateVelFromPDFSinglePrecisionAVX.cpp +++ b/src/walberla_bridge/src/lattice_boltzmann/generated_kernels/UpdateVelFromPDFSinglePrecisionAVX.cpp @@ -49,13 +49,9 @@ namespace pystencils { namespace internal_9f3cf46adc24d4ebfb8e08168d5e7562 { static FUNC_PREFIX void updatevelfrompdfsingleprecisionavx_updatevelfrompdfsingleprecisionavx(float *RESTRICT const _data_force, float *RESTRICT const _data_pdfs, float *RESTRICT _data_velocity, int64_t const _size_force_0, int64_t const _size_force_1, int64_t const _size_force_2, int64_t const _stride_force_1, int64_t const _stride_force_2, int64_t const _stride_force_3, int64_t const _stride_pdfs_1, int64_t const _stride_pdfs_2, int64_t const _stride_pdfs_3, int64_t const _stride_velocity_1, int64_t const _stride_velocity_2, int64_t const _stride_velocity_3) { -#ifdef _OPENMP #pragma omp parallel -#endif { -#ifdef _OPENMP #pragma omp for schedule(static) -#endif for (int64_t ctr_2 = 1; ctr_2 < _size_force_2 - 1; ctr_2 += 1) { for (int64_t ctr_1 = 1; ctr_1 < _size_force_1 - 1; ctr_1 += 1) { { diff --git a/src/walberla_bridge/tests/CMakeLists.txt b/src/walberla_bridge/tests/CMakeLists.txt index 0861ab7bce..ba661d90be 100644 --- a/src/walberla_bridge/tests/CMakeLists.txt +++ b/src/walberla_bridge/tests/CMakeLists.txt @@ -35,8 +35,8 @@ function(ESPRESSO_ADD_TEST) DEPENDS ${TEST_DEPENDS} $<$:espresso::avx_flags> - $<$:OpenMP::OpenMP_CXX> - $<$,$>:OpenMP::OpenMP_CUDA> + $<$:OpenMP::OpenMP_CUDA> + OpenMP::OpenMP_CXX espresso::walberla espresso::walberla_deps espresso::compiler_flags diff --git a/testsuite/python/CMakeLists.txt b/testsuite/python/CMakeLists.txt index 1b4ac9c704..f038ffc5c9 100644 --- a/testsuite/python/CMakeLists.txt +++ b/testsuite/python/CMakeLists.txt @@ -123,10 +123,7 @@ function(python_test) endif() list(APPEND TEST_LABELS "python_test") - set(TEST_NUM_CORES ${TEST_NUM_PROC}) - if(ESPRESSO_BUILD_WITH_SHARED_MEMORY_PARALLELISM) - math(EXPR TEST_NUM_CORES "${TEST_NUM_PROC} * ${TEST_NUM_THREADS}") - endif() + math(EXPR TEST_NUM_CORES "${TEST_NUM_PROC} * ${TEST_NUM_THREADS}") # cmake-format: off set_tests_properties( diff --git a/testsuite/python/caliper.py b/testsuite/python/caliper.py index dcba35a737..3e94721faa 100644 --- a/testsuite/python/caliper.py +++ b/testsuite/python/caliper.py @@ -25,39 +25,33 @@ import sys import os -HAS_CABANA = espressomd.has_features(["SHARED_MEMORY_PARALLELISM"]) EXPECTED_LABELS = """ integrate - {update_cabana} + update_cabana_state Initial Force Calculation calculate_forces - {gpu_to} - {update_cabana} + copy_particles_to_GPU + update_cabana_state init_forces_and_thermostat calc_long_range_forces - {short_range} - {gpu_from} + cabana_short_range + copy_forces_from_GPU Integration loop integrator_step_1 resort_particles_if_needed calculate_forces - {gpu_to} - {update_cabana} + copy_particles_to_GPU + update_cabana_state init_forces_and_thermostat calc_long_range_forces - {short_range} - {gpu_from} + cabana_short_range + copy_forces_from_GPU integrator_step_2 calc_energies - {update_cabana} + update_cabana_state short_range_loop -""".format( - update_cabana='update_cabana_state' if HAS_CABANA else '', - short_range='cabana_short_range' if HAS_CABANA else 'serial_short_range', - gpu_to='copy_particles_to_GPU', - gpu_from='copy_forces_from_GPU' -) +""" @utx.skipIfMissingFeatures(["CALIPER"]) diff --git a/testsuite/python/cell_system.py b/testsuite/python/cell_system.py index e43c6dbed7..3b473b3ede 100644 --- a/testsuite/python/cell_system.py +++ b/testsuite/python/cell_system.py @@ -94,7 +94,7 @@ def test_node_grid_hybrid(self): n_square_types={1}, cutoff_regular=0) self.check_node_grid() - @utx.skipIfMissingFeatures(["WCA", "SHARED_MEMORY_PARALLELISM"]) + @utx.skipIfMissingFeatures(["WCA"]) @ut.skipIf(espressomd.has_features("FPE"), "cannot run with FPE instrumentation") def test_verlet_list_overflow(self): diff --git a/testsuite/python/interactions_non-bonded.py b/testsuite/python/interactions_non-bonded.py index 93ad53ade7..f16886db9d 100644 --- a/testsuite/python/interactions_non-bonded.py +++ b/testsuite/python/interactions_non-bonded.py @@ -630,28 +630,38 @@ def get_reference_torque(gb_params, r, dir1, dir2): # force equals minus the counter-force np.testing.assert_array_equal(f1_sim, -f2_sim) # compare force to reference force - for i in range(3): - self.assertAlmostEqual(f2_sim[i], f2_ref[i], delta=delta) + np.testing.assert_allclose(f2_sim, f2_ref, atol=delta, rtol=0.) + # Test pressure tensor + p_ref = np.einsum("i,j", r, f2_ref) / self.system.volume() + p_sim = self.system.analysis.pressure_tensor()["non_bonded"] + np.testing.assert_allclose(p_sim, p_ref, atol=delta, rtol=0.) # Calc torques - torque1_sim = p1.torque_lab - torque2_sim = p2.torque_lab + torque1_sim = np.copy(p1.torque_lab) + torque2_sim = np.copy(p2.torque_lab) torque1_ref = get_reference_torque( gb_params, r, director1, director2) torque2_ref = get_reference_torque( gb_params, r, director2, director1) # Test torques - for i in range(3): - self.assertAlmostEqual( - torque1_sim[i], - torque1_ref[i], - delta=delta) - self.assertAlmostEqual( - torque2_sim[i], - torque2_ref[i], - delta=delta) + np.testing.assert_allclose( + torque1_sim, torque1_ref, atol=delta, rtol=0.) + np.testing.assert_allclose( + torque2_sim, torque2_ref, atol=delta, rtol=0.) + + # Test beyond cutoff + old_pos2 = np.copy(p2.pos) + p2.pos = p1.pos + [1.01 * cut, 0., 0.] + self.system.integrator.run(recalc_forces=True, steps=0) + np.testing.assert_array_equal(np.copy(p1.f), [0., 0., 0.]) + np.testing.assert_array_equal(np.copy(p2.f), [0., 0., 0.]) + np.testing.assert_array_equal(np.copy(p1.torque_lab), [0., 0., 0.]) + np.testing.assert_array_equal(np.copy(p2.torque_lab), [0., 0., 0.]) + np.testing.assert_array_equal( + self.system.analysis.pressure_tensor()["non_bonded"], 0.) # Test zero energy + p2.pos = old_pos2 self.system.non_bonded_inter[0, 0].gay_berne.set_params( sig=sigma_0, cut=0, eps=0, k1=k_1, k2=k_2, mu=mu, nu=nu) self.system.integrator.run(0)