|
peclet-dem 1.1.0
Performance-portable XPBD Discrete Element Method (Kokkos + ArborX)
|
dem — portable (Kokkos) owner<->ghost particle halo for the distributed XPBD step. More...
Go to the source code of this file.
dem — portable (Kokkos) owner<->ghost particle halo for the distributed XPBD step.
Kokkos counterpart of src/mpi/mpi_halo.h (MpiParticleHalo): a thin wrapper over transport-core's peclet::core::halo::ParticleHaloTopology<3> (host topology, periodic image shift) + ParticleHalo<3> (on-device gather/scatter + host-staged MPI). Rebuilt each substep from the owned positions; it gathers ghost copies of the owners' FULL state into the Particles SoA ghost slots (ghosts carry REAL mass; realIndices self-mapped, so a ghost evolves in place) and, during the velocity/position solves, RECONCILES them with their owners (docs/mpi_momentum_conservation .md): every contact is solved by exactly one rank (ContactOwnership), which writes the partner's half of each impulse into the partner's ghost slot; at every sync each ghost's change since its baseline is reverse-accumulated onto its owner (core ParticleHalo<3>::reverse) and the owners then republish (forward). Each impulse and correction is applied once, equal and opposite: linear momentum and the centre of mass are conserved to round-off.
Faithful Kokkos port of Simulation::mpi_gather_ghosts / mpi_forward_positions / mpi_forward4.
Local order is canonical, not MPI arrival order. core's NBX rounds hand over messages in the order they ARRIVE (ParticleMigrator::migrate appends migrants per message; the halo topology numbers its ghost blocks per message), and at np >= 4 a rank hears from several neighbours in a run-dependent order. The local slot order decides the manifold order (sorted by slot-pair key), hence the colouring and the Gauss-Seidel sweep order, so an arrival-ordered layout made two runs of one build diverge. Migrants are therefore stably re-ordered by source rank (MigratePack::srcRank) and ghost blocks are placed in ascending source rank (ghostSlot_): within a block the order is the sender's, which is canonical by induction. With one source per rank (np <= 2) both maps are the identity, so those layouts are unchanged bit for bit. Gated behind PECLET_DEM_MPI (mirrors cfd's CFD_MPI): the default dem module never includes this, so it stays byte-identical when the macro is off.
Definition in file mpi_halo.hpp.