From 98c48b7b9184b7c91a1311ecf451c95225d24688 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-No=C3=ABl=20Grad?= Date: Mon, 22 Apr 2024 16:33:27 +0200 Subject: [PATCH] Bump version requirements of all dependencies --- .clang-tidy | 3 +- .github/workflows/push_pull.yml | 14 +- .gitlab-ci.yml | 115 +++++++++-------- CMakeLists.txt | 94 +++++++------- cmake/FindCUDACompilerNVCC.cmake | 1 - cmake/unit_test.cmake | 4 + doc/doxygen/Doxyfile.in | 122 ++---------------- doc/sphinx/installation.rst | 69 +++++----- doc/sphinx/running.rst | 40 +++--- maintainer/CI/build_cmake.sh | 40 ++++-- maintainer/CI/doc_warnings.sh | 2 +- maintainer/CI/jupyter_warnings.py | 12 +- .../code_generation_context.py | 1 + .../custom_additional_extensions.py | 2 +- .../walberla_kernels/generate_lb_kernels.py | 1 + .../walberla_kernels/pystencils_espresso.py | 2 +- .../templates/Boundary.tmpl.h | 30 ++--- requirements.txt | 41 +++--- src/core/CMakeLists.txt | 7 + src/python/espressomd/CMakeLists.txt | 9 +- src/script_interface/CMakeLists.txt | 6 +- testsuite/python/caliper.py | 23 ++-- testsuite/python/sigint.py | 4 +- testsuite/python/sigint_child.py | 2 + 24 files changed, 309 insertions(+), 335 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index a996e64c0a4..8d269d52fa9 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -10,6 +10,8 @@ Checks: | -bugprone-implicit-widening-of-multiplication-result, -bugprone-macro-parentheses, -bugprone-reserved-identifier, + -bugprone-switch-missing-default-case, + -bugprone-unchecked-optional-access, clang-analyzer-alpha.*, modernize-deprecated-headers, modernize-make-shared, @@ -41,7 +43,6 @@ Checks: | readability-function-size' WarningsAsErrors: '*,-clang-analyzer-core.StackAddrEscapeBase,-clang-analyzer-optin.mpi.MPI-Checker' HeaderFilterRegex: '.*' -AnalyzeTemporaryDtors: false FormatStyle: none User: espresso CheckOptions: diff --git a/.github/workflows/push_pull.yml b/.github/workflows/push_pull.yml index 1a2eb4e39fd..e6e24fded3c 100644 --- a/.github/workflows/push_pull.yml +++ b/.github/workflows/push_pull.yml @@ -9,7 +9,7 @@ permissions: jobs: macos: - runs-on: macos-12 + runs-on: macos-13 if: ${{ github.repository == 'espressomd/espresso' }} steps: - name: Checkout @@ -20,22 +20,22 @@ jobs: key: macos save: ${{ github.ref == 'refs/heads/python' }} - name: Setup Python environment - uses: actions/setup-python@v4.3.1 + uses: actions/setup-python@v5.1.0 with: - python-version: '3.9' + python-version: '3.12' - name: Get runner specifications run: system_profiler SPHardwareDataType - name: Build and check uses: ./.github/actions/build_and_check env: - build_procs: 3 - check_procs: 3 + build_procs: 4 + check_procs: 4 with_ccache: 'true' debian: runs-on: ubuntu-latest container: - image: ghcr.io/espressomd/docker/debian:339903979196fd7e72127f2cb5bfb27759d129f9-base-layer + image: ghcr.io/espressomd/docker/debian:7843821c7cfe66dc8b718bb4041eba52adaa2df0-base-layer credentials: username: ${{ github.actor }} password: ${{ secrets.github_token }} @@ -74,7 +74,7 @@ jobs: runs-on: ubuntu-latest if: ${{ github.repository == 'espressomd/espresso' }} container: - image: ghcr.io/espressomd/docker/ubuntu-wo-dependencies:339903979196fd7e72127f2cb5bfb27759d129f9-base-layer + image: ghcr.io/espressomd/docker/ubuntu-wo-dependencies:7843821c7cfe66dc8b718bb4041eba52adaa2df0-base-layer credentials: username: ${{ github.actor }} password: ${{ secrets.github_token }} diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ee8c2fe7f7f..563c1b62c1f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: ghcr.io/espressomd/docker/ubuntu-22.04:339903979196fd7e72127f2cb5bfb27759d129f9 +image: ghcr.io/espressomd/docker/ubuntu:7843821c7cfe66dc8b718bb4041eba52adaa2df0 stages: - prepare @@ -18,6 +18,7 @@ stages: .notification_job_template: ¬ification_job_definition <<: *global_job_definition + image: ghcr.io/espressomd/docker/fedora:7843821c7cfe66dc8b718bb4041eba52adaa2df0 variables: GIT_SUBMODULE_STRATEGY: none before_script: @@ -33,7 +34,7 @@ variables: GIT_SUBMODULE_STRATEGY: recursive CCACHE_DIR: /cache CCACHE_MAXSIZE: 100G - with_ccache: "true" + with_ccache: 'true' status_pending: <<: *notification_job_definition @@ -80,9 +81,9 @@ default: <<: *global_job_definition stage: build variables: - CC: 'gcc-10' - CXX: 'g++-10' - GCOV: 'gcov-10' + CC: 'gcc-13' + CXX: 'g++-13' + GCOV: 'gcov-13' with_cuda: 'false' myconfig: 'default' with_coverage: 'true' @@ -101,9 +102,9 @@ maxset: <<: *global_job_definition stage: build variables: - CC: 'gcc-10' - CXX: 'g++-10' - GCOV: 'gcov-10' + CC: 'gcc-13' + CXX: 'g++-13' + GCOV: 'gcov-13' with_cuda: 'false' with_cxx_standard: '20' myconfig: 'maxset' @@ -126,9 +127,9 @@ no_rotation: <<: *global_job_definition stage: build variables: - CC: 'gcc-10' - CXX: 'g++-10' - GCOV: 'gcov-10' + CC: 'gcc-13' + CXX: 'g++-13' + GCOV: 'gcov-13' with_cuda: 'false' myconfig: 'no_rotation' with_coverage: 'true' @@ -141,16 +142,17 @@ no_rotation: - no-cuda - numa -fedora:36: +fedora:40: <<: *global_job_definition stage: build - image: ghcr.io/espressomd/docker/fedora:339903979196fd7e72127f2cb5bfb27759d129f9 + image: ghcr.io/espressomd/docker/fedora:7843821c7cfe66dc8b718bb4041eba52adaa2df0 variables: with_cuda: 'false' with_gsl: 'false' myconfig: 'maxset' make_check_python: 'true' with_stokesian_dynamics: 'true' + cmake_params: '-D CMAKE_INCLUDE_PATH=/usr/include/mpich-x86_64 -D CMAKE_PREFIX_PATH=/usr/lib64/mpich/lib/' script: - bash maintainer/CI/build_cmake.sh tags: @@ -163,12 +165,12 @@ clang-sanitizer: <<: *global_job_definition stage: build variables: - CC: 'clang-14' - CXX: 'clang++-14' - CUDAXX: 'clang++-14' + CC: 'clang-18' + CXX: 'clang++-18' + CUDACXX: 'clang++-18' myconfig: 'maxset' with_cuda: 'true' - with_coverage: 'false' + with_cuda_compiler: 'clang' with_static_analysis: 'true' check_skip_long: 'true' with_asan: 'false' @@ -176,6 +178,8 @@ clang-sanitizer: with_scafacos: 'true' with_walberla: 'true' with_stokesian_dynamics: 'true' + with_coverage: 'false' + with_coverage_python: 'false' script: - bash maintainer/CI/build_cmake.sh timeout: 2h @@ -188,9 +192,9 @@ fast_math: <<: *global_job_definition stage: build variables: - CC: 'gcc-10' - CXX: 'g++-10' - GCOV: 'gcov-10' + CC: 'gcc-12' + CXX: 'g++-12' + GCOV: 'gcov-12' myconfig: 'maxset' with_cuda: 'true' with_coverage: 'false' @@ -204,13 +208,13 @@ fast_math: - cuda when: manual -cuda11-coverage: +cuda12-coverage: <<: *global_job_definition stage: build variables: - CC: 'gcc-10' - CXX: 'g++-10' - GCOV: 'gcov-10' + CC: 'gcc-12' + CXX: 'g++-12' + GCOV: 'gcov-12' myconfig: 'maxset' with_cuda: 'true' with_coverage: 'true' @@ -225,13 +229,13 @@ cuda11-coverage: - cuda - numa -cuda11-maxset: +cuda12-maxset: <<: *global_job_definition stage: build variables: - CC: 'gcc-10' - CXX: 'g++-10' - GCOV: 'gcov-10' + CC: 'gcc-12' + CXX: 'g++-12' + GCOV: 'gcov-12' myconfig: 'maxset' with_cuda: 'true' with_coverage: 'false' @@ -254,14 +258,15 @@ cuda11-maxset: - cuda - numa - avx2 + - reuse-artifacts-same-arch tutorials-samples-maxset: <<: *global_job_definition stage: build variables: - CC: 'gcc-10' - CXX: 'g++-10' - GCOV: 'gcov-10' + CC: 'gcc-12' + CXX: 'g++-12' + GCOV: 'gcov-12' myconfig: 'maxset' with_cuda: 'true' with_coverage: 'false' @@ -288,9 +293,9 @@ tutorials-samples-default: <<: *global_job_definition stage: build variables: - CC: 'gcc-10' - CXX: 'g++-10' - GCOV: 'gcov-10' + CC: 'gcc-12' + CXX: 'g++-12' + GCOV: 'gcov-12' myconfig: 'default' with_cuda: 'true' with_coverage: 'false' @@ -317,9 +322,9 @@ tutorials-samples-empty: <<: *global_job_definition stage: build variables: - CC: 'gcc-10' - CXX: 'g++-10' - GCOV: 'gcov-10' + CC: 'gcc-12' + CXX: 'g++-12' + GCOV: 'gcov-12' myconfig: 'empty' with_cuda: 'true' with_coverage: 'false' @@ -344,9 +349,9 @@ tutorials-samples-no-gpu: <<: *global_job_definition stage: build variables: - CC: 'gcc-10' - CXX: 'g++-10' - GCOV: 'gcov-10' + CC: 'gcc-12' + CXX: 'g++-12' + GCOV: 'gcov-12' myconfig: 'maxset' with_cuda: 'true' with_coverage: 'false' @@ -373,9 +378,9 @@ installation: <<: *global_job_definition stage: build variables: - CC: 'gcc-10' - CXX: 'g++-10' - GCOV: 'gcov-10' + CC: 'gcc-12' + CXX: 'g++-12' + GCOV: 'gcov-12' myconfig: 'maxset' with_cuda: 'true' with_coverage: 'false' @@ -383,6 +388,7 @@ installation: make_check_python: 'false' with_scafacos: 'true' with_walberla: 'true' + with_walberla_avx: 'true' with_stokesian_dynamics: 'true' srcdir: '${CI_PROJECT_DIR}' build_type: 'Release' @@ -405,17 +411,19 @@ installation: tags: - espresso - cuda + - avx2 when: manual empty: <<: *global_job_definition stage: build variables: - CC: 'clang-14' - CXX: 'clang++-14' - CUDAXX: 'clang++-14' + CC: 'clang-18' + CXX: 'clang++-18' + CUDACXX: 'clang++-18' myconfig: 'empty' with_cuda: 'true' + with_cuda_compiler: 'clang' with_static_analysis: 'true' with_scafacos: 'false' with_walberla: 'false' @@ -433,7 +441,7 @@ check_sphinx: <<: *global_job_definition stage: additional_checks needs: - - cuda11-maxset + - cuda12-maxset when: on_success script: - cd ${CI_PROJECT_DIR}/build @@ -450,12 +458,13 @@ check_sphinx: - espresso - cuda - numa + - reuse-artifacts-same-arch run_tutorials: <<: *global_job_definition stage: additional_checks needs: - - cuda11-maxset + - cuda12-maxset when: on_success script: - cd ${CI_PROJECT_DIR}/build @@ -475,6 +484,7 @@ run_tutorials: - espresso - cuda - numa + - reuse-artifacts-same-arch only: - schedules @@ -482,7 +492,7 @@ run_doxygen: <<: *global_job_definition stage: additional_checks needs: - - cuda11-maxset + - cuda12-maxset when: on_success only: - python @@ -497,13 +507,14 @@ run_doxygen: - espresso - no-cuda - numa + - reuse-artifacts-same-arch maxset_no_gpu: <<: *global_job_definition stage: additional_checks when: on_success needs: - - cuda11-maxset + - cuda12-maxset script: - export CUDA_VISIBLE_DEVICES="" - cd ${CI_PROJECT_DIR}/build @@ -512,13 +523,14 @@ maxset_no_gpu: - espresso - no-cuda - numa + - reuse-artifacts-same-arch maxset_3_cores: <<: *global_job_definition stage: additional_checks when: on_success needs: - - cuda11-maxset + - cuda12-maxset script: - cd ${CI_PROJECT_DIR}/build - cmake -D ESPRESSO_TEST_NP=3 . @@ -527,6 +539,7 @@ maxset_3_cores: - espresso - cuda - numa + - reuse-artifacts-same-arch status_success: <<: *notification_job_definition diff --git a/CMakeLists.txt b/CMakeLists.txt index 7c40cb72a7c..def6da778e1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,11 +47,11 @@ macro(espresso_minimal_compiler_version) endif() endmacro() -espresso_minimal_compiler_version("GNU" 8.0.0) -espresso_minimal_compiler_version("Clang" 9.0.0) -espresso_minimal_compiler_version("AppleClang" 11.0.0) -espresso_minimal_compiler_version("Intel" 18.0) -espresso_minimal_compiler_version("IntelLLVM" 2021.0) +espresso_minimal_compiler_version("GNU" 10.5.0) +espresso_minimal_compiler_version("Clang" 14.0.0) +espresso_minimal_compiler_version("AppleClang" 14.0.0) +espresso_minimal_compiler_version("Intel" 2021.9) +espresso_minimal_compiler_version("IntelLLVM" 2023.1) include(FeatureSummary) project(ESPResSo) @@ -190,46 +190,25 @@ add_library(espresso::avx_flags ALIAS espresso_avx_flags) # CUDA compiler if(ESPRESSO_BUILD_WITH_CUDA) - set(ESPRESSO_DEFINE_CUDA_ARCHITECTURES OFF) - if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES) - set(ESPRESSO_DEFINE_CUDA_ARCHITECTURES ON) - endif() include(CheckLanguage) enable_language(CUDA) check_language(CUDA) set(CMAKE_CUDA_STANDARD ${CMAKE_CXX_STANDARD}) set(CMAKE_CUDA_STANDARD_REQUIRED ON) - set(ESPRESSO_MINIMAL_CUDA_VERSION 11.0) + set(ESPRESSO_MINIMAL_CUDA_VERSION 11.5) find_package(CUDAToolkit ${ESPRESSO_MINIMAL_CUDA_VERSION} REQUIRED) - if(ESPRESSO_DEFINE_CUDA_ARCHITECTURES) - unset(ESPRESSO_CUDA_ARCHITECTURES) - # 1. sm_75: RTX-2000 series (Turing) - # 2. sm_61: GTX-1000 series (Pascal) - # 3. sm_52: GTX-900 series (Maxwell) - if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA") - list(APPEND ESPRESSO_CUDA_ARCHITECTURES 75) - list(APPEND ESPRESSO_CUDA_ARCHITECTURES 61) - elseif(CMAKE_CUDA_COMPILER_ID STREQUAL "Clang") - # GTX-900 series (Maxwell) - if(CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 12) - list(APPEND ESPRESSO_CUDA_ARCHITECTURES 52) - endif() - if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 10) - list(APPEND ESPRESSO_CUDA_ARCHITECTURES 61) - # With Clang 14+, architectures sm_70+ are only supported with Thrust - # 1.11+ from CUDA 11.3+, for details see - # https://github.com/NVIDIA/cub/pull/170 - if((CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 14) - OR (CUDAToolkit_VERSION VERSION_GREATER_EQUAL 11.3.0)) - list(APPEND ESPRESSO_CUDA_ARCHITECTURES 75) - endif() - endif() - endif() - # only override CMAKE_CUDA_ARCHITECTURES when dependencies are satisfied - if(DEFINED ESPRESSO_CUDA_ARCHITECTURES) - set(CMAKE_CUDA_ARCHITECTURES ${ESPRESSO_CUDA_ARCHITECTURES}) + if(NOT DEFINED ESPRESSO_CMAKE_CUDA_ARCHITECTURES) + if("$ENV{CUDAARCHS}" STREQUAL "") + # 1. sm_75: RTX-2000 series (Turing) + # 2. sm_61: GTX-1000 series (Pascal) + set(ESPRESSO_CUDA_ARCHITECTURES "61;75") + else() + set(ESPRESSO_CUDA_ARCHITECTURES "$ENV{CUDAARCHS}") endif() + set(ESPRESSO_CMAKE_CUDA_ARCHITECTURES "${ESPRESSO_CUDA_ARCHITECTURES}" + CACHE INTERNAL "") endif() + set(CMAKE_CUDA_ARCHITECTURES "${ESPRESSO_CMAKE_CUDA_ARCHITECTURES}") if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA") find_package(CUDACompilerNVCC ${ESPRESSO_MINIMAL_CUDA_VERSION} REQUIRED) elseif(CMAKE_CUDA_COMPILER_ID STREQUAL "Clang") @@ -238,7 +217,7 @@ if(ESPRESSO_BUILD_WITH_CUDA) FATAL_ERROR "Cannot enable code coverage with Clang as the CUDA compiler") endif() - find_package(CUDACompilerClang 9.0 REQUIRED) + find_package(CUDACompilerClang 14.0 REQUIRED) else() message(FATAL_ERROR "Unknown CUDA compiler '${CMAKE_CUDA_COMPILER_ID}'") endif() @@ -246,8 +225,8 @@ endif() # Python interpreter and Cython interface library if(ESPRESSO_BUILD_WITH_PYTHON) - find_package(Python 3.9 REQUIRED COMPONENTS Interpreter Development NumPy) - find_package(Cython 0.29.21...<3.0.8 REQUIRED) + find_package(Python 3.10 REQUIRED COMPONENTS Interpreter Development NumPy) + find_package(Cython 0.29.28...<3.0.10 REQUIRED) find_program(IPYTHON_EXECUTABLE NAMES jupyter ipython3 ipython) endif() @@ -457,9 +436,8 @@ if(ESPRESSO_BUILD_WITH_COVERAGE) espresso_coverage_flags INTERFACE -g -fprofile-instr-generate -fcoverage-mapping) else() - target_compile_options( - espresso_coverage_flags INTERFACE -g --coverage -fprofile-arcs - -ftest-coverage) + target_compile_options(espresso_coverage_flags INTERFACE -g --coverage + -fprofile-abs-path) target_link_libraries(espresso_coverage_flags INTERFACE gcov) endif() endif() @@ -472,7 +450,6 @@ target_compile_options( -Wall -Wextra -pedantic - $<$:-Werror> # add extra warnings $<$:-Wextern-initializer> $<$:-Wrange-loop-analysis> @@ -486,12 +463,30 @@ target_compile_options( -Wno-sign-compare -Wno-unused-function -Wno-unused-parameter + -Wno-array-bounds $<$:-Wno-clobbered> $<$:-diag-disable=592> $<$:-Wno-gnu-zero-variadic-macro-arguments> $<$,$,8.1.0>>:-Wno-cast-function-type> $<$>:-Wno-implicit-fallthrough> - $<$>:-Wno-unused-private-field>) + $<$>:-Wno-unused-private-field> + # warnings are errors + $<$:-Werror>) + +if(ESPRESSO_BUILD_WITH_CUDA) + target_compile_options( + espresso_cuda_flags + INTERFACE + -Wall + -Wextra + -Wno-sign-compare + -Wno-unused-parameter + $<$>:-Wno-implicit-fallthrough> + # warnings are errors + $<$,$>:--Werror=all-warnings> + $<$,$>:-Werror> + ) +endif() # disable warning from -Wextra on ARM processors if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_SYSTEM_PROCESSOR MATCHES @@ -595,7 +590,7 @@ if(ESPRESSO_BUILD_WITH_WALBERLA) FetchContent_Declare( walberla GIT_REPOSITORY https://i10git.cs.fau.de/walberla/walberla.git - GIT_TAG 065ce5f311850371a97ac4766f47dbb5ca8424ba + GIT_TAG 0c8b4b926c6979288fd8a6846d02ec0870e1fe41 ) # workaround for https://gitlab.kitware.com/cmake/cmake/-/issues/21146 if(NOT DEFINED walberla_SOURCE_DIR OR NOT EXISTS "${walberla_SOURCE_DIR}") @@ -637,7 +632,7 @@ if(ESPRESSO_BUILD_WITH_WALBERLA) set(WALBERLA_LIBS ${WALBERLA_LIBS} walberla::fft) endif() if(ESPRESSO_BUILD_WITH_CUDA AND WALBERLA_BUILD_WITH_CUDA) - set(WALBERLA_LIBS ${WALBERLA_LIBS} walberla::cuda) + set(WALBERLA_LIBS ${WALBERLA_LIBS} walberla::gpu) endif() # workaround for https://gitlab.kitware.com/cmake/cmake/-/issues/21283 foreach(target_w_namespace IN LISTS WALBERLA_LIBS) @@ -660,7 +655,7 @@ if(ESPRESSO_BUILD_WITH_CALIPER) FetchContent_Declare( caliper GIT_REPOSITORY https://github.com/LLNL/Caliper.git - GIT_TAG v2.9.1 + GIT_TAG v2.10.0 ) if(NOT DEFINED caliper_SOURCE_DIR OR NOT EXISTS "${caliper_SOURCE_DIR}") FetchContent_Populate(caliper) @@ -678,6 +673,9 @@ if(ESPRESSO_BUILD_WITH_CALIPER) "GNU") target_compile_options(caliper-services PRIVATE -Wno-deprecated-declarations) + target_compile_options( + caliper-runtime + PRIVATE $<$:-Wno-maybe-uninitialized>) endif() endif() diff --git a/cmake/FindCUDACompilerNVCC.cmake b/cmake/FindCUDACompilerNVCC.cmake index 0ddce340a8c..be034162196 100644 --- a/cmake/FindCUDACompilerNVCC.cmake +++ b/cmake/FindCUDACompilerNVCC.cmake @@ -49,7 +49,6 @@ target_compile_options( $<$:-Xptxas=-O2 -Xcompiler=-O2,-g -DNDEBUG> $<$:-Xptxas=-O3 -Xcompiler=-Og,-g> $<$:-Xptxas=-O3 -Xcompiler=-O3,-g> - $<$:-Xcompiler=-Werror;-Xptxas=-Werror> $<$:-Xcompiler=-isysroot;-Xcompiler=${CMAKE_OSX_SYSROOT}> ) diff --git a/cmake/unit_test.cmake b/cmake/unit_test.cmake index 535d5ac80ca..247853af4fd 100644 --- a/cmake/unit_test.cmake +++ b/cmake/unit_test.cmake @@ -30,6 +30,10 @@ function(UNIT_TEST) endif() target_include_directories(${TEST_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/src/core) target_link_libraries(${TEST_NAME} PRIVATE espresso::config espresso::cpp_flags) + if(ESPRESSO_BUILD_WITH_COVERAGE AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + target_compile_options( + ${TEST_NAME} PRIVATE -fno-default-inline -fno-elide-constructors) + endif() # If NUM_PROC is given, set up MPI parallel test case if(TEST_NUM_PROC) diff --git a/doc/doxygen/Doxyfile.in b/doc/doxygen/Doxyfile.in index e4cc02ded2e..67333f21afd 100644 --- a/doc/doxygen/Doxyfile.in +++ b/doc/doxygen/Doxyfile.in @@ -1,4 +1,4 @@ -# Doxyfile 1.8.17 +# Doxyfile 1.9.8 @INCLUDE = "@CMAKE_CURRENT_BINARY_DIR@/doxy-features" @@ -95,14 +95,6 @@ ALLOW_UNICODE_NAMES = NO OUTPUT_LANGUAGE = English -# The OUTPUT_TEXT_DIRECTION tag is used to specify the direction in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all generated output in the proper direction. -# Possible values are: None, LTR, RTL and Context. -# The default value is: None. - -OUTPUT_TEXT_DIRECTION = None - # If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member # descriptions after the members that are listed in the file and class # documentation (similar to Javadoc). Set to NO to disable this. @@ -424,6 +416,14 @@ TYPEDEF_HIDES_STRUCT = NO LOOKUP_CACHE_SIZE = 0 +# If the TIMESTAMP tag is set different from NO then each generated page will +# contain the date or date and time when the page was generated. Setting this to +# NO can help when comparing the output of multiple runs. +# Possible values are: YES, NO, DATETIME and DATE. +# The default value is: NO. + +TIMESTAMP = YES + #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- @@ -1202,15 +1202,6 @@ HTML_COLORSTYLE_SAT = 100 HTML_COLORSTYLE_GAMMA = 80 -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting this -# to YES can help to show when doxygen was last run and thus if the -# documentation is up to date. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_TIMESTAMP = YES - # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. @@ -1481,17 +1472,6 @@ EXT_LINKS_IN_WINDOW = NO FORMULA_FONTSIZE = 10 -# Use the FORMULA_TRANSPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are not -# supported properly for IE 6.0, but are supported on all modern browsers. -# -# Note that when changing this option you need to delete any form_*.png files in -# the HTML output directory before the changes have effect. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FORMULA_TRANSPARENT = YES - # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see # https://www.mathjax.org) which uses client side JavaScript for the rendering # instead of using pre-rendered bitmaps. Use this if you do not have LaTeX @@ -1774,16 +1754,6 @@ LATEX_BATCHMODE = NO LATEX_HIDE_INDICES = NO -# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source -# code with syntax highlighting in the LaTeX output. -# -# Note that which sources are shown also depends on other settings such as -# SOURCE_BROWSER. -# The default value is: NO. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -LATEX_SOURCE_CODE = NO - # The LATEX_BIB_STYLE tag can be used to specify the style to use for the # bibliography, e.g. plainnat, or ieeetr. See # https://en.wikipedia.org/wiki/BibTeX and \cite for more info. @@ -1792,14 +1762,6 @@ LATEX_SOURCE_CODE = NO LATEX_BIB_STYLE = plainnat -# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated -# page will contain the date and time when the page was generated. Setting this -# to NO can help when comparing the output of multiple runs. -# The default value is: NO. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -LATEX_TIMESTAMP = NO - #--------------------------------------------------------------------------- # Configuration options related to the RTF output #--------------------------------------------------------------------------- @@ -1856,16 +1818,6 @@ RTF_STYLESHEET_FILE = RTF_EXTENSIONS_FILE = -# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code -# with syntax highlighting in the RTF output. -# -# Note that which sources are shown also depends on other settings such as -# SOURCE_BROWSER. -# The default value is: NO. -# This tag requires that the tag GENERATE_RTF is set to YES. - -RTF_SOURCE_CODE = NO - #--------------------------------------------------------------------------- # Configuration options related to the man page output #--------------------------------------------------------------------------- @@ -1955,15 +1907,6 @@ GENERATE_DOCBOOK = NO DOCBOOK_OUTPUT = docbook -# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the -# program listings (including syntax highlighting and cross-referencing -# information) to the DOCBOOK output. Note that enabling this will significantly -# increase the size of the DOCBOOK output. -# The default value is: NO. -# This tag requires that the tag GENERATE_DOCBOOK is set to YES. - -DOCBOOK_PROGRAMLISTING = NO - #--------------------------------------------------------------------------- # Configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- @@ -2143,25 +2086,9 @@ EXTERNAL_GROUPS = YES EXTERNAL_PAGES = YES #--------------------------------------------------------------------------- -# Configuration options related to the dot tool +# Configuration options related to diagram generator tools #--------------------------------------------------------------------------- -# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram -# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to -# NO turns the diagrams off. Note that this option also works with HAVE_DOT -# disabled, but it is recommended to install and use dot, since it yields more -# powerful graphs. -# The default value is: YES. - -CLASS_DIAGRAMS = YES - -# You can include diagrams made with dia in doxygen documentation. Doxygen will -# then run dia to produce the diagram and insert it in the documentation. The -# DIA_PATH tag allows you to specify the directory where the dia binary resides. -# If left empty dia is assumed to be found in the default search path. - -DIA_PATH = - # If set to YES the inheritance and collaboration graphs will hide inheritance # and usage relations if the target is undocumented or is not a class. # The default value is: YES. @@ -2187,23 +2114,6 @@ HAVE_DOT = $(HAVE_DOT) DOT_NUM_THREADS = 0 -# When you want a differently looking font in the dot files that doxygen -# generates you can specify the font name using DOT_FONTNAME. You need to make -# sure dot is able to find the font, which can be done by putting it in a -# standard location or by setting the DOTFONTPATH environment variable or by -# setting DOT_FONTPATH to the directory containing the font. -# The default value is: Helvetica. -# This tag requires that the tag HAVE_DOT is set to YES. - -DOT_FONTNAME = Helvetica - -# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of -# dot graphs. -# Minimum value: 4, maximum value: 24, default value: 10. -# This tag requires that the tag HAVE_DOT is set to YES. - -DOT_FONTSIZE = 10 - # By default doxygen will tell dot to use the default font as specified with # DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set # the path where dot can find it using this tag. @@ -2418,18 +2328,6 @@ DOT_GRAPH_MAX_NODES = 100 MAX_DOT_GRAPH_DEPTH = 0 -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, because dot on Windows does not seem -# to support this out of the box. -# -# Warning: Depending on the platform used, enabling this option may lead to -# badly anti-aliased labels on the edges of a graph (i.e. they become hard to -# read). -# The default value is: NO. -# This tag requires that the tag HAVE_DOT is set to YES. - -DOT_TRANSPARENT = YES - # Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) support diff --git a/doc/sphinx/installation.rst b/doc/sphinx/installation.rst index 46ba6fbe7ee..92f0ecb3d55 100644 --- a/doc/sphinx/installation.rst +++ b/doc/sphinx/installation.rst @@ -25,7 +25,7 @@ performance of the code. Therefore it is not possible to build a single binary that can satisfy all needs. For performance reasons a user should always activate only those features that are actually needed. This means, however, that learning how to compile is a necessary evil. -The build system of |es| uses CMake [4]_ to compile +The build system of |es| uses CMake to compile software easily on a wide range of platforms. Users who only need a "default" installation of |es| and have an account @@ -45,7 +45,7 @@ are required to be able to compile and use |es|: .. glossary:: CMake - The build system is based on CMake. + The build system is based on CMake version 3 or later [4]_. C++ compiler The C++ core of |es| needs to be built by a C++17-capable compiler. @@ -58,6 +58,11 @@ are required to be able to compile and use |es|: For some algorithms like P\ :math:`^3`\ M, |es| needs the FFTW library version 3 or later [5]_ for Fourier transforms, including header files. + CUDA + For some algorithms like P\ :math:`^3`\ M, + |es| provides GPU-accelerated implementations for NVIDIA GPUs. + We strongly recommend CUDA 12.0 or later [6]_. + MPI An MPI library that implements the MPI standard version 1.2 is required to run simulations in parallel. |es| is currently tested against @@ -88,7 +93,7 @@ are required to be able to compile and use |es|: Installing requirements on Ubuntu Linux ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -To compile |es| on Ubuntu 22.04 LTS, install the following dependencies: +To compile |es| on Ubuntu 24.04 LTS, install the following dependencies: .. code-block:: bash @@ -120,7 +125,7 @@ paths before building the project, for example via environment variables: .. code-block:: bash - export CUDA_TOOLKIT_ROOT_DIR="/usr/local/cuda-11.5" + export CUDA_TOOLKIT_ROOT_DIR="/usr/local/cuda-12.0" export PATH="${CUDA_TOOLKIT_ROOT_DIR}/bin${PATH:+:$PATH}" export LD_LIBRARY_PATH="${CUDA_TOOLKIT_ROOT_DIR}/lib64${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" @@ -130,41 +135,41 @@ to activate CUDA. These commands may need to be adapted depending on which operating system and CUDA version you are using. You can control the list of CUDA architectures to generate device code for. -For example, ``-D CMAKE_CUDA_ARCHITECTURES=61;75`` will generate device code -for both sm_61 and sm_75 architectures. +For example, ``CUDAARCHS="61;75" cmake .. -D ESPRESSO_BUILD_WITH_CUDA=ON`` +will generate device code for both sm_61 and sm_75 architectures. -On Ubuntu 22.04, the default GCC compiler is too recent for nvcc and will fail -to compile sources that rely on ``std::function``. You can either use GCC 10: +On Ubuntu 24.04, the default GCC compiler may too recent for nvcc. +You can either use GCC 12: .. code-block:: bash - CC=gcc-10 CXX=g++-10 CUDACXX=/usr/local/cuda-11.5/bin/nvcc cmake .. \ + CC=gcc-12 CXX=g++-12 CUDACXX=/usr/local/cuda-12.0/bin/nvcc cmake .. \ -D ESPRESSO_BUILD_WITH_CUDA=ON \ - -D CUDAToolkit_ROOT=/usr/local/cuda-11.5 \ - -D CMAKE_CUDA_FLAGS="--compiler-bindir=/usr/bin/g++-10" + -D CUDAToolkit_ROOT=/usr/local/cuda-12.0 \ + -D CMAKE_CUDA_FLAGS="--compiler-bindir=/usr/bin/g++-12" -or alternatively install Clang 14 as a replacement for nvcc and GCC: +or alternatively install Clang 18 as a replacement for nvcc and GCC: .. code-block:: bash - CC=clang-14 CXX=clang++-14 CUDACXX=clang++-14 cmake .. \ + CC=clang-18 CXX=clang++-18 CUDACXX=clang++-18 cmake .. \ -D ESPRESSO_BUILD_WITH_CUDA=ON \ - -D CUDAToolkit_ROOT=/usr/local/cuda-11.5 \ - -D CMAKE_CXX_FLAGS="-I/usr/include/x86_64-linux-gnu/c++/10 -I/usr/include/c++/10 --cuda-path=/usr/local/cuda-11.5" \ - -D CMAKE_CUDA_FLAGS="-I/usr/include/x86_64-linux-gnu/c++/10 -I/usr/include/c++/10 --cuda-path=/usr/local/cuda-11.5" + -D CUDAToolkit_ROOT=/usr/local/cuda-12.0 \ + -D CMAKE_CXX_FLAGS="-I/usr/include/x86_64-linux-gnu/c++/12 -I/usr/include/c++/12 --cuda-path=/usr/local/cuda-12.0" \ + -D CMAKE_CUDA_FLAGS="-I/usr/include/x86_64-linux-gnu/c++/12 -I/usr/include/c++/12 --cuda-path=/usr/local/cuda-12.0" Please note that all CMake options and compiler flags that involve ``/usr/local/cuda-*`` need to be adapted to your CUDA environment. But they are only necessary on systems with multiple CUDA releases installed, and can be safely removed if you have only one CUDA release installed. -Please also note that with Clang, you still need the GCC 10 toolchain, -which can be set up with ``apt install gcc-10 g++-10 libstdc++-10-dev``. +Please also note that with Clang, you still need the GCC 12 toolchain, +which can be set up with ``apt install gcc-12 g++-12 libstdc++-12-dev``. The extra compiler flags in the Clang CMake command above are needed to pin the search paths of Clang. By default, it searches trough the most recent -GCC version, which is GCC 12 on Ubuntu 22.04. It is not possible to install -the NVIDIA driver without GCC 12 due to a dependency resolution issue -(``nvidia-dkms`` depends on ``dkms`` which depends on ``gcc-12``). +GCC version, which is GCC 13 on Ubuntu 24.04. It is not possible to install +the NVIDIA driver without GCC 13 due to a dependency resolution issue +(``nvidia-dkms`` depends on ``dkms`` which depends on ``gcc-13``). .. _Requirements for building the documentation: @@ -255,11 +260,11 @@ Installing requirements on Windows via WSL To run |es| on Windows, use the Linux subsystem. For that you need to -* follow `these instructions `__ to install Ubuntu -* start Ubuntu (or open an Ubuntu tab in `Windows Terminal `__) +* follow `these instructions `__ to install Ubuntu +* start Ubuntu (or open an Ubuntu tab in `Windows Terminal `__) * execute ``sudo apt update`` to prepare the installation of dependencies * optional step: If you have a NVIDIA graphics card available and want to make - use of |es|'s GPU acceleration, follow `these instructions `__ + use of |es|'s GPU acceleration, follow `these instructions `__ to set up CUDA. * follow the instructions for :ref:`Installing requirements on Ubuntu Linux` @@ -807,12 +812,13 @@ When an option is enabled, additional options may become available. For example with ``-D ESPRESSO_BUILD_TESTS=ON``, one can specify the CTest parameters with ``-D ESPRESSO_CTEST_ARGS=-j$(nproc)``. -Environment variables can be passed to CMake. For example, to select Clang, use -``CC=clang CXX=clang++ CUDACXX=clang++ cmake .. -D ESPRESSO_BUILD_WITH_CUDA=ON``. -If you have multiple versions of the CUDA library installed, you can select the -correct one with ``CUDA_BIN_PATH=/usr/local/cuda-11.5 cmake .. -D ESPRESSO_BUILD_WITH_CUDA=ON`` -(with Clang as the CUDA compiler, you also need to override its default CUDA -path with ``-D CMAKE_CUDA_FLAGS=--cuda-path=/usr/local/cuda-11.5``). +Environment variables can be passed to CMake. For example, to select the Clang +compiler and specify which GPU architectures to generate device code for, use +``CC=clang CXX=clang++ CUDACXX=clang++ CUDAARCHS="61;75" cmake .. -D ESPRESSO_BUILD_WITH_CUDA=ON``. +When multiple versions of the CUDA library are available, the correct one can be +selected with ``CUDA_BIN_PATH=/usr/local/cuda-12.0 cmake .. -D ESPRESSO_BUILD_WITH_CUDA=ON`` +(with Clang as the CUDA compiler, it is also necessary to override its default +CUDA path with ``-D CMAKE_CUDA_FLAGS=--cuda-path=/usr/local/cuda-12.0``). .. _Build types and compiler flags: @@ -990,3 +996,6 @@ ____ .. [5] https://www.fftw.org/ + +.. [6] + https://docs.nvidia.com/cuda/ diff --git a/doc/sphinx/running.rst b/doc/sphinx/running.rst index d99937f7ff7..164e102cc71 100644 --- a/doc/sphinx/running.rst +++ b/doc/sphinx/running.rst @@ -770,16 +770,16 @@ and long-range forces (FFT summation) contribute equally to the runtime: .. code-block:: none - $ CALI_CONFIG_PROFILE=runtime-report ./pypresso ../samples/p3m.py --cpu - Path Inclusive time Exclusive time Time % - integrate 14.18 0.01 0.08 - Integration loop 13.84 0.43 2.88 - force_calc 13.41 0.20 1.35 - copy_forces_from_GPU 0.01 0.01 0.07 - short_range_loop 6.55 6.55 44.02 - calc_long_range_forces 6.40 6.40 43.00 - init_forces 0.24 0.24 1.58 - copy_particles_to_GPU 0.01 0.01 0.07 + $ CALI_CONFIG=runtime-report ./pypresso ../samples/p3m.py --cpu + Path Min time/rank Max time/rank Avg time/rank Time % + integrate 0.13 0.13 0.13 0.52 + Integration loop 1.49 1.49 1.49 6.03 + calculate_forces 1.14 1.14 1.14 4.62 + copy_particles_to_GPU 0.01 0.01 0.01 0.03 + init_forces 0.14 0.14 0.14 0.56 + calc_long_range_forces 8.78 8.78 8.78 35.66 + short_range_loop 10.77 10.77 10.77 43.76 + copy_forces_from_GPU 0.02 0.02 0.02 0.08 For the GPU implementation of the P3M algorithm, the long-range force calculation is cheaper, however the transfer of particle data to and from @@ -787,16 +787,16 @@ the GPU incur additional costs that are not negligible: .. code-block:: none - $ CALI_CONFIG_PROFILE=runtime-report ./pypresso ../samples/p3m.py --gpu - Path Inclusive time Exclusive time Time % - integrate 14.30 0.03 0.14 - Integration loop 13.87 1.76 7.90 - force_calc 12.12 0.82 3.68 - copy_forces_from_GPU 2.09 2.09 9.42 - short_range_loop 3.20 3.20 14.38 - calc_long_range_forces 3.75 3.75 16.87 - init_forces 1.25 1.25 5.61 - copy_particles_to_GPU 1.01 1.01 4.56 + $ CALI_CONFIG=runtime-report ./pypresso ../samples/p3m.py --gpu + Path Min time/rank Max time/rank Avg time/rank Time % + integrate 0.42 0.42 0.42 1.03 + Integration loop 0.50 0.50 0.50 1.22 + calculate_forces 0.62 0.62 0.62 1.51 + copy_particles_to_GPU 0.27 0.27 0.27 0.66 + init_forces 0.09 0.09 0.09 0.22 + calc_long_range_forces 0.60 0.60 0.60 1.46 + short_range_loop 0.85 0.85 0.85 2.06 + copy_forces_from_GPU 1.06 1.06 1.06 2.58 For a more fine-grained report on GPU kernels: diff --git a/maintainer/CI/build_cmake.sh b/maintainer/CI/build_cmake.sh index 7a95caaae96..eaf97e6c791 100755 --- a/maintainer/CI/build_cmake.sh +++ b/maintainer/CI/build_cmake.sh @@ -232,8 +232,8 @@ fi if [ "${with_cuda}" = true ]; then cmake_params="-D ESPRESSO_BUILD_WITH_CUDA=ON -D CUDAToolkit_ROOT=/usr/lib/cuda ${cmake_params}" - if [ "${CUDACXX}" = "" ]; then - cmake_params="-D CMAKE_CUDA_FLAGS='--compiler-bindir=/usr/bin/g++-10' ${cmake_params}" + if [ "${CUDACXX}" = "" ] && [ "${CXX}" != "" ]; then + cmake_params="-D CMAKE_CUDA_FLAGS='--compiler-bindir=$(which "${CXX}")' ${cmake_params}" fi else cmake_params="-D ESPRESSO_BUILD_WITH_CUDA=OFF ${cmake_params}" @@ -264,9 +264,19 @@ cd "${builddir}" # load MPI module if necessary if [ -f "/etc/os-release" ]; then - grep -q suse /etc/os-release && . /etc/profile.d/modules.sh && module load gnu-openmpi - grep -q 'rhel\|fedora' /etc/os-release && for f in /etc/profile.d/*module*.sh; do . "${f}"; done && module load mpi - grep -q "Ubuntu 22.04" /etc/os-release && export MPIEXEC_PREFLAGS="--mca;btl_vader_single_copy_mechanism;none${mpiexec_preflags:+;$mpiexec_preflags}" + grep -q "suse" /etc/os-release && . /etc/profile.d/modules.sh && module load gnu-openmpi + grep -q "rhel\|fedora" /etc/os-release && for f in /etc/profile.d/*module*.sh; do . "${f}"; done && module load mpi +fi + +# setup environment +if grep -q "Ubuntu" /etc/os-release; then + default_gcov="$(which "gcov")" + custom_gcov="$(which "${GCOV:-gcov}")" + if [ ! "${custom_gcov}" = "${default_gcov}" ] && [ -d "${HOME}/.local/var/lib/alternatives" ]; then + update-alternatives --altdir "${HOME}/.local/etc/alternatives" \ + --admindir "${HOME}/.local/var/lib/alternatives" \ + --install "${HOME}/.local/bin/gcov" "gcov" "${custom_gcov}" 10 + fi fi # CONFIGURE @@ -400,12 +410,20 @@ if [ "${with_coverage}" = true ] || [ "${with_coverage_python}" = true ]; then if [ "${with_coverage}" = true ]; then echo "Running lcov and gcov..." codecov_opts="${codecov_opts} --gcov" - lcov --gcov-tool "${GCOV:-gcov}" -q --directory . --ignore-errors graph --capture --output-file coverage.info # capture coverage info - lcov --gcov-tool "${GCOV:-gcov}" -q --remove coverage.info '/usr/*' --output-file coverage.info # filter out system - lcov --gcov-tool "${GCOV:-gcov}" -q --remove coverage.info '*/doc/*' --output-file coverage.info # filter out docs - if [ -d _deps/ ]; then - lcov --gcov-tool "${GCOV:-gcov}" -q --remove coverage.info $(realpath _deps/)'/*' --output-file coverage.info # filter out external projects - fi + lcov --gcov-tool "${GCOV:-gcov}" \ + --quiet \ + --ignore-errors graph,mismatch,mismatch,gcov,unused \ + --directory . \ + --filter brace,blank,range,region \ + --capture \ + --rc lcov_json_module="JSON::XS" \ + --exclude "/usr/*" \ + --exclude "$(realpath .)/_deps/*" \ + --exclude "$(realpath .)/src/python/espressomd/*" \ + --exclude "$(realpath "${srcdir}")/src/walberla_bridge/src/*/generated_kernels/*" \ + --exclude "$(realpath "${srcdir}")/libs/*" \ + --exclude "*/tmpxft_*cudafe1.stub.*" \ + --output-file coverage.info fi if [ "${with_coverage_python}" = true ]; then echo "Running python3-coverage..." diff --git a/maintainer/CI/doc_warnings.sh b/maintainer/CI/doc_warnings.sh index dc084d1313d..d9f4eac093a 100755 --- a/maintainer/CI/doc_warnings.sh +++ b/maintainer/CI/doc_warnings.sh @@ -31,7 +31,7 @@ # not enclosed within tags. Sphinx doesn't use line # wrapping, so these broken links can be found via text search. The first # negative lookahead filters out common Python types (for performance reasons). -regex_sphinx_broken_link='(?!(int|float|complex|bool|str|bytes|array|bytearray|memoryview|object|list|tuple|range|slice|dict|set|frozenset|(?:numpy\.|np\.)?(?:nd)?array)<)[^<>]+?(?!)' +regex_sphinx_broken_link='(?!(int|float|complex|bool|str|bytes|array|bytearray|memoryview|object|list|tuple|range|slice|dict|set|frozenset|(?:numpy\.|np\.)?(?:nd)?array|EnumType|IntEnum|StrEnum|ReprEnum|Enum|IntFlag|Flag)<)[^<>]+?(?!)' if [ ! -f doc/sphinx/html/index.html ]; then echo "Please run Sphinx first." diff --git a/maintainer/CI/jupyter_warnings.py b/maintainer/CI/jupyter_warnings.py index 520754b73ec..8b286395df4 100755 --- a/maintainer/CI/jupyter_warnings.py +++ b/maintainer/CI/jupyter_warnings.py @@ -23,9 +23,11 @@ """ import sys +import json import pathlib import lxml.etree +import jupyter_core.paths import nbformat import nbconvert @@ -58,7 +60,15 @@ def detect_invalid_urls(nb, build_root='.', html_exporter=None): ''' # convert notebooks to HTML if html_exporter is None: - html_exporter = nbconvert.HTMLExporter() + kwargs = {} + for path in jupyter_core.paths.jupyter_config_path(): + filepath = pathlib.Path(path) / "jupyter_nbconvert_config.json" + if filepath.is_file(): + with open(filepath) as f: + config = json.load(f) + kwargs = config.get("Exporter", {}) + break + html_exporter = nbconvert.HTMLExporter(**kwargs) html_exporter.template_name = 'classic' html_string = html_exporter.from_notebook_node(nb)[0] # parse HTML diff --git a/maintainer/walberla_kernels/code_generation_context.py b/maintainer/walberla_kernels/code_generation_context.py index a60495030f0..2dd3aa39be1 100644 --- a/maintainer/walberla_kernels/code_generation_context.py +++ b/maintainer/walberla_kernels/code_generation_context.py @@ -25,6 +25,7 @@ import lbmpy_walberla import pystencils import pystencils_walberla +import pystencils_walberla.codegen def adapt_pystencils(): diff --git a/maintainer/walberla_kernels/custom_additional_extensions.py b/maintainer/walberla_kernels/custom_additional_extensions.py index 3b2d6acb51c..1f12b7a055c 100644 --- a/maintainer/walberla_kernels/custom_additional_extensions.py +++ b/maintainer/walberla_kernels/custom_additional_extensions.py @@ -189,7 +189,7 @@ def data_initialisation(self, direction): dirVec = self.stencil_info[direction][1] init_list = [ - f"Vector3<{self.data_type}> InitialisatonAdditionalData = elementInitaliser(Cell(it.x() + {dirVec[0]}, it.y() + {dirVec[1]}, it.z() + {dirVec[2]}), blocks, *block);", + f"Vector3<{self.data_type}> InitialisatonAdditionalData = elementInitaliser(Cell(it.x() + {dirVec[0]}, it.y() + {dirVec[1]}, it.z() + {dirVec[2]}), blocks, *block);", # nopep8 "element.flux_0 = InitialisatonAdditionalData[0];", "element.flux_1 = InitialisatonAdditionalData[1];"] if self._dim == 3: diff --git a/maintainer/walberla_kernels/generate_lb_kernels.py b/maintainer/walberla_kernels/generate_lb_kernels.py index ec596ef3f38..2c79a211ba6 100644 --- a/maintainer/walberla_kernels/generate_lb_kernels.py +++ b/maintainer/walberla_kernels/generate_lb_kernels.py @@ -67,6 +67,7 @@ def paramlist(parameters, keys): with code_generation_context.CodeGeneration() as ctx: ctx.double_accuracy = not args.single_precision if target == ps.Target.GPU: + ctx.gpu = True ctx.cuda = True # vectorization parameters diff --git a/maintainer/walberla_kernels/pystencils_espresso.py b/maintainer/walberla_kernels/pystencils_espresso.py index 1980ba14387..e139eda94b6 100644 --- a/maintainer/walberla_kernels/pystencils_espresso.py +++ b/maintainer/walberla_kernels/pystencils_espresso.py @@ -28,7 +28,7 @@ def skip_philox_unthermalized(code, result_symbols, rng_name): for r in result_symbols: statement = f" {r.name};" - assert statement in code, f"no declaration for variable '{r.name}' in '{code}'" + assert statement in code, f"no declaration for variable '{r.name}' in '{code}'" # nopep8 code = code.replace(statement, f" {r.name}{{}};", 1) statement = f"{rng_name}(" assert code.count(statement) == 1, f"need 1 '{rng_name}' call in '{code}'" diff --git a/maintainer/walberla_kernels/templates/Boundary.tmpl.h b/maintainer/walberla_kernels/templates/Boundary.tmpl.h index bdeaf57c06d..7b86c47b784 100644 --- a/maintainer/walberla_kernels/templates/Boundary.tmpl.h +++ b/maintainer/walberla_kernels/templates/Boundary.tmpl.h @@ -31,8 +31,8 @@ {% if target is equalto 'cpu' -%} #include {%- elif target is equalto 'gpu' -%} -#include -#include +#include +#include {%- endif %} #include #include @@ -85,7 +85,7 @@ class {{class_name}} {% if target == 'gpu' -%} ~IndexVectors() { for( auto & gpuVec: gpuVectors_) - cudaFree( gpuVec ); + gpuFree( gpuVec ); } {% endif -%} @@ -100,7 +100,7 @@ class {{class_name}} { {% if target == 'gpu' -%} for( auto & gpuVec: gpuVectors_) - cudaFree( gpuVec ); + gpuFree( gpuVec ); gpuVectors_.resize( cpuVectors_.size() ); WALBERLA_ASSERT_EQUAL(cpuVectors_.size(), NUM_TYPES); @@ -108,8 +108,8 @@ class {{class_name}} { auto & gpuVec = gpuVectors_[i]; auto & cpuVec = cpuVectors_[i]; - cudaMalloc( &gpuVec, sizeof({{StructName}}) * cpuVec.size() ); - cudaMemcpy( gpuVec, &cpuVec[0], sizeof({{StructName}}) * cpuVec.size(), cudaMemcpyHostToDevice ); + gpuMalloc( &gpuVec, sizeof({{StructName}}) * cpuVec.size() ); + gpuMemcpy( gpuVec, &cpuVec[0], sizeof({{StructName}}) * cpuVec.size(), gpuMemcpyHostToDevice ); } {%- endif %} } @@ -136,12 +136,12 @@ class {{class_name}} {}; void run ( - {{- ["IBlock * block", kernel.kernel_selection_parameters, ["cudaStream_t stream = nullptr"] if target == 'gpu' else []] | type_identifier_list -}} + {{- ["IBlock * block", kernel.kernel_selection_parameters, ["gpuStream_t stream = nullptr"] if target == 'gpu' else []] | type_identifier_list -}} ); {% if generate_functor -%} void operator() ( - {{- ["IBlock * block", kernel.kernel_selection_parameters, ["cudaStream_t stream = nullptr"] if target == 'gpu' else []] | type_identifier_list -}} + {{- ["IBlock * block", kernel.kernel_selection_parameters, ["gpuStream_t stream = nullptr"] if target == 'gpu' else []] | type_identifier_list -}} ) { run( {{- ["block", kernel.kernel_selection_parameters, ["stream"] if target == 'gpu' else []] | identifier_list -}} ); @@ -149,28 +149,28 @@ class {{class_name}} {%- endif %} void inner ( - {{- ["IBlock * block", kernel.kernel_selection_parameters, ["cudaStream_t stream = nullptr"] if target == 'gpu' else []] | type_identifier_list -}} + {{- ["IBlock * block", kernel.kernel_selection_parameters, ["gpuStream_t stream = nullptr"] if target == 'gpu' else []] | type_identifier_list -}} ); void outer ( - {{- ["IBlock * block", kernel.kernel_selection_parameters, ["cudaStream_t stream = nullptr"] if target == 'gpu' else []] | type_identifier_list -}} + {{- ["IBlock * block", kernel.kernel_selection_parameters, ["gpuStream_t stream = nullptr"] if target == 'gpu' else []] | type_identifier_list -}} ); - std::function getSweep( {{- [interface_spec.high_level_args, ["cudaStream_t stream = nullptr"] if target == 'gpu' else []] | type_identifier_list -}} ) + std::function getSweep( {{- [interface_spec.high_level_args, ["gpuStream_t stream = nullptr"] if target == 'gpu' else []] | type_identifier_list -}} ) { return [ {{- ["this", interface_spec.high_level_args, ["stream"] if target == 'gpu' else []] | identifier_list -}} ] (IBlock * b) { this->run( {{- [ ['b'], interface_spec.mapping_codes, ["stream"] if target == 'gpu' else [] ] | identifier_list -}} ); }; } - std::function getInnerSweep( {{- [interface_spec.high_level_args, ["cudaStream_t stream = nullptr"] if target == 'gpu' else []] | type_identifier_list -}} ) + std::function getInnerSweep( {{- [interface_spec.high_level_args, ["gpuStream_t stream = nullptr"] if target == 'gpu' else []] | type_identifier_list -}} ) { return [ {{- [ ['this'], interface_spec.high_level_args, ["stream"] if target == 'gpu' else [] ] | identifier_list -}} ] (IBlock * b) { this->inner( {{- [ ['b'], interface_spec.mapping_codes, ["stream"] if target == 'gpu' else [] ] | identifier_list -}} ); }; } - std::function getOuterSweep( {{- [interface_spec.high_level_args, ["cudaStream_t stream = nullptr"] if target == 'gpu' else []] | type_identifier_list -}} ) + std::function getOuterSweep( {{- [interface_spec.high_level_args, ["gpuStream_t stream = nullptr"] if target == 'gpu' else []] | type_identifier_list -}} ) { return [ {{- [ ['this'], interface_spec.high_level_args, ["stream"] if target == 'gpu' else [] ] | identifier_list -}} ] (IBlock * b) @@ -198,7 +198,7 @@ class {{class_name}} auto * flagField = block->getData< FlagField_T > ( flagFieldID ); {{additional_data_handler.additional_field_data|indent(4)}} - assert(flagField->flagExists(boundaryFlagUID and + assert(flagField->flagExists(boundaryFlagUID) and flagField->flagExists(domainFlagUID)); auto boundaryFlag = flagField->getFlag(boundaryFlagUID); @@ -293,7 +293,7 @@ class {{class_name}} private: void run_impl( {{- ["IBlock * block", "IndexVectors::Type type", - kernel.kernel_selection_parameters, ["cudaStream_t stream = nullptr"] if target == 'gpu' else []] + kernel.kernel_selection_parameters, ["gpuStream_t stream = nullptr"] if target == 'gpu' else []] | type_identifier_list -}} ); diff --git a/requirements.txt b/requirements.txt index 600bfca1a71..796992dc913 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,39 +1,40 @@ # build system -cython>=0.29.21,<=3.0.7 +cython>=0.29.21,<3.0.10 setuptools>=68.1.2 packaging>=24.0 # required scientific packages -numpy>=1.23 -h5py>=3.6.0 +numpy>=1.26.4 +h5py>=3.10.0 # optional scientific packages -scipy>=1.8.0 -pint>=0.18 +scipy>=1.11.4 +pint>=0.19.2 # optional packages for graphics and external devices -matplotlib>=3.5.1 -vtk>=9.1.0 +matplotlib>=3.6.3 +vtk==9.1.0 PyOpenGL>=3.1.5 pygame>=2.1.2 # waLBerla dependencies pystencils==1.2 lbmpy==1.2 -sympy==1.9 +sympy==1.12 islpy==2022.2.1 -jinja2>=3.0.3 +jinja2>=3.1.2 # CI-related -requests>=2.25.1 -lxml>=4.8.0 -coverage>=6.2 +requests>=2.31.0 +lxml>=5.1.0 +coverage>=7.4.4 # sphinx and its dependencies -sphinx>=4.3.2 +sphinx>=7.2.6 sphinx-toggleprompt==0.4.0 -sphinxcontrib-bibtex>=2.6.1 -numpydoc>=1.5.0 -pybtex>=0.23 +sphinxcontrib-bibtex>=2.6.2 +numpydoc>=1.6.0 +pybtex>=0.24.0 # jupyter dependencies -jupyterlab>=4.0.8 -nbformat==5.1.3 -nbconvert==6.5.1 -tqdm>=4.57.0 +jupyterlab>=3.5 +ipykernel>=6.29.3 +nbformat==5.9.1 +nbconvert==6.5.3 +tqdm>=4.66.2 # linters and their dependencies pep8==1.7.1 autopep8==2.1.0 diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index ff46c13e12b..e81d413ea0d 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -121,3 +121,10 @@ add_subdirectory(virtual_sites) if(ESPRESSO_BUILD_TESTS) add_subdirectory(unit_tests) endif() + +if(ESPRESSO_BUILD_WITH_HDF5 AND ESPRESSO_BUILD_WITH_COVERAGE + AND NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang") + set_source_files_properties( + io/writer/h5md_core.cpp PROPERTIES COMPILE_OPTIONS -felide-constructors + DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) +endif() diff --git a/src/python/espressomd/CMakeLists.txt b/src/python/espressomd/CMakeLists.txt index 4c188ce6a14..fc60e7d026d 100644 --- a/src/python/espressomd/CMakeLists.txt +++ b/src/python/espressomd/CMakeLists.txt @@ -45,6 +45,7 @@ target_compile_options( $<$:-Wno-strict-aliasing> $<$:-Wno-maybe-uninitialized> $<$:-Wno-volatile> + $<$:-Wno-missing-field-initializers> $<$:-Wno-sometimes-uninitialized> $<$:-Wno-\#warnings> -Wno-unused-variable) @@ -69,11 +70,9 @@ foreach(cython_file ${cython_SRC}) add_custom_command( OUTPUT ${outputpath} COMMAND - ${CYTHON_EXECUTABLE} - $<$:--warning-errors> -3 --cplus - --directive embedsignature=True --directive binding=True -I - ${CMAKE_CURRENT_SOURCE_DIR} -I ${CMAKE_CURRENT_BINARY_DIR} - ${cython_file} -o ${outputpath} + ${CYTHON_EXECUTABLE} -3 --cplus --directive embedsignature=True + --directive binding=True -I ${CMAKE_CURRENT_SOURCE_DIR} -I + ${CMAKE_CURRENT_BINARY_DIR} ${cython_file} -o ${outputpath} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/.. DEPENDS ${cython_file} ${cython_HEADER}) set(target "espressomd_${basename}") diff --git a/src/script_interface/CMakeLists.txt b/src/script_interface/CMakeLists.txt index 14a9f75bd9f..3e795b23656 100644 --- a/src/script_interface/CMakeLists.txt +++ b/src/script_interface/CMakeLists.txt @@ -64,10 +64,14 @@ target_link_libraries( set_source_files_properties( ${CMAKE_CURRENT_SOURCE_DIR}/particle_data/ParticleHandle.cpp - PROPERTIES COMPILE_FLAGS -fno-finite-math-only) + PROPERTIES COMPILE_OPTIONS -fno-finite-math-only) target_include_directories(espresso_script_interface PUBLIC ${CMAKE_SOURCE_DIR}/src) +if(ESPRESSO_BUILD_WITH_COVERAGE AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + target_compile_options(espresso_script_interface + PRIVATE -fno-default-inline -fno-elide-constructors) +endif() if(ESPRESSO_BUILD_TESTS) add_subdirectory(tests) diff --git a/testsuite/python/caliper.py b/testsuite/python/caliper.py index e5cf639a9cb..67aedbb11bc 100644 --- a/testsuite/python/caliper.py +++ b/testsuite/python/caliper.py @@ -26,16 +26,23 @@ import os EXPECTED_LABELS = """ -calc_energies - short_range_loop integrate - Integration loop + Initial Force Calculation calculate_forces - copy_forces_from_GPU - short_range_loop - calc_long_range_forces + copy_particles_to_GPU init_forces + calc_long_range_forces + short_range_loop + copy_forces_from_GPU + Integration loop + calculate_forces copy_particles_to_GPU + init_forces + calc_long_range_forces + short_range_loop + copy_forces_from_GPU +calc_energies + short_range_loop """ @@ -47,7 +54,7 @@ def test_runtime_report(self): has_cuda = espressomd.has_features(["CUDA"]) script = str(pathlib.Path(__file__).parent / "caliper_child.py") my_env = os.environ.copy() - my_env["CALI_CONFIG_PROFILE"] = "runtime-report" + my_env["CALI_CONFIG"] = "runtime-report" process = subprocess.Popen([sys.executable, script], stdout=subprocess.PIPE, stderr=subprocess.PIPE, @@ -58,7 +65,7 @@ def test_runtime_report(self): if not line.startswith("WARNING:"): lines = lines[i:] break - header = "Path\tInclusive time\tExclusive\ttime\tTime %" + header = "Path\tMin time/rank\tMax time/rank\tAvg time/rank\tTime %" self.assertEqual(lines[0].split(), header.split(), msg=f"Caliper summary should start with '{header}'") labels = [line[:30].strip() for line in lines[1:]] diff --git a/testsuite/python/sigint.py b/testsuite/python/sigint.py index c719bdf4f1f..a8d9b1bbb3b 100644 --- a/testsuite/python/sigint.py +++ b/testsuite/python/sigint.py @@ -41,7 +41,9 @@ def check_signal_handling(self, process, sig): # capture stderr and return code (negative of signum) stdout, stderr = process.communicate(input=None, timeout=16.) assert stdout is None - traceback = stderr.decode() + traceback = ( + stderr.decode() + .replace("\n[WARNING] yaksa: 1 leaked handle pool objects", "")) return_code = process.poll() signum = -return_code self.assertEqual(signum, sig.value) diff --git a/testsuite/python/sigint_child.py b/testsuite/python/sigint_child.py index 27a79e189a5..8e94847dd2c 100644 --- a/testsuite/python/sigint_child.py +++ b/testsuite/python/sigint_child.py @@ -20,6 +20,8 @@ import numpy as np import espressomd +np.random.seed(42) + system = espressomd.System(box_l=[100, 100, 100]) system.time_step = 0.01 system.cell_system.skin = 0.1