11#include "DomainDecompMPIBase.h"
61 std::vector<int> getNeighbourRanks()
override {
62 throw std::runtime_error(
"GeneralDomainDecomposition::getNeighbourRanks() not yet implemented");
66 std::vector<int> getNeighbourRanksFullShell()
override {
67 throw std::runtime_error(
"GeneralDomainDecomposition::getNeighbourRanksFullShell() not yet implemented");
72 unsigned int stageNumber)
override {
73 throw std::runtime_error(
"GeneralDomainDecomposition::prepareNonBlockingStage() not yet implemented");
78 unsigned int stageNumber)
override {
79 throw std::runtime_error(
"GeneralDomainDecomposition::prepareNonBlockingStage() not yet implemented");
84 double etime)
override {
85 throw std::runtime_error(
86 "GeneralDomainDecomposition::queryBalanceAndExchangeNonBlocking() not yet implemented");
89 std::vector<CommunicationPartner> getNeighboursFromHaloRegion(
Domain* domain,
const HaloRegion& haloRegion,
90 double cutoff)
override {
91 throw std::runtime_error(
"GeneralDomainDecomposition::getNeighboursFromHaloRegion() not yet implemented");
109 static std::array<size_t, 3> getOptimalGrid(
const std::array<double, 3>& domainLength,
int numProcs);
118 static std::array<size_t, 3> getCoordsFromRank(
const std::array<size_t, 3>& gridSize,
int rank);
127 static std::tuple<std::array<double, 3>, std::array<double, 3>> initializeRegularGrid(
128 const std::array<double, 3>& domainLength,
const std::array<size_t, 3>& gridSize,
129 const std::array<size_t, 3>& gridCoords);
141 static bool queryRebalancing(
size_t step,
size_t updateFrequency,
size_t initPhase,
size_t initUpdateFrequency,
142 double lastTraversalTime);
160 std::array<double, 3> newMax);
169 std::pair<std::array<double, 3>, std::array<double, 3>> latchToGridSize(std::array<double, 3> boxMin,
170 std::array<double, 3> boxMax) {
171 for (
size_t ind = 0; ind < 3; ++ind) {
172 double currentGridSize = (*_gridSize)[ind];
174 boxMin[ind] = std::round(boxMin[ind] / currentGridSize) * currentGridSize;
176 if (boxMax[ind] != _domainLength[ind]) {
177 boxMax[ind] = std::round(boxMax[ind] / currentGridSize) * currentGridSize;
180 return {boxMin, boxMax};
184 std::array<double, 3> _boxMin;
185 std::array<double, 3> _boxMax;
187 std::array<double, 3> _domainLength;
188 double _interactionLength;
191 size_t _rebuildFrequency{10000};
193 size_t _initPhase{0};
194 size_t _initFrequency{500};
200 std::optional<std::array<double, 3>> _gridSize{};
205 bool _forceLatchingToLinkedCellsGrid{
false};
207 std::unique_ptr<LoadBalancer> _loadBalancer{
nullptr};
209 friend class GeneralDomainDecompositionTest;
Definition: DomainDecompMPIBase.h:30
This class is used to read in the phasespace and to handle macroscopic values.
Definition: Domain.h:47
Definition: GeneralDomainDecomposition.h:17
void readXML(XMLfileUnits &xmlconfig) override
Read in XML configuration for DomainDecomposition and all its included objects.
Definition: GeneralDomainDecomposition.cpp:241
void finishNonBlockingStage(bool forceRebalancing, ParticleContainer *moleculeContainer, Domain *domain, unsigned int stageNumber) override
Definition: GeneralDomainDecomposition.h:77
double getBoundingBoxMin(int dimension, Domain *domain) override
get the minimum of the bounding box of this process' domain in the given dimension (0,...
Definition: GeneralDomainDecomposition.cpp:59
bool queryBalanceAndExchangeNonBlocking(bool forceRebalancing, ParticleContainer *moleculeContainer, Domain *domain, double etime) override
Checks whether the balance and exchange step can be performed non-blocking.
Definition: GeneralDomainDecomposition.h:83
GeneralDomainDecomposition(double interactionLength, Domain *domain, bool forceGrid)
Definition: GeneralDomainDecomposition.cpp:15
double getBoundingBoxMax(int dimension, Domain *domain) override
get the maximum of the bounding box of this process' domain in the given dimension (0,...
Definition: GeneralDomainDecomposition.cpp:63
void balanceAndExchange(double lastTraversalTime, bool forceRebalancing, ParticleContainer *moleculeContainer, Domain *domain) override
balance the load (and optimize communication) and exchange boundary particles
Definition: GeneralDomainDecomposition.cpp:70
void prepareNonBlockingStage(bool forceRebalancing, ParticleContainer *moleculeContainer, Domain *domain, unsigned int stageNumber) override
Definition: GeneralDomainDecomposition.h:71
This Interface is used to get access to particles and pairs of particles.
Definition: ParticleContainer.h:69
XML file with unit attributes abstraction.
Definition: xmlfileUnits.h:25
Definition: HaloRegion.h:10