24#ifndef SUPER_COMMUNICATOR_H
25#define SUPER_COMMUNICATOR_H
52template <
typename T,
typename SUPER>
57#ifdef PARALLEL_MODE_MPI
59 MPI_Comm _neighborhoodComm;
60 MPI_Comm _communicatorComm;
64 std::vector<std::unique_ptr<BlockCommunicationNeighborhood<T,SUPER::d>>> _blockNeighborhoods;
66 std::vector<std::unique_ptr<BlockCommunicator>> _blockCommunicators;
69 std::vector<std::type_index> _fieldsRequested;
71 std::set<int> _remoteCuboidNeighborhood;
74 bool _enabled =
false;
87 template <
typename FIELD>
89 if (std::find(_fieldsRequested.begin(), _fieldsRequested.end(),
typeid(FIELD)) == _fieldsRequested.end()) {
90 _fieldsRequested.emplace_back(
typeid(FIELD));
91 for (
auto& neighborhood : _blockNeighborhoods) {
92 neighborhood->template requestField<FIELD>();
98 template <
typename... FIELDS>
100 (requestField<FIELDS>(), ...);
124template <
typename SUPER>
Smart pointer for managing the various ways of passing functors around.
Communication-free negotation of unique tags for inter-cuboid communication.
Generic communicator for overlaps between blocks of SUPER.
void communicate()
Perform communication.
SuperCommunicator(SUPER &super)
void requestFields()
Convenience method for requesting multiple FIELDS in one call.
void requestOverlap(int width)
Request all cells in overlap of width for communication.
const std::set< int > & getRemoteCuboids() const
Returns set of non-local neighborhood cuboid indices.
void clearRequestedCells()
Remove all requested cells.
void requestField()
Request FIELD for communication.
void exchangeRequests()
Exchange requests between processes.
void requestCell(LatticeR< SUPER::d+1 > latticeR)
Request single cell in the padding area for communication.
Wrapper functions that simplify the use of MPI.
Top level namespace for all of OpenLB.
SuperCommunicator(SUPER &) -> SuperCommunicator< typename SUPER::value_t, SUPER >
std::conditional_t< D==2, SuperIndicatorF2D< T >, SuperIndicatorF3D< T > > SuperIndicatorF