ParPrefix - Prefix Sums (or Partial Sums) Input: a sequence...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
Prefix Sums (or Partial Sums) Input: a sequence of n integers; a 0 , a 1 , …, a n -1 Output: a sequence of sums, s s i = a 0 + a 1 + … + a i = = i j j a 0
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Example: Input: 2, 8, 4, 7, 1, 1 Output: 2, 10, 14, 21, 22, 23
Background image of page 2
Sequential Algorithm Complexity: O ( n ) for n inputs s [0] a [0]; for i 0 to n-1 do s [ i ] s [ i – 1] + a [ i ];
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Partial Sums Pipeline a [ 0 ] = + + + a [ 1 ] a [ 2 ] a [ 3 ] p [ 0 ] p [ 1 ] p [ 2 ] p [ 0 ] p [ 1 ] p [ 2 ] p [ 3 ]
Background image of page 4
For Prefix Sum (or Partial Sum) See pages 172-73 in your textbook (Chapter 6)
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Data parallel method of adding all partial sums of 16 numbers 6.
Background image of page 6
Data parallel prefix sum operatio 6.
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
x 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 1 x 1 + x 2 x 2 + x 3 x 3 + x 4 x 4 + x 5 x 5 + x 6 x 6 + x 7 x 7 + x 8 x 1 + x 2 x 1 x 1 + x 2 + x 3 x 1 + + x 4 x 1 + + x 5 x 1 + + x 6 x 1 + + x 7 x 1 + + x 8 p = n log n = 8 × 3 T p = log n = 3 Cost = n log 2 n
Background image of page 8
Synchronous Iteration (Synchronous Parallelism) Each iteration composed of several processes that start together at beginning of iteration. Next iteration cannot begin until all processes have finished previous iteration.
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 22

ParPrefix - Prefix Sums (or Partial Sums) Input: a sequence...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online