ug4
Load Balancing Utility

Parses parameters related to load-balancing and creates a load-balancer accordingly. More...

Functions

function balancer CreateLoadBalancer (domain)
 
function balancer ParseParameters ()
 
function balancer PrintParameters ()
 
function balancer Rebalance (domain, loadBalancer)
 
function balancer RefineAndRebalanceDomain (domain, numRefs, loadBalancer)
 

Detailed Description

Parses parameters related to load-balancing and creates a load-balancer accordingly.

Author
Sebastian Reiter

All variables and functions in this script are contained in the namespace 'balancer'. A set of global parameters with initial values is defined together with the methods balancer.ParseParameters(), which is used to overwrite those initial values with user-specified parameters, and balancer.CreateLoadBalancer(domain) which creates a load-balancer for the specified domain according to the global parameters.

If you want to overwrite the default parameter values in your script, make sure to assign them before calling balancer.ParseParameters but after loading this utility file.

Function Documentation

◆ CreateLoadBalancer()

function balancer CreateLoadBalancer ( domain  )

Creates a load-balancer for the given domain. The returned class is of the type DomainLoadBalancer. The current set of global parameters in the balancer namespace steers the creation. The returned balancer can then be used to perform dynamic load-balancing and rebalancing of adaptively refined grids.

location: /home/runner/work/docs/docs/ug4/ugcore/scripts/util / load_balancing_util.lua :176-266

◆ ParseParameters()

function balancer ParseParameters ( )

Parses user-specified parameters related to load-balancing.

location: /home/runner/work/docs/docs/ug4/ugcore/scripts/util / load_balancing_util.lua :86-134

◆ PrintParameters()

function balancer PrintParameters ( )

Prints the balancing parameters

location: /home/runner/work/docs/docs/ug4/ugcore/scripts/util / load_balancing_util.lua :137-168

◆ Rebalance()

function balancer Rebalance ( domain  ,
loadBalancer   
)

If no loadBalancer is specified, this method performs rebalancing using balancer.defaultBalancer. If balancer.defaultBalancer doesn't exist, it will be automatically created using the current balancer parameters. Note that changes to the balancer parameters won't have any effect if balancer.defaultBalancer already exist. However, by setting balancer.defaultBalancer to nil, you trigger the recreation of the defaultBalancer with the new balancer parameters in the next call to balancer.Rebalance.

location: /home/runner/work/docs/docs/ug4/ugcore/scripts/util / load_balancing_util.lua :277-302

◆ RefineAndRebalanceDomain()

function balancer RefineAndRebalanceDomain ( domain  ,
numRefs  ,
loadBalancer   
)

If no loadBalancer is specified, this method performs rebalancing using balancer.defaultBalancer. See balancer.Rebalance for more information. The method performs global refinement. After each refinement, rebalancing is triggered.

location: /home/runner/work/docs/docs/ug4/ugcore/scripts/util / load_balancing_util.lua :308-322

function balancer.RefineAndRebalanceDomain(domain, numRefs, loadBalancer)
balancer.Rebalance(domain, loadBalancer)
if numRefs > 0 then
refiner = GlobalDomainRefiner(domain)
for i = 1, numRefs do
refiner:refine()
balancer.Rebalance(domain, loadBalancer)
end
delete(refiner)
end
end
parameterNumber numRefs
static SmartPtr< IRefiner > GlobalDomainRefiner(TDomain *dom)
Creates a global domain refiner.
Definition: refinement_bridge.cpp:92
function balancer Rebalance(domain, loadBalancer)
void TerminateAbortedRun()
Terminates the current run if AbortRun() was called and the abort-run-flag is thus set to true.
Definition: ug.cpp:353