![]() |
ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
|
Persistent per-neighbor buffer pool for halo exchanges. More...
#include <HaloExchange.hpp>
Collaboration diagram for GhostComm::ExchangeBuffers:Public Attributes | |
| std::vector< CommBuf > | send |
| Per-neighbor packed send buffers (index-aligned with plan->neighbors). | |
| std::vector< CommBuf > | recv |
| Per-neighbor recv buffers (index-aligned with plan->neighbors). | |
| std::vector< boost::mpi::request > | requests |
| Outstanding non-blocking send/recv requests (cleared before each use). | |
| std::vector< std::vector< ParticleList * > > | send_cells |
| Scratch cell-pointer arrays for the packing routines. | |
| std::vector< std::vector< ParticleList * > > | recv_cells |
| std::vector< std::size_t > | slot_to_neighbor |
Scratch index map for the Overwrite (wait_any) path in halo_exchange_finish: maps active request slot -> original neighbor index. | |
Persistent per-neighbor buffer pool for halo exchanges.
Owns the heap-allocated send/recv buffers, MPI-request slots, and cell-pointer scratch arrays for one set of neighbor communications. Holding this object across multiple calls to halo_exchange allows the underlying std::vector storage to be reused via resize — after the first exchange (warm-up) the vectors retain capacity and subsequent calls incur no heap allocations on the hot path.
Typical ownership: held as a member of the object that drives ghost communication (e.g. CellStructure::m_ghost_buffers) and passed to halo_exchange / halo_exchange_start as a mutable ref.
Thread-safety: a single instance must not be used from concurrent threads. The sequential ghost-exchange loop (each exchange completes via halo_exchange_finish before the next starts) is therefore safe.
Definition at line 69 of file HaloExchange.hpp.
| std::vector<CommBuf> GhostComm::ExchangeBuffers::recv |
Per-neighbor recv buffers (index-aligned with plan->neighbors).
Definition at line 73 of file HaloExchange.hpp.
Referenced by GhostComm::halo_exchange_start().
| std::vector<std::vector<ParticleList *> > GhostComm::ExchangeBuffers::recv_cells |
Definition at line 82 of file HaloExchange.hpp.
Referenced by GhostComm::halo_exchange_start().
| std::vector<boost::mpi::request> GhostComm::ExchangeBuffers::requests |
Outstanding non-blocking send/recv requests (cleared before each use).
Definition at line 75 of file HaloExchange.hpp.
Referenced by GhostComm::halo_exchange_start().
| std::vector<CommBuf> GhostComm::ExchangeBuffers::send |
Per-neighbor packed send buffers (index-aligned with plan->neighbors).
Definition at line 71 of file HaloExchange.hpp.
Referenced by GhostComm::halo_exchange_start().
| std::vector<std::vector<ParticleList *> > GhostComm::ExchangeBuffers::send_cells |
Scratch cell-pointer arrays for the packing routines.
For the Reduce direction send/recv roles swap; we need the plain ParticleList* from the SendRegion list. These must outlive the pack/unpack calls.
Definition at line 81 of file HaloExchange.hpp.
Referenced by GhostComm::halo_exchange_start().
| std::vector<std::size_t> GhostComm::ExchangeBuffers::slot_to_neighbor |
Scratch index map for the Overwrite (wait_any) path in halo_exchange_finish: maps active request slot -> original neighbor index.
Sized to the current neighbor count in halo_exchange_start alongside the other per-neighbor vectors; capacity is retained across calls so that no heap allocation occurs on the hot position-push path after the first (warm-up) exchange.
Definition at line 91 of file HaloExchange.hpp.
Referenced by GhostComm::halo_exchange_start().