|
OOFEM 3.0
|
#include <loadbalancer.h>
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 | |
| Domain * | domain |
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 IntArray * | giveDofManPartitions (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. | |
| 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. | |
| int | packMigratingData (Domain *, ProcessCommunicator &pc) |
| int | unpackMigratingData (Domain *, ProcessCommunicator &pc) |
| void | deleteRemoteDofManagers (Domain *) |
| void | deleteRemoteElements (Domain *) |
| void | initializeWtp (IntArray &wtp) |
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 74 of file loadbalancer.C.
References domain, and wtpList.
Referenced by oofem::ParmetisLoadBalancer::ParmetisLoadBalancer(), and oofem::LoadBalancer::WorkTransferPlugin::WorkTransferPlugin().
|
inlinevirtual |
Definition at line 127 of file loadbalancer.h.
|
pure virtual |
Implemented in oofem::ParmetisLoadBalancer.
References migrateLoad(), and printStatistics().
|
protected |
Definition at line 442 of file loadbalancer.C.
References oofem::DomainTransactionManager::addDofManTransaction(), oofem::DofManager_local, oofem::DofManager_shared, 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 giveClassName(), and migrateLoad().
|
protected |
Definition at line 491 of file loadbalancer.C.
References oofem::DomainTransactionManager::addElementTransaction(), 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 giveClassName(), and migrateLoad().
|
pure virtual |
Returns class name of the receiver.
Implemented in oofem::ParmetisLoadBalancer.
References deleteRemoteDofManagers(), deleteRemoteElements(), initializeWtp(), packMigratingData(), and unpackMigratingData().
|
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 |
|
pure virtual |
Returns the new partition number assigned to local element after LB.
Implemented in oofem::ParmetisLoadBalancer.
References initializeFrom().
Referenced by deleteRemoteElements().
|
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().
|
protected |
Definition at line 90 of file loadbalancer.C.
References oofem::IntArray::giveSize(), OOFEM_ERROR, and wtpList.
Referenced by giveClassName(), and initializeFrom().
| void oofem::LoadBalancer::migrateLoad | ( | Domain * | d | ) |
Definition at line 112 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::Communicator::finishExchange(), 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::Domain::giveNumberOfElements(), oofem::EngngModel::giveNumberOfProcesses(), oofem::DofManager::giveParallelMode(), oofem::DofManager::givePartitionList(), oofem::EngngModel::giveRank(), oofem::Domain::giveTransactionManager(), oofem::Communicator::initExchange(), oofem::Domain::initGlobalDofManMap(), oofem::Domain::initGlobalElementMap(), MIGRATE_LOAD_TAG, OOFEM_LOG_RELEVANT, oofem::Communicator::packAllData(), oofem::Communicator::unpackAllData(), and wtpList.
Referenced by calculateLoadTransfer().
|
protected |
Definition at line 241 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(), oofem::Domain::giveEngngModel(), oofem::DofManager::giveGlobalNumber(), oofem::DofManager::giveInputRecordName(), oofem::FEMComponent::giveInputRecordName(), oofem::Domain::giveNumberOfDofManagers(), oofem::Domain::giveNumberOfElements(), oofem::Element::giveParallelMode(), oofem::DofManager::givePartitionList(), oofem::ProcessCommunicator::giveProcessCommunicatorBuff(), oofem::EngngModel::giveRank(), oofem::ProcessCommunicator::giveRank(), OOFEM_LOG_RELEVANT, oofem::DofManager::saveContext(), oofem::Element::saveContext(), and oofem::ProcessCommunicatorBuff::write().
Referenced by giveClassName().
|
virtual |
Print receiver statistics.
Definition at line 517 of file loadbalancer.C.
References oofem::DofManager_local, domain, oofem::Element_local, oofem::EngngModelTimer::getUtime(), oofem::EngngModelTimer::getWtime(), oofem::EngngModel::giveRank(), oofem::EngngModel::giveTimer(), and OOFEM_LOG_RELEVANT.
Referenced by calculateLoadTransfer().
|
inlinevirtual |
sets associated Domain
Definition at line 165 of file loadbalancer.h.
|
protected |
Definition at line 308 of file loadbalancer.C.
References oofem::DomainTransactionManager::addDofManTransaction(), oofem::DomainTransactionManager::addElementTransaction(), oofem::classFactory, CM_Definition, CM_DefinitionGlobal, CM_State, CM_UnknownDictState, oofem::DofManager_local, oofem::DofManager_shared, oofem::Domain::giveEngngModel(), oofem::Element::giveGlobalNumber(), oofem::ProcessCommunicator::giveProcessCommunicatorBuff(), oofem::EngngModel::giveRank(), oofem::ProcessCommunicator::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 giveClassName().
|
protected |
Definition at line 122 of file loadbalancer.h.
Referenced by oofem::ParmetisLoadBalancer::calculateLoadTransfer(), oofem::ParmetisLoadBalancer::determineDofManState(), giveDomain(), 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 219 of file loadbalancer.h.
Referenced by initializeWtp(), LoadBalancer(), and migrateLoad().