OOFEM 3.0
Loading...
Searching...
No Matches
loadbalancer.h
Go to the documentation of this file.
1/*
2 *
3 * ##### ##### ###### ###### ### ###
4 * ## ## ## ## ## ## ## ### ##
5 * ## ## ## ## #### #### ## # ##
6 * ## ## ## ## ## ## ## ##
7 * ## ## ## ## ## ## ## ##
8 * ##### ##### ## ###### ## ##
9 *
10 *
11 * OOFEM : Object Oriented Finite Element Code
12 *
13 * Copyright (C) 1993 - 2025 Borek Patzak
14 *
15 *
16 *
17 * Czech Technical University, Faculty of Civil Engineering,
18 * Department of Structural Mechanics, 166 29 Prague, Czech Republic
19 *
20 * This library is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU Lesser General Public
22 * License as published by the Free Software Foundation; either
23 * version 2.1 of the License, or (at your option) any later version.
24 *
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28 * Lesser General Public License for more details.
29 *
30 * You should have received a copy of the GNU Lesser General Public
31 * License along with this library; if not, write to the Free Software
32 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
33 */
34
35#ifndef loadbalancer_h
36#define loadbalancer_h
37
38#include "oofemenv.h"
39#include "inputrecord.h"
40#include "floatarray.h"
41
42#include <vector>
43#include <memory>
44
46
47#define _IFT_LoadBalancer_wtp "wtp"
48#define _IFT_LoadBalancerMonitor_nodeWeightMode "nodeweightmode"
49#define _IFT_LoadBalancerMonitor_initialnodeweights "nw"
51
52namespace oofem {
53class Domain;
54class EngngModel;
55class ProcessCommunicator;
56class TimeStep;
57class IntArray;
58
59 #define MIGRATE_LOAD_TAG 9998
60
69{
70protected:
74public:
76
79
81 virtual void initializeFrom(InputRecord &ir);
82
85
90
92 virtual const char *giveClassName() const = 0;
93};
94
95
109{
110public:
121protected:
123
124public:
125
126 LoadBalancer(Domain * d);
127 virtual ~LoadBalancer() { }
128#ifdef _MSC_VER
129 LoadBalancer(LoadBalancer&& src) {domain = src.domain;}
130#endif
131
132
133
136 virtual void calculateLoadTransfer() = 0;
138
141 void migrateLoad(Domain *d);
143
145 virtual void printStatistics() const;
146
149
150 virtual DofManMode giveDofManState(int idofman) = 0;
151
153 virtual IntArray *giveDofManPartitions(int idofman) = 0;
154
156 virtual int giveElementPartition(int ielem) = 0;
157
159
160 virtual void initializeFrom(InputRecord &ir);
161
163 Domain *giveDomain() { return domain; }
165 virtual void setDomain(Domain *d) { this->domain = d; }
167 virtual const char *giveClassName() const = 0;
168
169protected:
170
175 void initializeWtp(IntArray &wtp);
176
177public:
178
180 {
181protected:
183public:
186
193 virtual void init(Domain *d) = 0;
208 virtual void migrate() = 0;
214 virtual void update() = 0;
215 };
216
217protected:
219 std :: vector< std :: unique_ptr< WorkTransferPlugin > >wtpList;
220};
221
222/*
223class OOFEM_EXPORT LoadBalancerElementInterface : public Interface
224{
225public:
226 LoadBalancerElementInterface() { }
227
228 virtual double predictRelativeComputationalCost();
229};
230*/
231} // end namespace oofem
232
233#endif // loadbalancer_h
LoadBalancerMonitor(EngngModel *em)
virtual const char * giveClassName() const =0
Returns class name of the receiver.
const FloatArray & giveProcessorWeights()
Returns processor weights; the larger weight means more powerful node, sum of weights should equal to...
virtual LoadBalancerDecisionType decide(TimeStep *)=0
Returns flag indicating whether rebalancing is necessary; should update node weights as well.
virtual void init(Domain *d)=0
virtual void calculateLoadTransfer()=0
virtual IntArray * giveDofManPartitions(int idofman)=0
Returns the partition list of given dofmanager after load balancing.
virtual void printStatistics() const
Print receiver statistics.
int packMigratingData(Domain *, ProcessCommunicator &pc)
Domain * giveDomain()
Returns reference to its domain.
virtual void setDomain(Domain *d)
sets associated Domain
virtual const char * giveClassName() const =0
Returns class name of the receiver.
virtual void initializeFrom(InputRecord &ir)
Initializes receiver according to object description stored in input record.
void initializeWtp(IntArray &wtp)
virtual DofManMode giveDofManState(int idofman)=0
Returns the label of dofmanager after load balancing.
virtual int giveElementPartition(int ielem)=0
Returns the new partition number assigned to local element after LB.
int unpackMigratingData(Domain *, ProcessCommunicator &pc)
LoadBalancer(Domain *d)
void deleteRemoteDofManagers(Domain *)
void migrateLoad(Domain *d)
@ DM_Shared
Shared dofman that remains shared.
@ DM_Local
Local dofman that remains local.
@ DM_NULL
Undefined (undetermined) state, if assigned means internal error.
@ DM_Remote
Local dofman that became remote (became local on remote partition).
std ::vector< std ::unique_ptr< WorkTransferPlugin > > wtpList
List of work transfer plugins.
void deleteRemoteElements(Domain *)
#define OOFEM_EXPORT
Definition oofemcfg.h:7

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011