xc
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
XC::LoadBalancer Class Referenceabstract

A LoadBalancer is an object used to balance a PartitionedDomain. More...

#include <LoadBalancer.h>

Inheritance diagram for XC::LoadBalancer:
XC::ReleaseHeavierToLighterNeighbours XC::ShedHeaviest XC::SwapHeavierToLighterNeighbours

Public Member Functions

 LoadBalancer (void)
 Default constructor.
 
 LoadBalancer (double factGreater, int releases, bool disallowDisconnected=true)
 Constructor. More...
 
virtual void setLinks (DomainPartitioner &thePartitioner)
 Sets the pointer to the DomainPartitioner object associated with the LoadBalancer to point to thePartitioner. More...
 
virtual int balance (Graph &theWeightedGraph)=0
 Each subclass must provide an implementation of this method. More...
 

Protected Member Functions

DomainPartitionergetDomainPartitioner (void)
 Returns a pointer to the DomainPartitioner. More...
 

Protected Attributes

int numReleases
 
double factorGreater
 number of releases.
 
bool disallowDisconnectedGraphs
 

Detailed Description

A LoadBalancer is an object used to balance a PartitionedDomain.

The LoadBalancer does this by invoking methods in the DomainPartitioner object with which it is associated.

Constructor & Destructor Documentation

§ LoadBalancer()

XC::LoadBalancer::LoadBalancer ( double  factGreater,
int  releases,
bool  disallowDisconnected = true 
)

Constructor.

Sets the parameters used in the balance() method.

Parameters
factGreaterfactor greater.
releasesnumber of releases.

Member Function Documentation

§ balance()

virtual int XC::LoadBalancer::balance ( Graph theWeightedGraph)
pure virtual

Each subclass must provide an implementation of this method.

This method is invoked to balance the PartitionedDomain. The Graph {theWeightedGraph} is a weighted graph in which the vertices represent the Subdomains, the edges Subdomains sharing common boundary nodes and the weight the cost of the previous Subdomain calculations (determined by invoking getCost() on the Subdomains).

Implemented in XC::SwapHeavierToLighterNeighbours, XC::ReleaseHeavierToLighterNeighbours, and XC::ShedHeaviest.

§ getDomainPartitioner()

XC::DomainPartitioner * XC::LoadBalancer::getDomainPartitioner ( void  )
protected

Returns a pointer to the DomainPartitioner.

If no DomainPartitioner has been set, a warning message is printed and \(0\) returned.

§ setLinks()

void XC::LoadBalancer::setLinks ( DomainPartitioner thePartitioner)
virtual

Sets the pointer to the DomainPartitioner object associated with the LoadBalancer to point to thePartitioner.


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