OpenLB 1.7
Loading...
Searching...
No Matches
blockCommunicator.h
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2021 Adrian Kummerlaender, Mathias J. Krause
4 * E-mail contact: info@openlb.net
5 * The most recent release of OpenLB can be downloaded at
6 * <http://www.openlb.net/>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program 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
19 * License along with this program; if not, write to the Free
20 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
22*/
23
24#ifndef BLOCK_COMMUNICATOR_H
25#define BLOCK_COMMUNICATOR_H
26
27#include <map>
28#include <set>
29#include <typeindex>
30
32
35
36namespace olb {
37
38template <typename T>
39class SuperCommunicationTagCoordinator;
40
42
48 virtual ~BlockCommunicator() { };
49
50#ifdef PARALLEL_MODE_MPI
51 virtual void receive() = 0;
52 virtual void send() = 0;
53 virtual void unpack() = 0;
54 virtual void wait() = 0;
55#else
56 virtual void copy() = 0;
57#endif
58
59};
60
61template <typename BLOCK>
63private:
64 const int _iC;
65#ifdef PARALLEL_MODE_MPI
66 MPI_Comm _mpiCommunicator;
67#endif
68
69#ifdef PARALLEL_MODE_MPI
70 class SendTask;
71 class RecvTask;
72
73 std::vector<SendTask> _sendTasks;
74 std::vector<RecvTask> _recvTasks;
75#else
76 class CopyTask;
77
78 std::vector<CopyTask> _copyTasks;
79#endif
80
81public:
82 template <typename T, typename SUPER>
83 ConcreteBlockCommunicator(SUPER& super,
84 LoadBalancer<T>& loadBalancer,
85#ifdef PARALLEL_MODE_MPI
87 MPI_Comm comm,
88#endif
89 int iC,
91
92#ifdef PARALLEL_MODE_MPI
93 void receive() override;
94 void send() override;
95 void unpack() override;
96 void wait() override;
97#else
98 void copy() override;
99#endif
100
101};
102
103
104}
105
106#endif
Configurable overlap communication neighborhood of a block.
Wrapper for a non-blocking block propagation receive request.
Wrapper for a non-blocking block propagation send request.
Base class for all LoadBalancer.
Communication-free negotation of unique tags for inter-cuboid communication.
Top level namespace for all of OpenLB.
Generic communicator for the overlap neighborhood of a block.
virtual void send()=0
virtual void unpack()=0
virtual void wait()=0
virtual void receive()=0