ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
HaloPlan.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2010-2026 The ESPResSo project
3 * Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
4 * Max-Planck-Institute for Polymer Research, Theory Group
5 *
6 * This file is part of ESPResSo.
7 *
8 * ESPResSo is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * ESPResSo is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22#pragma once
23
24#include "ParticleList.hpp"
25#include <boost/mpi/communicator.hpp>
26#include <optional>
27#include <utils/Vector.hpp>
28#include <vector>
29
30namespace GhostComm {
31enum class Direction { Push, Reduce }; // real->ghost ; ghost->real
32enum class Combine { Overwrite, Add };
37
43 int peer;
44 std::vector<SendRegion> send;
45 std::vector<ParticleList *> recv; // recv[k] <-> peer.send[k]
46};
52
56 std::vector<ParticleList *> cells;
57};
58
59struct HaloPlan {
60 boost::mpi::communicator comm;
61 std::vector<NeighborComm> neighbors;
62 std::vector<LocalComm> local;
63 std::optional<CollectiveSection> collective;
64 /**
65 * @brief Lazily-set flag for the once-per-plan symmetry check.
66 *
67 * Set to true on the first call to halo_exchange_start for this plan
68 * (see HaloExchange.cpp, ESPRESSO_ADDITIONAL_CHECKS guard). The plan
69 * object is rebuilt on every decomposition change, so the flag naturally
70 * rearms: a new plan always starts with symmetry_validated = false.
71 *
72 * mutable so halo_exchange_start can set it through a const HaloPlan&
73 * without requiring a non-const overload.
74 */
75 mutable bool symmetry_validated = false;
76};
77} // namespace GhostComm
Vector implementation and trait types for boost qvm interoperability.
std::vector< ParticleList * > cells
Definition HaloPlan.hpp:56
CollectivePattern pattern
Definition HaloPlan.hpp:55
bool symmetry_validated
Lazily-set flag for the once-per-plan symmetry check.
Definition HaloPlan.hpp:75
std::optional< CollectiveSection > collective
Definition HaloPlan.hpp:63
boost::mpi::communicator comm
Definition HaloPlan.hpp:60
std::vector< NeighborComm > neighbors
Definition HaloPlan.hpp:61
std::vector< LocalComm > local
Definition HaloPlan.hpp:62
Utils::Vector3d shift
Definition HaloPlan.hpp:50
ParticleList * dst
Definition HaloPlan.hpp:49
ParticleList * src
Definition HaloPlan.hpp:48
std::vector< ParticleList * > recv
Definition HaloPlan.hpp:45
std::vector< SendRegion > send
Definition HaloPlan.hpp:44
ParticleList * cell
Definition HaloPlan.hpp:39
Utils::Vector3d shift
Definition HaloPlan.hpp:40