Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Espresso head #282

Open
wants to merge 5,180 commits into
base: gjf_and_BAOAB
Choose a base branch
from
Open

Espresso head #282

wants to merge 5,180 commits into from

Conversation

bogdan-tanygin
Copy link
Owner

Fixes #

Description of changes:

jngrad and others added 30 commits November 29, 2022 11:01
Also check C++20 compliance in continuous integration.
Also remove now obsolete OpenMPI patches from the core.
The old version was broken and would skip the Cython version check
when Cython was not found. The build would not be able to complete.
The new version of FindCython is adapted from
https://github.com/scikit-build/scikit-build/blob/066200d/skbuild/resources/cmake/FindCython.cmake
Fixes espressomd#4618

We have concrete plans to integrate more external libraries into ESPResSo, such as waLBerla for hydrodynamics and librepa+kdpart for MD load balancing. We opted for the CMake `FetchContent` method, which allows us to finely tune the way these libraries are compiled and integrated into ESPResSo. However, our build system has imperfections that makes it difficult to integrate new libraries, or to use ESPResSo as a library in a parent project. In particular, CMake flags such as `WITH_FFTW` are inherited by included projects, which sometimes cause them to build components that are not needed in ESPResSo. This unnecessarily increases build times, and in a few cases, forces users to install extra dependencies to complete the build.

It is good practice to put a project-specific prefix on all CMake options to avoid this kind of name conflict. While we worked with external libraries maintainers to rename their CMake options, we obviously need to rename ESPResSo CMake options too. As such, this PR adds a prefix `ESPRESSO_BUILD_` to all options that control compilation, and a prefix `ESPRESSO_` to the other options. The new option names can be found in the user guide, section 2.4.4. "Options and Variables".

Since the waLBerla project requires C++17, and CUDA versions 10.x only support C++14, we will be migrating to C++17 and CUDA 11.x. This change is also motivated by the `thrust` library, which generates compiler warnings for certain containers until CUDA 11.5, and Cython which now uses C++17 by default in Ubuntu 22.04.

Description of changes:
- rename ESPResSo-specific CMake options and functions
   - e.g. for build options: `-D WITH_CUDA=ON` becomes `-D ESPRESSO_BUILD_WITH_CUDA=ON`
   - e.g. for other options: `-D CTEST_ARGS=-j16` becomes `-D ESPRESSO_CTEST_ARGS=-j16`
- require a C++17-capable compiler
   - replace 400 lines of code in the core by equivalent STL functions
   - reduce usage of Boost algorithms
   - check the project builds without external dependencies in C++20 mode
- bump all version requirements
   - CMake >= 3.18, Python >= 3.9, Cython >= 0.29.21, Boost >= 1.74, CUDA >= 11.0, OpenMPI >= 4.0, MPICH >= 3.4.1, GCC >= 8.0, Clang >= 9.0.0, AppleClang >= 11.0.0, Intel Classic >= 18.0, Intel oneAPI >= 2021.0
   - Python package version requirements are based on versions available in Ubuntu 22.04 and Debian 11
- `FindCython` now stops CMake generation when Cython was not found
Under specific circumstances one might have to override the cutoff check for virtual sites.

E.g. on `n>1` cores, when using the hybrid decomposition scheme to simulate a large virtual sites rigid object such as a large raspberry particle, the `min_global_cut` necessary to set up said object becomes quite large. Say the raspberry is surrounded by lots of small particles, e.g. a polymer suspension, which are put in the regular child decomposition of the `HybridDecomposition` cell system, the resulting minimum cell size of the regular cell decomposition is limited by this large `min_global_cut` -- even if the raspberry central particle resides in the N-square child decomposition, where it already interacts with all particles making the `min_global_cut` requirement superfluous. However, one forfeits the possible computational advantage of the hybrid decomposition.
Fixes espressomd#4595

Description of changes:
- Reaction methods now rebuild the list of free particle ids every time `ReactionAlgorithm::do_reaction()` and `WidomInsertion::calculate_particle_insertion_potential_energy()` are called
- Added a new test that checks that the reaction methods do the bookkeeping of empty ids by setting up two different instances of the reaction methods (constant pH and Widom insertion) with competing reactions. 

I benchmarked my implementation against the current python branch using the `mc_acid_base_reservoir.py` script and I get the following timings: 1.564e-04 (my PR) vs  1.473e-04 (current python branch). That means that my implementation comes with a 6% performance loss in its current state.
Fixes espressomd#4598 

Description of changes:
- add ParticleDirectors observable
Fixes espressomd#4622

