28
Load Balancing and Termination Detection Load balance : - statically before the execution of any processes - dynamic during the execution of the processes

Load Balancing and Termination Detection Load balance : - statically before the execution of any processes - dynamic during the execution of the processes

Embed Size (px)

Citation preview

Page 1: Load Balancing and Termination Detection Load balance : - statically before the execution of any processes - dynamic during the execution of the processes

Load Balancing and Termination Detection

Load balance :

- statically before the execution of any processes - dynamic during the execution of the processes

Page 2: Load Balancing and Termination Detection Load balance : - statically before the execution of any processes - dynamic during the execution of the processes

Load Balancing and Termination Detection

Potential static load balancing techniques Mapping problem and scheduling algorithm

. Round robin algorithm . Randomized algorithm . Recursive algorithm . Simulated annealing . Genetic algorithm

Page 3: Load Balancing and Termination Detection Load balance : - statically before the execution of any processes - dynamic during the execution of the processes

Load Balancing and Termination Detection

bin packing algorithm

Page 4: Load Balancing and Termination Detection Load balance : - statically before the execution of any processes - dynamic during the execution of the processes

Load Balancing and Termination Detection

Communicated processes should be executed on processors with directcommunication paths to reduce the communication delays.

The mapping of processes to processors is a NP complete problem.NP stands for non-deterministic polynomial and means that there isNo polynomial time algorithm for solving the problem.

Page 5: Load Balancing and Termination Detection Load balance : - statically before the execution of any processes - dynamic during the execution of the processes

Load Balancing and Termination Detection

There are several problems with static load balancing

. Difficult to estimate accurately the execution times of various parts of a program without actually executing the parts

. Communication delays may vary under different circumstances

. Some problems have indeterminate number of steps to reach their solution

We need to turn to dynamic load balancing

Page 6: Load Balancing and Termination Detection Load balance : - statically before the execution of any processes - dynamic during the execution of the processes

Load Balancing and Termination Detection

Dynamic load balancing - centralized (master slave) - decentralized (peer-to-peer)

Page 7: Load Balancing and Termination Detection Load balance : - statically before the execution of any processes - dynamic during the execution of the processes

Load Balancing and Termination Detection

Centralized work pool (processor farm) divide-and-conquer problems the problems in which tasks are different and of different size. the number of tasks change during execution such searching algorithm

FIFOPriority

Page 8: Load Balancing and Termination Detection Load balance : - statically before the execution of any processes - dynamic during the execution of the processes

Load Balancing and Termination Detection

Termination:

Stopping the computation when the solution has been reached isCalled termination.

-The task queue is empty-Every process has made a request for another task without any tasks being generated (local termination information,such search algorithm) specific local termination information, synchronous iterations)

Page 9: Load Balancing and Termination Detection Load balance : - statically before the execution of any processes - dynamic during the execution of the processes

Load Balancing and Termination Detection

The disadvantage of centralized load balancing

-potential exists for a bottleneck when there are many slave process that could be making simultaneously requests.

-centralized work pool will be satisfactory if there are few slaves and the tasks are intensive.

Page 10: Load Balancing and Termination Detection Load balance : - statically before the execution of any processes - dynamic during the execution of the processes

Load Balancing and Termination Detection

Decentralized dynamic load balancing

One approach is to distribute the work pool

Page 11: Load Balancing and Termination Detection Load balance : - statically before the execution of any processes - dynamic during the execution of the processes

Load Balancing and Termination Detection

Four policies of load balance

. Transfer policy

. Location policy

. Selection policy

. Information policy

Page 12: Load Balancing and Termination Detection Load balance : - statically before the execution of any processes - dynamic during the execution of the processes

Load Balancing and Termination Detection

Location policy

- receiver initiated : high system load - sender initiated : light system load - hybrid initiated

ping-pong effect : keep passing on the same taskthat is received

Page 13: Load Balancing and Termination Detection Load balance : - statically before the execution of any processes - dynamic during the execution of the processes

Load Balancing and Termination Detection

