Loading...
Searching...
No Matches
DataLBInterface.hpp
1/*---------------------------------------------------------------------------*\
2 *
3 * bitpit
4 *
5 * Copyright (C) 2015-2021 OPTIMAD engineering Srl
6 *
7 * -------------------------------------------------------------------------
8 * License
9 * This file is part of bitpit.
10 *
11 * bitpit is free software: you can redistribute it and/or modify it
12 * under the terms of the GNU Lesser General Public License v3 (LGPL)
13 * as published by the Free Software Foundation.
14 *
15 * bitpit is distributed in the hope that it will be useful, but WITHOUT
16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
18 * License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with bitpit. If not, see <http://www.gnu.org/licenses/>.
22 *
23\*---------------------------------------------------------------------------*/
24
25// Communications Class for Load Balancing
26
27#ifndef __BITPIT_PABLO_DATA_LB_INTERFACE_HPP__
28#define __BITPIT_PABLO_DATA_LB_INTERFACE_HPP__
29
30#include <stdint.h>
31
32#include "bitpit_common.hpp"
33
34namespace bitpit {
35
69template <class Impl>
71public:
72 size_t size(const uint32_t e) const;
73 size_t fixedSize() const;
74 void move(const uint32_t from, const uint32_t to);
75
76 template<class Buffer>
77 void gather(Buffer & buff,const uint32_t e);
78
79 template<class Buffer>
80 void scatter(Buffer & buff,const uint32_t e);
81
82 void assign(uint32_t stride, uint32_t length);
83 void resize(uint32_t newSize);
84 void resizeGhost(uint32_t newSize);
85 void shrink();
86
87protected:
89
90private:
91 //BartonHackman trick
92 Impl& getImpl();
93 const Impl& getImpl() const;
94
95};
96
105class DummyDataLBImpl : public bitpit::DataLBInterface<DummyDataLBImpl> {
106public:
107 size_t size(const uint32_t e) const;
108 size_t fixedSize() const;
109 void move(const uint32_t from, const uint32_t to);
110
111 template<class Buffer>
112 void gather(Buffer & buff,const uint32_t e);
113
114 template<class Buffer>
115 void scatter(Buffer & buff,const uint32_t e);
116
117 void assign(uint32_t stride, uint32_t length);
118 void resize(uint32_t newSize);
119 void resizeGhost(uint32_t newSize);
120 void shrink();
121
122};
123
124}
125
126#include "DataLBInterface.tpp"
127
128#endif /* __BITPIT_PABLO_DATA_LB_INTERFACE_HPP__ */
Base class for data communications.
void gather(Buffer &buff, const uint32_t e)
void assign(uint32_t stride, uint32_t length)
void move(const uint32_t from, const uint32_t to)
void scatter(Buffer &buff, const uint32_t e)
size_t size(const uint32_t e) const
void resizeGhost(uint32_t newSize)
void resize(uint32_t newSize)
Dummy class for data communications.
--- layout: doxygen_footer ---