Skip to content

Commit 2af93d5

Browse files
authored
Merge branch 'python' into visualizer_fix
2 parents 498f9d1 + 97f1853 commit 2af93d5

File tree

123 files changed

+2338
-1717
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+2338
-1717
lines changed

.clang-tidy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@ Checks: |
4343
readability-function-size'
4444
WarningsAsErrors: '*,-clang-analyzer-core.StackAddrEscapeBase,-clang-analyzer-optin.mpi.MPI-Checker'
4545
HeaderFilterRegex: '.*'
46+
ExcludeHeaderFilterRegex: '^/usr/'
4647
FormatStyle: none
4748
User: espresso
48-
CheckOptions:
49+
CheckOptions:
4950
- key: bugprone-argument-comment.StrictMode
5051
value: '0'
5152
- key: bugprone-assert-side-effect.AssertMacros

.github/workflows/push_pull.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
debian:
5858
runs-on: ubuntu-latest
5959
container:
60-
image: ghcr.io/espressomd/docker/debian:b858760d11a10767efa9e8b28b9a7fbfcf899e3a-base-layer
60+
image: ghcr.io/espressomd/docker/debian:3388b293a5e8a9b613b1bfa4220e54dfb4bff245-base-layer
6161
credentials:
6262
username: ${{ github.actor }}
6363
password: ${{ secrets.github_token }}
@@ -99,7 +99,7 @@ jobs:
9999
runs-on: ubuntu-latest
100100
if: ${{ github.repository == 'espressomd/espresso' }}
101101
container:
102-
image: ghcr.io/espressomd/docker/ubuntu-wo-dependencies:b858760d11a10767efa9e8b28b9a7fbfcf899e3a-base-layer
102+
image: ghcr.io/espressomd/docker/ubuntu-wo-dependencies:3388b293a5e8a9b613b1bfa4220e54dfb4bff245-base-layer
103103
credentials:
104104
username: ${{ github.actor }}
105105
password: ${{ secrets.github_token }}
@@ -141,7 +141,7 @@ jobs:
141141
runs-on: ubuntu-latest
142142
if: ${{ github.repository == 'espressomd/espresso' }}
143143
container:
144-
image: ghcr.io/espressomd/docker/fedora:b858760d11a10767efa9e8b28b9a7fbfcf899e3a-base-layer
144+
image: ghcr.io/espressomd/docker/fedora:3388b293a5e8a9b613b1bfa4220e54dfb4bff245-base-layer
145145
credentials:
146146
username: ${{ github.actor }}
147147
password: ${{ secrets.github_token }}

.gitlab-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
image: ghcr.io/espressomd/docker/ubuntu:b858760d11a10767efa9e8b28b9a7fbfcf899e3a
1+
image: ghcr.io/espressomd/docker/ubuntu:3388b293a5e8a9b613b1bfa4220e54dfb4bff245
22

33
stages:
44
- prepare
@@ -16,7 +16,7 @@ stages:
1616

1717
.notification_job_template: &notification_job_definition
1818
<<: *global_job_definition
19-
image: ghcr.io/espressomd/docker/fedora:b858760d11a10767efa9e8b28b9a7fbfcf899e3a
19+
image: ghcr.io/espressomd/docker/alpine:3388b293a5e8a9b613b1bfa4220e54dfb4bff245
2020
variables:
2121
GET_SOURCES_ATTEMPTS: 3
2222
dependencies: []

CMakeLists.txt

Lines changed: 148 additions & 100 deletions
Large diffs are not rendered by default.

cmake/FindCUDACompilerClang.cmake

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (C) 2009-2022 The ESPResSo project
2+
# Copyright (C) 2009-2025 The ESPResSo project
33
# Copyright (C) 2009,2010
44
# Max-Planck-Institute for Polymer Research, Theory Group
55
#
@@ -80,41 +80,6 @@ if(NOT CMAKE_CUDA_FLAGS MATCHES "-Wno-unknown-cuda-version")
8080
endif()
8181
message(STATUS "Found CUDA toolkit installation: ${ESPRESSO_CLANG_DETECTED_CUDA_DIR} (recognized by ${CMAKE_CUDA_COMPILER_ID} as CUDA ${ESPRESSO_CLANG_DETECTED_CUDA_VERSION})")
8282

