Title: Parallel prefix sum computation
1Parallel prefix sum computation
2Prefix sum
3(No Transcript)
4- Assume that input is An, An1,,A2n-1
- The left and right son of a node i is now given
by a simple formula 2i and 2i1, respectively.
Parallel prefix sums computation Phase1 for
km-1 down to 0 do for all 2k ?jlt2k1 in
parallel do AjA2jA2j1 B0A1
Phase2 for k0 to m do for all 2k ? jlt2k1
in parallel do iff odd(j) then
BjB(j-1)/2 else
BjBj/2-Aj1 output table Bn(2n-1)
5Recursive divide and concur approach
PREF-SUMS(A1..n/2,n/2) PREF-SUMS(An/2..n,n/
2)
6Recursive divide and concur algorithm as
arithmetic circuit
7List prefix
- for each processor i do
- yi ? xi
- while exist i nexti?NIL do
- for each processor i do
- if nexti ? NIL then
- ynexti ? yi ynexti
- nexti ? nextnexti
- yi x1 x2 xi
8(No Transcript)
9The first phase
10The second phase
The second phase of the algorithm now assigns a
processor to each of the (in general not good)
intervals l(i)..r(i) and proceeds to find a
decomposition of the interval into good
intervals. Lets consider decomposition of 1..7
into good intervals, were good intervals are
enclosed in rectangles.
1..7
5..7
1..4
5..6
7..7
7..7