29#include "ParticleList.hpp"
38#include <boost/mpi/collectives/reduce.hpp>
39#include <boost/mpi/communicator.hpp>
85 m_halo_plan = make_halo_plan();
103 c->m_is_boundary =
true;
105#ifdef ESPRESSO_ADDITIONAL_CHECKS
110 "HybridDecomposition"));
146 std::vector<ParticleChange> &
diff) {
151 for (
auto it =
cell_rd->particles().begin();
154 if (
not is_n_square_type(
it->type())) {
160 auto p = std::move(*
it);
173 for (
auto it =
cell_ns->particles().begin();
176 if (is_n_square_type(
it->type())) {
182 auto p = std::move(*
it);
216std::size_t HybridDecomposition::count_particles(
217 std::vector<Cell *>
const &local_cells)
const {
218 std::size_t count_local = 0;
221 count_local += cell->particles().size();
223 boost::mpi::reduce(m_comm, count_local,
count_global, std::plus<>{}, 0);
unsigned map_data_parts(unsigned data_parts)
Map the data parts flags from cells to those used internally by the ghost communication.
Asynchronous, split-phase ghost-communication engine.
Vector implementation and trait types for boost qvm interoperability.
Atom decomposition cell system.
GhostComm::HaloPlan const * halo_plan() const override
auto const & get_local_cells() const
auto const & get_ghost_cells() const
void resort(bool global_flag, std::vector< ParticleChange > &diff) override
std::span< Cell *const > local_cells() const override
std::span< Cell *const > local_cells() const override
Cell * particle_to_cell(Particle const &p) override
void resort(bool global, std::vector< ParticleChange > &diff) override
HybridDecomposition(boost::mpi::communicator comm, double cutoff_regular, double skin, std::function< bool()> get_ghost_flags, BoxGeometry const &box_geo, LocalBox const &local_box, std::set< int > n_square_types)
std::span< Cell *const > ghost_cells() const override
cudaStream_t stream[1]
CUDA streams for parallel computing on CPU and GPU.
Ghost particles and particle exchange.
@ GHOSTTRANS_PARTNUM
resize the receiver particle arrays to the size of the senders
void mark_boundary_cells(std::span< Cell *const > local_cells, std::span< Cell *const > ghost_cells, std::function< bool(Cell const *, Cell const *)> wrap_predicate=nullptr)
Classify each local cell as interior or boundary.
bool report_violations(std::vector< std::string > const &violations, char const *context)
Print violations to stderr and return whether the list was empty.
void halo_exchange(HaloPlan const &plan, BoxGeometry const &box, unsigned data_parts, ExchangeOp op, ExchangeBuffers &bufs)
Blocking wrapper using a caller-owned buffer pool (no per-call alloc after warm-up).
std::vector< std::string > validate_halo_plan(HaloPlan const &plan, std::span< Cell *const > local_cells, std::span< Cell *const > ghost_cells)
Validate a HaloPlan for correctness.
std::optional< CollectiveSection > collective
boost::mpi::communicator comm
std::vector< NeighborComm > neighbors
std::vector< LocalComm > local
Regular decomposition cell system.
void resort(bool global, std::vector< ParticleChange > &diff) override
std::span< Cell *const > local_cells() const override
auto const & get_local_cells() const
GhostComm::HaloPlan const * halo_plan() const override
auto const & get_ghost_cells() const