OOFEM 3.0
Loading...
Searching...
No Matches
oofem::LoadBalancer Class Referenceabstract

#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 }

Public Member Functions

 LoadBalancer (Domain *d)
virtual ~LoadBalancer ()
Work transfer calculation methods
virtual void calculateLoadTransfer ()=0
Work migration methods
void migrateLoad (Domain *d)
virtual void printStatistics () const
 Print receiver statistics.

Protected Attributes

Domaindomain

Query methods after work transfer calculation

std ::vector< std ::unique_ptr< WorkTransferPlugin > > wtpList
 List of work transfer plugins.
virtual DofManMode giveDofManState (int idofman)=0
 Returns the label of dofmanager after load balancing.
virtual IntArraygiveDofManPartitions (int idofman)=0
 Returns the partition list of given dofmanager after load balancing.
virtual int giveElementPartition (int ielem)=0
 Returns the new partition number assigned to local element after LB.
virtual void initializeFrom (InputRecord &ir)
 Initializes receiver according to object description stored in input record.
DomaingiveDomain ()
 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.
int packMigratingData (Domain *, ProcessCommunicator &pc)
int unpackMigratingData (Domain *, ProcessCommunicator &pc)
void deleteRemoteDofManagers (Domain *)
void deleteRemoteElements (Domain *)
void initializeWtp (IntArray &wtp)

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

◆ DofManMode

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

◆ LoadBalancer()

oofem::LoadBalancer::LoadBalancer ( Domain * d)

◆ ~LoadBalancer()

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

Definition at line 127 of file loadbalancer.h.

Member Function Documentation

◆ calculateLoadTransfer()

virtual void oofem::LoadBalancer::calculateLoadTransfer ( )
pure virtual

◆ deleteRemoteDofManagers()

◆ deleteRemoteElements()

◆ giveClassName()

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

◆ giveDofManPartitions()

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().

◆ giveDofManState()

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().

◆ giveDomain()

Domain * oofem::LoadBalancer::giveDomain ( )
inline

Returns reference to its domain.

Definition at line 163 of file loadbalancer.h.

References domain.

◆ giveElementPartition()

virtual int oofem::LoadBalancer::giveElementPartition ( int ielem)
pure virtual

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

Implemented in oofem::ParmetisLoadBalancer.

References initializeFrom().

Referenced by deleteRemoteElements().

◆ initializeFrom()

void oofem::LoadBalancer::initializeFrom ( InputRecord & ir)
virtual

Initializes receiver according to object description stored in input record.

Definition at line 81 of file loadbalancer.C.

References _IFT_LoadBalancer_wtp, initializeWtp(), and IR_GIVE_OPTIONAL_FIELD.

Referenced by giveElementPartition().

◆ initializeWtp()

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

Definition at line 90 of file loadbalancer.C.

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

Referenced by giveClassName(), and initializeFrom().

◆ migrateLoad()

◆ packMigratingData()

◆ printStatistics()

void oofem::LoadBalancer::printStatistics ( ) const
virtual

◆ setDomain()

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

sets associated Domain

Definition at line 165 of file loadbalancer.h.

◆ unpackMigratingData()

Member Data Documentation

◆ domain

◆ wtpList

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

List of work transfer plugins.

Definition at line 219 of file loadbalancer.h.

Referenced by initializeWtp(), LoadBalancer(), and migrateLoad().


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

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