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
30
namespace
GhostComm
{
31
enum class
Direction
{
Push
,
Reduce
};
// real->ghost ; ghost->real
32
enum class
Combine
{
Overwrite
,
Add
};
33
struct
ExchangeOp
{
34
Direction
direction
;
35
Combine
combine
;
36
};
37
38
struct
SendRegion
{
39
ParticleList
*
cell
;
40
Utils::Vector3d
shift
;
41
};
42
struct
NeighborComm
{
43
int
peer
;
44
std::vector<SendRegion>
send
;
45
std::vector<ParticleList *>
recv
;
// recv[k] <-> peer.send[k]
46
};
47
struct
LocalComm
{
48
ParticleList
*
src
;
49
ParticleList
*
dst
;
50
Utils::Vector3d
shift
;
51
};
52
53
enum class
CollectivePattern
{
None
,
Broadcast
,
ReduceSum
};
54
struct
CollectiveSection
{
55
CollectivePattern
pattern
;
56
std::vector<ParticleList *>
cells
;
57
};
58
59
struct
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.hpp
Vector implementation and trait types for boost qvm interoperability.
ParticleList
Utils::Bag< Particle > ParticleList
List of particles.
Definition
core/ParticleList.hpp:31
GhostComm
Definition
HaloExchange.cpp:49
GhostComm::Direction
Direction
Definition
HaloPlan.hpp:31
GhostComm::Direction::Push
@ Push
Definition
HaloPlan.hpp:31
GhostComm::Direction::Reduce
@ Reduce
Definition
HaloPlan.hpp:31
GhostComm::Combine
Combine
Definition
HaloPlan.hpp:32
GhostComm::Combine::Overwrite
@ Overwrite
Definition
HaloPlan.hpp:32
GhostComm::Combine::Add
@ Add
Definition
HaloPlan.hpp:32
GhostComm::CollectivePattern
CollectivePattern
Definition
HaloPlan.hpp:53
GhostComm::CollectivePattern::ReduceSum
@ ReduceSum
Definition
HaloPlan.hpp:53
GhostComm::CollectivePattern::None
@ None
Definition
HaloPlan.hpp:53
GhostComm::CollectivePattern::Broadcast
@ Broadcast
Definition
HaloPlan.hpp:53
Utils::Vector3d
VectorXd< 3 > Vector3d
Definition
Vector.hpp:207
GhostComm::CollectiveSection
Definition
HaloPlan.hpp:54
GhostComm::CollectiveSection::cells
std::vector< ParticleList * > cells
Definition
HaloPlan.hpp:56
GhostComm::CollectiveSection::pattern
CollectivePattern pattern
Definition
HaloPlan.hpp:55
GhostComm::ExchangeOp
Definition
HaloPlan.hpp:33
GhostComm::ExchangeOp::direction
Direction direction
Definition
HaloPlan.hpp:34
GhostComm::ExchangeOp::combine
Combine combine
Definition
HaloPlan.hpp:35
GhostComm::HaloPlan
Definition
HaloPlan.hpp:59
GhostComm::HaloPlan::symmetry_validated
bool symmetry_validated
Lazily-set flag for the once-per-plan symmetry check.
Definition
HaloPlan.hpp:75
GhostComm::HaloPlan::collective
std::optional< CollectiveSection > collective
Definition
HaloPlan.hpp:63
GhostComm::HaloPlan::comm
boost::mpi::communicator comm
Definition
HaloPlan.hpp:60
GhostComm::HaloPlan::neighbors
std::vector< NeighborComm > neighbors
Definition
HaloPlan.hpp:61
GhostComm::HaloPlan::local
std::vector< LocalComm > local
Definition
HaloPlan.hpp:62
GhostComm::LocalComm
Definition
HaloPlan.hpp:47
GhostComm::LocalComm::shift
Utils::Vector3d shift
Definition
HaloPlan.hpp:50
GhostComm::LocalComm::dst
ParticleList * dst
Definition
HaloPlan.hpp:49
GhostComm::LocalComm::src
ParticleList * src
Definition
HaloPlan.hpp:48
GhostComm::NeighborComm
Definition
HaloPlan.hpp:42
GhostComm::NeighborComm::recv
std::vector< ParticleList * > recv
Definition
HaloPlan.hpp:45
GhostComm::NeighborComm::peer
int peer
Definition
HaloPlan.hpp:43
GhostComm::NeighborComm::send
std::vector< SendRegion > send
Definition
HaloPlan.hpp:44
GhostComm::SendRegion
Definition
HaloPlan.hpp:38
GhostComm::SendRegion::cell
ParticleList * cell
Definition
HaloPlan.hpp:39
GhostComm::SendRegion::shift
Utils::Vector3d shift
Definition
HaloPlan.hpp:40
src
core
ghosts
HaloPlan.hpp
Generated on
for ESPResSo by
1.15.0