Load Balancing
Load Balancing
Load Balancing
Goal: All processors working all the
time
Efficiency of 1
Distribute the load (work) to meet the goal
Static
Dynamic
Load Balancing
The load balancing problem can be
reduced to the bin-packing problem
NP-complete
Heterogeneity
Different types of resources
Processor
Network, etc.
Evaluation of load
balancing
Efficiency
Communication
Partitioning Techniques
Regular grids (-: Easy :-)
striping
blocking
use processing power to divide load more
fairly
Generalized Graphs
Levelization
Scattered Decomposition
Recursive Bisection
Levelization
Begin with a boundary
Levelization
Levelization
Want to insure nearest neighbor
comm.
If p is # processors and n is # nodes.
Let ri be the sum of the number of
nodes in contiguous levels i and i + 1
Let r = max{r1, r2, , rn}
Nearest neighbor communication is
assured if n/p > r
Scattered Decomposition
Used for highly irregular grids
Partition load into a large number r of
rectangular clusters such that r >> p
Each processor is given a disjoint set
of r/p clusters.
Communication overhead can be a
problem for highly irregular problems.
Recursive Bisection
Recursively divide the domain in
two pieces at each step.
3 Methods
Recursive Coordinate
Bisection
Divide the domain
based on the
physical coordinates
of the nodes.
Pick a dimension and
divide in half.
RCB uses no connectivity information
Ineritial Bisection
Often, coordinate bisection is susceptible
to the orientation of the mesh
Solution: Find the principle axis of the
communication graph
Greedy Bisection
Start with a vertex of
the smallest degree
Computationally
expensive
Recursive Spectral
Bisection
Uses the discrete Laplacian
Let A be the adjacency matrix
Let D be the diagonal matrix where
LG = A - D
Recursive Spectral
Bisection
LG is negative semidefinite
Its largest eigenvalue is zero and the
corresponding eigenvector is all ones.
The magnitude of the second largest
eigenvalue gives a measure of the
connectivity of the graph.
Its corresponding eigenvector gives a
measure of distances between nodes.
Recursive Spectral
Bisection
The eigenvector corresponding to
the second largest eigenvalue is
the Fiedler vector.
Calculation of the Fiedler vector is
computationally intensive.
RSB yields connected partitions
that are very well balanced.
Example
RSB
299 edges cut
The Kernighan-Lin
algorithm
Swap pairs of nodes to decrease the cut
Will allow intermediate increases in the cut size to
avoid certain local minima
Loop
The Kernihan-Lin
Algorithm
Helpful-Sets
Two Steps
Helpful-Sets
Helpful-Sets Algorithm
Coarsen by
Comparisons
Graph
airfoil
|v|
4253
|e|
12289
ML
85
(0.08)
Chaco
IN
94
(0.00)
crack
10240
30380
211
(0.16)
377
(0.01)
218
(0.05)
196
(0.14)
243
(0.10)
208
(0.44)
wave
156317 10593319542
(3.64)
9834
(0.19)
9660
(1.61)
9801
(3.50)
10361
(2.84)
9614
(11.93)
22579
13643
(0.06)
9897
(0.06)
8869
(3.45)
8869
(11.52)
lh
1443
20148
total edge weight
36376
487380 (0.33)
mat
73752
17617189359
(1.80)
DEBR
10485762097149100286
(48.99)
IN+KL
83
(0.02)
Metis
PMetis
85
(0.04)
all
94
(0.04)
all+HS
83
(0.15)
9555
(2.04)
Party
(0.
Centralized DLB
Control of the load is centralized
Two approaches
Load Monitor
Periodically, monitor load on the processors
Adjust load to keep optimal balance
Repartitioning
Consider: dynamic situation is simply a
sequence of static situations
Solution: repartition the load after each
Issues
scalability problems
how different are current load distribution
and new load distribution
data dependencies
Decentralizing DLB
Generally focused on work pool
Two approaches
Hierarchy
Fully distributed
Three steps
Flow calculation
View as a network flow problem
Flow calculation
Many network flow algorithms
Diffusion
Each processor balances its load with
all its neighbors
wtp1 wtp
t
t
(
w
w
pq p q )
q ,{ p , q}F
log(1 / )
O
2
1
steps
Diffusion
Convergence to load balance can be
slow
Can be improved with over-relaxation
Diffuses load in
log(
1
/
O
1 2
steps
Dimension Exchange
Rather than communicate with all neighbors
each round, only communicate with one
l = (li + lj)/2
l = li * a + lj * (1 a)
Random Polling