OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
oofem::LoadBalancer Class Referenceabstract

Abstract base class representing general load balancer. More...

#include <loadbalancer.h>

+ Inheritance diagram for oofem::LoadBalancer:
+ Collaboration diagram for oofem::LoadBalancer:

Classes

class  WorkTransferPlugin
 

Public Types

enum  DofManMode { DM_NULL, DM_Local, DM_Shared, DM_Remote }
 Describes the state of dofmanager after load balancing on the local partition. More...
 

Public Member Functions

 LoadBalancer (Domain *d)
 
virtual ~LoadBalancer ()
 
virtual void printStatistics () const
 Print receiver statistics. More...
 
virtual IRResultType initializeFrom (InputRecord *ir)
 Initializes receiver according to object description stored in input record. More...
 
DomaingiveDomain ()
 Returns reference to its domain. More...
 
virtual void setDomain (Domain *d)
 sets associated Domain More...
 
virtual const char * giveClassName () const =0
 Returns class name of the receiver. More...
 
Work transfer calculation methods
virtual void calculateLoadTransfer ()=0
 
Work migration methods
void migrateLoad (Domain *d)
 
Query methods after work transfer calculation
virtual DofManMode giveDofManState (int idofman)=0
 Returns the label of dofmanager after load balancing. More...
 
virtual IntArraygiveDofManPartitions (int idofman)=0
 Returns the partition list of given dofmanager after load balancing. More...
 
virtual int giveElementPartition (int ielem)=0
 Returns the new partition number assigned to local element after LB. More...
 

Protected Member Functions

int packMigratingData (Domain *, ProcessCommunicator &pc)
 
int unpackMigratingData (Domain *, ProcessCommunicator &pc)
 
void deleteRemoteDofManagers (Domain *)
 
void deleteRemoteElements (Domain *)
 
void initializeWtp (IntArray &wtp)
 

Protected Attributes

Domaindomain
 
std::vector< std::unique_ptr< WorkTransferPlugin > > wtpList
 List of work transfer plugins. More...
 

Detailed Description

Abstract base class representing general load balancer.

The task of load balancer is to recover load balance when running in parallel. This is achieved by moving work from busy nodes to other nodes to achieve an equal distribution of work. In general load balancer should repartition the problem domain, taking into account several criteria:

  • It should take into account different computational requirement of different elements
  • The new partitioning should minimize the cut (to minimize the communication)
  • The new partitioning should minimize data movement (the cost of repartitioning) by preserving the locality as much as possible. In other words the new and existing partitioning should be "similar".

Definition at line 108 of file loadbalancer.h.

Member Enumeration Documentation

Describes the state of dofmanager after load balancing on the local partition.

Enumerator
DM_NULL 

Undefined (undetermined) state, if assigned means internal error.

DM_Local 

Local dofman that remains local.

DM_Shared 

Shared dofman that remains shared.

DM_Remote 

Local dofman that became remote (became local on remote partition).

Definition at line 115 of file loadbalancer.h.

Constructor & Destructor Documentation

oofem::LoadBalancer::LoadBalancer ( Domain d)

Definition at line 57 of file loadbalancer.C.

References domain.

virtual oofem::LoadBalancer::~LoadBalancer ( )
inlinevirtual

Definition at line 127 of file loadbalancer.h.

Member Function Documentation

virtual void oofem::LoadBalancer::calculateLoadTransfer ( )
pure virtual
virtual const char* oofem::LoadBalancer::giveClassName ( ) const
pure virtual

Returns class name of the receiver.

Implemented in oofem::ParmetisLoadBalancer.

virtual IntArray* oofem::LoadBalancer::giveDofManPartitions ( int  idofman)
pure virtual

Returns the partition list of given dofmanager after load balancing.

Implemented in oofem::ParmetisLoadBalancer.

Referenced by deleteRemoteDofManagers(), and packMigratingData().

virtual DofManMode oofem::LoadBalancer::giveDofManState ( int  idofman)
pure virtual

Returns the label of dofmanager after load balancing.

Implemented in oofem::ParmetisLoadBalancer.

Referenced by deleteRemoteDofManagers(), and packMigratingData().

Domain* oofem::LoadBalancer::giveDomain ( )
inline
virtual int oofem::LoadBalancer::giveElementPartition ( int  ielem)
pure virtual

Returns the new partition number assigned to local element after LB.

Implemented in oofem::ParmetisLoadBalancer.

Referenced by deleteRemoteElements(), packMigratingData(), and oofem::NonlocalMaterialWTP::packMigratingElementDependencies().

IRResultType oofem::LoadBalancer::initializeFrom ( InputRecord ir)
virtual

Initializes receiver according to object description stored in input record.

Definition at line 64 of file loadbalancer.C.

References _IFT_LoadBalancer_wtp, initializeWtp(), IR_GIVE_OPTIONAL_FIELD, and oofem::IRRT_OK.

Referenced by oofem::EngngModel::updateAttributes().

void oofem::LoadBalancer::initializeWtp ( IntArray wtp)
protected

Definition at line 77 of file loadbalancer.C.

References oofem::IntArray::giveSize(), OOFEM_ERROR, and wtpList.

Referenced by initializeFrom().

virtual void oofem::LoadBalancer::setDomain ( Domain d)
inlinevirtual

Member Data Documentation

std :: vector< std :: unique_ptr< WorkTransferPlugin > > oofem::LoadBalancer::wtpList
protected

List of work transfer plugins.

Definition at line 216 of file loadbalancer.h.

Referenced by initializeWtp(), and migrateLoad().


The documentation for this class was generated from the following files:

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:37 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011