diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fe6fa8d3b9f..195193aec28 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: docker.pkg.github.com/espressomd/docker/ubuntu-20.04:06b6216c7aa3555bcf28c90734dbb84e7285c96f +image: docker.pkg.github.com/espressomd/docker/ubuntu-20.04:700579881dceba20fa27ec476a4b4e0746b72683 stages: - prepare @@ -188,9 +188,7 @@ clang-sanitizer: CXX: 'clang++-9' script: - export myconfig=maxset with_cuda=true with_cuda_compiler=clang with_coverage=false - - export with_static_analysis=true test_timeout=900 - - export with_asan=true ASAN_OPTIONS="allocator_may_return_null=1" - - export with_ubsan=true UBSAN_OPTIONS=suppressions=${CI_PROJECT_DIR}/maintainer/CI/ubsan.supp + - export with_static_analysis=true test_timeout=900 with_asan=true with_ubsan=true - bash maintainer/CI/build_cmake.sh timeout: 2h tags: diff --git a/.travis.yml b/.travis.yml index b5e66864612..b266dbe0293 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,6 @@ matrix: - os: linux sudo: required services: docker - env: myconfig=maxset image=espressomd/docker-ubuntu-20.04:06b6216c7aa3555bcf28c90734dbb84e7285c96f script: - maintainer/CI/build_docker.sh diff --git a/cmake/FindSphinx.cmake b/cmake/FindSphinx.cmake index 20b23fd9031..353ead0beea 100644 --- a/cmake/FindSphinx.cmake +++ b/cmake/FindSphinx.cmake @@ -7,8 +7,8 @@ execute_process( ERROR_VARIABLE QUERY_VERSION_ERR RESULT_VARIABLE QUERY_VERSION_RESULT) if(NOT QUERY_VERSION_RESULT) - # Sphinx switched at some point from returning ther version on stdout to - # printing it at stderr. Since we do not know ther version yet, we use stdout + # Sphinx switched at some point from returning their version on stdout to + # printing it at stderr. Since we do not know their version yet, we use stdout # if it matches a version regex, or stderr otherwise. if(QUERY_VERSION_OUT MATCHES "[0-9]+\.[0-9.]+") set(QUERY_VERSION "${QUERY_VERSION_OUT}") @@ -26,7 +26,7 @@ if(NOT QUERY_VERSION_RESULT) endif() set(SPHINX_VERSION_COMPATIBLE TRUE) -# Blacklist broken version +# Blacklist broken versions if("${SPHINX_VERSION}" VERSION_EQUAL "2.1.0" OR "${SPHINX_VERSION}" VERSION_EQUAL "3.0.0") message(WARNING "Sphinx version ${SPHINX_VERSION} is not compatible.") set(SPHINX_VERSION_COMPATIBLE FALSE) diff --git a/cmake/unit_test.cmake b/cmake/unit_test.cmake index 628b9d330f3..6fc459276b9 100644 --- a/cmake/unit_test.cmake +++ b/cmake/unit_test.cmake @@ -48,13 +48,16 @@ function(UNIT_TEST) endif() if(WARNINGS_ARE_ERRORS) - set_tests_properties( - ${TEST_NAME} - PROPERTIES - ENVIRONMENT - "UBSAN_OPTIONS=suppressions=${CMAKE_SOURCE_DIR}/tools/ubsan-suppressions.txt:halt_on_error=1:print_stacktrace=1 ASAN_OPTIONS=halt_on_error=1:detect_leaks=0 MSAN_OPTIONS=halt_on_error=1" - ) + set(SANITIZERS_HALT_ON_ERROR "halt_on_error=1") + else() + set(SANITIZERS_HALT_ON_ERROR "halt_on_error=0") endif() + set(UBSAN_OPTIONS "UBSAN_OPTIONS=suppressions=${CMAKE_SOURCE_DIR}/maintainer/CI/ubsan.supp:${SANITIZERS_HALT_ON_ERROR}:print_stacktrace=1") + set(ASAN_OPTIONS "ASAN_OPTIONS=${SANITIZERS_HALT_ON_ERROR}:detect_leaks=0:allocator_may_return_null=1") + set(MSAN_OPTIONS "MSAN_OPTIONS=${SANITIZERS_HALT_ON_ERROR}") + set_tests_properties( + ${TEST_NAME} PROPERTIES ENVIRONMENT + "${UBSAN_OPTIONS} ${ASAN_OPTIONS} ${MSAN_OPTIONS}") add_dependencies(check_unit_tests ${TEST_NAME}) endfunction(UNIT_TEST) diff --git a/doc/sphinx/installation.rst b/doc/sphinx/installation.rst index e51dfd28fa5..48ad534a3fc 100644 --- a/doc/sphinx/installation.rst +++ b/doc/sphinx/installation.rst @@ -91,6 +91,9 @@ are required: sudo apt install python3-matplotlib python3-scipy ipython3 jupyter-notebook sudo pip3 install 'pint>=0.9' +Nvidia GPU acceleration +""""""""""""""""""""""" + If your computer has an Nvidia graphics card, you should also download and install the CUDA SDK to make use of GPU computation: @@ -98,13 +101,19 @@ CUDA SDK to make use of GPU computation: sudo apt install nvidia-cuda-toolkit -On Ubuntu 18.04, you need to modify a file to make CUDA work with the default compiler: +On Ubuntu, the default GCC compiler is too recent for nvcc, which will generate +compiler errors. You can either install an older version of GCC and select it +with environment variables ``CC`` and ``CXX`` when building |es|, or edit the +system header files as shown in the following example for Ubuntu 18.04: .. code-block:: bash sudo sed -i 's/__GNUC__ > 6/__GNUC__ > 7/g' /usr/include/crt/host_config.h sudo sed -i 's/than 6/than 7/g' /usr/include/crt/host_config.h +AMD GPU acceleration +"""""""""""""""""""" + If your computer has an AMD graphics card, you should also download and install the ROCm SDK to make use of GPU computation: @@ -683,6 +692,13 @@ For example with ``-D WITH_CUDA=ON``, one can choose the CUDA compiler with ``-D ROCM_HOME=`` variable becomes available, with default value ``ROCM_HOME=/opt/rocm``. +Environment variables can be passed to CMake. For example, to select Clang, use +``CC=clang CXX=clang++ cmake .. -DWITH_CUDA=ON -DWITH_CUDA_COMPILER=clang``. +If you have multiple versions of the CUDA library installed, you can select the +correct one with ``CUDA_BIN_PATH=/usr/local/cuda-10.0 cmake .. -DWITH_CUDA=ON`` +(with Clang as the CUDA compiler, you also need to override its default CUDA +path with ``-DCMAKE_CXX_FLAGS=--cuda-path=/usr/local/cuda-10.0``). + Compiling, testing and installing --------------------------------- diff --git a/maintainer/CI/build_docker.sh b/maintainer/CI/build_docker.sh index 273cedbf3a5..dfafe5989de 100755 --- a/maintainer/CI/build_docker.sh +++ b/maintainer/CI/build_docker.sh @@ -22,16 +22,14 @@ cat > "${ENV_FILE}" <&2 - exit 1 -fi +image="espressomd/docker-ubuntu-20.04:06b6216c7aa3555bcf28c90734dbb84e7285c96f" docker run -u espresso --env-file "${ENV_FILE}" -v "${PWD}:/travis" -it "${image}" /bin/bash -c "cp -r /travis .; cd travis && maintainer/CI/build_cmake.sh" || exit 1 diff --git a/maintainer/Espresso.spec b/maintainer/Espresso.spec deleted file mode 100644 index 32c3ed8ed61..00000000000 --- a/maintainer/Espresso.spec +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright (C) 2012-2019 The ESPResSo project -# Copyright (C) 2009,2010 Christoph Junghans -# -# 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 . -# -BuildRequires: fftw3-devel tcl-devel make gcc - -Summary: A program to simulate polymers -Name: Espresso -Version: 2.0.2 -Release: d -Source: %{name}-%{version}.tar.gz -License: Espresso Licence -Group: Applications/Engineering -BuildRoot: %{_builddir}/%{name}-root - -%description -A program to simulate polymers and more. Details.... - -%prep -%setup -q -%build -export ESPRESSO_SOURCE=%{_builddir}/%{name}-%{version} -export ESPRESSO_SCRIPTS=$ESPRESSO_SOURCE/scripts -./configure --with-mpi=fake -make -%install -export ESPRESSO_SOURCE=%{_builddir}/%{name}-%{version} -export ESPRESSO_SCRIPTS=$ESPRESSO_SOURCE/scripts -export conf=`$ESPRESSO_SOURCE/config/config.guess` -install -D obj-$conf/Espresso_bin ${RPM_BUILD_ROOT}/usr/local/Espresso/Espresso_bin -install -D start_Espresso ${RPM_BUILD_ROOT}/usr/local/Espresso/start_Espresso -mkdir -p ${RPM_BUILD_ROOT}/usr/local/Espresso/scripts -install -D scripts/* ${RPM_BUILD_ROOT}/usr/local/Espresso/scripts -mkdir -p ${RPM_BUILD_ROOT}/usr/local/bin -ln -s ${RPM_BUILD_ROOT}/usr/local/Espresso/start_Espresso ${RPM_BUILD_ROOT}/usr/local/bin/Espresso -%clean -rm -rf ${RPM_BUILD_ROOT} -%files -%defattr(-,root,root) -/usr/local/Espresso/start_Espresso -/usr/local/Espresso/Espresso_bin -/usr/local/Espresso/scripts -%changelog -* Tue Feb 27 2007 - Christoph Junghans -- initial package: version 2.0.2 diff --git a/samples/gibbs_ensemble_client.py b/samples/gibbs_ensemble_client.py index 828500bac24..c05c3161e9b 100644 --- a/samples/gibbs_ensemble_client.py +++ b/samples/gibbs_ensemble_client.py @@ -53,7 +53,7 @@ MSG_EXCHANGE_PART_ADD_REVERT = 41 MSG_EXCHANGE_PART_REMOVE = 5 MSG_EXCHANGE_PART_REMOVE_REVERT = 51 -MSG_ENEGRY = 6 +MSG_ENERGY = 6 parser = argparse.ArgumentParser() parser.add_argument('-n', '--number-particles', type=int, nargs=1) @@ -166,10 +166,10 @@ def send_data(data, socket): # send the initial energy energy = system.analysis.energy()['total'] -send_data(pickle.dumps([MSG_ENEGRY, energy]), socket) +send_data(pickle.dumps([MSG_ENERGY, energy]), socket) while msg[0] != MSG_END: - # receive comand to execute next step + # receive command to execute next step msg = recv_data(socket) if msg[0] == MSG_END: break @@ -191,7 +191,7 @@ def send_data(data, socket): # calculation energy and send it to the host energy = system.analysis.energy()['total'] - send_data(pickle.dumps([MSG_ENEGRY, energy]), socket) + send_data(pickle.dumps([MSG_ENERGY, energy]), socket) # closing the socket socket.close() diff --git a/samples/gibbs_ensemble_socket.py b/samples/gibbs_ensemble_socket.py index 5d9e17be154..920833c338e 100644 --- a/samples/gibbs_ensemble_socket.py +++ b/samples/gibbs_ensemble_socket.py @@ -81,7 +81,7 @@ EXCHANGE_CHANCE = 0.8 VOLUME_CHANCE = 1.0 - INIT_MOVE_CHANCE - EXCHANGE_CHANCE -# socket paramters +# socket parameters HOST = 'localhost' PORT = 31415 NUMBER_OF_CLIENTS = 2 @@ -96,7 +96,7 @@ MSG_EXCHANGE_PART_ADD_REVERT = 41 MSG_EXCHANGE_PART_REMOVE = 5 MSG_EXCHANGE_PART_REMOVE_REVERT = 51 -MSG_ENEGRY = 6 +MSG_ENERGY = 6 # script locations espresso_executable = "../pypresso" @@ -139,7 +139,7 @@ class Box: def recv_energy(self): '''Received the energy data from the client.''' msg = self.recv_data() - if msg[0] == MSG_ENEGRY: + if msg[0] == MSG_ENERGY: self.energy = msg[1] return 0 else: diff --git a/src/core/CellStructure.hpp b/src/core/CellStructure.hpp index 42ee93e12e9..0c8ac6f0aee 100644 --- a/src/core/CellStructure.hpp +++ b/src/core/CellStructure.hpp @@ -154,7 +154,7 @@ struct CellStructure { */ Particle &append_indexed_particle(ParticleList &pl, Particle &&p) { /* Check if cell may reallocate, in which case the index - * entries for all particles in this celle have to be + * entries for all particles in this cell have to be * updated. */ auto const may_reallocate = pl.size() >= pl.capacity(); auto &new_part = pl.insert(std::move(p)); diff --git a/src/core/RuntimeErrorCollector.cpp b/src/core/RuntimeErrorCollector.cpp index b2594c64579..45e8758d902 100644 --- a/src/core/RuntimeErrorCollector.cpp +++ b/src/core/RuntimeErrorCollector.cpp @@ -23,7 +23,7 @@ #include -#include +#include #include using namespace std; diff --git a/src/core/accumulators/Correlator.cpp b/src/core/accumulators/Correlator.cpp index 64881edfe6c..0a5fb261a89 100644 --- a/src/core/accumulators/Correlator.cpp +++ b/src/core/accumulators/Correlator.cpp @@ -162,8 +162,6 @@ std::vector fcs_acf(std::vector const &A, return C; } -/* global variables */ - /* Error codes */ constexpr const char init_errors[][64] = { "", // 0 diff --git a/src/core/accumulators/Correlator.hpp b/src/core/accumulators/Correlator.hpp index e120b9debd5..7def6ee316d 100644 --- a/src/core/accumulators/Correlator.hpp +++ b/src/core/accumulators/Correlator.hpp @@ -116,9 +116,6 @@ #include #include -#include -#include -#include #include #include diff --git a/src/core/actor/DipolarBarnesHut.hpp b/src/core/actor/DipolarBarnesHut.hpp index 9e7addd68f4..1872ed63cbf 100644 --- a/src/core/actor/DipolarBarnesHut.hpp +++ b/src/core/actor/DipolarBarnesHut.hpp @@ -44,16 +44,13 @@ class DipolarBarnesHut : public Actor { m_itolsq = itolsq; setBHPrecision(&m_epssq, &m_itolsq); if (!s.requestFGpu()) - std::cerr << "DipolarBarnesHut needs access to forces on GPU!" - << std::endl; + runtimeErrorMsg() << "DipolarBarnesHut needs access to forces on GPU!"; if (!s.requestRGpu()) - std::cerr << "DipolarBarnesHut needs access to positions on GPU!" - << std::endl; + runtimeErrorMsg() << "DipolarBarnesHut needs access to positions on GPU!"; if (!s.requestDipGpu()) - std::cerr << "DipolarBarnesHut needs access to dipoles on GPU!" - << std::endl; + runtimeErrorMsg() << "DipolarBarnesHut needs access to dipoles on GPU!"; }; void computeForces(SystemInterface &s) override { @@ -66,10 +63,7 @@ class DipolarBarnesHut : public Actor { summarizeBH(m_bh_data.blocks); sortBH(m_bh_data.blocks); if (forceBH(&m_bh_data, k, s.fGpuBegin(), s.torqueGpuBegin())) { - fprintf( - stderr, - "forceBH: some of kernels encounter the algorithm functional error"); - errexit(); + runtimeErrorMsg() << "kernels encountered a functional error"; } }; void computeEnergy(SystemInterface &s) override { @@ -82,10 +76,7 @@ class DipolarBarnesHut : public Actor { summarizeBH(m_bh_data.blocks); sortBH(m_bh_data.blocks); if (energyBH(&m_bh_data, k, (&(((CUDA_energy *)s.eGpu())->dipolar)))) { - fprintf( - stderr, - "energyBH: some of kernels encounter the algorithm functional error"); - errexit(); + runtimeErrorMsg() << "kernels encountered a functional error"; } }; diff --git a/src/core/actor/DipolarBarnesHut_cuda.cu b/src/core/actor/DipolarBarnesHut_cuda.cu index 8e1db5d66ec..60700a9f8af 100644 --- a/src/core/actor/DipolarBarnesHut_cuda.cu +++ b/src/core/actor/DipolarBarnesHut_cuda.cu @@ -476,7 +476,7 @@ __global__ __launch_bounds__(THREADS3, FACTOR3) void summarizationKernel() { // position of equivalent total dipole and its magnitude: // (like a mass and the center of mass) float p[3], u[3]; - // Per-block BH tree cashing: + // Per-block BH tree caching: __shared__ int child[THREADS3 * 8]; // no children by default: @@ -522,14 +522,14 @@ __global__ __launch_bounds__(THREADS3, FACTOR3) void summarizationKernel() { ch = bhpara->child[k * 8 + i]; if (ch >= 0) { if (i != j) { - // Move children to front (needed later for a speed only). + // Move child to front (needed later for a speed only). // The child's octant change is incorrect from // a tree organization perspective. However, the sum // will be the same. bhpara->child[k * 8 + i] = -1; bhpara->child[k * 8 + j] = ch; } - // Cache a missing children in the block shared memory: + // Cache a missing child in the block shared memory: child[missing * THREADS3 + threadIdx.x] = ch; m = bhpara->mass[ch]; // Is a child the particle? Only particles have non-negative mass @@ -612,8 +612,7 @@ __global__ __launch_bounds__(THREADS3, FACTOR3) void summarizationKernel() { bhpara->r[3 * k + l] = p[l] * m; bhpara->u[3 * k + l] = u[l]; } - __threadfence(); // make sure data are visible before setting - // // mass + __threadfence(); // make sure data are visible before setting mass bhpara->mass[k] = cm; __threadfence(); k += inc; @@ -731,7 +730,7 @@ __global__ __launch_bounds__(THREADS5, FACTOR5) void forceCalculationKernel( // "epssqd" which define a fraction of the octant cell and // an additive distance respectively. // Their joint contribution for the given tree depth are - // calculated withing the array dq[i], which will + // calculated within the array dq[i], which will // be compared later with squared distance between the particle // and the cell depending on a cell level. // Original tree box edge (2*radiusd) should be divided *0.5 diff --git a/src/core/actor/DipolarDirectSum.hpp b/src/core/actor/DipolarDirectSum.hpp index ba62680c918..0bf0d62b552 100644 --- a/src/core/actor/DipolarDirectSum.hpp +++ b/src/core/actor/DipolarDirectSum.hpp @@ -25,6 +25,7 @@ #include "SystemInterface.hpp" #include "cuda_interface.hpp" #include "electrostatics_magnetostatics/dipole.hpp" +#include "errorhandling.hpp" #include "grid.hpp" #include @@ -49,16 +50,13 @@ class DipolarDirectSum : public Actor { k = static_cast(dipole.prefactor); if (!s.requestFGpu()) - std::cerr << "DipolarDirectSum needs access to forces on GPU!" - << std::endl; + runtimeErrorMsg() << "DipolarDirectSum needs access to forces on GPU!"; if (!s.requestRGpu()) - std::cerr << "DipolarDirectSum needs access to positions on GPU!" - << std::endl; + runtimeErrorMsg() << "DipolarDirectSum needs access to positions on GPU!"; if (!s.requestDipGpu()) - std::cerr << "DipolarDirectSum needs access to dipoles on GPU!" - << std::endl; + runtimeErrorMsg() << "DipolarDirectSum needs access to dipoles on GPU!"; }; void computeForces(SystemInterface &s) override { dds_float box[3]; diff --git a/src/core/actor/DipolarDirectSum_cuda.cu b/src/core/actor/DipolarDirectSum_cuda.cu index cbab515660d..5c225ad8778 100644 --- a/src/core/actor/DipolarDirectSum_cuda.cu +++ b/src/core/actor/DipolarDirectSum_cuda.cu @@ -38,9 +38,7 @@ __device__ inline void get_mi_vector_dds(dds_float res[3], dds_float const a[3], dds_float const b[3], dds_float const box_l[3], int const periodic[3]) { - int i; - - for (i = 0; i < 3; i++) { + for (int i = 0; i < 3; i++) { res[i] = a[i] - b[i]; if (periodic[i]) res[i] -= floor(res[i] / box_l[i] + 0.5) * box_l[i]; @@ -63,7 +61,7 @@ __device__ void dipole_ia_force(int id, dds_float pf, float const *r1, dds_float dr[3]; dds_float _r1[3], _r2[3], _dip1[3], _dip2[3]; - for (int i = i = 0; i < 3; i++) { + for (int i = 0; i < 3; i++) { _r1[i] = r1[i]; _r2[i] = r2[i]; _dip1[i] = dip1[i]; diff --git a/src/core/bonded_interactions/quartic.hpp b/src/core/bonded_interactions/quartic.hpp index 00bc85c4420..a8ae023f011 100644 --- a/src/core/bonded_interactions/quartic.hpp +++ b/src/core/bonded_interactions/quartic.hpp @@ -28,7 +28,6 @@ #include "bonded_interaction_data.hpp" -#include #include /** Set the parameters for the quartic potential diff --git a/src/core/cluster_analysis/Cluster.hpp b/src/core/cluster_analysis/Cluster.hpp index 4da33faebe2..c76044dfea6 100644 --- a/src/core/cluster_analysis/Cluster.hpp +++ b/src/core/cluster_analysis/Cluster.hpp @@ -19,14 +19,10 @@ #ifndef CLUSTER_ANALYSIS_CLUSTER_HPP #define CLUSTER_ANALYSIS_CLUSTER_HPP -#include -#include #include -#include #include #include "Particle.hpp" -#include namespace ClusterAnalysis { diff --git a/src/core/cluster_analysis/ClusterStructure.hpp b/src/core/cluster_analysis/ClusterStructure.hpp index fcf2f74ab7d..f5d31fa7c13 100644 --- a/src/core/cluster_analysis/ClusterStructure.hpp +++ b/src/core/cluster_analysis/ClusterStructure.hpp @@ -22,8 +22,6 @@ #include "pair_criteria/pair_criteria.hpp" #include -#include -#include #include "Cluster.hpp" #include "Particle.hpp" diff --git a/src/core/communication.hpp b/src/core/communication.hpp index f2ae0b0bfc4..79c15390888 100644 --- a/src/core/communication.hpp +++ b/src/core/communication.hpp @@ -57,9 +57,6 @@ #include "grid_based_algorithms/lb_constants.hpp" #include -#include - -#include #include /** The number of this node. */ diff --git a/src/core/constraints/ShapeBasedConstraint.hpp b/src/core/constraints/ShapeBasedConstraint.hpp index 34a7f7bc669..2517e19daaf 100644 --- a/src/core/constraints/ShapeBasedConstraint.hpp +++ b/src/core/constraints/ShapeBasedConstraint.hpp @@ -23,7 +23,6 @@ #include "Constraint.hpp" #include "Particle.hpp" -#include "energy.hpp" #include #include diff --git a/src/core/electrostatics_magnetostatics/coulomb.cpp b/src/core/electrostatics_magnetostatics/coulomb.cpp index c3871286dfe..8f2e7210741 100644 --- a/src/core/electrostatics_magnetostatics/coulomb.cpp +++ b/src/core/electrostatics_magnetostatics/coulomb.cpp @@ -40,6 +40,8 @@ double coulomb_cutoff; #include +#include + Coulomb_parameters coulomb; namespace Coulomb { diff --git a/src/core/electrostatics_magnetostatics/dipole.cpp b/src/core/electrostatics_magnetostatics/dipole.cpp index 7435b25d1da..828db98d2ab 100644 --- a/src/core/electrostatics_magnetostatics/dipole.cpp +++ b/src/core/electrostatics_magnetostatics/dipole.cpp @@ -40,6 +40,7 @@ double dipolar_cutoff; #include #include +#include Dipole_parameters dipole = { 0.0, diff --git a/src/core/electrostatics_magnetostatics/elc.cpp b/src/core/electrostatics_magnetostatics/elc.cpp index f6cd1bf3672..3f1c326ce37 100644 --- a/src/core/electrostatics_magnetostatics/elc.cpp +++ b/src/core/electrostatics_magnetostatics/elc.cpp @@ -136,7 +136,7 @@ void ELC_setup_constants() { /** * @brief Calculated cached sin/cos values for one direction. * - * @tparam Index of the dimension to consider (e.g. 0 for x ...). + * @tparam dir Index of the dimension to consider (e.g. 0 for x ...). * * @param particles Particle to calculate values for * @param n_freq Number of frequencies to calculate per particle diff --git a/src/core/electrostatics_magnetostatics/fft.cpp b/src/core/electrostatics_magnetostatics/fft.cpp index c1665a6b96e..0337e7f0ece 100644 --- a/src/core/electrostatics_magnetostatics/fft.cpp +++ b/src/core/electrostatics_magnetostatics/fft.cpp @@ -37,7 +37,9 @@ using Utils::get_linear_index; #include #include +#include #include + #include /************************************************ diff --git a/src/core/electrostatics_magnetostatics/mdlc_correction.cpp b/src/core/electrostatics_magnetostatics/mdlc_correction.cpp index b3a4a487cb7..2c6d95a5cbd 100644 --- a/src/core/electrostatics_magnetostatics/mdlc_correction.cpp +++ b/src/core/electrostatics_magnetostatics/mdlc_correction.cpp @@ -89,7 +89,7 @@ double slab_dip_count_mu(double *mt, double *mx, double *my, } /** Compute the dipolar DLC corrections for forces and torques. - * Algorithm implemented accordingly to @cite brodka04a. + * %Algorithm implemented accordingly to @cite brodka04a. */ double get_DLC_dipolar(int kcut, std::vector &fs, std::vector &ts, @@ -236,7 +236,7 @@ double get_DLC_dipolar(int kcut, std::vector &fs, } /** Compute the dipolar DLC corrections - * Algorithm implemented accordingly to @cite brodka04a. + * %Algorithm implemented accordingly to @cite brodka04a. */ double get_DLC_energy_dipolar(int kcut, const ParticleRange &particles) { auto const facux = 2.0 * M_PI / box_geo.length()[0]; diff --git a/src/core/electrostatics_magnetostatics/mmm1d.cpp b/src/core/electrostatics_magnetostatics/mmm1d.cpp index 9548a7e4843..a996b5db947 100644 --- a/src/core/electrostatics_magnetostatics/mmm1d.cpp +++ b/src/core/electrostatics_magnetostatics/mmm1d.cpp @@ -42,6 +42,8 @@ using Utils::strcat_alloc; #include #include +#include + /** How many trial calculations */ #define TEST_INTEGRATIONS 1000 diff --git a/src/core/electrostatics_magnetostatics/p3m-common.cpp b/src/core/electrostatics_magnetostatics/p3m-common.cpp index c0d18659abb..d772883bac8 100644 --- a/src/core/electrostatics_magnetostatics/p3m-common.cpp +++ b/src/core/electrostatics_magnetostatics/p3m-common.cpp @@ -29,6 +29,8 @@ #include #include +#include + /* For debug messages */ extern int this_node; diff --git a/src/core/electrostatics_magnetostatics/p3m-dipolar.cpp b/src/core/electrostatics_magnetostatics/p3m-dipolar.cpp index 945cae175ab..e9f1edbdb33 100644 --- a/src/core/electrostatics_magnetostatics/p3m-dipolar.cpp +++ b/src/core/electrostatics_magnetostatics/p3m-dipolar.cpp @@ -57,8 +57,6 @@ using Utils::sinc; #include #include -#include -#include #include /************************************************ diff --git a/src/core/electrostatics_magnetostatics/p3m.cpp b/src/core/electrostatics_magnetostatics/p3m.cpp index 8ea5db2469b..50efd7db7ae 100644 --- a/src/core/electrostatics_magnetostatics/p3m.cpp +++ b/src/core/electrostatics_magnetostatics/p3m.cpp @@ -60,7 +60,6 @@ using Utils::strcat_alloc; #include #include -#include #include /************************************************ diff --git a/src/core/electrostatics_magnetostatics/p3m_interpolation.hpp b/src/core/electrostatics_magnetostatics/p3m_interpolation.hpp index 72bc193c7a9..a788e41317c 100644 --- a/src/core/electrostatics_magnetostatics/p3m_interpolation.hpp +++ b/src/core/electrostatics_magnetostatics/p3m_interpolation.hpp @@ -67,7 +67,7 @@ class p3m_interpolation_cache { /** * @brief Charge assignment order the weights are for. - * @return The charge assigment order. + * @return The charge assignment order. */ auto cao() const { return m_cao; } diff --git a/src/core/electrostatics_magnetostatics/scafacos.cpp b/src/core/electrostatics_magnetostatics/scafacos.cpp index 0c321e0a62e..835bc6bd086 100644 --- a/src/core/electrostatics_magnetostatics/scafacos.cpp +++ b/src/core/electrostatics_magnetostatics/scafacos.cpp @@ -19,7 +19,7 @@ * along with this program. If not, see . */ /** @file - * Provide a C-like interface for Scafacos + * Provide a C-like interface for ScaFaCoS. */ #include "electrostatics_magnetostatics/scafacos.hpp" diff --git a/src/core/ghosts.cpp b/src/core/ghosts.cpp index e52156c750f..1beb1d26e6e 100644 --- a/src/core/ghosts.cpp +++ b/src/core/ghosts.cpp @@ -76,8 +76,8 @@ class CommBuf { const auto &bonds() const { return bondbuf; } private: - std::vector buf; //< Buffer for everything but bonds - std::vector bondbuf; //< Buffer for bond lists + std::vector buf; ///< Buffer for everything but bonds + std::vector bondbuf; ///< Buffer for bond lists }; static size_t calc_transmit_size(unsigned data_parts) { @@ -349,7 +349,7 @@ void ghost_communicator(GhostCommunicator *gcr, unsigned int data_parts) { prepare_recv_buffer(recv_buffer, ghost_comm, data_parts); /* transfer data */ - // Use two send/recvs in order to avoid, having to serialize CommBuf + // Use two send/recvs in order to avoid having to serialize CommBuf // (which consists of already serialized data). switch (comm_type) { case GHOST_RECV: diff --git a/src/core/grid.hpp b/src/core/grid.hpp index 1c86777b76a..0f06c7e491c 100644 --- a/src/core/grid.hpp +++ b/src/core/grid.hpp @@ -36,11 +36,9 @@ #include "LocalBox.hpp" -#include #include #include -#include #include extern BoxGeometry box_geo; diff --git a/src/core/grid_based_algorithms/electrokinetics_cuda.cu b/src/core/grid_based_algorithms/electrokinetics_cuda.cu index a5fd96049c0..e945662e1c6 100644 --- a/src/core/grid_based_algorithms/electrokinetics_cuda.cu +++ b/src/core/grid_based_algorithms/electrokinetics_cuda.cu @@ -2475,7 +2475,7 @@ int ek_init() { try { electrostatics = new FdElectrostatics(es_parameters, stream[0]); } catch (std::string e) { - std::cout << "Error in initialization of electrokinetics electrostatics " + std::cerr << "Error in initialization of electrokinetics electrostatics " "solver: " << e << std::endl; return 1; diff --git a/src/core/grid_based_algorithms/lb.cpp b/src/core/grid_based_algorithms/lb.cpp index 774a2daea40..24849da0664 100644 --- a/src/core/grid_based_algorithms/lb.cpp +++ b/src/core/grid_based_algorithms/lb.cpp @@ -59,6 +59,7 @@ using Utils::get_linear_index; #include #include +#include namespace { /** Basis of the mode space as described in @cite dunweg07a */ diff --git a/src/core/grid_based_algorithms/lb_interface.cpp b/src/core/grid_based_algorithms/lb_interface.cpp index d496b8e0364..5ad9b0c48d7 100644 --- a/src/core/grid_based_algorithms/lb_interface.cpp +++ b/src/core/grid_based_algorithms/lb_interface.cpp @@ -32,6 +32,7 @@ #include using Utils::get_linear_index; +#include #include ActiveLB lattice_switch = ActiveLB::NONE; @@ -504,7 +505,6 @@ void lb_lbfluid_print_vtk_boundary(const std::string &filename) { std::vector bound_array(lbpar_gpu.number_of_nodes); lb_get_boundary_flags_GPU(bound_array.data()); - /** print of the calculated phys values */ fprintf(fp, "# vtk DataFile Version 2.0\nlbboundaries\n" "ASCII\nDATASET STRUCTURED_POINTS\nDIMENSIONS %u %u %u\n" @@ -515,7 +515,6 @@ void lb_lbfluid_print_vtk_boundary(const std::string &filename) { lbpar_gpu.agrid, lbpar_gpu.agrid, lbpar_gpu.agrid, lbpar_gpu.number_of_nodes); for (int j = 0; j < int(lbpar_gpu.number_of_nodes); ++j) { - /** print of the calculated phys values */ fprintf(fp, "%d \n", bound_array[j]); } #endif // CUDA @@ -649,7 +648,6 @@ void lb_lbfluid_print_boundary(const std::string &filename) { xyz[1] = k % lbpar_gpu.dim_y; k /= lbpar_gpu.dim_y; xyz[2] = k; - /** print of the calculated phys values */ fprintf(fp, "%f %f %f %u\n", (xyz[0] + 0.5) * lbpar_gpu.agrid, (xyz[1] + 0.5) * lbpar_gpu.agrid, (xyz[2] + 0.5) * lbpar_gpu.agrid, bound_array[j]); @@ -694,7 +692,6 @@ void lb_lbfluid_print_velocity(const std::string &filename) { xyz[1] = k % lbpar_gpu.dim_y; k /= lbpar_gpu.dim_y; xyz[2] = k; - /** print of the calculated phys values */ fprintf(fp, "%f %f %f %f %f %f\n", (xyz[0] + 0.5) * agrid, (xyz[1] + 0.5) * agrid, (xyz[2] + 0.5) * agrid, host_values[j].v[0] * lattice_speed, diff --git a/src/core/grid_based_algorithms/lb_interpolation.cpp b/src/core/grid_based_algorithms/lb_interpolation.cpp index 982a5219662..02c568479bc 100644 --- a/src/core/grid_based_algorithms/lb_interpolation.cpp +++ b/src/core/grid_based_algorithms/lb_interpolation.cpp @@ -29,7 +29,6 @@ #include "lbgpu.hpp" namespace { - InterpolationOrder interpolation_order = InterpolationOrder::linear; } diff --git a/src/core/immersed_boundary/ImmersedBoundaries.cpp b/src/core/immersed_boundary/ImmersedBoundaries.cpp index a03d0686e57..6059b54cab0 100644 --- a/src/core/immersed_boundary/ImmersedBoundaries.cpp +++ b/src/core/immersed_boundary/ImmersedBoundaries.cpp @@ -27,6 +27,8 @@ #include +#include + /** Volume conservation. * Calculate volumes, volume force and add it to each virtual particle. * This function is called from @ref integrate. diff --git a/src/core/immersed_boundary/ibm_triel.cpp b/src/core/immersed_boundary/ibm_triel.cpp index cbbe2365b7f..a407c94f6cb 100644 --- a/src/core/immersed_boundary/ibm_triel.cpp +++ b/src/core/immersed_boundary/ibm_triel.cpp @@ -27,6 +27,8 @@ #include #include +#include + namespace { /** Rotate calculated trielastic forces in the 2d plane back to the 3d plane. * Use knowledge that the x-axis in rotated system is parallel to r(p1->p2) in diff --git a/src/core/io/writer/h5md_core.cpp b/src/core/io/writer/h5md_core.cpp index 78185f5fad9..4b0f2aaeb8d 100644 --- a/src/core/io/writer/h5md_core.cpp +++ b/src/core/io/writer/h5md_core.cpp @@ -34,8 +34,8 @@ namespace H5md { static void backup_file(const std::string &from, const std::string &to) { if (this_node == 0) { /* - * If the file itself *and* a backup file exists something must - * went wrong before. + * If the file itself *and* a backup file exists, something must + * have went wrong. */ boost::filesystem::path pfrom(from), pto(to); try { diff --git a/src/core/rattle.cpp b/src/core/rattle.cpp index 2863c963748..3e940a7fe82 100644 --- a/src/core/rattle.cpp +++ b/src/core/rattle.cpp @@ -105,7 +105,7 @@ static void init_correction_vector(const ParticleRange &local_particles, /** * @brief Add the position correction to particles. * - * The position correction is acccumulated in the forces + * The position correction is accumulated in the forces * of the particles so that it can be reduced over the ghosts. * * @param ia_params Parameters diff --git a/src/core/reaction_ensemble.cpp b/src/core/reaction_ensemble.cpp index 9e3b56ea35c..fdf46fe5871 100644 --- a/src/core/reaction_ensemble.cpp +++ b/src/core/reaction_ensemble.cpp @@ -844,7 +844,7 @@ bool ReactionAlgorithm::do_global_mc_move_for_particles_of_type( dummy_old_particle_numbers, old_state_index, new_state_index, true); } else { bf = std::min(1.0, bf * exp(-beta * (E_pot_new - E_pot_old))); // Metropolis - // Algorithm + // algorithm // since // proposal // density is @@ -861,7 +861,7 @@ bool ReactionAlgorithm::do_global_mc_move_for_particles_of_type( // bf = std::min(1.0, // bf*exp(-beta*(E_pot_new-E_pot_old))*new_radius/old_radius); - // Metropolis-Hastings Algorithm for asymmetric proposal density + // Metropolis-Hastings algorithm for asymmetric proposal density if (m_uniform_real_distribution(m_generator) < bf) { // accept m_accepted_configurational_MC_moves += 1; diff --git a/src/core/thermostat.hpp b/src/core/thermostat.hpp index d165d136251..cc7115a4e83 100644 --- a/src/core/thermostat.hpp +++ b/src/core/thermostat.hpp @@ -33,7 +33,6 @@ #include #include -#include #include #include diff --git a/src/core/unit_tests/thermostats_test.cpp b/src/core/unit_tests/thermostats_test.cpp index 4acc357c716..45eecdce6b7 100644 --- a/src/core/unit_tests/thermostats_test.cpp +++ b/src/core/unit_tests/thermostats_test.cpp @@ -25,10 +25,7 @@ #include #include -#include #include -#include -#include #include "Particle.hpp" #include "integrators/brownian_inline.hpp" diff --git a/src/core/virtual_sites/VirtualSitesRelative.cpp b/src/core/virtual_sites/VirtualSitesRelative.cpp index ff0ffd7fa11..a509ebcd3a6 100644 --- a/src/core/virtual_sites/VirtualSitesRelative.cpp +++ b/src/core/virtual_sites/VirtualSitesRelative.cpp @@ -115,7 +115,7 @@ Particle *get_reference_particle( } /** - * @brief Contraint force on the real particle. + * @brief Constraint force on the real particle. * * Calculates the force exerted by the constraint on the * reference particle. diff --git a/src/python/espressomd/polymer.pyx b/src/python/espressomd/polymer.pyx index b17ec295ea1..52a79eb07b0 100644 --- a/src/python/espressomd/polymer.pyx +++ b/src/python/espressomd/polymer.pyx @@ -75,7 +75,7 @@ def linear_polymer_positions(**kwargs): Seed for the RNG used to generate the particle positions. bond_angle : :obj:`float`, optional If set, this parameter defines the angle between adjacent bonds - withing a polymer. + within a polymer. start_positions : array_like :obj:`float`. If set, this vector defines the start positions for the polymers, i.e., the position of each polymer's first monomer bead. diff --git a/src/python/pypresso.cmakein b/src/python/pypresso.cmakein index f3def790e36..d75fef4cd15 100755 --- a/src/python/pypresso.cmakein +++ b/src/python/pypresso.cmakein @@ -28,17 +28,15 @@ if [ "@CMAKE_CXX_COMPILER_ID@" != "GNU" ] && [ "@WITH_UBSAN@" = "ON" ] && [ "@WI fi export LD_PRELOAD if [ "@WITH_UBSAN@" = "ON" ]; then + export UBSAN_OPTIONS="print_stacktrace=1 suppressions=\"@CMAKE_SOURCE_DIR@/maintainer/CI/ubsan.supp\" $UBSAN_OPTIONS" if [ "@WARNINGS_ARE_ERRORS@" = "ON" ]; then - export UBSAN_OPTIONS="halt_on_error=1 print_stacktrace=1 suppressions=\"@CMAKE_SOURCE_DIR@/tools/ubsan-suppressions.txt\" $UBSAN_OPTIONS" - else - export UBSAN_OPTIONS="print_stacktrace=1 suppressions=\"@CMAKE_SOURCE_DIR@/tools/ubsan-suppressions.txt\" $UBSAN_OPTIONS" + export UBSAN_OPTIONS="halt_on_error=1 $UBSAN_OPTIONS" fi fi if [ "@WITH_ASAN@" = "ON" ]; then + ASAN_OPTIONS="protect_shadow_gap=0 allocator_may_return_null=1 $ASAN_OPTIONS" if [ "@WARNINGS_ARE_ERRORS@" = "ON" ]; then - ASAN_OPTIONS="halt_on_error=1 protect_shadow_gap=0 $ASAN_OPTIONS" - else - ASAN_OPTIONS="protect_shadow_gap=0 $ASAN_OPTIONS" + ASAN_OPTIONS="halt_on_error=1 $ASAN_OPTIONS" fi if [ "$1" = "--leaks" ]; then shift diff --git a/src/script_interface/auto_parameters/AutoParameters.hpp b/src/script_interface/auto_parameters/AutoParameters.hpp index a22a282baaf..ce0054f8049 100644 --- a/src/script_interface/auto_parameters/AutoParameters.hpp +++ b/src/script_interface/auto_parameters/AutoParameters.hpp @@ -118,7 +118,7 @@ class AutoParameters : public Base { valid_params.clear(); for (auto const &p : m_parameters) { - valid_params.push_back(p.first); + valid_params.emplace_back(p.first); } return valid_params; diff --git a/src/shapes/src/Slitpore.cpp b/src/shapes/src/Slitpore.cpp index ad5d1a9871c..e5e968e2c8a 100644 --- a/src/shapes/src/Slitpore.cpp +++ b/src/shapes/src/Slitpore.cpp @@ -46,7 +46,6 @@ void Slitpore::calculate_dist(const Utils::Vector3d &pos, double &dist, m_pore_mouth - m_pore_length + m_lower_smoothing_radius}; if (pos[2] > m_pore_mouth + m_channel_width / 2) { - // printf("upper wall\n"); // Feel the upper wall dist = m_pore_mouth + m_channel_width - pos[2]; vec[0] = vec[1] = 0; @@ -95,14 +94,13 @@ void Slitpore::calculate_dist(const Utils::Vector3d &pos, double &dist, } if (pos[0] > c12[0] && pos[0] < c22[0]) { - // printf("pore end\n"); // Feel the pore end wall dist = pos[2] - (m_pore_mouth - m_pore_length); vec[0] = vec[1] = 0; vec[2] = dist; return; } - // Else + // Feel the lower smoothing if (pos[0] < dividing_plane()) { dist = -sqrt(Utils::sqr(c12[0] - pos[0]) + Utils::sqr(c12[1] - pos[2])) + diff --git a/src/shapes/src/Stomatocyte.cpp b/src/shapes/src/Stomatocyte.cpp index f1962149ef1..3ceb3763cc7 100644 --- a/src/shapes/src/Stomatocyte.cpp +++ b/src/shapes/src/Stomatocyte.cpp @@ -351,7 +351,5 @@ void Stomatocyte::calculate_dist(const Utils::Vector3d &pos, double &dist, vec = normal_3D * distance; dist = std::copysign(distance, m_direction); - - // And we are done with the stomatocyte } } // namespace Shapes diff --git a/src/shapes/unit_tests/Ellipsoid_test.cpp b/src/shapes/unit_tests/Ellipsoid_test.cpp index 7a2ca46459d..39ba2641962 100644 --- a/src/shapes/unit_tests/Ellipsoid_test.cpp +++ b/src/shapes/unit_tests/Ellipsoid_test.cpp @@ -20,7 +20,6 @@ */ #include -#include #define BOOST_TEST_MODULE ellipsoid test #define BOOST_TEST_DYN_LINK diff --git a/src/shapes/unit_tests/HollowConicalFrustum_test.cpp b/src/shapes/unit_tests/HollowConicalFrustum_test.cpp index 7143951ed44..e41fbb2c8d6 100644 --- a/src/shapes/unit_tests/HollowConicalFrustum_test.cpp +++ b/src/shapes/unit_tests/HollowConicalFrustum_test.cpp @@ -19,9 +19,6 @@ * along with this program. If not, see . */ -#include -#include - #define BOOST_TEST_MODULE Cone test #define BOOST_TEST_DYN_LINK diff --git a/src/shapes/unit_tests/Union_test.cpp b/src/shapes/unit_tests/Union_test.cpp index fff825516b1..904663b871a 100644 --- a/src/shapes/unit_tests/Union_test.cpp +++ b/src/shapes/unit_tests/Union_test.cpp @@ -19,14 +19,12 @@ * along with this program. If not, see . */ -#include #include #define BOOST_TEST_MODULE Union test #define BOOST_TEST_DYN_LINK #include -#include #include #include diff --git a/src/shapes/unit_tests/Wall_test.cpp b/src/shapes/unit_tests/Wall_test.cpp index 623ecc54185..02030a8d0bb 100644 --- a/src/shapes/unit_tests/Wall_test.cpp +++ b/src/shapes/unit_tests/Wall_test.cpp @@ -19,9 +19,6 @@ * along with this program. If not, see . */ -#include -#include - #define BOOST_TEST_MODULE Wall test #define BOOST_TEST_DYN_LINK #include diff --git a/src/utils/include/utils/mpi/cart_comm.hpp b/src/utils/include/utils/mpi/cart_comm.hpp index dd26e57602c..d783791550c 100644 --- a/src/utils/include/utils/mpi/cart_comm.hpp +++ b/src/utils/include/utils/mpi/cart_comm.hpp @@ -63,7 +63,7 @@ boost::mpi::communicator cart_create( /** * @brief Wrapper around MPI_Cart_coords. * - * @tparam dim Number of dimensions + * @tparam dims Number of dimensions */ template Vector3i cart_coords(boost::mpi::communicator const &comm, int rank) { @@ -75,7 +75,7 @@ Vector3i cart_coords(boost::mpi::communicator const &comm, int rank) { /** * @brief Wrapper around MPI_Cart_rank. * - * @tparam dim Number of dimensions + * @tparam dims Number of dimensions */ template int cart_rank(boost::mpi::communicator const &comm, diff --git a/src/utils/include/utils/print.hpp b/src/utils/include/utils/print.hpp deleted file mode 100644 index c8631188bc3..00000000000 --- a/src/utils/include/utils/print.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2017-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 CORE_UTILS_PRINT_HPP -#define CORE_UTILS_PRINT_HPP - -#include - -namespace Utils { - -/** - * @brief Python style print function. - */ -template void print(T v) { std::cout << v << '\n'; } - -/** - * @brief Python style print function. - */ -template void print(Arg v, Args... args) { - std::cout << v << " "; - print(args...); -} - -} /* namespace Utils */ - -#endif diff --git a/src/utils/include/utils/serialization/flat_map.hpp b/src/utils/include/utils/serialization/flat_map.hpp deleted file mode 100644 index 98f349b5ae5..00000000000 --- a/src/utils/include/utils/serialization/flat_map.hpp +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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 CORE_UTILS_SERIALIZATION_FLAT_MAP_HPP -#define CORE_UTILS_SERIALIZATION_FLAT_MAP_HPP - -#include -#include - -namespace boost { -namespace serialization { - -template -void load(Archive &ar, boost::container::flat_map &v, - const unsigned int) { - using value_type = typename boost::container::flat_map::value_type; - typename boost::container::flat_map::size_type count; - - ar &count; - v.reserve(count); - - for (int i = 0; i < count; i++) { - value_type e; - - ar >> e; - v.emplace_hint(v.end(), e); - } -} - -template -void save(Archive &ar, boost::container::flat_map const &v, - const unsigned int) { - typename boost::container::flat_map::size_type count(v.size()); - - ar << count; - - for (auto const &e : v) { - ar << e; - } -} - -template -void serialize(Archive &ar, boost::container::flat_map &v, - const unsigned int version) { - split_free(ar, v, version); -} -} // namespace serialization -} // namespace boost - -#endif diff --git a/src/utils/include/utils/serialization/flat_set.hpp b/src/utils/include/utils/serialization/flat_set.hpp deleted file mode 100644 index 7bb5946db59..00000000000 --- a/src/utils/include/utils/serialization/flat_set.hpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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 CORE_UTILS_SERIALIZATION_FLAT_SET_HPP -#define CORE_UTILS_SERIALIZATION_FLAT_SET_HPP - -#include - -namespace boost { -namespace serialization { -template -void load(Archive &ar, boost::container::flat_set &v, - const unsigned int) { - using value_type = typename boost::container::flat_set::value_type; - using size_type = typename boost::container::flat_set::size_type; - size_type count; - - ar >> count; - v.reserve(count); - - for (; count > 0; --count) { - value_type e; - - ar >> e; - v.emplace_hint(v.end(), e); - } -} - -template -void save(Archive &ar, boost::container::flat_set const &v, - const unsigned int) { - typename boost::container::flat_set::size_type count(v.size()); - - ar << count; - - for (auto const &e : v) { - ar << e; - } -} - -template -void serialize(Archive &ar, boost::container::flat_set &v, - const unsigned int version) { - split_free(ar, v, version); -} -} // namespace serialization -} // namespace boost - -#endif diff --git a/src/utils/include/utils/uniform.hpp b/src/utils/include/utils/uniform.hpp index 9a508673b52..bf46e95d274 100644 --- a/src/utils/include/utils/uniform.hpp +++ b/src/utils/include/utils/uniform.hpp @@ -35,7 +35,7 @@ namespace Utils { */ constexpr inline double uniform(uint64_t in) { auto constexpr const max = std::numeric_limits::max(); - auto constexpr const fac = 1. / (max + 1.); + auto constexpr const fac = 1. / (static_cast(max) + 1.); return fac * in + 0.5 * fac; } diff --git a/src/utils/tests/Array_test.cpp b/src/utils/tests/Array_test.cpp index cb4a855e0c5..21062d13515 100644 --- a/src/utils/tests/Array_test.cpp +++ b/src/utils/tests/Array_test.cpp @@ -20,10 +20,8 @@ #define BOOST_TEST_MODULE Utils::Array test #define BOOST_TEST_DYN_LINK -#include #include #include -#include #include #include diff --git a/src/utils/tests/NumeratedContainer_test.cpp b/src/utils/tests/NumeratedContainer_test.cpp index 5a3bbecfbdc..2bb081eb25b 100644 --- a/src/utils/tests/NumeratedContainer_test.cpp +++ b/src/utils/tests/NumeratedContainer_test.cpp @@ -25,8 +25,6 @@ #define BOOST_TEST_DYN_LINK #include -#include - #include "utils/NumeratedContainer.hpp" using namespace Utils; diff --git a/src/utils/tests/Vector_test.cpp b/src/utils/tests/Vector_test.cpp index 689faaff662..abd7f1cb7b3 100644 --- a/src/utils/tests/Vector_test.cpp +++ b/src/utils/tests/Vector_test.cpp @@ -26,7 +26,6 @@ #include #include -#include #include #include diff --git a/src/utils/tests/interpolation_gradient_test.cpp b/src/utils/tests/interpolation_gradient_test.cpp index a4e10a59cf7..789664de3b8 100644 --- a/src/utils/tests/interpolation_gradient_test.cpp +++ b/src/utils/tests/interpolation_gradient_test.cpp @@ -28,8 +28,6 @@ using Utils::Interpolation::bspline_3d_gradient_accumulate; #include "utils/math/gaussian.hpp" #include "utils/raster.hpp" -#include - BOOST_AUTO_TEST_CASE(number_of_points) { int count = 0; auto counter = [&count](const std::array &, const Utils::Vector3d &) { diff --git a/src/utils/tests/mask_test.cpp b/src/utils/tests/mask_test.cpp index a44343c4476..2f719204eb5 100644 --- a/src/utils/tests/mask_test.cpp +++ b/src/utils/tests/mask_test.cpp @@ -23,7 +23,6 @@ #include -#include #include #include diff --git a/src/utils/tests/quaternion_test.cpp b/src/utils/tests/quaternion_test.cpp index a1024e81b7f..842a1a747ce 100644 --- a/src/utils/tests/quaternion_test.cpp +++ b/src/utils/tests/quaternion_test.cpp @@ -19,7 +19,6 @@ #define BOOST_TEST_MODULE quaternion test #define BOOST_TEST_DYN_LINK -#include #include #include diff --git a/testsuite/python/brownian_dynamics.py b/testsuite/python/brownian_dynamics.py index a608c8ac9a8..b495f79b216 100644 --- a/testsuite/python/brownian_dynamics.py +++ b/testsuite/python/brownian_dynamics.py @@ -185,7 +185,7 @@ def setup_diff_mass_rinertia(self, p): p.rinertia = [0.4, 0.4, 0.4] def test_msd_global_temp(self): - """Tests diffusion via MSD for global gamma and temeprature""" + """Tests diffusion via MSD for global gamma and temperature""" gamma = 9.4 kT = 0.37 diff --git a/testsuite/python/lb.py b/testsuite/python/lb.py index 0319b8bb63f..c8503db5f57 100644 --- a/testsuite/python/lb.py +++ b/testsuite/python/lb.py @@ -316,7 +316,7 @@ def test_incompatible_agrid(self): sys.stderr.flush() def test_agrid_rounding(self): - """Tests agird*n ~= box_l for a case where rounding down is needed""" + """Tests agrid*n ~= box_l for a case where rounding down is needed""" system = self.system old_l = system.box_l diff --git a/testsuite/python/save_checkpoint.py b/testsuite/python/save_checkpoint.py index 7d5c524af99..1cccc07513f 100644 --- a/testsuite/python/save_checkpoint.py +++ b/testsuite/python/save_checkpoint.py @@ -48,6 +48,12 @@ checkpoint = espressomd.checkpointing.Checkpoint( checkpoint_id=idx, checkpoint_path="@CMAKE_CURRENT_BINARY_DIR@") +# cleanup old checkpoint files +if checkpoint.has_checkpoints(): + for filepath in os.listdir(checkpoint.checkpoint_dir): + if filepath.endswith((".checkpoint", ".cpt")): + os.remove(os.path.join(checkpoint.checkpoint_dir, filepath)) + LB_implementation = None if 'LB.CPU' in modes: LB_implementation = espressomd.lb.LBFluid diff --git a/testsuite/scripts/tutorials/test_html_runner.py b/testsuite/scripts/tutorials/test_html_runner.py index c105ebeff7a..049f421ba9f 100644 --- a/testsuite/scripts/tutorials/test_html_runner.py +++ b/testsuite/scripts/tutorials/test_html_runner.py @@ -25,7 +25,7 @@ class HtmlRunner(ut.TestCase): """ Test the :file:`doc/tutorials/html_runner.py` script. A new Jupyter - notebook and a new python script are created, and both are suplied to + notebook and a new python script are created, and both are supplied to html_runner.py, which will include the python script in a new code cell, substitute global variables, run the code and then save the result in a new notebook. The input notebook contains IPython magic commands and diff --git a/tools/ubsan-suppressions.txt b/tools/ubsan-suppressions.txt deleted file mode 100644 index 27cdb451181..00000000000 --- a/tools/ubsan-suppressions.txt +++ /dev/null @@ -1,4 +0,0 @@ -null:boost/serialization/singleton.hpp -function:src/python/espressomd/ -nonnull-attribute:boost::container::container_detail::memmove_n_source -