Description of changes:
- the `System.part.pairs()` method now returns the correct particle pairs when particle ids aren't both contiguous and starting from 0
Factor out duplicated code, remove unreachable code, add extra checks.
Option 'normed' in numpy.histogramdd was deprecated since 1.15 and
removed in 1.24.
kodiakhq bot and others added 30 commits July 13, 2023 14:56
Description of changes:
- make electrostatics a member of the System class
- make magnetostatics a member of the System class
- remove 5 global variables (partial fix for espressomd#2628)
- API change: new syntax for long-range actors
```python
system.electrostatics.solver = espressomd.electrostatics.P3M(...)
system.electrostatics.extension = espressomd.electrostatic_extensions.ICC(...)
system.magnetostatics.solver = espressomd.magnetostatics.DipolarDirectSumCpu(...)

system.electrostatics.clear()
system.magnetostatics.clear()
```
Fixes espressomd#4740, fixes espressomd#2509

Description of changes:
- third-party tools:
   - fix the broken Caliper integration and write an integration test
   - use standard Caliper macros instead of macro aliases
   - build Caliper as a CMake subproject to inherit options (e.g. CUDA and MPI support) and facilitate linking
   - add native support for CUDA-GDB (a few compiler flags were missing from `Debug` builds)
   - add native support for kernprof (new flag added to `pypresso`)
- documentation:
   - centralize scattered information about debuggers into a self-contained section of the user guide
   - document all supported debuggers and profilers: Caliper, Valgrind, GDB, CUDA-GDB, kernprof, perf, sanitizers
   - make the Doxygen docs more consistent with the Sphinx user guide (same fonts) and website (same logo)
Also remove the MASS feature from the P3M test and do some cleanup.
Follow up to our work with HPC Vega and the EESSI project.

Description of changes:
- add GPU support in P3M and LB
- remove MASS dependency in P3M
- adjust steepest descent for large particle numbers
Fixes espressomd#4752

Description of changes:
- skip expensive runtime checks on type-erased waLBerla fields during particle coupling
Co-authored-by: Alexander Reinauer <[email protected]>
Fixes espressomd#3154

Description of changes:
- make observables run in parallel
   - only send the extracted data via MPI (the original implementation sent the entire particle data structure)
   - remove a major performance bottleneck in parallel simulations
- remove 8 callbacks from the deprecated `MpiCallbacks` framework
Description of changes:
- remove two P3M global variables (partial fix for espressomd#2628)
- add missing `cudaFree`  to fix all remaining memory leaks on the GPU
- add a new `pypresso` option `--cuda-sanitizer` to run the NVIDIA Compute Sanitizer suite
   - by default, runs `memcheck`, but one can select another tool via command line options
   - the stand-alone tool `cuda-memcheck` is deprecated in CUDA 12.0
Factor out code duplication. Make remaining MpiCallbacks return void.
Fixes espressomd#4755

Description of changes:
- split short-range force kernel into a central radial kernel, a central radial with charge kernel, and a non-central kernel
Use lambda captures by reference. Use consistent function names.
Remove unused header includes. Reduce usage of the actors list.
The waLBerla module now only uses Boost in the unit tests.
* remove the actor list
* enforce SOLID principles
* add fine-grained event hooks
Description of changes:
- API changes:
   - the `espressomd.System` class now has a new member `lb`
   - the `espressomd.System` class member `ekreactions` is now the `reaction` attribute of `system.ekcontainer`
   - the `espressomd.System` class no longer has an `actors` member
   - further API changes will take place in an upcoming PR
- remove Boost dependency from LB/EK sources
   - follow-up to [**Remove remaining boost components** walberla/walberla#605](https://i10git.cs.fau.de/walberla/walberla/-/merge_requests/605)
   - partial fix for espressomd#4723 (comment)
   - unit tests from the walberla bridge still depend on `Boost::unit_test_framework`
- fix regressions in EK
   - EK now throws an error when the box_l or node_grid changes, when the MD time step and EK tau disagree, when the box size is not an integer multiple of agrid
- rewrite the LB and EK code in the core from scratch to enforce SOLID principles
   - folder `src/grid_based_algorithms` was split into `src/core/lb` and `src/core/ek`
   - LB and EK global variables (`lattice_switch`, `ek_container`, `ek_reactions`, `lb_walberla_instance`,
   `lb_walberla_params_instance`) were removed; these objects are now members of the `System` class
    (partial fix for espressomd#2628)
* Move up halo region calculation by one level
* Only consider shifted positions for coupling if the particle is close enough to the boundary to affect a ghost layer
* Introduce a cached vector of pointers to blocks to avoid slow block iteration and position to block matching in waLBerla (partially)

The last point is relevant, because there are 16 calls per particle and time step for get_block_and_cell()
Description of changes:
* make LB particle coupling more efficient
* fix LB particle coupling benchmark
Description of changes:
- Resizing the box now throws a runtime error if there are constraints present, since constraint preconditions might no longer be fulfilled (e.g. a wall constraint might end up outside the box boundaries when the box shrinks)
- This feature was originally introduced in ESPResSo 4.0.0 (espressomd#2031), but never actually worked because the PR accidentally removed the event function call during merge conflict resolution
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.