Parallel Distributed Computing Unit-5
Parallel Distributed Computing Unit-5
Problems
Ananth Grama, Anshul Gupta, George Karypis, and Vipin Kumar
Ax ≥ b
(a) (b)
5 2 1 5 2 1 5 2 1 5 2 1 5 2
up up left down
1 8 3 8 3 4 8 3 4 8 3 4 3
4 7 6 4 7 6 7 6 7 6 7 8 6
left down
1 2 3 1 2 3 1 2 1 2
up up left
4 5 6 4 5 4 5 3 4 5 3
7 8 7 8 6 7 8 6 7 8 6
(c)
2 4 2 4
3 5 6 3 5 6
7 7 7
8 9 8 9 8 9
(a)
1 1
2 3 2 3
4 4 4
5 6 5 6 5 6
7 7 7 7 7
8 9 8 9 8 9 8 9 8 9
10 10 10 10 10 10 10 10 10
(b)
7 2 3 7 2 7 2 3
D 4 6 5 E 4 6 3 F 4 6
Blank tile
1 8 1 8 5 1 8 5
up right The last tile moved.
Step 3
7 2 3 7 2
G 4 6 H 4 6 3
1 8 5 1 8 5
2 3 4 5 5 1 4 5
4
6 7 8 9 3 8 9
9
10 11 7 11
8
11
12 13 14 10 14
14
15 16 17 13 16 17
17
18 19 16 15 19
19
20 21 18
24
22 23 24 21 23 24
23
Current State
Top of the stack
• The core data structure is a list, called Open list, that stores
unexplored nodes sorted on their heuristic estimates.
• The best node is selected from the list, expanded, and its off-
spring are inserted at the right position.
• A closed list stores all the nodes that have been previously
seen.
(a) (b)
7 2 3 7 2 3
6 4 6 5 6 4 6 5
1 8 1 8
Step 1 Step 1
7 2 3 7 2 3 7 2 3 7 2 3
7 4 6 4 6 5 7 7 4 6 4 6 5 7
1 8 5 1 8 1 8 5 1 8
Step 2
7 2 7 2 3
8 4 6 3 4 6 6
1 8 5 1 8 5
7 2 3 7 2 3
6 4 6 5 6 4 6 5
1 8 1 8
Step 1 Step 1
7 2 3 7 2 3 7 2 3 7 2 3
7 4 6 4 6 5 7 7 4 6 4 6 5 7
1 8 5 1 8 1 8 5 1 8
Step 2 Step 2 Step 4
7 2 7 2 3 7 2 7 2 3 7 2 3 7 2 3
8 4 6 3 4 6 6 8 4 6 3 4 6 4 6 5 4 5
1 8 5 1 8 5 1 8 5 1 8 5 1 8 1 6 8
6 8 8
Step 3
7 2 3 7 3 7 2 3 7 2 3 7 3 7 2 3
7 4 8 6 4 2 6 4 6 7 7 4 8 6 4 2 6 4 6 7
1 5 1 8 5 1 8 5 1 5 1 8 5 1 8 5
7 7
(c)
C D E F
(a) (b)
Finished Got
available work
work
Processor active
Processor idle
Got a reject
Issued a request
3 5 3 4
5 4
7 9 7 8
9 8
10 11 10
11 14
13 13 14
16
17
15 17 16
19
18 19
24
Cutoff depth
21
23
22 23 24
Current State
(a) (b)
Splitting the DFS tree: the two subtrees along with their stack
representations are shown in (a) and (b).
Load-Balancing Schemes
1
E =
1 + To/W
1
=
1 + (tcomm V (p) log W )/W
Analyzing DFS: V (P ) for Various Schemes
i p−i
f (i, p) = (1 + f (i, p)) + (1 + f (i + 1, p)),
p p
p−i p−i
f (i, p) = 1 + f (i + 1, p),
p p
p
f (i, p) = + f (i + 1, p).
p−i
V (P ) for Random Polling
• We have:
X
p−1
1
f (0, p) = p × ,
i=0
p − i
X
p
1
= p× ,
i=1
i
= p × Hp ,
• Random Polling: We have V (p) = O(p log p), To = O(p log p log W )
Therefore W = O(p log2 p).
Analysis of Load-Balancing Schemes: Conclusions
600
ARR
GRR
Speedup
500
RP
400
300
200
100
0
0 200 400 600 800 1000 1200
700000
100000
0
0 200 400 600 800 1000 1200
p
W
2e+07
1.5e+07
1e+07
E = 0.64
E = 0.74
5e+06 E = 0.85
E = 0.90
0
0 20000 40000 60000 80000 100000 120000
2
p log p
• Assume, for now that work transfers can only happen from Pi
to Pj if j > i.
• When the token reaches processor P0, all processors are done.
Dijkstra’s Token Termination Detection
• When a processor gets done with its work, it sends its parent the
weight back.
w2 = 0.25 w2 = 0.25
Put expanded
nodes Get
current
best node
Pick the best node Place generated Pick the best node
from the list nodes in the list from the list
PSfrag replacements
Local list
Local list
Local list
Exchange
best nodes
Exchange
best nodes
P0 Pp−1
P1
PSfrag replacements
Local list
Exchange
best nodes Local list
Local list
P0 Pp−1
P1
2 10 R2 L1
3 4 11 R3 R4 L2
5 12 R5 L3
6 9 13 L4
Goal node G Goal node G
7 8
(a) (b)
2 R2 L1
3 4 R3 R4 L2
5 R5 L3
6 R6 L4
7 R7 L5
Goal node G Goal node G
(a) (b)