![]() |
ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
|
Enumerations | |
| enum | GhostTag : int { TAG_POSITION = 100 , TAG_FORCE = 101 , TAG_PARTNUM = 102 , TAG_DEFAULT = 103 , TAG_BONDS = 104 } |
| MPI tags for ghost communications. More... | |
Functions | |
| int | main_tag (unsigned data_parts) |
| std::span< ParticleList *const > | as_span (std::vector< ParticleList * > const &v) |
| View a list of cell pointers as a span for the packing routines. | |
| std::vector< ParticleList * > | region_cells (std::vector< SendRegion > const &send) |
| Extract the plain cell pointers from a list of send regions. | |
| void | pack_regions (CommBuf &buf, std::vector< SendRegion > const ®ions, BoxGeometry const &box, unsigned data_parts) |
| Pack all send regions of one NeighborComm into a single buffer. | |
| void | run_collective (HaloPlan const &plan, BoxGeometry const &box, unsigned data_parts, ExchangeOp op) |
| Collective (broadcast/reduce-sum) section. | |
| enum GhostComm::anonymous_namespace{HaloExchange.cpp}::GhostTag : int |
MPI tags for ghost communications.
One tag per exchange-kind keeps concurrent exchanges (a future goal) from aliasing: within a single exchange each message is already uniquely matched by (peer, tag). The BONDS transfer needs its own tag because it is sent as a second message to the same peer, mirroring the legacy two-transfer.
| Enumerator | |
|---|---|
| TAG_POSITION | |
| TAG_FORCE | |
| TAG_PARTNUM | |
| TAG_DEFAULT | |
| TAG_BONDS | |
Definition at line 61 of file HaloExchange.cpp.
| std::span< ParticleList *const > GhostComm::anonymous_namespace{HaloExchange.cpp}::as_span | ( | std::vector< ParticleList * > const & | v | ) |
View a list of cell pointers as a span for the packing routines.
Definition at line 83 of file HaloExchange.cpp.
References as_span().
Referenced by as_span(), and pack_regions().
| int GhostComm::anonymous_namespace{HaloExchange.cpp}::main_tag | ( | unsigned | data_parts | ) |
Definition at line 69 of file HaloExchange.cpp.
References GHOSTTRANS_FORCE, GHOSTTRANS_PARTNUM, GHOSTTRANS_POSITION, main_tag(), TAG_DEFAULT, TAG_FORCE, TAG_PARTNUM, and TAG_POSITION.
Referenced by main_tag().
| void GhostComm::anonymous_namespace{HaloExchange.cpp}::pack_regions | ( | CommBuf & | buf, |
| std::vector< SendRegion > const & | regions, | ||
| BoxGeometry const & | box, | ||
| unsigned | data_parts | ||
| ) |
Pack all send regions of one NeighborComm into a single buffer.
All regions are packed with a single pack_cells call so that bonds produce exactly one boost binary archive per neighbor message – matching the single unpack_cells call on the receive side. Concatenating per-region archives would corrupt the bond stream (the second archive header is misread as bond data by the receiver).
Per-region shifts are honored via the common shift. All SendRegion.shift values within a NeighborComm are equal — RegularDecomposition:: make_halo_plan() sets them all to {}. This lets us pack every region's cells in one pack_cells call (a single bond archive, matching the receiver's single unpack_cells).
pack_regions must be generalized to pack each region's non-bond (flat) data with its own shift while still writing all bonds into ONE shared archive — do not simply concatenate per-region archives (that was the bond-corruption bug fixed in commit 314e7c366b). Definition at line 117 of file HaloExchange.cpp.
References as_span(), Utils::Vector< T, N >::empty(), Utils::Vector< T, N >::front(), GhostComm::pack_cells(), pack_regions(), and region_cells().
Referenced by pack_regions().
| std::vector< ParticleList * > GhostComm::anonymous_namespace{HaloExchange.cpp}::region_cells | ( | std::vector< SendRegion > const & | send | ) |
Extract the plain cell pointers from a list of send regions.
Definition at line 88 of file HaloExchange.cpp.
References region_cells().
Referenced by pack_regions(), and region_cells().
| void GhostComm::anonymous_namespace{HaloExchange.cpp}::run_collective | ( | HaloPlan const & | plan, |
| BoxGeometry const & | box, | ||
| unsigned | data_parts, | ||
| ExchangeOp | op | ||
| ) |
Collective (broadcast/reduce-sum) section.
For each root rank in [0, comm.size()):
std::plus on the raw double buffer; root unpacks into cells[root] (the owned cell, so forces accumulate there).The legacy code uses one GHOST_BCST (or GHOST_RDCE) step per rank, each step addressing a single cell pointer (ghost_comm.part_lists[0] == &cells.at(n)). We replicate that loop exactly.
Definition at line 155 of file HaloExchange.cpp.
References GhostComm::CommBuf::bonds(), GhostComm::calc_transmit_size(), GhostComm::HaloPlan::collective, GhostComm::HaloPlan::comm, GhostComm::ExchangeOp::direction, GhostComm::None, GhostComm::pack_cells(), GhostComm::Push, GhostComm::CommBuf::resize(), run_collective(), GhostComm::CommBuf::size(), and GhostComm::unpack_cells().
Referenced by run_collective().