espressomd / espresso

The ESPResSo package
https://espressomd.org
GNU General Public License v3.0
226 stars 183 forks source link

Test failures with specific myconfig.hpp #4964

Closed RudolfWeeber closed 1 month ago

RudolfWeeber commented 2 months ago

With the following myconfig.hpp, the lb thermostat test as well as some others fail. Also looks like virtual sites relative velocities don't get updated (for rotating central particle) in some cases. Default myconfig seems to be fine.


/*
 * Copyright (C) 2010-2022 The ESPResSo project
 * Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
 *   Max-Planck-Institute for Polymer Research, Theory Group
 *
 * 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 <http://www.gnu.org/licenses/>.
 */

/*
 * This is the default myconfig.hpp file.
 * When users don't supply a myconfig.hpp file, this file is used.
 *
 * DO NOT MODIFY THIS FILE! It should be modified *only* by the
 * maintainers of ESPResSo, as it has a profound impact on many users.
 */

// Geometry, equation of motion, thermostat/barostat
#define ROTATION

#define MASS
#define EXTERNAL_FORCES
#define DPD
// Charges and dipoles

// Active matter

// Force/energy calculation
#define TABULATED
#define HERTZIAN
#define WCA

#define VIRTUAL_SITES_RELATIVE
#define VIRTUAL_SITES_INERTIALESS_TRACERS
#define COLLISION_DETECTION
jngrad commented 1 month ago

I played with the myconfig file and found some more examples in the testsuite. I didn't notice virtual sites relative velocities not being updated, but I did notice Lees-Edwards being unhappy about the following myconfig file:

#define LENNARD_JONES
#define WCA
$ mpiexec -n 4 ./pypresso ../testsuite/python/lees_edwards.py LeesEdwards.test_zz_lj_pair_visibility
AssertionError: 1.3528118864 not greater than or equal to 1.4 : Pair not found by the core (0, 1)

The soft-sphere potential in test_interactions had a larger cutoff than the LJ potential in test_zz_lj_pair_visibility (1.5 vs. 1.2), and since the non-bonded interactions weren't reset in the tearDown method, the distance criterion wasn't correct.

jngrad commented 1 month ago

As a side note: with the way we use the myconfig file, every time we enable or disable an external library like HDF5, waLBerla, ScaFaCoS or Caliper, we need to rebuild the entire core and script interface, even though most core and script interface translation units do not need to know about these features. Likewise, external features do not necessarily need to know about internal ESPResSo features. Maybe there is a way to split config/config.hpp into config/internal.hpp and config/external.hpp to improve build cache re-use when troubleshooting interactions between config files, in a safe manner. The major hurdles I can think of is remembering when to include one or the other depending on which symbols are in the translation unit (something we already have to think about anyway when using the STL and Boost), and dealing with conditionally-enabled features, like DIPOLES -> SCAFACOS_DIPOLES and FFTW -> THOLE (quite hard, because we currently leverage ifdefs to gracefully skip a feature if a dependent feature is missing).