83-
target_compile_options(
84-
espresso_cuda_flags
85-
INTERFACE
86-
$<$<CONFIG:Debug>:-g>
87-
$<$<CONFIG:Release>:-O3 -DNDEBUG>
88-
$<$<CONFIG:MinSizeRel>:-O2 -DNDEBUG>
89-
$<$<CONFIG:RelWithDebInfo>:-O2 -g -DNDEBUG>
90-
$<$<CONFIG:Coverage>:-O3 -g -fprofile-instr-generate -fcoverage-mapping>
91-
$<$<CONFIG:RelWithAssert>:-O3 -g>
92-
)
93-
94-
function(espresso_configure_gpu_target)
95-
cmake_parse_arguments(TARGET "" "NAME" "SOURCES" ${ARGN})
96-
set_source_files_properties(${TARGET_SOURCES} PROPERTIES LANGUAGE "CUDA")
97-
set_target_properties(${TARGET_NAME} PROPERTIES LINKER_LANGUAGE "CXX")
98-
target_link_libraries(${TARGET_NAME} PRIVATE espresso::cuda_flags)
99-
endfunction()
100-
101-
function(espresso_add_gpu_library)
102-
add_library(${ARGV})
103-
cmake_parse_arguments(ARG "STATIC;SHARED;MODULE;EXCLUDE_FROM_ALL" "" "" ${ARGN})
104-
list(GET ARGV 0 TARGET_NAME)
105-
set(TARGET_SOURCES ${ARG_UNPARSED_ARGUMENTS})
106-
list(POP_FRONT TARGET_SOURCES)
107-
espresso_configure_gpu_target(NAME ${TARGET_NAME} SOURCES ${TARGET_SOURCES})
108-
endfunction()
109-
110-
function(espresso_add_gpu_executable)
111-
add_executable(${ARGV})
112-
list(GET ARGV 0 TARGET_NAME)
113-
set(TARGET_SOURCES ${ARGV})
114-
list(POP_FRONT TARGET_SOURCES)
115-
espresso_configure_gpu_target(NAME ${TARGET_NAME} SOURCES ${TARGET_SOURCES})
116-
endfunction()
117-
11883
include(FindPackageHandleStandardArgs)
11984
find_package_handle_standard_args(
12085
CUDACompilerClang REQUIRED_VARS CMAKE_CUDA_COMPILER VERSION_VAR

cmake/FindCUDACompilerNVCC.cmake

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (C) 2009-2022 The ESPResSo project
2+
# Copyright (C) 2009-2025 The ESPResSo project
33
# Copyright (C) 2009,2010
44
# Max-Planck-Institute for Polymer Research, Theory Group
55
#
@@ -25,37 +25,6 @@
2525
set(CUDA_LINK_LIBRARIES_KEYWORD PUBLIC)
2626
set(CUDA_PROPAGATE_HOST_FLAGS OFF)
2727

28-
target_compile_options(
29-
espresso_cuda_flags
30-
INTERFACE
31-
$<$<CONFIG:Debug>:-g -G>
32-
$<$<CONFIG:Release>:-Xptxas=-O3 -Xcompiler=-O3 -DNDEBUG>
33-
$<$<CONFIG:MinSizeRel>:-Xptxas=-O2 -Xcompiler=-Os -DNDEBUG>
34-
$<$<CONFIG:RelWithDebInfo>:-Xptxas=-O2 -Xcompiler=-O2,-g -DNDEBUG>
35-
$<$<CONFIG:Coverage>:-Xptxas=-O3 -Xcompiler=-Og,-g,--coverage,-fprofile-abs-path>
36-
$<$<CONFIG:RelWithAssert>:-Xptxas=-O3 -Xcompiler=-O3,-g>
37-
$<$<BOOL:${CMAKE_OSX_SYSROOT}>:-Xcompiler=-isysroot;-Xcompiler=${CMAKE_OSX_SYSROOT}>
38-
# workaround for https://github.com/espressomd/espresso/issues/4943
39-
$<$<BOOL:${ESPRESSO_BUILD_WITH_CCACHE}>:$<$<CONFIG:Coverage>:--coverage -fprofile-abs-path>>
40-
)
41-
42-
function(espresso_configure_gpu_target)
43-
set(TARGET_NAME ${ARGV0})
44-
set_target_properties(${TARGET_NAME} PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
45-
target_link_libraries(${TARGET_NAME} PRIVATE espresso::cuda_flags $<$<CONFIG:Coverage>:gcov>)
46-
espresso_add_cuda_rpaths(${TARGET_NAME})
47-
endfunction()
48-
49-
function(espresso_add_gpu_library)
50-
add_library(${ARGV})
51-
espresso_configure_gpu_target(${ARGV0})
52-
endfunction()
53-
54-
function(espresso_add_gpu_executable)
55-
add_executable(${ARGV})
56-
espresso_configure_gpu_target(${ARGV0})
57-
endfunction()
58-
5928
include(FindPackageHandleStandardArgs)
6029
find_package_handle_standard_args(
6130
CUDACompilerNVCC REQUIRED_VARS CMAKE_CUDA_COMPILER VERSION_VAR

cmake/espresso_unit_test.cmake

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,44 +19,45 @@
1919

2020
# generate a test name based on the file name
2121
function(espresso_unit_test_make_name)
22-
cmake_parse_arguments(TEST "" "SRC;NAME" "" ${ARGN})
22+
cmake_parse_arguments(TEST "" "SRC;NAME;SUFFIX" "" ${ARGN})
2323
if(NOT DEFINED TEST_NAME)
2424
cmake_path(GET TEST_SRC STEM TEST_NAME)
2525
set(TEST_NAME ${TEST_NAME} PARENT_SCOPE)
26+
if(DEFINED TEST_SUFFIX)
27+
set(TEST_NAME ${TEST_NAME}_${TEST_SUFFIX} PARENT_SCOPE)
28+
endif()
29+
elseif(DEFINED TEST_SUFFIX)
30+
message(FATAL_ERROR "Cannot provide both a NAME and SUFFIX (test: ${TEST_SRC})")
2631
endif()
2732
endfunction()
2833

2934
# create the executable of a unit test
3035
function(espresso_unit_test_executable)
31-
cmake_parse_arguments(TEST "" "SRC;NAME;NUM_PROC;NUM_THREADS" "DEPENDS" ${ARGN})
32-
espresso_unit_test_make_name(SRC ${TEST_SRC} NAME ${TEST_NAME})
33-
if(${TEST_SRC} MATCHES ".*\.cu$")
34-
espresso_add_gpu_executable(${TEST_NAME} ${TEST_SRC})
35-
else()
36-
add_executable(${TEST_NAME} ${TEST_SRC})
36+
cmake_parse_arguments(TEST "" "SRC;NAME;SUFFIX;NUM_PROC;NUM_THREADS" "DEPENDS" ${ARGN})
37+
if(DEFINED TEST_UNPARSED_ARGUMENTS)
38+
message(FATAL_ERROR "Cannot parse arguments ${TEST_UNPARSED_ARGUMENTS}")
3739
endif()
40+
espresso_unit_test_make_name(${ARGV})
41+
add_executable(${TEST_NAME} ${TEST_SRC})
3842
espresso_set_common_target_properties(${TEST_NAME})
3943
# Build tests only when testing
4044
set_target_properties(${TEST_NAME} PROPERTIES EXCLUDE_FROM_ALL ON)
41-
target_link_libraries(${TEST_NAME} PRIVATE Boost::unit_test_framework)
42-
if(TEST_DEPENDS)
43-
target_link_libraries(${TEST_NAME} PRIVATE ${TEST_DEPENDS})
44-
endif()
45+
target_link_libraries(
46+
${TEST_NAME} PRIVATE Boost::unit_test_framework espresso::config
47+
espresso::compiler_flags espresso::tests::compiler_flags ${TEST_DEPENDS})
4548
target_include_directories(${TEST_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/src/core)
46-
if(${TEST_SRC} MATCHES ".*\.cu$")
47-
target_link_libraries(${TEST_NAME} PRIVATE espresso::config CUDA::cudart)
48-
else()
49-
target_link_libraries(${TEST_NAME} PRIVATE espresso::config espresso::cpp_flags espresso::tests::cpp_flags)
50-
endif()
5149
if(ESPRESSO_BUILD_WITH_CUDA)
5250
espresso_add_cuda_rpaths(${TEST_NAME}) # for GPU-aware MPI vendors
5351
endif()
5452
endfunction()
5553

5654
# register the executable of a unit test in the CTest suite
5755
function(espresso_unit_test_register)
58-
cmake_parse_arguments(TEST "" "SRC;NAME;NUM_PROC;NUM_THREADS;TARGET" "DEPENDS" ${ARGN})
59-
espresso_unit_test_make_name(SRC ${TEST_SRC} NAME ${TEST_NAME})
56+
cmake_parse_arguments(TEST "" "SRC;NAME;SUFFIX;NUM_PROC;NUM_THREADS;TARGET" "DEPENDS" ${ARGN})
57+
if(DEFINED TEST_UNPARSED_ARGUMENTS)
58+
message(FATAL_ERROR "Cannot parse arguments ${TEST_UNPARSED_ARGUMENTS}")
59+
endif()
60+
espresso_unit_test_make_name(${ARGV})
6061
if(NOT DEFINED TEST_TARGET)
6162
set(TEST_TARGET ${TEST_NAME})
6263
endif()
@@ -66,8 +67,8 @@ function(espresso_unit_test_register)
6667
set(TEST_NUM_PROC ${ESPRESSO_TEST_NP})
6768
endif()
6869
espresso_set_mpiexec_tmpdir(${TEST_NAME})
69-
add_test(NAME ${TEST_NAME} COMMAND ${MPIEXEC} ${ESPRESSO_MPIEXEC_PREFLAGS}
70-
${MPIEXEC_NUMPROC_FLAG} ${TEST_NUM_PROC} ${MPIEXEC_PREFLAGS}
70+
add_test(NAME ${TEST_NAME} COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS}
71+
${ESPRESSO_MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${TEST_NUM_PROC}
7172
${ESPRESSO_MPIEXEC_TMPDIR} ${CMAKE_CURRENT_BINARY_DIR}/${TEST_TARGET}
7273
${MPIEXEC_POSTFLAGS})
7374
else()
@@ -97,9 +98,11 @@ function(espresso_unit_test_register)
9798
math(EXPR TEST_NUM_CORES "${TEST_NUM_CORES} * ${TEST_NUM_THREADS}")
9899
endif()
99100
set_tests_properties(
100-
${TEST_NAME} PROPERTIES ENVIRONMENT "${TEST_ENV_VARIABLES}" PROCESSORS ${TEST_NUM_CORES})
101+
${TEST_NAME} PROPERTIES ENVIRONMENT "${TEST_ENV_VARIABLES}"
102+
PROCESSORS ${TEST_NUM_CORES}
103+
LABELS "unit_test")
101104

102-
add_dependencies(check_unit_tests ${TEST_TARGET})
105+
add_dependencies(unit_tests_executables ${TEST_TARGET})
103106
endfunction()
104107

105108
# create the executable of a unit test and register it in the CTest suite

doc/bibliography.bib

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,22 @@ @Article{brown95a
271271
publisher={Taylor \& Francis},
272272
}
273273

274+
@Article{buyl14a,
275+
title = {{H5MD}: {A} structured, efficient, and portable file format for molecular data},
276+
author = {de Buyl, Pierre and Colberg, Peter H. and H{\"o}fling, Felix},
277+
journal = {Computer Physics Communications},
278+
number = {6},
279+
volume = {185},
280+
year = {2014},
281+
pages = {1546--1553},
282+
doi = {10.1016/j.cpc.2014.01.018},
283+
publisher = {Elsevier},
284+
issn = {0010-4655},
285+
}
286+
274287
@Article{cerda08d,
275288
title = {{P3M} algorithm for dipolar interactions},
276-
author = {Cerd\`{a}, Juan J. and Ballenegger, Vincent and Lenz, Olaf and Holm, Christian},
289+
author = {Cerd{\`a}, Juan J. and Ballenegger, Vincent and Lenz, Olaf and Holm, Christian},
277290
journal = {The Journal of Chemical Physics},
278291
year = {2008},
279292
pages = {234104},
@@ -398,6 +411,18 @@ @Article{deserno98b
398411
doi = {10.1063/1.477415},
399412
}
400413

414+
@TechReport{devresse24a,
415+
author = {Devresse, Adrien and Cornu, Nicolas and Grosheintz-Laval, Luc and Awile, Omar and
416+
de Geus, Tom and Pereira, Fernando and Wolf, Matthias and {HighFive Contributors}},
417+
title = {{HighFive} - Header-only {C++} {HDF5} interface},
418+
month = dec,
419+
year = 2024,
420+
institution = {Blue Brain Project},
421+
type = {Software release},
422+
number = {v2.10.1},
423+
doi = {10.5281/zenodo.14272664},
424+
}
425+
401426
@Article{dhumieres09a,
402427
title = {Viscosity independent numerical errors for {L}attice {B}oltzmann models: from recurrence equations to ``magic'' collision numbers},
403428
author = {d'Humi{\`e}res, Dominique and Ginzburg, Irina},
@@ -903,6 +928,13 @@ @TechReport{misc-cuda-gdb
903928
url = {https://docs.nvidia.com/cuda/pdf/cuda-gdb.pdf},
904929
}
905930

931+
@Misc{misc-hdf5,
932+
author = {{The HDF Group}},
933+
title = {{Hierarchical Data Format}, version~5},
934+
howpublished = {GitHub},
935+
url = {https://github.com/HDFGroup/hdf5},
936+
}
937+
906938
@Misc{misc-kernprof,
907939
author = {Kern, Robert and Crall, Jon and Olsen, Brett and {OpenPyUtils community contributors}},
908940
title = {{line_profiler} and {kernprof}},

doc/sphinx/installation.rst

Lines changed: 20 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -641,24 +641,33 @@ They are added by CMake if the corresponding dependency was found on the
641641
system. Some of these external features are optional and must be activated
642642
using a CMake flag (see :ref:`Options and Variables`).
643643

644-
- ``CUDA`` Enables GPU-specific features.
644+
- ``CUDA``: enable offloading to Nvidia GPUs for features that support it
645+
(see :ref:`CUDA acceleration`)
645646

646-
- ``FFTW`` Enables features relying on the fast Fourier transforms, e.g. P3M.
647+
- ``FFTW``: enables features relying on the fast Fourier transforms,
648+
such as the P3M method (see :ref:`Coulomb P3M` and :ref:`Dipolar P3M`)
647649

648-
- ``H5MD`` Write data to H5MD-formatted hdf5 files (see :ref:`Writing H5MD-files`)
650+
- ``H5MD``: enable parallel input/output to hdf5 files with H5MD specification
651+
(see :ref:`Writing hdf5 files`)
649652

650-
- ``SCAFACOS`` Enables features relying on the ScaFaCoS library (see
653+
- ``WALBERLA``: enable continuum-based solvers: lattice-Boltzmann method,
654+
diffusion-advection-reaction equations solver, and Poisson equation solver
655+
if ``FFTW`` is enabled (see :ref:`Lattice-Boltzmann` and :ref:`Electrokinetics`)
656+
657+
- ``SCAFACOS``: enables features from the ScaFaCoS library (see
651658
:ref:`ScaFaCoS electrostatics`, :ref:`ScaFaCoS magnetostatics`).
652659

653-
- ``GSL`` Enables features relying on the GNU Scientific Library, e.g.
660+
- ``GSL``: enables features relying on the GNU Scientific Library, e.g.
654661
:meth:`espressomd.cluster_analysis.Cluster.fractal_dimension`.
655662

656-
- ``STOKESIAN_DYNAMICS`` Enables the Stokesian Dynamics feature
663+
- ``STOKESIAN_DYNAMICS``: enable the Stokesian Dynamics propagator
657664
(see :ref:`Stokesian Dynamics`). Requires BLAS and LAPACK.
658665

659-
- ``SHARED_MEMORY_PARALLELISM`` Enables shared-memory parallelism.
660-
666+
- ``SHARED_MEMORY_PARALLELISM``: enable shared-memory parallelism
667+
(OpenMP, Kokkos, Cabana)
661668

669+
- ``CALIPER``, ``VALGRIND``, ``FPE``: enable various instrumentation tools
670+
(see :ref:`Instrumentation`)
662671

663672
.. _Configuring:
664673

@@ -926,32 +935,11 @@ The repository URLs can be found in the ``GIT_REPOSITORY`` field of the
926935
corresponding ``FetchContent_Declare()`` commands. The ``GIT_TAG`` field
927936
provides the commit. Clone these repositories locally and edit the |es|
928937
build system such that ``GIT_REPOSITORY`` points to the absolute path of
929-
the clone. You can automate this task by adapting the following commands:
930-
931-
* ``ESPRESSO_BUILD_WITH_WALBERLA``
932-
933-
.. code-block:: bash
934-
935-
sed -ri 's|GIT_REPOSITORY +.+/walberla.git|GIT_REPOSITORY /work/username/walberla|' CMakeLists.txt
936-
937-
* ``ESPRESSO_BUILD_WITH_HDF5``
938-
939-
.. code-block:: bash
938+
the clone. You can automate this text substitution by adapting the following command:
940939

941-
sed -ri 's|GIT_REPOSITORY +.+h5xx.git|GIT_REPOSITORY /work/username/h5xx|' CMakeLists.txt
942-
943-
* ``ESPRESSO_BUILD_WITH_STOKESIAN_DYNAMICS``
944-
945-
.. code-block:: bash
946-
947-
sed -ri 's|GIT_REPOSITORY +.+stokesian-dynamics.git|GIT_REPOSITORY /work/username/stokesian_dynamics|' CMakeLists.txt
948-
949-
* ``ESPRESSO_BUILD_WITH_CALIPER``
950-
951-
.. code-block:: bash
952-
953-
sed -ri 's|GIT_REPOSITORY +.+/Caliper.git|GIT_REPOSITORY /work/username/caliper|' CMakeLists.txt
940+
.. code-block:: bash
954941
942+
sed -ri 's|GIT_REPOSITORY +.+/([^/]+).git|GIT_REPOSITORY /work/username/\1|' CMakeLists.txt
955943
956944
Compiling, testing and installing
957945
---------------------------------

0 commit comments

Comments
 (0)