OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
loadbalancer.C
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 - 2013 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 #include "loadbalancer.h"
36 #include "domain.h"
37 #include "engngm.h"
38 #include "timer.h"
39 #include "mathfem.h"
40 #include "timestep.h"
41 #include "floatarray.h"
42 #include "classfactory.h"
43 #include "element.h"
44 #include "floatarray.h"
45 #include "intarray.h"
46 
47 #include "processcomm.h"
48 #include "datastream.h"
49 #include "communicator.h"
51 #include "nonlocalmatwtp.h"
52 
53 namespace oofem {
54  //#define __VERBOSE_PARALLEL
55  //#define LoadBalancer_debug_print
56 
58 {
59  domain = d;
60 }
61 
62 
65 {
66  IRResultType result; // Required by IR_GIVE_FIELD macro
67 
68  IntArray wtp;
70 
71  this->initializeWtp(wtp);
72 
73  return IRRT_OK;
74 }
75 
76 void
78 {
79  int size = wtp.giveSize();
80 
81  if ( size ) {
82  wtpList.clear();
83  wtpList.reserve(size);
84  for ( int iwtp: wtp ) {
85  std :: unique_ptr< WorkTransferPlugin > plugin;
86  if ( iwtp == 1 ) {
87  plugin.reset( new NonlocalMaterialWTP(this) );
88  } else {
89  OOFEM_ERROR("Unknown work transfer plugin type");
90  }
91 
92  wtpList.push_back(std :: move( plugin ));
93  }
94  }
95 }
96 
97 
98 void
100 {
101  // domain->migrateLoad(this);
102  int nproc = d->giveEngngModel()->giveNumberOfProcesses();
103  int myrank = d->giveEngngModel()->giveRank();
104 
105  OOFEM_LOG_RELEVANT("[%d] LoadBalancer: migrateLoad: migrating load\n", myrank);
106 
107  // initialize work transfer plugins before any transfer
108  for ( auto &wtp: wtpList ) {
109  wtp->init(d);
110  }
111 
112  CommunicatorBuff cb(nproc, CBT_dynamic);
113  Communicator com(d->giveEngngModel(), &cb, myrank, nproc, CommMode_Dynamic);
114 
115  // move existing dofmans and elements, that will be local on current partition,
116  // into local map
118  com.initExchange(MIGRATE_LOAD_TAG);
119 
120  // do something in between
121  d->initGlobalDofManMap();
123 
124  this->deleteRemoteDofManagers(d);
125  this->deleteRemoteElements(d);
126 
127  // receive remote data
128  com.unpackAllData(this, d, & LoadBalancer :: unpackMigratingData);
129  com.finishExchange();
130 
132 
133 
134 #ifdef LoadBalancer_debug_print
135  // debug print
136  int nnodes = d->giveNumberOfDofManagers(), nelems = d->giveNumberOfElements();
137  fprintf(stderr, "\n[%d] Nodal Table\n", myrank);
138  for ( int i = 1; i <= nnodes; i++ ) {
140  fprintf( stderr, "[%d]: %5d[%d] local\n", myrank, i, d->giveDofManager(i)->giveGlobalNumber() );
141  } else if ( d->giveDofManager(i)->giveParallelMode() == DofManager_shared ) {
142  fprintf( stderr, "[%d]: %5d[%d] shared ", myrank, i, d->giveDofManager(i)->giveGlobalNumber() );
143  for ( int j = 1; j <= d->giveDofManager(i)->givePartitionList()->giveSize(); j++ ) {
144  fprintf( stderr, "%d ", d->giveDofManager(i)->givePartitionList()->at(j) );
145  }
146 
147  fprintf(stderr, "\n");
148  }
149  }
150 
151  fprintf(stderr, "\n[%d] Element Table\n", myrank);
152  for ( int i = 1; i <= nelems; i++ ) {
153  fprintf(stderr, "%5d {", i);
154  for ( int j = 1; j <= d->giveElement(i)->giveNumberOfDofManagers(); j++ ) {
155  fprintf( stderr, "%d ", d->giveElement(i)->giveDofManager(j)->giveNumber() );
156  }
157 
158  fprintf(stderr, "}\n");
159  }
160 
161 #endif
162 
163  // migrate work transfer plugin data
164  for ( auto &wtp: wtpList ) {
165  wtp->migrate();
166  }
167 
168  // update work transfer plugin data
169  for ( auto &wtp: wtpList ) {
170  wtp->update();
171  }
172 
173 
174 #ifdef LoadBalancer_debug_print
175  // debug print
176  nnodes = d->giveNumberOfDofManagers();
177  nelems = d->giveNumberOfElements();
178  fprintf(stderr, "LB Debug print (after wtp update):\n");
179  fprintf(stderr, "\n[%d] Nodal Table\n", myrank);
180  for ( int i = 1; i <= nnodes; i++ ) {
182  fprintf( stderr, "[%d]: %5d[%d] local\n", myrank, i, d->giveDofManager(i)->giveGlobalNumber() );
183  } else if ( d->giveDofManager(i)->giveParallelMode() == DofManager_shared ) {
184  fprintf( stderr, "[%d]: %5d[%d] shared ", myrank, i, d->giveDofManager(i)->giveGlobalNumber() );
185  for ( int j = 1; j <= d->giveDofManager(i)->givePartitionList()->giveSize(); j++ ) {
186  fprintf( stderr, "%d ", d->giveDofManager(i)->givePartitionList()->at(j) );
187  }
188 
189  fprintf(stderr, "\n");
190  }
191  }
192 
193  fprintf(stderr, "\n[%d] Element Table\n", myrank);
194  for ( int i = 1; i <= nelems; i++ ) {
195  fprintf(stderr, "[%d] %5d [%d]{", myrank, i, d->giveElement(i)->giveGlobalNumber());
196  for ( int j = 1; j <= d->giveElement(i)->giveNumberOfDofManagers(); j++ ) {
197  fprintf( stderr, "%d[%d] ", d->giveElement(i)->giveDofManager(j)->giveNumber(), d->giveElement(i)->giveDofManager(j)->giveGlobalNumber());
198  }
199 
200  fprintf(stderr, "}\n");
201  }
202 
203 #endif
204 
205 
206 
207  // print some local statistics
208  int nelem = domain->giveNumberOfElements();
209  int nnode = domain->giveNumberOfDofManagers();
210  int lnode = 0, lelem = 0;
211 
212  for ( int i = 1; i <= nnode; i++ ) {
214  lnode++;
215  }
216  }
217 
218  for ( int i = 1; i <= nelem; i++ ) {
220  lelem++;
221  }
222  }
223 
224  OOFEM_LOG_RELEVANT("[%d] LB Statistics: local elem=%d local node=%d\n", myrank, lelem, lnode);
225 }
226 
227 int
229 {
230  int myrank = d->giveEngngModel()->giveRank();
231  int iproc = pc.giveRank();
232 
233  // **************************************************
234  // Pack migrating data to remote partition
235  // **************************************************
236 
237  // pack dofManagers
238  if ( iproc == myrank ) {
239  return 1; // skip local partition
240  }
241 
242  // query process communicator to use
244  // loop over dofManagers
245  int ndofman = d->giveNumberOfDofManagers();
246  for ( int idofman = 1; idofman <= ndofman; idofman++ ) {
247  DofManager *dofman = d->giveDofManager(idofman);
248  // sync data to remote partition
249  // if dofman already present on remote partition then there is no need to sync
250  //if ((this->giveDofManPartitions(idofman)->findFirstIndexOf(iproc))) {
251  if ( ( this->giveDofManPartitions(idofman)->findFirstIndexOf(iproc) ) &&
252  ( !dofman->givePartitionList()->findFirstIndexOf(iproc) ) ) {
253  pcbuff->write( dofman->giveInputRecordName() );
254  pcbuff->write( this->giveDofManState(idofman) );
255  pcbuff->write( dofman->giveGlobalNumber() );
256 
257  // pack dofman state (this is the local dofman, not available on remote)
258  /* this is a potential performance leak, sending shared dofman to a partition,
259  * in which is already shared does not require to send context (is already there)
260  * here for simplicity it is always send */
262  // send list of new partitions
263  this->giveDofManPartitions(idofman)->storeYourself(*pcbuff);
264  }
265  }
266 
267  // pack end-of-dofman-section record
268  pcbuff->write("");
269 
270  int nelem = d->giveNumberOfElements(), nsend = 0;
271 
272  for ( int ielem = 1; ielem <= nelem; ielem++ ) { // begin loop over elements
273  Element *elem = d->giveElement(ielem);
274  if ( ( elem->giveParallelMode() == Element_local ) &&
275  ( this->giveElementPartition(ielem) == iproc ) ) {
276  // pack local element (node numbers should be global ones!!!)
277  // pack type
278  pcbuff->write( elem->giveInputRecordName() );
279  // nodal numbers should be packed as global !!
281  nsend++;
282  }
283  } // end loop over elements
284 
285  // pack end-of-element-record
286  pcbuff->write("");
287 
288  OOFEM_LOG_RELEVANT("[%d] LoadBalancer:: sending %d migrating elements to %d\n", myrank, nsend, iproc);
289 
290  return 1;
291 }
292 
293 
294 int
296 {
297  // create temp space for dofManagers and elements
298  // merging should be made by domain ?
299  // maps of new dofmanagers and elements indexed by global number
300 
301  // we can put local dofManagers and elements into maps (should be done before unpacking)
302  // int nproc=this->giveEngngModel()->giveNumberOfProcesses();
303  int myrank = d->giveEngngModel()->giveRank();
304  int iproc = pc.giveRank();
305  int _mode, _globnum;
306  bool _newentry;
307  std :: string _type;
308  IntArray _partitions, local_partitions;
309  //LoadBalancer::DofManMode dmode;
310  DofManager *dofman;
312 
313  // **************************************************
314  // Unpack migrating data to remote partition
315  // **************************************************
316 
317  if ( iproc == myrank ) {
318  return 1; // skip local partition
319  }
320 
321  // query process communicator to use
323 
324  // unpack dofman data
325  do {
326  if ( !pcbuff->read(_type) ) {
327  OOFEM_ERROR("Internal error in load balancing.");
328  }
329  if ( _type.size() == 0 ) { // Empty string marks end of data
330  break;
331  }
332  pcbuff->read(_mode);
333  switch ( _mode ) {
335  // receiving new local dofManager
336  pcbuff->read(_globnum);
337  /*
338  * _newentry = false;
339  * if ( ( dofman = dtm->giveDofManager(_globnum) ) == NULL ) {
340  * // data not available -> create a new one
341  * _newentry = true;
342  * dofman = classFactory.createDofManager(_etype, 0, d);
343  * }
344  */
345  _newentry = true;
346  dofman = classFactory.createDofManager(_type.c_str(), 0, d);
347 
348  dofman->setGlobalNumber(_globnum);
349  // unpack dofman state (this is the local dofman, not available on remote)
351  // unpack list of new partitions
352  _partitions.restoreYourself(*pcbuff);
353  dofman->setPartitionList(& _partitions);
355  // add transaction if new entry allocated; otherwise existing one has been modified via returned dofman
356  if ( _newentry ) {
358  }
359 
360  //dmanMap[_globnum] = dofman;
361  break;
362 
364  // receiving new shared dofManager, that was local on sending partition
365  // should be received only once (from partition where was local)
366  pcbuff->read(_globnum);
367  /*
368  * _newentry = false;
369  * if ( ( dofman = dtm->giveDofManager(_globnum) ) == NULL ) {
370  * // data not available -> mode should be SharedUpdate
371  * _newentry = true;
372  * dofman = classFactory.createDofManager(_etype, 0, d);
373  * }
374  */
375  _newentry = true;
376  dofman = classFactory.createDofManager(_type.c_str(), 0, d);
377 
378 
379  dofman->setGlobalNumber(_globnum);
380  // unpack dofman state (this is the local dofman, not available on remote)
382  // unpack list of new partitions
383  _partitions.restoreYourself(*pcbuff);
384  dofman->setPartitionList(& _partitions);
386 #ifdef __VERBOSE_PARALLEL
387  fprintf(stderr, "[%d] received Shared new dofman [%d]\n", myrank, _globnum);
388 #endif
389  // add transaction if new entry allocated; otherwise existing one has been modified via returned dofman
390  if ( _newentry ) {
392  }
393 
394  //dmanMap[_globnum] = dofman;
395  break;
396 
397  default:
398  OOFEM_ERROR("unexpected dof manager mode (%d)", _mode);
399  }
400  } while ( 1 );
401 
402  // unpack element data
403  Element *elem;
404  int nrecv = 0;
405  do {
406  pcbuff->read(_type);
407  if ( _type.size() == 0 ) {
408  break;
409  }
410 
411  elem = classFactory.createElement(_type.c_str(), 0, d);
412  elem->restoreContext(*pcbuff, CM_Definition | CM_State);
413  elem->initForNewStep();
415  nrecv++;
416  //recvElemList.push_back(elem);
417  } while ( 1 );
418 
419  OOFEM_LOG_RELEVANT("[%d] LoadBalancer:: receiving %d migrating elements from %d\n", myrank, nrecv, iproc);
420 
421  return 1;
422 }
423 
424 
425 /* will delete those dofmanagers, that were sent to remote partition and are locally owned here
426  * so they are no longer necessary (those with state equal to DM_Remote and DM_SharedMerge)
427  * This will update domain DofManager list as well as global dmanMap and physically deletes the remote dofManager
428  */
429 void
431 {
432  int ndofman = d->giveNumberOfDofManagers();
433  //LoadBalancer* lb = this->giveLoadBalancer();
435  DofManager *dman;
436  int myrank = d->giveEngngModel()->giveRank();
438  // loop over local nodes
439 
440  for ( int i = 1; i <= ndofman; i++ ) {
441  dmode = this->giveDofManState(i);
442  if ( dmode == LoadBalancer :: DM_Remote ) {
443  // positive candidate found
445  // dmanMap.erase (d->giveDofManager (i)->giveGlobalNumber());
446  //dman = dofManagerList->unlink (i);
447  //delete dman;
448  } else if ( dmode == LoadBalancer :: DM_NULL ) {
449  // positive candidate found; we delete all null dof managers
450  // they will be created by nonlocalmatwtp if necessary.
451  // potentially, they can be reused, but this will make the code too complex
453  } else if ( dmode == LoadBalancer :: DM_Shared ) {
454  dman = d->giveDofManager(i);
455  dman->setPartitionList( this->giveDofManPartitions(i) );
457  if ( !dman->givePartitionList()->findFirstIndexOf(myrank) ) {
459  //dmanMap.erase (this->giveDofManager (i)->giveGlobalNumber());
460  //dman = dofManagerList->unlink (i);
461  //delete dman;
462  }
463  } else if ( dmode == LoadBalancer :: DM_Local ) {
464  IntArray _empty(0);
465  dman = d->giveDofManager(i);
466  dman->setPartitionList(& _empty);
468  } else {
469  OOFEM_ERROR("unknown dmode encountered");
470  }
471  }
472 }
473 
474 /* will delete those elements, that were sent to remote partition and are locally owned here
475  * so they are no longer necessary (those with state equal to DM_Remote and DM_SharedMerge)
476  * This will update domain DofManager list as well as global dmanMap and physically deletes the remote dofManager
477  */
478 void
480 {
481  int nelem = d->giveNumberOfElements();
482  int myrank = d->giveEngngModel()->giveRank();
483  //LoadBalancer* lb = this->giveLoadBalancer();
485  //Element* elem;
486 
487  // loop over local nodes
488 
489  for ( int i = 1; i <= nelem; i++ ) {
490  if ( this->giveElementPartition(i) != myrank ) {
491  // positive candidate found
492  // this->deleteElement (i); // delete and set entry to NULL
494  //elem = elementList->unlink (i);
495  //dmanMap.erase (elem->giveGlobalNumber());
496  //delete (elem);
497  } else if ( d->giveElement(i)->giveParallelMode() != Element_local ) {
499  }
500  }
501 }
502 
503 
504 void
506 {
507  EngngModel *emodel = domain->giveEngngModel();
508  int nelem, nnode;
509  int lelem = 0, lnode = 0;
510  int myrank = emodel->giveRank();
511 
512  nelem = domain->giveNumberOfElements();
513  nnode = domain->giveNumberOfDofManagers();
514 
515  for ( int i = 1; i <= nnode; i++ ) {
517  lnode++;
518  }
519  }
520 
521  for ( int i = 1; i <= nelem; i++ ) {
523  lelem++;
524  }
525  }
526 
527  double mySolutionWTime = emodel->giveTimer()->getWtime(EngngModelTimer :: EMTT_AnalysisTimer);
528  double mySolutionUTime = emodel->giveTimer()->getUtime(EngngModelTimer :: EMTT_AnalysisTimer);
529 
530  OOFEM_LOG_RELEVANT("[%d] LB Statistics: wt=%.1f ut=%.1f nelem=%d nnode=%d\n", myrank,
531  mySolutionWTime, mySolutionUTime, lelem, lnode);
532 }
533 
534 
537 {
538  IRResultType result; // Required by IR_GIVE_FIELD macro
539  int nproc = emodel->giveNumberOfProcesses();
540  int nodeWeightMode = 0;
541 
542  nodeWeights.resize(nproc);
543  for ( int i = 0; i < nproc; i++ ) {
544  nodeWeights(i) = 1.0 / nproc;
545  }
546 
548  if ( nodeWeightMode == 0 ) { // default, dynamic weights
549  staticNodeWeightFlag = false;
550  } else if ( nodeWeightMode == 1 ) { // equal weights for all nodes
551  staticNodeWeightFlag = true;
552  } else if ( nodeWeightMode == 2 ) { // user defined static weights
554  if ( nodeWeights.giveSize() != nproc ) {
555  OOFEM_ERROR("nodeWeights size not equal to number of processors");
556  }
557 
558  staticNodeWeightFlag = true;
559  } else {
560  OOFEM_ERROR("unsupported node weight type, using default value");
561  staticNodeWeightFlag = false;
562  }
563 
564  return IRRT_OK;
565 }
566 
567 
568 /*
569  * void
570  * LoadBalancer::migrateLoad () {}
571  *
572  * IRResultType
573  * LoadBalancer::initializeFrom (InputRecord* ir) {
574  *
575  * return IRRT_OK;
576  * }
577  *
578  * IRResultType
579  * LoadBalancerMonitor::initializeFrom (InputRecord* ir) {return IRRT_OK;}
580  */
581 
582 
583 
585  lb = _lb;
586 }
588 } // end namespace oofem
int addDofManTransaction(DomainTransactionType, int, DofManager *)
contextIOResultType storeYourself(DataStream &stream) const
Stores array to output stream.
Definition: intarray.C:289
DofManMode
Describes the state of dofmanager after load balancing on the local partition.
Definition: loadbalancer.h:115
Class and object Domain.
Definition: domain.h:115
int addElementTransaction(DomainTransactionType, int, Element *)
#define _IFT_LoadBalancer_wtp
Definition: loadbalancer.h:47
int giveGlobalNumber() const
Definition: dofmanager.h:501
LoadBalancer(Domain *d)
Definition: loadbalancer.C:57
int giveNumberOfDofManagers() const
Returns number of dof managers in domain.
Definition: domain.h:432
int unpackMigratingData(Domain *, ProcessCommunicator &pc)
Definition: loadbalancer.C:295
int packAllData(T *ptr, int(T::*packFunc)(ProcessCommunicator &))
Pack all problemCommunicators data to their send buffers.
Definition: communicator.h:223
Shared dofman that remains shared.
Definition: loadbalancer.h:118
int giveGlobalNumber() const
Definition: element.h:1059
#define CM_State
Definition: contextmode.h:46
int commitTransactions(DomainTransactionManager *tm)
Commits transactions recorded in transaction manager.
Definition: domain.C:1619
void initGlobalDofManMap(bool forceinit=false)
Initializes global dof man map according to domain dofman list.
Definition: domain.C:1735
virtual const char * giveInputRecordName() const =0
const IntArray * givePartitionList()
Returns partition list of receiver.
Definition: dofmanager.h:519
EngngModel * giveEngngModel()
Returns engineering model to which receiver is associated.
Definition: domain.C:433
Undefined (undetermined) state, if assigned means internal error.
Definition: loadbalancer.h:116
virtual void initForNewStep()
Initializes receivers state to new time step.
Definition: element.C:846
Abstract base class for all finite elements.
Definition: element.h:145
DofManager * createDofManager(const char *name, int num, Domain *domain)
Creates new instance of Dof manager corresponding to given keyword.
Definition: classfactory.C:169
Base class for dof managers.
Definition: dofmanager.h:113
int giveNumberOfProcesses() const
Returns the number of collaborating processes.
Definition: engngm.h:1060
int giveNumberOfElements() const
Returns number of elements in domain.
Definition: domain.h:434
The ProcessCommunicator and corresponding buffers (represented by this class) are separated in order ...
Definition: processcomm.h:64
int giveRank()
Returns corresponding rank of associated partition.
Definition: processcomm.h:207
#define _IFT_LoadBalancerMonitor_initialnodeweights
Definition: loadbalancer.h:49
void migrateLoad(Domain *d)
Definition: loadbalancer.C:99
Class implementing an array of integers.
Definition: intarray.h:61
int & at(int i)
Coefficient access function.
Definition: intarray.h:103
virtual int giveNumberOfDofManagers() const
Definition: element.h:656
void setParallelMode(dofManagerParallelMode _mode)
Sets parallel mode of receiver.
Definition: dofmanager.h:514
void initializeWtp(IntArray &wtp)
Definition: loadbalancer.C:77
Local dofman that became remote (became local on remote partition).
Definition: loadbalancer.h:119
#define OOFEM_LOG_RELEVANT(...)
Definition: logger.h:126
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
Definition: element.C:970
void deleteRemoteElements(Domain *)
Definition: loadbalancer.C:479
Class representing domain transaction manager.
DomainTransactionManager * giveTransactionManager()
Returns domain transaction manager.
Definition: domain.C:1606
Element * giveElement(int n)
Service for accessing particular domain fe element.
Definition: domain.C:160
virtual int write(const int *data, int count)
Writes count integer values from array pointed by data.
Definition: processcomm.h:83
#define _IFT_LoadBalancerMonitor_nodeWeightMode
Definition: loadbalancer.h:48
#define OOFEM_ERROR(...)
Definition: error.h:61
double getWtime(EngngModelTimerType t)
Returns elapsed wall clock time.
Definition: timer.C:159
Local dofman that remains local.
Definition: loadbalancer.h:117
ProcessCommunicatorBuff * giveProcessCommunicatorBuff()
Returns communication buffer.
Definition: processcomm.h:210
std::vector< std::unique_ptr< WorkTransferPlugin > > wtpList
List of work transfer plugins.
Definition: loadbalancer.h:216
Class representing process communicator for engineering model.
Definition: processcomm.h:176
contextIOResultType restoreYourself(DataStream &stream)
Restores array from image on stream.
Definition: intarray.C:305
Abstract base class representing general load balancer.
Definition: loadbalancer.h:108
virtual IntArray * giveDofManPartitions(int idofman)=0
Returns the partition list of given dofmanager after load balancing.
(Dynamic) In this case the communication pattern and the amount of data sent between nodes is not kno...
int packMigratingData(Domain *, ProcessCommunicator &pc)
Definition: loadbalancer.C:228
void setPartitionList(const IntArray *_p)
Sets receiver&#39;s partition list.
Definition: dofmanager.h:521
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
Definition: dofmanager.C:543
elementParallelMode giveParallelMode() const
Return elementParallelMode of receiver.
Definition: element.h:1069
void deleteRemoteDofManagers(Domain *)
Definition: loadbalancer.C:430
Element is local, there are no contributions from other domains to this element.
Definition: element.h:101
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
Class representing communicator.
Definition: communicator.h:105
Class representing the general Input Record.
Definition: inputrecord.h:101
#define CM_DefinitionGlobal
Definition: contextmode.h:48
virtual int giveElementPartition(int ielem)=0
Returns the new partition number assigned to local element after LB.
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
Definition: element.C:885
int giveRank() const
Returns domain rank in a group of collaborating processes (0..groupSize-1)
Definition: engngm.h:1058
ClassFactory & classFactory
Definition: classfactory.C:59
#define CM_Definition
Definition: contextmode.h:47
virtual int read(int *data, int count)
Reads count integer values into array pointed by data.
Definition: processcomm.h:91
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: loadbalancer.C:536
The Communicator and corresponding buffers (represented by this class) are separated in order to allo...
Definition: communicator.h:60
Abstract base class representing the "problem" under consideration.
Definition: engngm.h:181
#define IR_GIVE_OPTIONAL_FIELD(__ir, __value, __id)
Macro facilitating the use of input record reading methods.
Definition: inputrecord.h:78
int giveSize() const
Definition: intarray.h:203
the oofem namespace is to define a context or scope in which all oofem names are defined.
DofManager * giveDofManager(int i) const
Definition: element.C:514
int giveNumber() const
Definition: femcmpnn.h:107
DofManager * giveDofManager(int n)
Service for accessing particular domain dof manager.
Definition: domain.C:314
Element * createElement(const char *name, int num, Domain *domain)
Creates new instance of element corresponding to given keyword.
Definition: classfactory.C:159
virtual DofManMode giveDofManState(int idofman)=0
Returns the label of dofmanager after load balancing.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: loadbalancer.C:64
DofManager is local, there are no contribution from other domains to this DofManager.
Definition: dofmanager.h:81
double getUtime(EngngModelTimerType t)
Returns total user time elapsed.
Definition: timer.C:154
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
Definition: dofmanager.C:611
#define CM_UnknownDictState
Definition: contextmode.h:49
void setGlobalNumber(int newNumber)
Sets receiver global number.
Definition: dofmanager.h:507
Class implements Work Transfer Plugin that introduces extension to efficiently handle nonlocal depend...
void initGlobalElementMap(bool forceinit=false)
Definition: domain.C:1756
EngngModelTimer * giveTimer()
Returns reference to receiver timer (EngngModelTimer).
Definition: engngm.h:760
DofManager is shared by neighboring partitions, it is necessary to sum contributions from all contrib...
Definition: dofmanager.h:82
dofManagerParallelMode giveParallelMode() const
Return dofManagerParallelMode of receiver.
Definition: dofmanager.h:512
virtual void printStatistics() const
Print receiver statistics.
Definition: loadbalancer.C:505
#define MIGRATE_LOAD_TAG
Definition: loadbalancer.h:59
int findFirstIndexOf(int value) const
Finds index of first occurrence of given value in array.
Definition: intarray.C:331

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:29 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011