14. Groote Algorithm
Mar 1, 2021
Algorithm X (cont.)
Recall when
Subtree strategy
First solve the problem for
(
Polynomial when
Chunking strategy
Split into 2 subtrees. One will be done first. Then send all processors to the remaining side. (doppelganger effect).
for use soon:
(some mistake here; should be
Same result, which is better? If there are no failures:
- subtree strategy:
New Notion for Optimality
If work of an algorithm is
Measure in precise units DO-ALL
Algorithms of this complexity are optimal.
Groote Algorithm
This is a collision based DO-ALL algorithm.
Case: 2 processors
Setup:
Trivial solution: both processors do all tasks,
Another strategy:
- two processors start from opposite ends of array.
- when finished with task, set bit-array to 1
- check next bit and do work until collision
- if at collision both see 1, the last task is done twice
Case: 3 processors
Work on 1 half is:
After the collision, the middle processor works exclusively in one direction. The end jumps in the middle of the remaining half.
Solve this recurrence:
This recurrence is done when
This strategy works for a few processors, but becomes tedious when number of processors increases.
Case: processors
k | P | W |
---|---|---|
1 | 1 | |
2 | 4 | |
3 | 8 | |
d |
Example k=2: 4 processors
Divide processors into 2 groups. There are
Processors work vertically on each slice. Ultimately a collision occurs.
Example k=3: 8 processors
Divide processors into groups of two and work on a cube from both directions
Example k=4: 16 processors
Notice: each time we increase
In the general case
Example k = d
If
If
If