Process Selection - round-robin algorithm - random polling algorithm

Page 14: Load Balancing and Termination Detection Load balance : - statically before the execution of any processes - dynamic during the execution of the processes

Load Balancing and Termination Detection

Load balancing using a line structure

Page 15: Load Balancing and Termination Detection Load balance : - statically before the execution of any processes - dynamic during the execution of the processes

Load Balancing and Termination Detection

- for left and right communication- for the current task

Page 16: Load Balancing and Termination Detection Load balance : - statically before the execution of any processes - dynamic during the execution of the processes

Load Balancing and Termination Detection

Page 17: Load Balancing and Termination Detection Load balance : - statically before the execution of any processes - dynamic during the execution of the processes

Load Balancing and Termination Detection

Distributed Termination Detection Algorithm

. Application-specific local termination condition exist throughout the collection of processes, at time t, (each process can send a message to the master when its local termination conditions are satisfied)

. There are no messages in transit between processes at time t. (it is hard to recognize)

Page 18: Load Balancing and Termination Detection Load balance : - statically before the execution of any processes - dynamic during the execution of the processes

Load Balancing and Termination Detection

Using Acknowledge Messages

. Each process is in one of two states - inactive - active

Page 19: Load Balancing and Termination Detection Load balance : - statically before the execution of any processes - dynamic during the execution of the processes

Load Balancing and Termination Detection

. Its local termination condition exists

. It has transmitted all its acknowledgements for tasks it has received.

. It has received all its acknowledgements for tasks it has send out.

Page 20: Load Balancing and Termination Detection Load balance : - statically before the execution of any processes - dynamic during the execution of the processes

Load Balancing and Termination Detection

Ring termination algorithm

1. When P0 has terminated, it generates a token that it passed to P1. 2. When Pi(1<=I<=n) receive the token and has already terminated, it passed the token onward to Pi+1. Otherwise, it waits for its local termination condition and then passes the token onward. Pn-1 passes the token to P0. 3. When P0 receives a token, it knows that all processes in the ring have terminated. A messages can then be sent to all processes informing them of global termination, if necessary.

Page 21: Load Balancing and Termination Detection Load balance : - statically before the execution of any processes - dynamic during the execution of the processes

Load Balancing and Termination Detection

Page 22: Load Balancing and Termination Detection Load balance : - statically before the execution of any processes - dynamic during the execution of the processes

Load Balancing and Termination Detection

Page 23: Load Balancing and Termination Detection Load balance : - statically before the execution of any processes - dynamic during the execution of the processes

Load Balancing and Termination Detection

Tree algorithm

Page 24: Load Balancing and Termination Detection Load balance : - statically before the execution of any processes - dynamic during the execution of the processes

Load Balancing and Termination Detection

Shortest path1. The shortest distance between two towns or other points on a map, where the weights represent distance2. The quickest route to travel, where the weights represent time3. The least expensive way to travel by air, where the weighs represent the cost of the flights between cities4. The best way to climb a mountain given a terrain map with contours5. The best rout through a computer network for minimum message delay6. The most efficient manufacturing system, where the weights represent hours of work.

Page 25: Load Balancing and Termination Detection Load balance : - statically before the execution of any processes - dynamic during the execution of the processes

Load Balancing and Termination Detection

Graph representation

-adjacency matrix-adjacency list Space:O(n2)

Time : O(1)

Page 26: Load Balancing and Termination Detection Load balance : - statically before the execution of any processes - dynamic during the execution of the processes

Load Balancing and Termination Detection

Space:O(nvmax)Time : O(v)

Page 27: Load Balancing and Termination Detection Load balance : - statically before the execution of any processes - dynamic during the execution of the processes

Load Balancing and Termination Detection

Searching a graph

- Moor single-source shortest path algorithm - Dijkstra’s single-source shortest path algorithm

Page 28: Load Balancing and Termination Detection Load balance : - statically before the execution of any processes - dynamic during the execution of the processes

Load Balancing and Termination Detection