From e01c95c3dfff7939bd51cf6bc47ef5cbf726a9d9 Mon Sep 17 00:00:00 2001 From: Christoph Junghans Date: Wed, 2 Oct 2019 10:14:57 -0600 Subject: [PATCH 01/16] cmake: install missing targets --- src/core/io/mpiio/CMakeLists.txt | 1 + src/core/io/reader/CMakeLists.txt | 1 + src/pdbparser/CMakeLists.txt | 1 + 3 files changed, 3 insertions(+) diff --git a/src/core/io/mpiio/CMakeLists.txt b/src/core/io/mpiio/CMakeLists.txt index 365c58295f9..7c4b0dc4228 100644 --- a/src/core/io/mpiio/CMakeLists.txt +++ b/src/core/io/mpiio/CMakeLists.txt @@ -1,3 +1,4 @@ add_library(mpiio SHARED mpiio.cpp) target_include_directories(mpiio PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(mpiio PRIVATE EspressoConfig EspressoCore MPI::MPI_CXX) +install(TARGETS mpiio LIBRARY DESTINATION ${PYTHON_INSTDIR}/espressomd) diff --git a/src/core/io/reader/CMakeLists.txt b/src/core/io/reader/CMakeLists.txt index 1b9ee38735c..6c2de627ac0 100644 --- a/src/core/io/reader/CMakeLists.txt +++ b/src/core/io/reader/CMakeLists.txt @@ -1,3 +1,4 @@ add_library(pdbreader SHARED readpdb.cpp) target_link_libraries(pdbreader PUBLIC EspressoConfig EspressoCore pdbparser) target_include_directories(pdbreader PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +install(TARGETS pdbreader LIBRARY DESTINATION ${PYTHON_INSTDIR}/espressomd) diff --git a/src/pdbparser/CMakeLists.txt b/src/pdbparser/CMakeLists.txt index c58d79e8cb7..3c4a66f1dc1 100644 --- a/src/pdbparser/CMakeLists.txt +++ b/src/pdbparser/CMakeLists.txt @@ -1,5 +1,6 @@ add_library(pdbparser SHARED ${CMAKE_CURRENT_SOURCE_DIR}/src/PdbParser.cpp) target_include_directories(pdbparser PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) +install(TARGETS pdbparser LIBRARY DESTINATION ${PYTHON_INSTDIR}/espressomd) if(WITH_UNIT_TESTS) add_subdirectory(unit_tests) endif(WITH_UNIT_TESTS) From e65df394574d3baf75aba2747db660e51c80e99c Mon Sep 17 00:00:00 2001 From: Christoph Junghans Date: Wed, 2 Oct 2019 10:17:07 -0600 Subject: [PATCH 02/16] cmake: remove SOVERSION --- CMakeLists.txt | 8 -------- doc/sphinx/conf.py.in | 2 +- src/config/CMakeLists.txt | 1 - src/core/CMakeLists.txt | 1 - src/core/cluster_analysis/CMakeLists.txt | 1 - src/core/shapes/CMakeLists.txt | 1 - src/script_interface/CMakeLists.txt | 1 - 7 files changed, 1 insertion(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 48cafaf268e..a248c02cc40 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,14 +29,6 @@ endif() enable_language(CXX) set(PROJECT_VERSION "5.0-dev") -string(REGEX - REPLACE "^([1-9]+)\\.[0-9]+.*$" - "\\1" - SOVERSION - "${PROJECT_VERSION}") -if(NOT ${SOVERSION} MATCHES "^[1-9]+$") - message(FATAL_ERROR "Could not determine SOVERSION from ${PROJECT_VERSION}") -endif(NOT ${SOVERSION} MATCHES "^[1-9]+$") # # CMake internal vars diff --git a/doc/sphinx/conf.py.in b/doc/sphinx/conf.py.in index cb0b3c67570..abe304110b0 100644 --- a/doc/sphinx/conf.py.in +++ b/doc/sphinx/conf.py.in @@ -69,7 +69,7 @@ author = 'C. Holm, F. Weik, R. Weeber' # The short X.Y version. version = '@PROJECT_VERSION@' # The full version, including alpha/beta/rc tags. -release = '@SOVERSION@' +release = '@PROJECT_VERSION@' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/src/config/CMakeLists.txt b/src/config/CMakeLists.txt index 618e4e59c60..dd34cb4b971 100644 --- a/src/config/CMakeLists.txt +++ b/src/config/CMakeLists.txt @@ -36,7 +36,6 @@ execute_process(COMMAND ${PYTHON_EXECUTABLE} add_library(EspressoConfig SHARED config-features.cpp) add_dependencies(EspressoConfig myconfig check_myconfig generate_config_features) install(TARGETS EspressoConfig LIBRARY DESTINATION ${PYTHON_INSTDIR}/espressomd) -set_target_properties(EspressoConfig PROPERTIES SOVERSION ${SOVERSION}) target_include_directories(EspressoConfig PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) # Parse repository info from git if available diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 854ff2dae48..9aeb0940ac9 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -157,7 +157,6 @@ else(CUDA) endif(CUDA) install(TARGETS EspressoCore LIBRARY DESTINATION ${PYTHON_INSTDIR}/espressomd) -set_target_properties(EspressoCore PROPERTIES SOVERSION ${SOVERSION}) target_include_directories(EspressoCore PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) if(WITH_COVERAGE) target_compile_options(EspressoCore PUBLIC "$<$:-g>") diff --git a/src/core/cluster_analysis/CMakeLists.txt b/src/core/cluster_analysis/CMakeLists.txt index 354bdd8613a..e7e0c22fef5 100644 --- a/src/core/cluster_analysis/CMakeLists.txt +++ b/src/core/cluster_analysis/CMakeLists.txt @@ -4,7 +4,6 @@ set(cluster_analysis_SRC ) add_library(cluster_analysis SHARED ${cluster_analysis_SRC}) install(TARGETS cluster_analysis LIBRARY DESTINATION ${PYTHON_INSTDIR}/espressomd) -set_target_properties(cluster_analysis PROPERTIES SOVERSION ${SOVERSION}) set_target_properties(cluster_analysis PROPERTIES MACOSX_RPATH TRUE) target_link_libraries(cluster_analysis PUBLIC EspressoCore PRIVATE EspressoConfig) diff --git a/src/core/shapes/CMakeLists.txt b/src/core/shapes/CMakeLists.txt index 268172df6ae..c0e78aeeb56 100644 --- a/src/core/shapes/CMakeLists.txt +++ b/src/core/shapes/CMakeLists.txt @@ -13,5 +13,4 @@ set(Shapes_SRC ) add_library(Shapes SHARED ${Shapes_SRC}) install(TARGETS Shapes LIBRARY DESTINATION ${PYTHON_INSTDIR}/espressomd) -set_target_properties(Shapes PROPERTIES SOVERSION ${SOVERSION}) target_link_libraries(Shapes PUBLIC EspressoConfig EspressoCore) diff --git a/src/script_interface/CMakeLists.txt b/src/script_interface/CMakeLists.txt index d28603f816e..0a8966887fb 100644 --- a/src/script_interface/CMakeLists.txt +++ b/src/script_interface/CMakeLists.txt @@ -33,7 +33,6 @@ endif() add_library(EspressoScriptInterface SHARED ${EspressoScriptInterface_SRC}) install(TARGETS EspressoScriptInterface LIBRARY DESTINATION ${PYTHON_INSTDIR}/espressomd) -set_target_properties(EspressoScriptInterface PROPERTIES SOVERSION ${SOVERSION}) target_link_libraries(EspressoScriptInterface PRIVATE EspressoConfig PUBLIC EspressoCore Shapes cluster_analysis mpiio pdbreader) if(HDF5_FOUND) target_link_libraries(EspressoScriptInterface PRIVATE H5mdCore) From 03ae219c6ca1ca39ac4eba77963723f4d75f9d94 Mon Sep 17 00:00:00 2001 From: Christoph Junghans Date: Wed, 2 Oct 2019 10:33:45 -0600 Subject: [PATCH 03/16] cmake: fix permission of python module install --- src/python/espressomd/CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/python/espressomd/CMakeLists.txt b/src/python/espressomd/CMakeLists.txt index ebe76992dae..59f2b8affc5 100644 --- a/src/python/espressomd/CMakeLists.txt +++ b/src/python/espressomd/CMakeLists.txt @@ -107,6 +107,7 @@ foreach(cython_file ${cython_SRC}) target_link_libraries(${target} PRIVATE EspressoConfig EspressoCore EspressoScriptInterface) target_include_directories(${target} SYSTEM PRIVATE ${PYTHON_INCLUDE_DIRS} ${NUMPY_INCLUDE_DIR}) add_dependencies(espressomd ${target}) + install(TARGETS ${target} LIBRARY DESTINATION ${PYTHON_INSTDIR}/espressomd) endif() endforeach() @@ -124,6 +125,4 @@ foreach(auxfile ${cython_AUX}) endforeach(auxfile) install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} DESTINATION ${PYTHON_INSTDIR} - PATTERN "CMakeFiles" EXCLUDE PATTERN "*.cpp" EXCLUDE - PATTERN "*.cmake" EXCLUDE PATTERN "Makefile" EXCLUDE) - + FILES_MATCHING PATTERN "*.py") From e29fcbd53f549be09b54aed6c2dd0a12abaa8633 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-No=C3=ABl=20Grad?= Date: Sat, 12 Oct 2019 19:44:11 +0200 Subject: [PATCH 04/16] Document CMake logic --- src/python/espressomd/CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/python/espressomd/CMakeLists.txt b/src/python/espressomd/CMakeLists.txt index 59f2b8affc5..598211d8449 100644 --- a/src/python/espressomd/CMakeLists.txt +++ b/src/python/espressomd/CMakeLists.txt @@ -38,9 +38,9 @@ add_custom_command(OUTPUT code_info.pyx WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/myconfig.pxi ) -file(GLOB cython_SRC *.pyx) # Make the cython_SRC, cython_HEADER and cython_AUX a cached variable to # be able to extend it in the subdirectories. +file(GLOB cython_SRC *.pyx) SET(cython_SRC "${cython_SRC}" CACHE INTERNAL "cython_SRC") file(GLOB cython_HEADER *.pxd) SET(cython_HEADER "${cython_HEADER}" CACHE INTERNAL "cython_HEADER") @@ -53,6 +53,7 @@ add_subdirectory(io) list(APPEND cython_SRC ${CMAKE_CURRENT_BINARY_DIR}/code_info.pyx) list(REMOVE_DUPLICATES cython_SRC) +# Configure, compile and install Cython files foreach(cython_file ${cython_SRC}) get_filename_component(basename ${cython_file} NAME_WE) file(RELATIVE_PATH relpath ${CMAKE_CURRENT_SOURCE_DIR} ${cython_file}) @@ -113,6 +114,7 @@ endforeach() target_link_libraries(espressomd_profiler PRIVATE Profiler) +# Configure Python files foreach(auxfile ${cython_AUX}) get_filename_component(filename ${auxfile} NAME) file(RELATIVE_PATH relpath ${CMAKE_CURRENT_SOURCE_DIR} ${auxfile}) @@ -124,5 +126,6 @@ foreach(auxfile ${cython_AUX}) ) endforeach(auxfile) +# Install Python files install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} DESTINATION ${PYTHON_INSTDIR} - FILES_MATCHING PATTERN "*.py") + FILES_MATCHING PATTERN "*.py") From aabbb99d2aa397a7fd234c1f31b90c153a111355 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-No=C3=ABl=20Grad?= Date: Sat, 12 Oct 2019 19:53:32 +0200 Subject: [PATCH 05/16] Fix version nomenclature in Sphinx docs --- doc/sphinx/conf.py.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/sphinx/conf.py.in b/doc/sphinx/conf.py.in index abe304110b0..9377954e60d 100644 --- a/doc/sphinx/conf.py.in +++ b/doc/sphinx/conf.py.in @@ -67,7 +67,7 @@ author = 'C. Holm, F. Weik, R. Weeber' # built documents. # # The short X.Y version. -version = '@PROJECT_VERSION@' +version = '.'.join('@PROJECT_VERSION@'.split('.')[:2]) # The full version, including alpha/beta/rc tags. release = '@PROJECT_VERSION@' From e615b18b5803394c01714809a5ce0df312e798ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-No=C3=ABl=20Grad?= Date: Sun, 13 Oct 2019 19:34:22 +0200 Subject: [PATCH 06/16] Deprecate DESTDIR install method Installing ESPResSo with `make install DESTDIR="/path/to/es"` will install files in the wrong folder and set an incorrect runtime path in Cython shared objects, causing import errors. See full report: https://github.com/espressomd/espresso/pull/3228#issuecomment-541422452 --- doc/sphinx/installation.rst | 11 +++++--- testsuite/cmake/CMakeLists.txt | 12 ++------- testsuite/cmake/test_install.sh | 22 +++++++++++----- testsuite/cmake/test_install_destdir.sh | 30 --------------------- testsuite/cmake/test_install_prefix.sh | 30 --------------------- testsuite/cmake/test_python_bindings.sh | 35 ------------------------- 6 files changed, 24 insertions(+), 116 deletions(-) mode change 100644 => 100755 testsuite/cmake/test_install.sh delete mode 100755 testsuite/cmake/test_install_destdir.sh delete mode 100755 testsuite/cmake/test_install_prefix.sh delete mode 100755 testsuite/cmake/test_python_bindings.sh diff --git a/doc/sphinx/installation.rst b/doc/sphinx/installation.rst index eb7f9f850ff..88e474d67a9 100644 --- a/doc/sphinx/installation.rst +++ b/doc/sphinx/installation.rst @@ -669,7 +669,7 @@ build directory and create a new one. .. _make\: Compiling, testing and installing: ``make``: Compiling, testing and installing --------------------------------------------- +------------------------------------------- The command ``make`` is mainly used to compile the source code, but it can do a number of other things. The generic syntax of the ``make`` @@ -694,9 +694,12 @@ targets are available: Deletes all files that were created during the compilation. ``install`` - Install |es|. - Use ``make DESTDIR=/home/john install`` to install to a - specific directory. + Install |es| in the path specified by the CMake variable + ``CMAKE_INSTALL_PREFIX``. The path can be changed by calling CMake + with ``cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/espresso``. Do not use + ``make DESTDIR=/path/to/espresso install`` to install to a specific path, + this will cause issues with the runtime path (RPATH) and will conflict + with the CMake variable ``CMAKE_INSTALL_PREFIX`` if it has been set. ``doxygen`` Creates the Doxygen code documentation in the :file:`doc/doxygen` diff --git a/testsuite/cmake/CMakeLists.txt b/testsuite/cmake/CMakeLists.txt index f88ea945860..824a448d444 100644 --- a/testsuite/cmake/CMakeLists.txt +++ b/testsuite/cmake/CMakeLists.txt @@ -23,17 +23,9 @@ else() endif() set(DESTDIR "${CMAKE_CURRENT_BINARY_DIR}/install") -add_custom_target(setup_install) -add_custom_target(setup_install_destdir COMMAND make install DESTDIR="${DESTDIR}" WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) -add_dependencies(setup_install setup_install_destdir) -cmake_test(FILE test_install_destdir.sh DEPENDENCIES BashUnitTests.sh test_install.sh) -if(CMAKE_INSTALL_PREFIX STREQUAL "/tmp/espresso-unit-tests") - add_custom_target(setup_install_prefix COMMAND make install WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) - add_dependencies(setup_install setup_install_prefix) - cmake_test(FILE test_install_prefix.sh DEPENDENCIES BashUnitTests.sh) -endif() +add_custom_target(setup_install COMMAND make install WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) -cmake_test(FILE test_python_bindings.sh DEPENDENCIES BashUnitTests.sh) +cmake_test(FILE test_install.sh DEPENDENCIES BashUnitTests.sh) add_custom_target(check_cmake_install COMMAND ${CMAKE_CTEST_COMMAND} --timeout ${TEST_TIMEOUT} -C serial --output-on-failure) add_dependencies(check_cmake_install setup_install) diff --git a/testsuite/cmake/test_install.sh b/testsuite/cmake/test_install.sh old mode 100644 new mode 100755 index 7497b10fcd1..66312d63a86 --- a/testsuite/cmake/test_install.sh +++ b/testsuite/cmake/test_install.sh @@ -16,21 +16,29 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# test espresso installation -function helper_test_install_common() { - local root=$1 - local filepaths=("${root}/bin/pypresso" \ - "${root}/@Python_SITEARCH@/espressomd/EspressoCore.so" \ +# load bash unit testing library +source BashUnitTests.sh + +# test installation and Python bindings +function test_install() { + local filepaths=("@CMAKE_INSTALL_PREFIX@/bin/pypresso" \ + "@CMAKE_INSTALL_PREFIX@/@Python_SITEARCH@/espressomd/EspressoCore.so" \ ) if [ "@TESTING_PYTHON@" = "TRUE" ] then - filepaths+=("${root}/@Python_SITEARCH@/espressomd/_init.so" \ - "${root}/@Python_SITEARCH@/espressomd/__init__.py" + filepaths+=("@CMAKE_INSTALL_PREFIX@/@Python_SITEARCH@/espressomd/_init.so" \ + "@CMAKE_INSTALL_PREFIX@/@Python_SITEARCH@/espressomd/__init__.py" ) fi for filepath in ${filepaths[@]} do assert_file_exists "${filepath}" done + + # check the espressomd module can be imported + assert_return_code "@CMAKE_BINARY_DIR@/pypresso" -c "import sys;sys.path.insert(0, '@CMAKE_INSTALL_PREFIX@/@Python_SITEARCH@');import espressomd" } +# run tests +run_test_suite + diff --git a/testsuite/cmake/test_install_destdir.sh b/testsuite/cmake/test_install_destdir.sh deleted file mode 100755 index acdceb57c38..00000000000 --- a/testsuite/cmake/test_install_destdir.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env bash -# Copyright (C) 2018-2019 The ESPResSo project -# -# This file is part of ESPResSo. -# -# ESPResSo is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ESPResSo is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# load bash unit testing library -source BashUnitTests.sh -source test_install.sh - -# test espresso installation via `make install DESTDIR=/some/dir` -function test_install_DESTDIR() { - helper_test_install_common "@DESTDIR@/@CMAKE_INSTALL_PREFIX@" -} - -# run tests -run_test_suite - diff --git a/testsuite/cmake/test_install_prefix.sh b/testsuite/cmake/test_install_prefix.sh deleted file mode 100755 index 04ffa228e8f..00000000000 --- a/testsuite/cmake/test_install_prefix.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env bash -# Copyright (C) 2018-2019 The ESPResSo project -# -# This file is part of ESPResSo. -# -# ESPResSo is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ESPResSo is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# load bash unit testing library -source BashUnitTests.sh -source test_install.sh - -# test espresso installation via `cmake -DCMAKE_INSTALL_PREFIX=/some/dir ..` -function test_install_CMAKE_INSTALL_PREFIX() { - helper_test_install_common "@CMAKE_INSTALL_PREFIX@" -} - -# run tests -run_test_suite - diff --git a/testsuite/cmake/test_python_bindings.sh b/testsuite/cmake/test_python_bindings.sh deleted file mode 100755 index 87864120d6c..00000000000 --- a/testsuite/cmake/test_python_bindings.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env bash -# Copyright (C) 2018-2019 The ESPResSo project -# -# This file is part of ESPResSo. -# -# ESPResSo is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# ESPResSo is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# load bash unit testing library -source BashUnitTests.sh - -# test if Python module can be imported -function test_Python() { - # test espresso installation via `make install DESTDIR=/some/dir` - assert_return_code "@CMAKE_BINARY_DIR@/pypresso" -c "import sys;sys.path.insert(0, '@DESTDIR@/@CMAKE_INSTALL_PREFIX@/@Python_SITEARCH@');import espressomd" - # test espresso installation via `cmake -DCMAKE_INSTALL_PREFIX=/some/dir ..` - if [ "@CMAKE_INSTALL_PREFIX@" = "/tmp/espresso-unit-tests" ] - then - assert_return_code "@CMAKE_BINARY_DIR@/pypresso" -c "import sys;sys.path.insert(0, '@CMAKE_INSTALL_PREFIX@/@Python_SITEARCH@');import espressomd" - fi -} - -# run tests -run_test_suite - From 0c1c4674c1c824dca36b16cffa2367e8ec49cff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-No=C3=ABl=20Grad?= Date: Sun, 13 Oct 2019 20:01:26 +0200 Subject: [PATCH 07/16] Fix cluster_analysis module When installing ESPResSo, the C++ shared objects and Cython shared objects are stored in the same folder. Since they have the same .so extension, when importing espressomd.cluster_analysis, the file cluster_analysis.py is loaded and the file cluster_analysis.so is automatically considered a Cython shared object, and Python fails to find the Cython-specific symbol PyInit_cluster_analysis. This is remediated by giving a different name to the C++ shared object. --- src/core/cluster_analysis/CMakeLists.txt | 10 +++++----- src/script_interface/CMakeLists.txt | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/core/cluster_analysis/CMakeLists.txt b/src/core/cluster_analysis/CMakeLists.txt index e7e0c22fef5..7274fc6e3a1 100644 --- a/src/core/cluster_analysis/CMakeLists.txt +++ b/src/core/cluster_analysis/CMakeLists.txt @@ -2,11 +2,11 @@ set(cluster_analysis_SRC Cluster.cpp ClusterStructure.cpp ) -add_library(cluster_analysis SHARED ${cluster_analysis_SRC}) -install(TARGETS cluster_analysis LIBRARY DESTINATION ${PYTHON_INSTDIR}/espressomd) -set_target_properties(cluster_analysis PROPERTIES MACOSX_RPATH TRUE) -target_link_libraries(cluster_analysis PUBLIC EspressoCore PRIVATE EspressoConfig) +add_library(core_cluster_analysis SHARED ${cluster_analysis_SRC}) +install(TARGETS core_cluster_analysis LIBRARY DESTINATION ${PYTHON_INSTDIR}/espressomd) +set_target_properties(core_cluster_analysis PROPERTIES MACOSX_RPATH TRUE) +target_link_libraries(core_cluster_analysis PUBLIC EspressoCore PRIVATE EspressoConfig) if(GSL) -target_link_libraries(cluster_analysis PRIVATE GSL::gsl GSL::gslcblas) +target_link_libraries(core_cluster_analysis PRIVATE GSL::gsl GSL::gslcblas) endif() diff --git a/src/script_interface/CMakeLists.txt b/src/script_interface/CMakeLists.txt index 0a8966887fb..848eab8dae2 100644 --- a/src/script_interface/CMakeLists.txt +++ b/src/script_interface/CMakeLists.txt @@ -33,7 +33,7 @@ endif() add_library(EspressoScriptInterface SHARED ${EspressoScriptInterface_SRC}) install(TARGETS EspressoScriptInterface LIBRARY DESTINATION ${PYTHON_INSTDIR}/espressomd) -target_link_libraries(EspressoScriptInterface PRIVATE EspressoConfig PUBLIC EspressoCore Shapes cluster_analysis mpiio pdbreader) +target_link_libraries(EspressoScriptInterface PRIVATE EspressoConfig PUBLIC EspressoCore Shapes core_cluster_analysis mpiio pdbreader) if(HDF5_FOUND) target_link_libraries(EspressoScriptInterface PRIVATE H5mdCore) endif() From f54875d429513480229c4f39f5d1323a9bb778cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-No=C3=ABl=20Grad?= Date: Sun, 13 Oct 2019 20:11:57 +0200 Subject: [PATCH 08/16] Add job to check the installed version of ESPResSo Install the files in a different directory and check the python and tutorials/samples tests can still run with the installed files. Please note that pypresso will experience a major slowdown in CI when located outside the build directory, hence the 3h timeout. This job is meant to be run only during releases and in PRs that add new core modules. --- .gitlab-ci.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d3d912cdcb6..8370386b77c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -272,6 +272,37 @@ tutorials-samples-no-gpu: only: - schedules +installation: + <<: *global_job_definition + stage: build + image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/ubuntu-python3:cuda-10.1 + script: + - export myconfig=maxset with_coverage=false make_check=false + - export srcdir=${CI_PROJECT_DIR} test_timeout=1800 + - bash maintainer/CI/build_cmake.sh + - cd build + # install ESPResSo (in CI, pypresso will run up to 5 times slower when + # located outside the build directory, hence the larger timeout value) + - make install + # get path of installed files + - CI_INSTALL_DIR="/tmp/espresso-unit-tests" + - CI_INSTALL_PYTHON_PATH=$(dirname $(find "${CI_INSTALL_DIR}/lib" -name espressomd)) + # deploy object-in-fluid module + - cp -r "src/python/object_in_fluid" "${CI_INSTALL_PYTHON_PATH}/object_in_fluid" + # set the PYTHONPATH, guard the case where it is initially an empty string + - export PYTHONPATH="${PYTHONPATH:+$PYTHONPATH:}${CI_INSTALL_PYTHON_PATH}" + # run all tests with the installed files + - sed -i "s|$(pwd)/pypresso|${CI_INSTALL_DIR}/bin/pypresso|" testsuite/{python,scripts/samples,scripts/tutorials}/CTestTestfile.cmake + - make -j2 check_python_skip_long + - make -j2 check_samples + - make -j2 check_tutorials + tags: + - docker + - linux + - cuda + timeout: 3h + when: manual + empty: <<: *global_job_definition stage: build From 807416ed421b3c1f87239433b66e5b0b10866b64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-No=C3=ABl=20Grad?= Date: Mon, 14 Oct 2019 19:08:17 +0200 Subject: [PATCH 09/16] Skip tutorial ferrofluid part 3 (timeout) Takes more than 1 hour to run in CI when pypresso is located outside the build directory. --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8370386b77c..f370dcc0a52 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -293,6 +293,8 @@ installation: - export PYTHONPATH="${PYTHONPATH:+$PYTHONPATH:}${CI_INSTALL_PYTHON_PATH}" # run all tests with the installed files - sed -i "s|$(pwd)/pypresso|${CI_INSTALL_DIR}/bin/pypresso|" testsuite/{python,scripts/samples,scripts/tutorials}/CTestTestfile.cmake + # skip long tests + - sed -i "/tutorial_11-ferrofluid_3/d" testsuite/scripts/tutorials/CTestTestfile.cmake - make -j2 check_python_skip_long - make -j2 check_samples - make -j2 check_tutorials From 8110fe7d69acf2b145d29a2ab23f3f396a362ac2 Mon Sep 17 00:00:00 2001 From: Florian Weik Date: Tue, 15 Oct 2019 13:40:15 +0200 Subject: [PATCH 10/16] core: Move Particle declaration to separate file --- src/core/Particle.hpp | 338 ++++++++++++++++++++++++++ src/core/particle_data.hpp | 313 +----------------------- src/core/serialization/Particle.hpp | 5 +- src/core/unit_tests/Particle_test.cpp | 1 + src/core/virtual_sites.hpp | 3 +- 5 files changed, 347 insertions(+), 313 deletions(-) create mode 100644 src/core/Particle.hpp diff --git a/src/core/Particle.hpp b/src/core/Particle.hpp new file mode 100644 index 00000000000..12484af8f03 --- /dev/null +++ b/src/core/Particle.hpp @@ -0,0 +1,338 @@ +/* + * Copyright (C) 2010-2019 The ESPResSo project + * + * This file is part of ESPResSo. + * + * ESPResSo is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * ESPResSo is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#ifndef ESPRESSO_CORE_PARTICLE_HPP +#define ESPRESSO_CORE_PARTICLE_HPP + +#include "config.hpp" + +#include +#include +#include + +/** Properties of a particle which are not supposed to + * change during the integration, but have to be known + * for all ghosts. Ghosts are particles which are + * needed in the interaction calculation, but are just copies of + * particles stored on different nodes. + */ +struct ParticleProperties { + /** unique identifier for the particle. */ + int identity = -1; + /** Molecule identifier. */ + int mol_id = 0; + /** particle type, used for non bonded interactions. */ + int type = 0; + + /** particle mass */ +#ifdef MASS + double mass = 1.0; +#else + constexpr static double mass{1.0}; +#endif /* MASS */ + +#ifdef ROTATIONAL_INERTIA + /** rotational inertia */ + Utils::Vector3d rinertia = {1., 1., 1.}; +#else + static constexpr Utils::Vector3d rinertia = {1., 1., 1.}; +#endif + +#ifdef MEMBRANE_COLLISION + /** parameters for membrane collision mechanisms */ + Utils::Vector3d out_direction = {0., 0., 0.}; +#endif + + /** bitfield for the particle axes of rotation */ + int rotation = 0; + + /** charge. */ +#ifdef ELECTROSTATICS + double q = 0.0; +#else + constexpr static double q{0.0}; +#endif + +#ifdef LB_ELECTROHYDRODYNAMICS + /** electrophoretic mobility times E-field: mu_0 * E */ + Utils::Vector3d mu_E = {0., 0., 0.}; +#endif + +#ifdef DIPOLES + /** dipole moment (absolute value) */ + double dipm = 0.; +#endif + +#ifdef VIRTUAL_SITES + /** is particle virtual */ + bool is_virtual = false; +#ifdef VIRTUAL_SITES_RELATIVE + /** The following properties define, with respect to which real particle a + * virtual site is placed and at what distance. The relative orientation of + * the vector pointing from real particle to virtual site with respect to the + * orientation of the real particle is stored in the virtual site's + * quaternion attribute. + */ + struct VirtualSitesRelativeParameters { + int to_particle_id = 0; + double distance = 0; + /** Relative position of the virtual site. */ + Utils::Vector4d rel_orientation = {0., 0., 0., 0.}; + /** Orientation of the virtual particle in the body fixed frame. */ + Utils::Vector4d quat = {0., 0., 0., 0.}; + + template void serialize(Archive &ar, long int) { + ar &to_particle_id; + ar &distance; + ar &rel_orientation; + ar &quat; + } + } vs_relative; +#endif +#else /* VIRTUAL_SITES */ + static constexpr const bool is_virtual = false; +#endif /* VIRTUAL_SITES */ + +#ifdef LANGEVIN_PER_PARTICLE + double T = -1.; +#ifndef PARTICLE_ANISOTROPY + double gamma = -1.; +#else + Utils::Vector3d gamma = {-1., -1., -1.}; +#endif // PARTICLE_ANISOTROPY +/** Friction coefficient gamma for rotation */ +#ifdef ROTATION +#ifndef PARTICLE_ANISOTROPY + double gamma_rot = -1.; +#else + Utils::Vector3d gamma_rot = {-1., -1., -1.}; +#endif // ROTATIONAL_INERTIA +#endif // ROTATION +#endif // LANGEVIN_PER_PARTICLE + +#ifdef EXTERNAL_FORCES + /** flag whether to fix a particle in space. + Values: +
  • 0 no external influence +
  • 1 apply external force \ref ParticleProperties::ext_force +
  • 2,3,4 fix particle coordinate 0,1,2 +
  • 5 apply external torque \ref ParticleProperties::ext_torque +
+ */ + int ext_flag = 0; + /** External force, apply if \ref ParticleProperties::ext_flag == 1. */ + Utils::Vector3d ext_force = {0, 0, 0}; + +#ifdef ROTATION + /** External torque, apply if \ref ParticleProperties::ext_flag == 16. */ + Utils::Vector3d ext_torque = {0, 0, 0}; +#endif +#endif +}; + +/** Positional information on a particle. Information that is + * communicated to calculate interactions with ghost particles. + */ +struct ParticlePosition { + /** periodically folded position. */ + Utils::Vector3d p = {0, 0, 0}; + +#ifdef ROTATION + /** quaternion to define particle orientation */ + Utils::Vector4d quat = {1., 0., 0., 0.}; + /** unit director calculated from the quaternion */ + Utils::Vector3d calc_director() const { + return Utils::convert_quaternion_to_director(quat); + }; +#endif + +#ifdef BOND_CONSTRAINT + /** particle position at the previous time step */ + Utils::Vector3d p_old = {0., 0., 0.}; +#endif +}; + +/** Force information on a particle. Forces of ghost particles are + * collected and added up to the force of the original particle. + */ +struct ParticleForce { + ParticleForce() = default; + ParticleForce(ParticleForce const &) = default; + ParticleForce(const Utils::Vector3d &f) : f(f) {} +#ifdef ROTATION + ParticleForce(const Utils::Vector3d &f, const Utils::Vector3d &torque) + : f(f), torque(torque) {} +#endif + + ParticleForce &operator+=(ParticleForce const &rhs) { + f += rhs.f; +#ifdef ROTATION + torque += rhs.torque; +#endif + + return *this; + } + + /** force. */ + Utils::Vector3d f = {0., 0., 0.}; + +#ifdef ROTATION + /** torque */ + Utils::Vector3d torque = {0., 0., 0.}; +#endif +}; + +/** Momentum information on a particle. Information not contained in + communication of ghost particles so far, but a communication would + be necessary for velocity dependent potentials. */ +struct ParticleMomentum { + /** velocity. */ + Utils::Vector3d v = {0., 0., 0.}; + +#ifdef ROTATION + /** angular velocity + ALWAYS IN PARTICLE FIXED, I.E., CO-ROTATING COORDINATE SYSTEM */ + Utils::Vector3d omega = {0., 0., 0.}; +#endif +}; + +/** Information on a particle that is needed only on the + * node the particle belongs to + */ +struct ParticleLocal { + /** check whether a particle is a ghost or not */ + bool ghost = false; + /** position in the last time step before last Verlet list update. */ + Utils::Vector3d p_old = {0, 0, 0}; + /** index of the simulation box image where the particle really sits. */ + Utils::Vector3i i = {0, 0, 0}; +}; + +struct ParticleParametersSwimming { +// ifdef inside because we need this type for some MPI prototypes +#ifdef ENGINE + bool swimming = false; + double f_swim = 0.; + double v_swim = 0.; + int push_pull = 0; + double dipole_length = 0.; + Utils::Vector3d v_center; + Utils::Vector3d v_source; + double rotational_friction = 0.; +#endif + + template void serialize(Archive &ar, long int) { +#ifdef ENGINE + ar &swimming &f_swim &v_swim &push_pull &dipole_length &v_center &v_source + &rotational_friction; +#endif + } +}; + +/** Struct holding all information for one particle. */ +struct Particle { + int &identity() { return p.identity; } + int const &identity() const { return p.identity; } + + bool operator==(Particle const &rhs) const { + return identity() == rhs.identity(); + } + + bool operator!=(Particle const &rhs) const { + return identity() != rhs.identity(); + } + + /** + * @brief Return a copy of the particle with + * only the fixed size parts. + * + * This creates a copy of the particle with + * only the parts than can be copied w/o heap + * allocation, e.g. w/o bonds and exclusions. + * This is more efficient if these parts are + * not actually needed. + */ + Particle flat_copy() const { + Particle ret; + + ret.p = p; + ret.r = r; + ret.m = m; + ret.f = f; + ret.l = l; +#ifdef ENGINE + ret.swim = swim; +#endif + + return ret; + } + + /// + ParticleProperties p; + /// + ParticlePosition r; +#ifdef DIPOLES + Utils::Vector3d calc_dip() const { return r.calc_director() * p.dipm; } +#endif + /// + ParticleMomentum m; + /// + ParticleForce f; + /// + ParticleLocal l; + + /** Bonded interactions list + * + * The format is pretty simple: just the bond type, and then the particle + * ids. The number of particle ids can be determined easily from the + * bonded_ia_params entry for the type. + */ + IntList bl; + + IntList &bonds() { return bl; } + IntList const &bonds() const { return bl; } + + IntList &exclusions() { +#ifdef EXCLUSIONS + return el; +#else + throw std::runtime_error{"Exclusions not enabled."}; +#endif + } + + IntList const &exclusions() const { +#ifdef EXCLUSIONS + return el; +#else + throw std::runtime_error{"Exclusions not enabled."}; +#endif + } + +#ifdef EXCLUSIONS + /** list of particles, with which this particle has no nonbonded + * interactions + */ + IntList el; +#endif + +#ifdef ENGINE + ParticleParametersSwimming swim; +#endif +}; + +#endif diff --git a/src/core/particle_data.hpp b/src/core/particle_data.hpp index adf6201fc2a..f5cac4eb0ad 100644 --- a/src/core/particle_data.hpp +++ b/src/core/particle_data.hpp @@ -36,10 +36,11 @@ #include "config.hpp" +#include "Particle.hpp" + #include #include #include -#include #include @@ -80,316 +81,6 @@ enum { * data types ************************************************/ -/** Properties of a particle which are not supposed to - * change during the integration, but have to be known - * for all ghosts. Ghosts are particles which are - * needed in the interaction calculation, but are just copies of - * particles stored on different nodes. - */ -struct ParticleProperties { - /** unique identifier for the particle. */ - int identity = -1; - /** Molecule identifier. */ - int mol_id = 0; - /** particle type, used for non bonded interactions. */ - int type = 0; - - /** particle mass */ -#ifdef MASS - double mass = 1.0; -#else - constexpr static double mass{1.0}; -#endif /* MASS */ - -#ifdef ROTATIONAL_INERTIA - /** rotational inertia */ - Utils::Vector3d rinertia = {1., 1., 1.}; -#else - static constexpr Utils::Vector3d rinertia = {1., 1., 1.}; -#endif - -#ifdef MEMBRANE_COLLISION - /** parameters for membrane collision mechanisms */ - Utils::Vector3d out_direction = {0., 0., 0.}; -#endif - - /** bitfield for the particle axes of rotation */ - int rotation = 0; - - /** charge. */ -#ifdef ELECTROSTATICS - double q = 0.0; -#else - constexpr static double q{0.0}; -#endif - -#ifdef LB_ELECTROHYDRODYNAMICS - /** electrophoretic mobility times E-field: mu_0 * E */ - Utils::Vector3d mu_E = {0., 0., 0.}; -#endif - -#ifdef DIPOLES - /** dipole moment (absolute value) */ - double dipm = 0.; -#endif - -#ifdef VIRTUAL_SITES - /** is particle virtual */ - bool is_virtual = false; -#ifdef VIRTUAL_SITES_RELATIVE - /** The following properties define, with respect to which real particle a - * virtual site is placed and at what distance. The relative orientation of - * the vector pointing from real particle to virtual site with respect to the - * orientation of the real particle is stored in the virtual site's - * quaternion attribute. - */ - struct VirtualSitesRelativeParameters { - int to_particle_id = 0; - double distance = 0; - /** Relative position of the virtual site. */ - Utils::Vector4d rel_orientation = {0., 0., 0., 0.}; - /** Orientation of the virtual particle in the body fixed frame. */ - Utils::Vector4d quat = {0., 0., 0., 0.}; - - template void serialize(Archive &ar, long int) { - ar &to_particle_id; - ar &distance; - ar &rel_orientation; - ar &quat; - } - } vs_relative; -#endif -#else /* VIRTUAL_SITES */ - static constexpr const bool is_virtual = false; -#endif /* VIRTUAL_SITES */ - -#ifdef LANGEVIN_PER_PARTICLE - double T = -1.; -#ifndef PARTICLE_ANISOTROPY - double gamma = -1.; -#else - Utils::Vector3d gamma = {-1., -1., -1.}; -#endif // PARTICLE_ANISOTROPY -/** Friction coefficient gamma for rotation */ -#ifdef ROTATION -#ifndef PARTICLE_ANISOTROPY - double gamma_rot = -1.; -#else - Utils::Vector3d gamma_rot = {-1., -1., -1.}; -#endif // ROTATIONAL_INERTIA -#endif // ROTATION -#endif // LANGEVIN_PER_PARTICLE - -#ifdef EXTERNAL_FORCES - /** flag whether to fix a particle in space. - Values: -
  • 0 no external influence -
  • 1 apply external force \ref ParticleProperties::ext_force -
  • 2,3,4 fix particle coordinate 0,1,2 -
  • 5 apply external torque \ref ParticleProperties::ext_torque -
- */ - int ext_flag = 0; - /** External force, apply if \ref ParticleProperties::ext_flag == 1. */ - Utils::Vector3d ext_force = {0, 0, 0}; - -#ifdef ROTATION - /** External torque, apply if \ref ParticleProperties::ext_flag == 16. */ - Utils::Vector3d ext_torque = {0, 0, 0}; -#endif -#endif -}; - -/** Positional information on a particle. Information that is - * communicated to calculate interactions with ghost particles. - */ -struct ParticlePosition { - /** periodically folded position. */ - Utils::Vector3d p = {0, 0, 0}; - -#ifdef ROTATION - /** quaternion to define particle orientation */ - Utils::Vector4d quat = {1., 0., 0., 0.}; - /** unit director calculated from the quaternion */ - Utils::Vector3d calc_director() const { - return Utils::convert_quaternion_to_director(quat); - }; -#endif - -#ifdef BOND_CONSTRAINT - /** particle position at the previous time step */ - Utils::Vector3d p_old = {0., 0., 0.}; -#endif -}; - -/** Force information on a particle. Forces of ghost particles are - * collected and added up to the force of the original particle. - */ -struct ParticleForce { - ParticleForce() = default; - ParticleForce(ParticleForce const &) = default; - ParticleForce(const Utils::Vector3d &f) : f(f) {} -#ifdef ROTATION - ParticleForce(const Utils::Vector3d &f, const Utils::Vector3d &torque) - : f(f), torque(torque) {} -#endif - - ParticleForce &operator+=(ParticleForce const &rhs) { - f += rhs.f; -#ifdef ROTATION - torque += rhs.torque; -#endif - - return *this; - } - - /** force. */ - Utils::Vector3d f = {0., 0., 0.}; - -#ifdef ROTATION - /** torque */ - Utils::Vector3d torque = {0., 0., 0.}; -#endif -}; - -/** Momentum information on a particle. Information not contained in - communication of ghost particles so far, but a communication would - be necessary for velocity dependent potentials. */ -struct ParticleMomentum { - /** velocity. */ - Utils::Vector3d v = {0., 0., 0.}; - -#ifdef ROTATION - /** angular velocity - ALWAYS IN PARTICLE FIXED, I.E., CO-ROTATING COORDINATE SYSTEM */ - Utils::Vector3d omega = {0., 0., 0.}; -#endif -}; - -/** Information on a particle that is needed only on the - * node the particle belongs to - */ -struct ParticleLocal { - /** check whether a particle is a ghost or not */ - bool ghost = false; - /** position in the last time step before last Verlet list update. */ - Utils::Vector3d p_old = {0, 0, 0}; - /** index of the simulation box image where the particle really sits. */ - Utils::Vector3i i = {0, 0, 0}; -}; - -struct ParticleParametersSwimming { -// ifdef inside because we need this type for some MPI prototypes -#ifdef ENGINE - bool swimming = false; - double f_swim = 0.; - double v_swim = 0.; - int push_pull = 0; - double dipole_length = 0.; - Utils::Vector3d v_center; - Utils::Vector3d v_source; - double rotational_friction = 0.; -#endif - - template void serialize(Archive &ar, long int) { -#ifdef ENGINE - ar &swimming &f_swim &v_swim &push_pull &dipole_length &v_center &v_source - &rotational_friction; -#endif - } -}; - -/** Struct holding all information for one particle. */ -struct Particle { - int &identity() { return p.identity; } - int const &identity() const { return p.identity; } - - bool operator==(Particle const &rhs) const { - return identity() == rhs.identity(); - } - - bool operator!=(Particle const &rhs) const { - return identity() != rhs.identity(); - } - - /** - * @brief Return a copy of the particle with - * only the fixed size parts. - * - * This creates a copy of the particle with - * only the parts than can be copied w/o heap - * allocation, e.g. w/o bonds and exclusions. - * This is more efficient if these parts are - * not actually needed. - */ - Particle flat_copy() const { - Particle ret; - - ret.p = p; - ret.r = r; - ret.m = m; - ret.f = f; - ret.l = l; -#ifdef ENGINE - ret.swim = swim; -#endif - - return ret; - } - - /// - ParticleProperties p; - /// - ParticlePosition r; -#ifdef DIPOLES - Utils::Vector3d calc_dip() const { return r.calc_director() * p.dipm; } -#endif - /// - ParticleMomentum m; - /// - ParticleForce f; - /// - ParticleLocal l; - - /** Bonded interactions list - * - * The format is pretty simple: just the bond type, and then the particle - * ids. The number of particle ids can be determined easily from the - * bonded_ia_params entry for the type. - */ - IntList bl; - - IntList &bonds() { return bl; } - IntList const &bonds() const { return bl; } - - IntList &exclusions() { -#ifdef EXCLUSIONS - return el; -#else - throw std::runtime_error{"Exclusions not enabled."}; -#endif - } - - IntList const &exclusions() const { -#ifdef EXCLUSIONS - return el; -#else - throw std::runtime_error{"Exclusions not enabled."}; -#endif - } - -#ifdef EXCLUSIONS - /** list of particles, with which this particle has no nonbonded - * interactions - */ - IntList el; -#endif - -#ifdef ENGINE - ParticleParametersSwimming swim; -#endif -}; - /** List of particles. The particle array is resized using a sophisticated * (we hope) algorithm to avoid unnecessary resizes. * Access using \ref realloc_particlelist, ... diff --git a/src/core/serialization/Particle.hpp b/src/core/serialization/Particle.hpp index 91adfa7ec3a..91eac4dcd5f 100644 --- a/src/core/serialization/Particle.hpp +++ b/src/core/serialization/Particle.hpp @@ -19,11 +19,14 @@ #ifndef CORE_UTILS_SERIALIZATION_PARTICLE_HPP #define CORE_UTILS_SERIALIZATION_PARTICLE_HPP -#include "particle_data.hpp" +#include "Particle.hpp" + #include #include +class Particle; + namespace boost { namespace serialization { /* Pod serialize for Particle */ diff --git a/src/core/unit_tests/Particle_test.cpp b/src/core/unit_tests/Particle_test.cpp index bd52ca0c7ec..bf22d8f1ba7 100644 --- a/src/core/unit_tests/Particle_test.cpp +++ b/src/core/unit_tests/Particle_test.cpp @@ -29,6 +29,7 @@ #include #include +#include "Particle.hpp" #include "serialization/Particle.hpp" BOOST_AUTO_TEST_CASE(comparison) { diff --git a/src/core/virtual_sites.hpp b/src/core/virtual_sites.hpp index 05d2474cd76..8aab54a63ad 100644 --- a/src/core/virtual_sites.hpp +++ b/src/core/virtual_sites.hpp @@ -20,9 +20,10 @@ #define VIRTUAL_SITES_HPP #include "config.hpp" -#include #ifdef VIRTUAL_SITES +#include "Particle.hpp" + #include "virtual_sites/VirtualSites.hpp" /** @brief get active virtual sites implementation */ From e694d0995584bf8fcddec19fecfa8c37c8d2f3f5 Mon Sep 17 00:00:00 2001 From: Florian Weik Date: Tue, 15 Oct 2019 13:52:00 +0200 Subject: [PATCH 11/16] core: Narrowed includes from particle_data.hpp to Particle.hpp where possible --- src/core/EspressoSystemInterface.cpp | 2 +- src/core/PartCfg.hpp | 2 +- src/core/bonded_interactions/bonded_coulomb_sr.hpp | 2 +- src/core/bonded_interactions/bonded_interaction_data.hpp | 2 +- src/core/bonded_interactions/thermalized_bond.hpp | 2 +- src/core/cells.cpp | 2 +- src/core/cells.hpp | 2 +- src/core/cluster_analysis/Cluster.cpp | 2 +- src/core/cluster_analysis/Cluster.hpp | 2 +- src/core/cluster_analysis/ClusterStructure.hpp | 2 +- src/core/collision.cpp | 2 +- src/core/collision.hpp | 2 +- src/core/communication.cpp | 2 +- src/core/communication.hpp | 2 +- src/core/constraints/Constraint.hpp | 2 +- src/core/constraints/HomogeneousMagneticField.hpp | 2 +- src/core/constraints/ShapeBasedConstraint.hpp | 2 +- src/core/diamond.hpp | 2 +- src/core/dpd.hpp | 2 +- src/core/electrostatics_magnetostatics/debye_hueckel.hpp | 2 +- src/core/electrostatics_magnetostatics/elc.cpp | 2 +- src/core/electrostatics_magnetostatics/elc.hpp | 2 +- src/core/electrostatics_magnetostatics/icc.cpp | 2 +- .../magnetic_non_p3m_methods.hpp | 2 +- src/core/electrostatics_magnetostatics/mdlc_correction.cpp | 2 +- src/core/electrostatics_magnetostatics/mmm1d.hpp | 2 +- src/core/electrostatics_magnetostatics/mmm2d.cpp | 2 +- src/core/electrostatics_magnetostatics/p3m-dipolar.cpp | 2 +- src/core/electrostatics_magnetostatics/p3m-dipolar.hpp | 2 +- src/core/electrostatics_magnetostatics/p3m.cpp | 2 +- src/core/electrostatics_magnetostatics/reaction_field.hpp | 2 +- src/core/electrostatics_magnetostatics/scafacos.hpp | 2 +- src/core/event.cpp | 2 +- src/core/ghosts.cpp | 2 +- src/core/grid_based_algorithms/lbgpu.cpp | 2 +- src/core/immersed_boundary/ImmersedBoundaries.cpp | 6 +++--- src/core/integrate.cpp | 2 +- src/core/integrators/velocity_verlet_inline.hpp | 2 +- src/core/integrators/velocity_verlet_npt.cpp | 2 +- src/core/integrators/velocity_verlet_npt.hpp | 2 +- src/core/io/mpiio/mpiio.cpp | 2 +- src/core/io/reader/readpdb.cpp | 1 + src/core/io/reader/readpdb.hpp | 2 +- src/core/metadynamics.hpp | 2 +- .../nonbonded_interactions/nonbonded_interaction_data.hpp | 2 +- src/core/nonbonded_interactions/thole.hpp | 2 +- src/core/object-in-fluid/membrane_collision.hpp | 2 +- src/core/object-in-fluid/oif_global_forces.cpp | 2 +- src/core/object-in-fluid/oif_local_forces.hpp | 2 +- src/core/object-in-fluid/out_direction.hpp | 2 +- src/core/observables/DPDStress.hpp | 2 +- src/core/observables/LBVelocityProfile.hpp | 2 +- src/core/observables/ParticleForces.hpp | 2 +- src/core/observables/PidProfileObservable.hpp | 2 +- src/core/observables/StressTensor.hpp | 2 +- src/core/pair_criteria/pair_criteria.hpp | 2 +- src/core/particle_data.cpp | 4 ++-- src/core/polymer.hpp | 2 +- src/core/rattle.cpp | 2 +- src/core/reaction_ensemble.cpp | 2 +- src/core/rotate_system.cpp | 2 +- src/core/rotation.cpp | 2 +- src/core/rotation.hpp | 2 +- src/core/serialization/ParticleParametersSwimming.hpp | 2 +- src/core/statistics.cpp | 2 +- src/core/statistics.hpp | 2 +- src/core/thermostat.hpp | 2 +- src/core/virtual_sites/VirtualSitesRelative.hpp | 2 +- src/core/virtual_sites/lb_inertialess_tracers.cpp | 2 +- src/core/virtual_sites/lb_inertialess_tracers_cuda.cu | 2 +- .../virtual_sites/lb_inertialess_tracers_cuda_interface.cpp | 2 +- src/core/virtual_sites/virtual_sites_com.hpp | 2 +- 72 files changed, 75 insertions(+), 74 deletions(-) diff --git a/src/core/EspressoSystemInterface.cpp b/src/core/EspressoSystemInterface.cpp index 9ad901ddd92..58273f8bf61 100644 --- a/src/core/EspressoSystemInterface.cpp +++ b/src/core/EspressoSystemInterface.cpp @@ -17,10 +17,10 @@ * along with this program. If not, see . */ #include "EspressoSystemInterface.hpp" +#include "Particle.hpp" #include "cells.hpp" #include "cuda_interface.hpp" #include "grid.hpp" -#include "particle_data.hpp" /* Initialize instance pointer */ EspressoSystemInterface *EspressoSystemInterface::m_instance = nullptr; diff --git a/src/core/PartCfg.hpp b/src/core/PartCfg.hpp index 4eebceb4da3..cc05ecf73fa 100644 --- a/src/core/PartCfg.hpp +++ b/src/core/PartCfg.hpp @@ -19,10 +19,10 @@ #ifndef CORE_PART_CFG_HPP #define CORE_PART_CFG_HPP +#include "Particle.hpp" #include "ParticleCache.hpp" #include "cells.hpp" #include "grid.hpp" -#include "particle_data.hpp" #include "serialization/Particle.hpp" #include diff --git a/src/core/bonded_interactions/bonded_coulomb_sr.hpp b/src/core/bonded_interactions/bonded_coulomb_sr.hpp index 53431ad8c97..fe0f0a2354c 100644 --- a/src/core/bonded_interactions/bonded_coulomb_sr.hpp +++ b/src/core/bonded_interactions/bonded_coulomb_sr.hpp @@ -32,9 +32,9 @@ #ifdef ELECTROSTATICS +#include "Particle.hpp" #include "bonded_interaction_data.hpp" #include "electrostatics_magnetostatics/coulomb_inline.hpp" -#include "particle_data.hpp" /** Set the parameters for the short-range bonded Coulomb potential * diff --git a/src/core/bonded_interactions/bonded_interaction_data.hpp b/src/core/bonded_interactions/bonded_interaction_data.hpp index 736419ae9f6..68dd24e9ddf 100644 --- a/src/core/bonded_interactions/bonded_interaction_data.hpp +++ b/src/core/bonded_interactions/bonded_interaction_data.hpp @@ -21,8 +21,8 @@ #include +#include "Particle.hpp" #include "TabulatedPotential.hpp" -#include "particle_data.hpp" #include /** @file diff --git a/src/core/bonded_interactions/thermalized_bond.hpp b/src/core/bonded_interactions/thermalized_bond.hpp index 91379645bd2..5db22853815 100644 --- a/src/core/bonded_interactions/thermalized_bond.hpp +++ b/src/core/bonded_interactions/thermalized_bond.hpp @@ -31,9 +31,9 @@ /** number of thermalized bonds */ extern int n_thermalized_bonds; +#include "Particle.hpp" #include "bonded_interaction_data.hpp" #include "integrate.hpp" -#include "particle_data.hpp" #include "random.hpp" #include diff --git a/src/core/cells.cpp b/src/core/cells.cpp index 780d3305a67..1638cbd2435 100644 --- a/src/core/cells.cpp +++ b/src/core/cells.cpp @@ -25,6 +25,7 @@ * Implementation of cells.hpp. */ #include "cells.hpp" +#include "Particle.hpp" #include "algorithm/link_cell.hpp" #include "communication.hpp" #include "debug.hpp" @@ -37,7 +38,6 @@ #include "layered.hpp" #include "nonbonded_interactions/nonbonded_interaction_data.hpp" #include "nsquare.hpp" -#include "particle_data.hpp" #include #include diff --git a/src/core/cells.hpp b/src/core/cells.hpp index 45b5229a298..6a4005d6ad7 100644 --- a/src/core/cells.hpp +++ b/src/core/cells.hpp @@ -60,9 +60,9 @@ #include #include +#include "Particle.hpp" #include "ParticleIterator.hpp" #include "ghosts.hpp" -#include "particle_data.hpp" #include "Cell.hpp" #include "ParticleRange.hpp" diff --git a/src/core/cluster_analysis/Cluster.cpp b/src/core/cluster_analysis/Cluster.cpp index 02f17b9866f..2e2f3453980 100644 --- a/src/core/cluster_analysis/Cluster.cpp +++ b/src/core/cluster_analysis/Cluster.cpp @@ -16,8 +16,8 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ +#include "Particle.hpp" #include "partCfg_global.hpp" -#include "particle_data.hpp" #ifdef GSL #include "gsl/gsl_fit.h" #endif diff --git a/src/core/cluster_analysis/Cluster.hpp b/src/core/cluster_analysis/Cluster.hpp index 8f65e64fbb8..4da33faebe2 100644 --- a/src/core/cluster_analysis/Cluster.hpp +++ b/src/core/cluster_analysis/Cluster.hpp @@ -25,7 +25,7 @@ #include #include -#include "particle_data.hpp" +#include "Particle.hpp" #include namespace ClusterAnalysis { diff --git a/src/core/cluster_analysis/ClusterStructure.hpp b/src/core/cluster_analysis/ClusterStructure.hpp index d7390cf7eb7..fcf2f74ab7d 100644 --- a/src/core/cluster_analysis/ClusterStructure.hpp +++ b/src/core/cluster_analysis/ClusterStructure.hpp @@ -26,8 +26,8 @@ #include #include "Cluster.hpp" +#include "Particle.hpp" #include "pair_criteria/pair_criteria.hpp" -#include "particle_data.hpp" namespace ClusterAnalysis { diff --git a/src/core/collision.cpp b/src/core/collision.cpp index b9fdd265700..bf7045d6cfa 100644 --- a/src/core/collision.cpp +++ b/src/core/collision.cpp @@ -18,13 +18,13 @@ */ #include "collision.hpp" +#include "Particle.hpp" #include "cells.hpp" #include "communication.hpp" #include "errorhandling.hpp" #include "event.hpp" #include "grid.hpp" #include "nonbonded_interactions/nonbonded_interaction_data.hpp" -#include "particle_data.hpp" #include "rotation.hpp" #include "virtual_sites/VirtualSitesRelative.hpp" diff --git a/src/core/collision.hpp b/src/core/collision.hpp index 1c0e4b8d109..2920b53e999 100644 --- a/src/core/collision.hpp +++ b/src/core/collision.hpp @@ -39,9 +39,9 @@ #define COLLISION_MODE_BIND_THREE_PARTICLES 16 /*@}*/ +#include "Particle.hpp" #include "bonded_interactions/bonded_interaction_data.hpp" #include "integrate.hpp" -#include "particle_data.hpp" #include "virtual_sites.hpp" class Collision_parameters { diff --git a/src/core/communication.cpp b/src/core/communication.cpp index 1a04dbc531e..366271bba52 100644 --- a/src/core/communication.cpp +++ b/src/core/communication.cpp @@ -33,6 +33,7 @@ #include "errorhandling.hpp" #include "EspressoSystemInterface.hpp" +#include "Particle.hpp" #include "bonded_interactions/bonded_tab.hpp" #include "cells.hpp" #include "collision.hpp" @@ -53,7 +54,6 @@ #include "nonbonded_interactions/nonbonded_tab.hpp" #include "npt.hpp" #include "partCfg_global.hpp" -#include "particle_data.hpp" #include "pressure.hpp" #include "rotation.hpp" #include "statistics.hpp" diff --git a/src/core/communication.hpp b/src/core/communication.hpp index 2959e9700e4..90df761e477 100644 --- a/src/core/communication.hpp +++ b/src/core/communication.hpp @@ -52,9 +52,9 @@ #include "MpiCallbacks.hpp" /** Included needed by callbacks. */ +#include "Particle.hpp" #include "cuda_init.hpp" #include "grid_based_algorithms/lb_constants.hpp" -#include "particle_data.hpp" #include #include diff --git a/src/core/constraints/Constraint.hpp b/src/core/constraints/Constraint.hpp index 735917f8d4f..e363bb3fa2b 100644 --- a/src/core/constraints/Constraint.hpp +++ b/src/core/constraints/Constraint.hpp @@ -19,8 +19,8 @@ #ifndef CONSTRAINTS_CONSTRAINT_HPP #define CONSTRAINTS_CONSTRAINT_HPP +#include "Particle.hpp" #include "energy.hpp" -#include "particle_data.hpp" namespace Constraints { class Constraint { diff --git a/src/core/constraints/HomogeneousMagneticField.hpp b/src/core/constraints/HomogeneousMagneticField.hpp index 2c099c63d77..05a20c5bc1b 100644 --- a/src/core/constraints/HomogeneousMagneticField.hpp +++ b/src/core/constraints/HomogeneousMagneticField.hpp @@ -20,7 +20,7 @@ #define CONSTRAINTS_HOMOGENEOUSMAGNETICFIELD_HPP #include "Constraint.hpp" -#include "particle_data.hpp" +#include "Particle.hpp" namespace Constraints { diff --git a/src/core/constraints/ShapeBasedConstraint.hpp b/src/core/constraints/ShapeBasedConstraint.hpp index 7cb465207e6..87056588011 100644 --- a/src/core/constraints/ShapeBasedConstraint.hpp +++ b/src/core/constraints/ShapeBasedConstraint.hpp @@ -22,8 +22,8 @@ #include #include "Constraint.hpp" +#include "Particle.hpp" #include "energy.hpp" -#include "particle_data.hpp" #include "shapes/NoWhere.hpp" #include "shapes/Shape.hpp" diff --git a/src/core/diamond.hpp b/src/core/diamond.hpp index b6096d70088..b04f72cb369 100644 --- a/src/core/diamond.hpp +++ b/src/core/diamond.hpp @@ -30,7 +30,7 @@ */ #include "PartCfg.hpp" -#include "particle_data.hpp" +#include "Particle.hpp" #include "utils/Vector.hpp" /** C implementation of 'counterions \ [options]'. diff --git a/src/core/dpd.hpp b/src/core/dpd.hpp index e5d4d4d9897..5da75ace6e2 100644 --- a/src/core/dpd.hpp +++ b/src/core/dpd.hpp @@ -30,7 +30,7 @@ #include "config.hpp" #ifdef DPD -#include "particle_data.hpp" +#include "Particle.hpp" #include #include diff --git a/src/core/electrostatics_magnetostatics/debye_hueckel.hpp b/src/core/electrostatics_magnetostatics/debye_hueckel.hpp index d9e48774de3..b9ebf3f0e2c 100644 --- a/src/core/electrostatics_magnetostatics/debye_hueckel.hpp +++ b/src/core/electrostatics_magnetostatics/debye_hueckel.hpp @@ -28,7 +28,7 @@ #ifdef ELECTROSTATICS -#include "particle_data.hpp" +#include "Particle.hpp" /** Structure to hold Debye-Hueckel Parameters. */ typedef struct { diff --git a/src/core/electrostatics_magnetostatics/elc.cpp b/src/core/electrostatics_magnetostatics/elc.cpp index 5bf43b1d1cf..9258dff0004 100644 --- a/src/core/electrostatics_magnetostatics/elc.cpp +++ b/src/core/electrostatics_magnetostatics/elc.cpp @@ -21,11 +21,11 @@ /** \file * Implementation of \ref elc.hpp. */ +#include "Particle.hpp" #include "cells.hpp" #include "communication.hpp" #include "errorhandling.hpp" #include "mmm-common.hpp" -#include "particle_data.hpp" #include "pressure.hpp" #include #include diff --git a/src/core/electrostatics_magnetostatics/elc.hpp b/src/core/electrostatics_magnetostatics/elc.hpp index 24205daf42d..8754f785bc4 100644 --- a/src/core/electrostatics_magnetostatics/elc.hpp +++ b/src/core/electrostatics_magnetostatics/elc.hpp @@ -29,7 +29,7 @@ #ifndef _ELC_H #define _ELC_H -#include "particle_data.hpp" +#include "Particle.hpp" #ifdef P3M diff --git a/src/core/electrostatics_magnetostatics/icc.cpp b/src/core/electrostatics_magnetostatics/icc.cpp index be18f8a889e..a5dd13686c1 100644 --- a/src/core/electrostatics_magnetostatics/icc.cpp +++ b/src/core/electrostatics_magnetostatics/icc.cpp @@ -34,6 +34,7 @@ #include "electrostatics_magnetostatics/p3m_gpu.hpp" +#include "Particle.hpp" #include "cells.hpp" #include "communication.hpp" #include "config.hpp" @@ -41,7 +42,6 @@ #include "event.hpp" #include "forces.hpp" #include "nonbonded_interactions/nonbonded_interaction_data.hpp" -#include "particle_data.hpp" #include "short_range_loop.hpp" #include diff --git a/src/core/electrostatics_magnetostatics/magnetic_non_p3m_methods.hpp b/src/core/electrostatics_magnetostatics/magnetic_non_p3m_methods.hpp index b141b213048..c67cb9e85be 100644 --- a/src/core/electrostatics_magnetostatics/magnetic_non_p3m_methods.hpp +++ b/src/core/electrostatics_magnetostatics/magnetic_non_p3m_methods.hpp @@ -39,7 +39,7 @@ #include #ifdef DIPOLES -#include "particle_data.hpp" +#include "Particle.hpp" /** Calculates dipolar energy and/or force between two particles */ double calc_dipole_dipole_ia(Particle &p1, Particle &p2, bool force_flag); diff --git a/src/core/electrostatics_magnetostatics/mdlc_correction.cpp b/src/core/electrostatics_magnetostatics/mdlc_correction.cpp index 29914de906d..c59496e8531 100644 --- a/src/core/electrostatics_magnetostatics/mdlc_correction.cpp +++ b/src/core/electrostatics_magnetostatics/mdlc_correction.cpp @@ -36,6 +36,7 @@ #include "electrostatics_magnetostatics/mdlc_correction.hpp" #if defined(DIPOLES) && defined(DP3M) +#include "Particle.hpp" #include "cells.hpp" #include "communication.hpp" #include "electrostatics_magnetostatics/dipole.hpp" @@ -43,7 +44,6 @@ #include "errorhandling.hpp" #include "global.hpp" #include "grid.hpp" -#include "particle_data.hpp" DLC_struct dlc_params = {1e100, 0, 0, 0, 0}; diff --git a/src/core/electrostatics_magnetostatics/mmm1d.hpp b/src/core/electrostatics_magnetostatics/mmm1d.hpp index b97e8b1e287..b062b6c7d1a 100644 --- a/src/core/electrostatics_magnetostatics/mmm1d.hpp +++ b/src/core/electrostatics_magnetostatics/mmm1d.hpp @@ -29,7 +29,7 @@ #ifndef MMM1D_H #define MMM1D_H -#include "particle_data.hpp" +#include "Particle.hpp" #ifdef ELECTROSTATICS diff --git a/src/core/electrostatics_magnetostatics/mmm2d.cpp b/src/core/electrostatics_magnetostatics/mmm2d.cpp index 2695e32a3d6..64e4a332d77 100644 --- a/src/core/electrostatics_magnetostatics/mmm2d.cpp +++ b/src/core/electrostatics_magnetostatics/mmm2d.cpp @@ -27,6 +27,7 @@ #include "electrostatics_magnetostatics/mmm2d.hpp" #ifdef ELECTROSTATICS +#include "Particle.hpp" #include "cells.hpp" #include "communication.hpp" #include "electrostatics_magnetostatics/coulomb.hpp" @@ -34,7 +35,6 @@ #include "grid.hpp" #include "integrate.hpp" #include "mmm-common.hpp" -#include "particle_data.hpp" #include "specfunc.hpp" #include diff --git a/src/core/electrostatics_magnetostatics/p3m-dipolar.cpp b/src/core/electrostatics_magnetostatics/p3m-dipolar.cpp index a961feca124..6516a0a0ff5 100644 --- a/src/core/electrostatics_magnetostatics/p3m-dipolar.cpp +++ b/src/core/electrostatics_magnetostatics/p3m-dipolar.cpp @@ -36,6 +36,7 @@ #ifdef DP3M +#include "Particle.hpp" #include "cells.hpp" #include "communication.hpp" #include "domain_decomposition.hpp" @@ -43,7 +44,6 @@ #include "global.hpp" #include "grid.hpp" #include "integrate.hpp" -#include "particle_data.hpp" #include "tuning.hpp" #include diff --git a/src/core/electrostatics_magnetostatics/p3m-dipolar.hpp b/src/core/electrostatics_magnetostatics/p3m-dipolar.hpp index f65c31ddef4..4b0243c9c4b 100644 --- a/src/core/electrostatics_magnetostatics/p3m-dipolar.hpp +++ b/src/core/electrostatics_magnetostatics/p3m-dipolar.hpp @@ -39,10 +39,10 @@ #include "config.hpp" #ifdef DP3M +#include "Particle.hpp" #include "electrostatics_magnetostatics/dipole.hpp" #include "fft.hpp" #include "p3m-common.hpp" -#include "particle_data.hpp" #include #include diff --git a/src/core/electrostatics_magnetostatics/p3m.cpp b/src/core/electrostatics_magnetostatics/p3m.cpp index 4bc883048bf..378dba79569 100644 --- a/src/core/electrostatics_magnetostatics/p3m.cpp +++ b/src/core/electrostatics_magnetostatics/p3m.cpp @@ -26,6 +26,7 @@ #ifdef P3M +#include "Particle.hpp" #include "cells.hpp" #include "communication.hpp" #include "domain_decomposition.hpp" @@ -38,7 +39,6 @@ #include "global.hpp" #include "grid.hpp" #include "integrate.hpp" -#include "particle_data.hpp" #include "tuning.hpp" #ifdef CUDA #include "p3m_gpu_error.hpp" diff --git a/src/core/electrostatics_magnetostatics/reaction_field.hpp b/src/core/electrostatics_magnetostatics/reaction_field.hpp index 91f84bed1ad..e4b844f0050 100644 --- a/src/core/electrostatics_magnetostatics/reaction_field.hpp +++ b/src/core/electrostatics_magnetostatics/reaction_field.hpp @@ -31,7 +31,7 @@ #include "config.hpp" #ifdef ELECTROSTATICS -#include "particle_data.hpp" +#include "Particle.hpp" /** Structure to hold Reaction Field Parameters. */ typedef struct { diff --git a/src/core/electrostatics_magnetostatics/scafacos.hpp b/src/core/electrostatics_magnetostatics/scafacos.hpp index d0dab532235..b08009c50ad 100644 --- a/src/core/electrostatics_magnetostatics/scafacos.hpp +++ b/src/core/electrostatics_magnetostatics/scafacos.hpp @@ -31,7 +31,7 @@ #include #include -#include "particle_data.hpp" +#include "Particle.hpp" namespace Scafacos { #if defined(SCAFACOS) diff --git a/src/core/event.cpp b/src/core/event.cpp index 2a520d45047..d8e03306a29 100644 --- a/src/core/event.cpp +++ b/src/core/event.cpp @@ -25,6 +25,7 @@ */ #include "event.hpp" +#include "Particle.hpp" #include "bonded_interactions/thermalized_bond.hpp" #include "cells.hpp" #include "collision.hpp" @@ -45,7 +46,6 @@ #include "npt.hpp" #include "nsquare.hpp" #include "partCfg_global.hpp" -#include "particle_data.hpp" #include "pressure.hpp" #include "random.hpp" #include "rattle.hpp" diff --git a/src/core/ghosts.cpp b/src/core/ghosts.cpp index 9e030c331ef..057699a9e57 100644 --- a/src/core/ghosts.cpp +++ b/src/core/ghosts.cpp @@ -25,9 +25,9 @@ * see \ref ghosts.hpp "ghosts.hpp" */ #include "ghosts.hpp" +#include "Particle.hpp" #include "communication.hpp" #include "errorhandling.hpp" -#include "particle_data.hpp" #include #include diff --git a/src/core/grid_based_algorithms/lbgpu.cpp b/src/core/grid_based_algorithms/lbgpu.cpp index 95880dfc459..32d03be1c05 100644 --- a/src/core/grid_based_algorithms/lbgpu.cpp +++ b/src/core/grid_based_algorithms/lbgpu.cpp @@ -27,6 +27,7 @@ #include "errorhandling.hpp" #include "lb-d3q19.hpp" +#include "Particle.hpp" #include "communication.hpp" #include "cuda_interface.hpp" #include "global.hpp" @@ -35,7 +36,6 @@ #include "grid_based_algorithms/lbgpu.hpp" #include "integrate.hpp" #include "nonbonded_interactions/nonbonded_interaction_data.hpp" -#include "particle_data.hpp" #include "statistics.hpp" #include diff --git a/src/core/immersed_boundary/ImmersedBoundaries.cpp b/src/core/immersed_boundary/ImmersedBoundaries.cpp index b207ec36b4d..7a80d56254f 100644 --- a/src/core/immersed_boundary/ImmersedBoundaries.cpp +++ b/src/core/immersed_boundary/ImmersedBoundaries.cpp @@ -19,12 +19,12 @@ #include "ImmersedBoundaries.hpp" +#include "Particle.hpp" #include "bonded_interactions/bonded_interaction_data.hpp" #include "cells.hpp" #include "communication.hpp" #include "errorhandling.hpp" #include "grid.hpp" -#include "particle_data.hpp" #include @@ -133,7 +133,7 @@ void ImmersedBoundaries::calc_volumes() { // triangles, not all particles First round to check for volume // conservation and virtual Loop over all bonds of this particle Actually // j loops over the bond-list, i.e. the bond partners (see - // particle_data.hpp) + // Particle.hpp) int softID = -1; int j = 0; while (j < p1.bl.n) { @@ -240,7 +240,7 @@ void ImmersedBoundaries::calc_volume_force() { // triangles, not all particles First round to check for volume // conservation and virtual Loop over all bonds of this particle Actually // j loops over the bond-list, i.e. the bond partners (see - // particle_data.hpp) + // Particle.hpp) int softID = -1; double volRef = 0.; double kappaV = 0.; diff --git a/src/core/integrate.cpp b/src/core/integrate.cpp index a3018589f9f..0d9cbfc311d 100644 --- a/src/core/integrate.cpp +++ b/src/core/integrate.cpp @@ -27,6 +27,7 @@ */ #include "integrate.hpp" +#include "Particle.hpp" #include "accumulators.hpp" #include "bonded_interactions/bonded_interaction_data.hpp" #include "bonded_interactions/thermalized_bond.hpp" @@ -49,7 +50,6 @@ #include "immersed_boundaries.hpp" #include "nonbonded_interactions/nonbonded_interaction_data.hpp" #include "npt.hpp" -#include "particle_data.hpp" #include "pressure.hpp" #include "rattle.hpp" #include "rotation.hpp" diff --git a/src/core/integrators/velocity_verlet_inline.hpp b/src/core/integrators/velocity_verlet_inline.hpp index 6b19ab6ec41..0fe30e33ae1 100644 --- a/src/core/integrators/velocity_verlet_inline.hpp +++ b/src/core/integrators/velocity_verlet_inline.hpp @@ -19,9 +19,9 @@ #ifndef INTEGRATORS_VELOCITY_VERLET_HPP #define INTEGRATORS_VELOCITY_VERLET_HPP +#include "Particle.hpp" #include "ParticleRange.hpp" #include "config.hpp" -#include "particle_data.hpp" #include "rotation.hpp" /** Propagate the velocities and positions. Integration steps before force diff --git a/src/core/integrators/velocity_verlet_npt.cpp b/src/core/integrators/velocity_verlet_npt.cpp index 9e738153720..3e7a0615c3b 100644 --- a/src/core/integrators/velocity_verlet_npt.cpp +++ b/src/core/integrators/velocity_verlet_npt.cpp @@ -20,6 +20,7 @@ #include "config.hpp" #ifdef NPT +#include "Particle.hpp" #include "ParticleRange.hpp" #include "cells.hpp" #include "communication.hpp" @@ -27,7 +28,6 @@ #include "integrate.hpp" #include "nonbonded_interactions/nonbonded_interaction_data.hpp" #include "npt.hpp" -#include "particle_data.hpp" #include "thermostat.hpp" #include "utils/math/sqr.hpp" diff --git a/src/core/integrators/velocity_verlet_npt.hpp b/src/core/integrators/velocity_verlet_npt.hpp index 85255b9eddf..1b4769590f1 100644 --- a/src/core/integrators/velocity_verlet_npt.hpp +++ b/src/core/integrators/velocity_verlet_npt.hpp @@ -22,8 +22,8 @@ #include "config.hpp" #ifdef NPT +#include "Particle.hpp" #include "ParticleRange.hpp" -#include "particle_data.hpp" /** Special propagator for NPT ISOTROPIC Propagate the velocities and positions. Integration steps before force diff --git a/src/core/io/mpiio/mpiio.cpp b/src/core/io/mpiio/mpiio.cpp index 21dce043088..687a7b17a5c 100644 --- a/src/core/io/mpiio/mpiio.cpp +++ b/src/core/io/mpiio/mpiio.cpp @@ -50,13 +50,13 @@ #include "config.hpp" +#include "Particle.hpp" #include "bonded_interactions/bonded_interaction_data.hpp" #include "cells.hpp" #include "errorhandling.hpp" #include "event.hpp" #include "integrate.hpp" #include "mpiio.hpp" -#include "particle_data.hpp" #include diff --git a/src/core/io/reader/readpdb.cpp b/src/core/io/reader/readpdb.cpp index b8de507c231..f50e7a7fa16 100644 --- a/src/core/io/reader/readpdb.cpp +++ b/src/core/io/reader/readpdb.cpp @@ -19,6 +19,7 @@ #include "readpdb.hpp" #include "grid.hpp" #include "nonbonded_interactions/lj.hpp" +#include "particle_data.hpp" #include #include diff --git a/src/core/io/reader/readpdb.hpp b/src/core/io/reader/readpdb.hpp index 45f68d2ae8c..567e2a8cc8c 100644 --- a/src/core/io/reader/readpdb.hpp +++ b/src/core/io/reader/readpdb.hpp @@ -20,8 +20,8 @@ #ifndef __READ_PDB_HPP #define __READ_PDB_HPP +#include "Particle.hpp" #include "PdbParser.hpp" -#include "particle_data.hpp" namespace Reader { namespace PDB { diff --git a/src/core/metadynamics.hpp b/src/core/metadynamics.hpp index 8f2ff7243d7..97d21868e47 100644 --- a/src/core/metadynamics.hpp +++ b/src/core/metadynamics.hpp @@ -22,8 +22,8 @@ #ifndef METADYNAMICS_H #define METADYNAMICS_H +#include "Particle.hpp" #include "ParticleRange.hpp" -#include "particle_data.hpp" /** \file * diff --git a/src/core/nonbonded_interactions/nonbonded_interaction_data.hpp b/src/core/nonbonded_interactions/nonbonded_interaction_data.hpp index ae87235f4c1..60569cba990 100644 --- a/src/core/nonbonded_interactions/nonbonded_interaction_data.hpp +++ b/src/core/nonbonded_interactions/nonbonded_interaction_data.hpp @@ -24,9 +24,9 @@ * Various procedures concerning interactions between particles. */ +#include "Particle.hpp" #include "TabulatedPotential.hpp" #include "dpd.hpp" -#include "particle_data.hpp" #include #include diff --git a/src/core/nonbonded_interactions/thole.hpp b/src/core/nonbonded_interactions/thole.hpp index e820c153595..ceb7f41fc0f 100644 --- a/src/core/nonbonded_interactions/thole.hpp +++ b/src/core/nonbonded_interactions/thole.hpp @@ -29,11 +29,11 @@ #include "config.hpp" #ifdef THOLE +#include "Particle.hpp" #include "bonded_interactions/bonded_interaction_data.hpp" #include "electrostatics_magnetostatics/coulomb_inline.hpp" #include "grid.hpp" #include "nonbonded_interactions/nonbonded_interaction_data.hpp" -#include "particle_data.hpp" int thole_set_params(int part_type_a, int part_type_b, double scaling_coeff, double q1q2); diff --git a/src/core/object-in-fluid/membrane_collision.hpp b/src/core/object-in-fluid/membrane_collision.hpp index db3d385ae54..6ef8d0e1a6a 100644 --- a/src/core/object-in-fluid/membrane_collision.hpp +++ b/src/core/object-in-fluid/membrane_collision.hpp @@ -31,9 +31,9 @@ #ifdef MEMBRANE_COLLISION +#include "Particle.hpp" #include "integrate.hpp" #include "nonbonded_interactions/nonbonded_interaction_data.hpp" -#include "particle_data.hpp" #include diff --git a/src/core/object-in-fluid/oif_global_forces.cpp b/src/core/object-in-fluid/oif_global_forces.cpp index 6d4b24c0053..4571f8a6850 100644 --- a/src/core/object-in-fluid/oif_global_forces.cpp +++ b/src/core/object-in-fluid/oif_global_forces.cpp @@ -18,13 +18,13 @@ */ #include "oif_global_forces.hpp" +#include "Particle.hpp" #include "bonded_interactions/bonded_interaction_data.hpp" #include "cells.hpp" #include "communication.hpp" #include "errorhandling.hpp" #include "grid.hpp" #include "grid_based_algorithms/lb_interface.hpp" -#include "particle_data.hpp" #include using Utils::angle_btw_triangles; diff --git a/src/core/object-in-fluid/oif_local_forces.hpp b/src/core/object-in-fluid/oif_local_forces.hpp index b8ff9163a91..73534bbacf7 100644 --- a/src/core/object-in-fluid/oif_local_forces.hpp +++ b/src/core/object-in-fluid/oif_local_forces.hpp @@ -25,9 +25,9 @@ * (Dupin2007) \ref forces.cpp */ +#include "Particle.hpp" #include "bonded_interactions/bonded_interaction_data.hpp" #include "grid.hpp" -#include "particle_data.hpp" #include #include diff --git a/src/core/object-in-fluid/out_direction.hpp b/src/core/object-in-fluid/out_direction.hpp index ae9e11e313b..56c43e5652d 100644 --- a/src/core/object-in-fluid/out_direction.hpp +++ b/src/core/object-in-fluid/out_direction.hpp @@ -27,9 +27,9 @@ #ifdef MEMBRANE_COLLISION +#include "Particle.hpp" #include "bonded_interactions/bonded_interaction_data.hpp" #include "grid.hpp" -#include "particle_data.hpp" #include using Utils::get_n_triangle; diff --git a/src/core/observables/DPDStress.hpp b/src/core/observables/DPDStress.hpp index 9159395e7fc..f29ae059667 100644 --- a/src/core/observables/DPDStress.hpp +++ b/src/core/observables/DPDStress.hpp @@ -20,8 +20,8 @@ #define OBSERVABLES_DPDSTRESS_HPP #include "Observable.hpp" +#include "Particle.hpp" #include "dpd.hpp" -#include "particle_data.hpp" #include namespace Observables { diff --git a/src/core/observables/LBVelocityProfile.hpp b/src/core/observables/LBVelocityProfile.hpp index 6ef3a51cf53..0064fde7a86 100644 --- a/src/core/observables/LBVelocityProfile.hpp +++ b/src/core/observables/LBVelocityProfile.hpp @@ -20,7 +20,7 @@ #define OBSERVABLES_LBVELOCITYPROFILE_HPP #include "LBProfileObservable.hpp" -#include "particle_data.hpp" +#include "Particle.hpp" #include diff --git a/src/core/observables/ParticleForces.hpp b/src/core/observables/ParticleForces.hpp index 5174450d873..b82f793be79 100644 --- a/src/core/observables/ParticleForces.hpp +++ b/src/core/observables/ParticleForces.hpp @@ -19,9 +19,9 @@ #ifndef OBSERVABLES_PARTICLEFORCES_HPP #define OBSERVABLES_PARTICLEFORCES_HPP +#include "Particle.hpp" #include "PidObservable.hpp" #include "integrate.hpp" -#include "particle_data.hpp" #include namespace Observables { diff --git a/src/core/observables/PidProfileObservable.hpp b/src/core/observables/PidProfileObservable.hpp index ae30209b47f..1eecc4dc163 100644 --- a/src/core/observables/PidProfileObservable.hpp +++ b/src/core/observables/PidProfileObservable.hpp @@ -20,10 +20,10 @@ #define OBSERVABLES_PIDPROFILEOBSERVABLE_HPP #include "Observable.hpp" +#include "Particle.hpp" #include "PidObservable.hpp" #include "ProfileObservable.hpp" #include "integrate.hpp" -#include "particle_data.hpp" #include namespace Observables { diff --git a/src/core/observables/StressTensor.hpp b/src/core/observables/StressTensor.hpp index 79ee7855195..12e149fb739 100644 --- a/src/core/observables/StressTensor.hpp +++ b/src/core/observables/StressTensor.hpp @@ -19,7 +19,7 @@ #ifndef OBSERVABLES_STRESSTENSOR_HPP #include "Observable.hpp" -#include "particle_data.hpp" +#include "Particle.hpp" #include "pressure.hpp" #include diff --git a/src/core/pair_criteria/pair_criteria.hpp b/src/core/pair_criteria/pair_criteria.hpp index a965492e2ae..66698782586 100644 --- a/src/core/pair_criteria/pair_criteria.hpp +++ b/src/core/pair_criteria/pair_criteria.hpp @@ -19,8 +19,8 @@ #ifndef PAIR_CRITERIA_HPP #define PAIR_CRITERIA_HPP +#include "Particle.hpp" #include "energy_inline.hpp" -#include "particle_data.hpp" #include namespace PairCriteria { diff --git a/src/core/particle_data.cpp b/src/core/particle_data.cpp index a64cea9235d..98f4801d4cc 100644 --- a/src/core/particle_data.cpp +++ b/src/core/particle_data.cpp @@ -21,10 +21,10 @@ /** \file * Particles and particle lists. * - * The corresponding header file is particle_data.hpp. + * The corresponding header file is Particle.hpp. */ -#include "particle_data.hpp" +#include "Particle.hpp" #include "PartCfg.hpp" #include "bonded_interactions/bonded_interaction_data.hpp" diff --git a/src/core/polymer.hpp b/src/core/polymer.hpp index 067e252d84d..8c3f2bc16a2 100644 --- a/src/core/polymer.hpp +++ b/src/core/polymer.hpp @@ -30,7 +30,7 @@ */ #include "PartCfg.hpp" -#include "particle_data.hpp" +#include "Particle.hpp" #include "utils/Vector.hpp" Utils::Vector3d random_position(std::function const &generate_rn); diff --git a/src/core/rattle.cpp b/src/core/rattle.cpp index f9af950e796..4ea17e8be7c 100644 --- a/src/core/rattle.cpp +++ b/src/core/rattle.cpp @@ -25,6 +25,7 @@ int n_rigidbonds = 0; #ifdef BOND_CONSTRAINT +#include "Particle.hpp" #include "bonded_interactions/bonded_interaction_data.hpp" #include "cells.hpp" #include "communication.hpp" @@ -33,7 +34,6 @@ int n_rigidbonds = 0; #include "grid.hpp" #include "integrate.hpp" #include "nonbonded_interactions/nonbonded_interaction_data.hpp" -#include "particle_data.hpp" #include diff --git a/src/core/reaction_ensemble.cpp b/src/core/reaction_ensemble.cpp index 20605af784e..507bafd92c8 100644 --- a/src/core/reaction_ensemble.cpp +++ b/src/core/reaction_ensemble.cpp @@ -20,11 +20,11 @@ /** @file */ #include "reaction_ensemble.hpp" +#include "Particle.hpp" #include "energy.hpp" #include "global.hpp" #include "integrate.hpp" #include "partCfg_global.hpp" -#include "particle_data.hpp" #include #include diff --git a/src/core/rotate_system.cpp b/src/core/rotate_system.cpp index a9c29483cd4..33501b3a52b 100644 --- a/src/core/rotate_system.cpp +++ b/src/core/rotate_system.cpp @@ -16,10 +16,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ +#include "Particle.hpp" #include "cells.hpp" #include "communication.hpp" #include "event.hpp" -#include "particle_data.hpp" #include "rotation.hpp" #include diff --git a/src/core/rotation.cpp b/src/core/rotation.cpp index 08613f96701..12f81eca8aa 100644 --- a/src/core/rotation.cpp +++ b/src/core/rotation.cpp @@ -35,6 +35,7 @@ #include "rotation.hpp" #ifdef ROTATION +#include "Particle.hpp" #include "cells.hpp" #include "communication.hpp" #include "cuda_interface.hpp" @@ -42,7 +43,6 @@ #include "global.hpp" #include "grid_based_algorithms/lb_interface.hpp" #include "integrate.hpp" -#include "particle_data.hpp" #include "thermostat.hpp" #include diff --git a/src/core/rotation.hpp b/src/core/rotation.hpp index 37578d8e731..777a8895e69 100644 --- a/src/core/rotation.hpp +++ b/src/core/rotation.hpp @@ -28,8 +28,8 @@ #ifdef ROTATION +#include "Particle.hpp" #include "ParticleRange.hpp" -#include "particle_data.hpp" #include #include diff --git a/src/core/serialization/ParticleParametersSwimming.hpp b/src/core/serialization/ParticleParametersSwimming.hpp index c1fa325838a..7a20f27344c 100644 --- a/src/core/serialization/ParticleParametersSwimming.hpp +++ b/src/core/serialization/ParticleParametersSwimming.hpp @@ -19,7 +19,7 @@ #ifndef CORE_UTILS_SERIALIZATION_PARTICLE_SWIM_HPP #define CORE_UTILS_SERIALIZATION_PARTICLE_SWIM_HPP -#include "particle_data.hpp" +#include "Particle.hpp" #include diff --git a/src/core/statistics.cpp b/src/core/statistics.cpp index 1c48c33c058..111d9504e39 100644 --- a/src/core/statistics.cpp +++ b/src/core/statistics.cpp @@ -26,6 +26,7 @@ #include "statistics.hpp" +#include "Particle.hpp" #include "bonded_interactions/bonded_interaction_data.hpp" #include "communication.hpp" #include "energy.hpp" @@ -36,7 +37,6 @@ #include "nonbonded_interactions/nonbonded_interaction_data.hpp" #include "npt.hpp" #include "partCfg_global.hpp" -#include "particle_data.hpp" #include "pressure.hpp" #include "short_range_loop.hpp" diff --git a/src/core/statistics.hpp b/src/core/statistics.hpp index 513794f7fff..3fdd49219e0 100644 --- a/src/core/statistics.hpp +++ b/src/core/statistics.hpp @@ -28,8 +28,8 @@ #include "Observable_stat.hpp" #include "PartCfg.hpp" +#include "Particle.hpp" #include "nonbonded_interactions/nonbonded_interaction_data.hpp" -#include "particle_data.hpp" #include #include diff --git a/src/core/thermostat.hpp b/src/core/thermostat.hpp index cb9df39108f..ca77f10a04c 100644 --- a/src/core/thermostat.hpp +++ b/src/core/thermostat.hpp @@ -25,8 +25,8 @@ #include "config.hpp" +#include "Particle.hpp" #include "integrate.hpp" -#include "particle_data.hpp" #include "random.hpp" #include "rotation.hpp" diff --git a/src/core/virtual_sites/VirtualSitesRelative.hpp b/src/core/virtual_sites/VirtualSitesRelative.hpp index ec9f37c0719..975cecee5de 100644 --- a/src/core/virtual_sites/VirtualSitesRelative.hpp +++ b/src/core/virtual_sites/VirtualSitesRelative.hpp @@ -23,8 +23,8 @@ #include "config.hpp" #ifdef VIRTUAL_SITES_RELATIVE +#include "Particle.hpp" #include "communication.hpp" -#include "particle_data.hpp" #include "virtual_sites.hpp" /** @brief Virtual sites implementation for rigid bodies */ diff --git a/src/core/virtual_sites/lb_inertialess_tracers.cpp b/src/core/virtual_sites/lb_inertialess_tracers.cpp index 351a2a369ab..522289be166 100644 --- a/src/core/virtual_sites/lb_inertialess_tracers.cpp +++ b/src/core/virtual_sites/lb_inertialess_tracers.cpp @@ -22,6 +22,7 @@ #include "virtual_sites/lb_inertialess_tracers.hpp" #ifdef VIRTUAL_SITES_INERTIALESS_TRACERS +#include "Particle.hpp" #include "cells.hpp" #include "grid.hpp" #include "grid_based_algorithms/lb.hpp" @@ -29,7 +30,6 @@ #include "grid_based_algorithms/lb_interface.hpp" #include "integrate.hpp" #include "lb_inertialess_tracers_cuda_interface.hpp" -#include "particle_data.hpp" #include diff --git a/src/core/virtual_sites/lb_inertialess_tracers_cuda.cu b/src/core/virtual_sites/lb_inertialess_tracers_cuda.cu index b6a2842daf7..8fcb9fb69f1 100644 --- a/src/core/virtual_sites/lb_inertialess_tracers_cuda.cu +++ b/src/core/virtual_sites/lb_inertialess_tracers_cuda.cu @@ -27,12 +27,12 @@ #if defined(VIRTUAL_SITES_INERTIALESS_TRACERS) && defined(CUDA) +#include "Particle.hpp" #include "cuda_interface.hpp" #include "cuda_utils.hpp" #include "grid_based_algorithms/lb_boundaries.hpp" #include "grid_based_algorithms/lbgpu.cuh" #include "grid_based_algorithms/lbgpu.hpp" -#include "particle_data.hpp" #include "virtual_sites/lb_inertialess_tracers.hpp" #include "virtual_sites/lb_inertialess_tracers_cuda_interface.hpp" diff --git a/src/core/virtual_sites/lb_inertialess_tracers_cuda_interface.cpp b/src/core/virtual_sites/lb_inertialess_tracers_cuda_interface.cpp index 70b4988975c..31b6fb2ec99 100644 --- a/src/core/virtual_sites/lb_inertialess_tracers_cuda_interface.cpp +++ b/src/core/virtual_sites/lb_inertialess_tracers_cuda_interface.cpp @@ -26,10 +26,10 @@ #ifdef VIRTUAL_SITES_INERTIALESS_TRACERS +#include "Particle.hpp" #include "communication.hpp" #include "grid.hpp" #include "integrate.hpp" -#include "particle_data.hpp" #include "serialization/ibm_cuda_particle_velocities_input.hpp" #include "virtual_sites/lb_inertialess_tracers_cuda_interface.hpp" diff --git a/src/core/virtual_sites/virtual_sites_com.hpp b/src/core/virtual_sites/virtual_sites_com.hpp index 3d84da64437..49388f4388e 100644 --- a/src/core/virtual_sites/virtual_sites_com.hpp +++ b/src/core/virtual_sites/virtual_sites_com.hpp @@ -24,7 +24,7 @@ #include "config.hpp" #ifdef VIRTUAL_SITES_COM -#include "particle_data.hpp" +#include "Particle.hpp" // The following three functions have to be provided by all implementations // of virtual sites From cd96f745cd67934aa182038a71d484970e700bf9 Mon Sep 17 00:00:00 2001 From: Florian Weik Date: Tue, 15 Oct 2019 15:18:04 +0200 Subject: [PATCH 12/16] core: particle_data: Fixed erroneous forward declaration --- src/core/serialization/Particle.hpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/core/serialization/Particle.hpp b/src/core/serialization/Particle.hpp index 91eac4dcd5f..f2e839af124 100644 --- a/src/core/serialization/Particle.hpp +++ b/src/core/serialization/Particle.hpp @@ -25,8 +25,6 @@ #include -class Particle; - namespace boost { namespace serialization { /* Pod serialize for Particle */ From dc429bf65c8b663e86bb83cc27d6dbb9c6116261 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-No=C3=ABl=20Grad?= Date: Tue, 15 Oct 2019 15:22:02 +0200 Subject: [PATCH 13/16] Remove redundant PYTHONPATH --- .gitlab-ci.yml | 2 -- testsuite/cmake/test_install.sh | 5 +++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f370dcc0a52..8a8a1440392 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -289,8 +289,6 @@ installation: - CI_INSTALL_PYTHON_PATH=$(dirname $(find "${CI_INSTALL_DIR}/lib" -name espressomd)) # deploy object-in-fluid module - cp -r "src/python/object_in_fluid" "${CI_INSTALL_PYTHON_PATH}/object_in_fluid" - # set the PYTHONPATH, guard the case where it is initially an empty string - - export PYTHONPATH="${PYTHONPATH:+$PYTHONPATH:}${CI_INSTALL_PYTHON_PATH}" # run all tests with the installed files - sed -i "s|$(pwd)/pypresso|${CI_INSTALL_DIR}/bin/pypresso|" testsuite/{python,scripts/samples,scripts/tutorials}/CTestTestfile.cmake # skip long tests diff --git a/testsuite/cmake/test_install.sh b/testsuite/cmake/test_install.sh index 66312d63a86..d357c5dc0ea 100755 --- a/testsuite/cmake/test_install.sh +++ b/testsuite/cmake/test_install.sh @@ -35,8 +35,9 @@ function test_install() { assert_file_exists "${filepath}" done - # check the espressomd module can be imported - assert_return_code "@CMAKE_BINARY_DIR@/pypresso" -c "import sys;sys.path.insert(0, '@CMAKE_INSTALL_PREFIX@/@Python_SITEARCH@');import espressomd" + # check the espressomd module can be imported from python3 and pypresso + assert_return_code "@PYTHON_EXECUTABLE@" -c "import sys;sys.path.insert(0, '@CMAKE_INSTALL_PREFIX@/@Python_SITEARCH@');import espressomd" + assert_return_code "@CMAKE_INSTALL_PREFIX@/bin/pypresso" -c "import espressomd" } # run tests From 103a27d977f31dde1839315cd74db3375126abc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-No=C3=ABl=20Grad?= Date: Tue, 15 Oct 2019 15:35:04 +0200 Subject: [PATCH 14/16] Simplify CMake test logic The installed files only exist if the Python bindings are enabled. --- testsuite/cmake/CMakeLists.txt | 8 ++------ testsuite/cmake/test_install.sh | 13 ++++--------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/testsuite/cmake/CMakeLists.txt b/testsuite/cmake/CMakeLists.txt index 824a448d444..f8985a45431 100644 --- a/testsuite/cmake/CMakeLists.txt +++ b/testsuite/cmake/CMakeLists.txt @@ -12,21 +12,17 @@ function(CMAKE_TEST) endfunction(CMAKE_TEST) if(WITH_PYTHON AND PYTHONINTERP_FOUND) - set(TESTING_PYTHON TRUE) # obtain Python*_SITEARCH without find_package(Python*) execute_process( COMMAND "${PYTHON_EXECUTABLE}" -c "from distutils import sysconfig as sc;print(sc.get_python_lib(prefix='', plat_specific=True, standard_lib=False))" OUTPUT_VARIABLE Python_SITEARCH OUTPUT_STRIP_TRAILING_WHITESPACE) -else() - set(TESTING_PYTHON FALSE) + + cmake_test(FILE test_install.sh DEPENDENCIES BashUnitTests.sh) endif() set(DESTDIR "${CMAKE_CURRENT_BINARY_DIR}/install") add_custom_target(setup_install COMMAND make install WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) - -cmake_test(FILE test_install.sh DEPENDENCIES BashUnitTests.sh) - add_custom_target(check_cmake_install COMMAND ${CMAKE_CTEST_COMMAND} --timeout ${TEST_TIMEOUT} -C serial --output-on-failure) add_dependencies(check_cmake_install setup_install) diff --git a/testsuite/cmake/test_install.sh b/testsuite/cmake/test_install.sh index d357c5dc0ea..d70cc6de348 100755 --- a/testsuite/cmake/test_install.sh +++ b/testsuite/cmake/test_install.sh @@ -23,15 +23,11 @@ source BashUnitTests.sh function test_install() { local filepaths=("@CMAKE_INSTALL_PREFIX@/bin/pypresso" \ "@CMAKE_INSTALL_PREFIX@/@Python_SITEARCH@/espressomd/EspressoCore.so" \ + "@CMAKE_INSTALL_PREFIX@/@Python_SITEARCH@/espressomd/_init.so" \ + "@CMAKE_INSTALL_PREFIX@/@Python_SITEARCH@/espressomd/__init__.py" ) - if [ "@TESTING_PYTHON@" = "TRUE" ] - then - filepaths+=("@CMAKE_INSTALL_PREFIX@/@Python_SITEARCH@/espressomd/_init.so" \ - "@CMAKE_INSTALL_PREFIX@/@Python_SITEARCH@/espressomd/__init__.py" - ) - fi - for filepath in ${filepaths[@]} - do + + for filepath in ${filepaths[@]}; do assert_file_exists "${filepath}" done @@ -42,4 +38,3 @@ function test_install() { # run tests run_test_suite - From 2d00b1ccf31026ef1626417324ef77600a29fe6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-No=C3=ABl=20Grad?= Date: Tue, 15 Oct 2019 16:35:37 +0200 Subject: [PATCH 15/16] Remove unused DESTDIR variable --- testsuite/cmake/BashUnitTests.sh | 5 +++-- testsuite/cmake/CMakeLists.txt | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/testsuite/cmake/BashUnitTests.sh b/testsuite/cmake/BashUnitTests.sh index 108bb472a9a..1480aca9f73 100755 --- a/testsuite/cmake/BashUnitTests.sh +++ b/testsuite/cmake/BashUnitTests.sh @@ -24,13 +24,14 @@ ## #define ELECTROSTATICS ## #define EXTERNAL_FORCES ## EOF +## cmake .. -DCMAKE_INSTALL_PREFIX=/tmp/espresso ## make -## make install DESTDIR="install" +## make install ## } ## ## # cleanup ## function tear_down() { -## rm -rf install +## rm -rf /tmp/espresso ## make dist-clean ## } ## diff --git a/testsuite/cmake/CMakeLists.txt b/testsuite/cmake/CMakeLists.txt index f8985a45431..9e6045b5cf2 100644 --- a/testsuite/cmake/CMakeLists.txt +++ b/testsuite/cmake/CMakeLists.txt @@ -20,7 +20,6 @@ if(WITH_PYTHON AND PYTHONINTERP_FOUND) cmake_test(FILE test_install.sh DEPENDENCIES BashUnitTests.sh) endif() -set(DESTDIR "${CMAKE_CURRENT_BINARY_DIR}/install") add_custom_target(setup_install COMMAND make install WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) add_custom_target(check_cmake_install COMMAND ${CMAKE_CTEST_COMMAND} --timeout ${TEST_TIMEOUT} -C serial --output-on-failure) From 1eb21f34581c634c8f2871823b539b476a6929e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-No=C3=ABl=20Grad?= Date: Tue, 15 Oct 2019 16:48:08 +0200 Subject: [PATCH 16/16] Cannot test python3 in CI The clang:6.0 job fails due to undefined ASAN symbols. The logic to fix that error is in the pypresso wrapper. --- testsuite/cmake/test_install.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/testsuite/cmake/test_install.sh b/testsuite/cmake/test_install.sh index d70cc6de348..2e8fbc44fc5 100755 --- a/testsuite/cmake/test_install.sh +++ b/testsuite/cmake/test_install.sh @@ -31,8 +31,7 @@ function test_install() { assert_file_exists "${filepath}" done - # check the espressomd module can be imported from python3 and pypresso - assert_return_code "@PYTHON_EXECUTABLE@" -c "import sys;sys.path.insert(0, '@CMAKE_INSTALL_PREFIX@/@Python_SITEARCH@');import espressomd" + # check the espressomd module can be imported from pypresso assert_return_code "@CMAKE_INSTALL_PREFIX@/bin/pypresso" -c "import espressomd" }