OOFEM
2.4
OOFEM.org - Object Oriented Finite Element Solver
|
Abstract base class representing general load balancer. More...
#include <loadbalancer.h>
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... | |
Domain * | giveDomain () |
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 IntArray * | giveDofManPartitions (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 | |
Domain * | domain |
std::vector< std::unique_ptr< WorkTransferPlugin > > | wtpList |
List of work transfer plugins. More... | |
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:
Definition at line 108 of file loadbalancer.h.
Describes the state of dofmanager after load balancing on the local partition.
Definition at line 115 of file loadbalancer.h.
oofem::LoadBalancer::LoadBalancer | ( | Domain * | d | ) |
Definition at line 57 of file loadbalancer.C.
References domain.
|
inlinevirtual |
Definition at line 127 of file loadbalancer.h.
|
pure virtual |
Implemented in oofem::ParmetisLoadBalancer.
Referenced by oofem::EngngModel::balanceLoad().
|
protected |
Definition at line 430 of file loadbalancer.C.
References oofem::DomainTransactionManager::addDofManTransaction(), DM_Local, DM_NULL, DM_Remote, DM_Shared, oofem::DofManager_local, oofem::DofManager_shared, oofem::DomainTransactionManager::DTT_Remove, oofem::IntArray::findFirstIndexOf(), oofem::Domain::giveDofManager(), giveDofManPartitions(), giveDofManState(), oofem::Domain::giveEngngModel(), oofem::DofManager::giveGlobalNumber(), oofem::Domain::giveNumberOfDofManagers(), oofem::DofManager::givePartitionList(), oofem::EngngModel::giveRank(), oofem::Domain::giveTransactionManager(), OOFEM_ERROR, oofem::DofManager::setParallelMode(), and oofem::DofManager::setPartitionList().
Referenced by migrateLoad().
|
protected |
Definition at line 479 of file loadbalancer.C.
References oofem::DomainTransactionManager::addElementTransaction(), oofem::DomainTransactionManager::DTT_Remove, oofem::Element_local, oofem::Domain::giveElement(), giveElementPartition(), oofem::Domain::giveEngngModel(), oofem::Element::giveGlobalNumber(), oofem::Domain::giveNumberOfElements(), oofem::Element::giveParallelMode(), oofem::EngngModel::giveRank(), and oofem::Domain::giveTransactionManager().
Referenced by migrateLoad().
|
pure virtual |
Returns class name of the receiver.
Implemented in oofem::ParmetisLoadBalancer.
|
pure virtual |
Returns the partition list of given dofmanager after load balancing.
Implemented in oofem::ParmetisLoadBalancer.
Referenced by deleteRemoteDofManagers(), and packMigratingData().
|
pure virtual |
Returns the label of dofmanager after load balancing.
Implemented in oofem::ParmetisLoadBalancer.
Referenced by deleteRemoteDofManagers(), and packMigratingData().
|
inline |
Returns reference to its domain.
Definition at line 160 of file loadbalancer.h.
Referenced by oofem::WallClockLoadBalancerMonitor::decide(), oofem::NonlocalMaterialWTP::fastRebuildNonlocalTables(), and oofem::NonlocalMaterialWTP::migrate().
|
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().
|
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().
|
protected |
Definition at line 77 of file loadbalancer.C.
References oofem::IntArray::giveSize(), OOFEM_ERROR, and wtpList.
Referenced by initializeFrom().
void oofem::LoadBalancer::migrateLoad | ( | Domain * | d | ) |
Definition at line 99 of file loadbalancer.C.
References oofem::IntArray::at(), oofem::CBT_dynamic, oofem::Domain::commitTransactions(), oofem::CommMode_Dynamic, deleteRemoteDofManagers(), deleteRemoteElements(), oofem::DofManager_local, oofem::DofManager_shared, domain, oofem::Element_local, oofem::Domain::giveDofManager(), oofem::Element::giveDofManager(), oofem::Domain::giveElement(), oofem::Domain::giveEngngModel(), oofem::DofManager::giveGlobalNumber(), oofem::Element::giveGlobalNumber(), oofem::FEMComponent::giveNumber(), oofem::Domain::giveNumberOfDofManagers(), oofem::Element::giveNumberOfDofManagers(), oofem::Domain::giveNumberOfElements(), oofem::EngngModel::giveNumberOfProcesses(), oofem::DofManager::giveParallelMode(), oofem::Element::giveParallelMode(), oofem::DofManager::givePartitionList(), oofem::EngngModel::giveRank(), oofem::IntArray::giveSize(), oofem::Domain::giveTransactionManager(), oofem::Domain::initGlobalDofManMap(), oofem::Domain::initGlobalElementMap(), MIGRATE_LOAD_TAG, OOFEM_LOG_RELEVANT, oofem::Communicator::packAllData(), packMigratingData(), unpackMigratingData(), and wtpList.
Referenced by oofem::EngngModel::balanceLoad().
|
protected |
Definition at line 228 of file loadbalancer.C.
References CM_Definition, CM_DefinitionGlobal, CM_State, CM_UnknownDictState, oofem::Element_local, oofem::IntArray::findFirstIndexOf(), oofem::Domain::giveDofManager(), giveDofManPartitions(), giveDofManState(), oofem::Domain::giveElement(), giveElementPartition(), oofem::Domain::giveEngngModel(), oofem::DofManager::giveGlobalNumber(), oofem::FEMComponent::giveInputRecordName(), oofem::Domain::giveNumberOfDofManagers(), oofem::Domain::giveNumberOfElements(), oofem::Element::giveParallelMode(), oofem::DofManager::givePartitionList(), oofem::ProcessCommunicator::giveProcessCommunicatorBuff(), oofem::ProcessCommunicator::giveRank(), oofem::EngngModel::giveRank(), OOFEM_LOG_RELEVANT, oofem::DofManager::saveContext(), oofem::Element::saveContext(), oofem::IntArray::storeYourself(), and oofem::ProcessCommunicatorBuff::write().
Referenced by migrateLoad().
|
virtual |
Print receiver statistics.
Definition at line 505 of file loadbalancer.C.
References oofem::DofManager_local, domain, oofem::Element_local, oofem::EngngModelTimer::EMTT_AnalysisTimer, oofem::EngngModelTimer::getUtime(), oofem::EngngModelTimer::getWtime(), oofem::Domain::giveDofManager(), oofem::Domain::giveElement(), oofem::Domain::giveEngngModel(), oofem::Domain::giveNumberOfDofManagers(), oofem::Domain::giveNumberOfElements(), oofem::DofManager::giveParallelMode(), oofem::Element::giveParallelMode(), oofem::EngngModel::giveRank(), oofem::EngngModel::giveTimer(), and OOFEM_LOG_RELEVANT.
Referenced by oofem::EngngModel::balanceLoad().
|
inlinevirtual |
sets associated Domain
Definition at line 162 of file loadbalancer.h.
Referenced by oofem::NonLinearDynamic::updateDomainLinks(), and oofem::NonLinearStatic::updateDomainLinks().
|
protected |
Definition at line 295 of file loadbalancer.C.
References oofem::DomainTransactionManager::addDofManTransaction(), oofem::DomainTransactionManager::addElementTransaction(), oofem::classFactory, CM_Definition, CM_DefinitionGlobal, CM_State, CM_UnknownDictState, oofem::ClassFactory::createDofManager(), oofem::ClassFactory::createElement(), DM_Remote, DM_Shared, oofem::DofManager_local, oofem::DofManager_shared, oofem::DomainTransactionManager::DTT_ADD, oofem::Domain::giveEngngModel(), oofem::Element::giveGlobalNumber(), oofem::ProcessCommunicator::giveProcessCommunicatorBuff(), oofem::ProcessCommunicator::giveRank(), oofem::EngngModel::giveRank(), oofem::Domain::giveTransactionManager(), oofem::Element::initForNewStep(), OOFEM_ERROR, OOFEM_LOG_RELEVANT, oofem::ProcessCommunicatorBuff::read(), oofem::DofManager::restoreContext(), oofem::Element::restoreContext(), oofem::IntArray::restoreYourself(), oofem::DofManager::setGlobalNumber(), oofem::DofManager::setParallelMode(), and oofem::DofManager::setPartitionList().
Referenced by migrateLoad().
|
protected |
Definition at line 122 of file loadbalancer.h.
Referenced by oofem::ParmetisLoadBalancer::calculateLoadTransfer(), oofem::ParmetisLoadBalancer::determineDofManState(), oofem::ParmetisLoadBalancer::handleMasterSlaveDofManLinks(), oofem::ParmetisLoadBalancer::initGlobalParmetisElementNumbering(), oofem::ParmetisLoadBalancer::labelDofManagers(), LoadBalancer(), migrateLoad(), oofem::ParmetisLoadBalancer::packSharedDmanPartitions(), printStatistics(), and oofem::ParmetisLoadBalancer::unpackSharedDmanPartitions().
|
protected |
List of work transfer plugins.
Definition at line 216 of file loadbalancer.h.
Referenced by initializeWtp(), and migrateLoad().