Given an array A[0..n-1], prefix sum on array A is given by array PS[0..n-1] such that PS[i]=Pi j=0 A[j]. Thus, PS[0] = A[0], PS[1] = A[0]+A[1], PS[2] = A[0]+A[1]+A[2], etc. One can find the prefix sum in parallel as follows using p processors: (i) partition the array into p subarrays, assigning processor Pi to the ith subarray, for 0 ≤ i ≤ p − 1, (ii) find local sums of individual subarrays, si , for 0 ≤ i ≤ p − 1, (iii) find prefix sums on the local sums, (iv) Pi uses the prefix sum value for the previous partition (i.e., Pi−1 j=0 sj ) to calculate the prefix sum of its own subarray. For Step (iii), one processor can do this, or all processors can replicate this process.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Given an array A[0..n-1], prefix sum on array A is given by array PS[0..n-1] such that PS[i]=Pi
j=0 A[j]. Thus, PS[0] = A[0],
PS[1] = A[0]+A[1], PS[2] = A[0]+A[1]+A[2], etc.


One can find the prefix sum in parallel as follows using p processors: (i) partition the array into p subarrays, assigning
processor Pi to the ith subarray, for 0 ≤ i ≤ p − 1, (ii) find local sums of individual subarrays, si
, for 0 ≤ i ≤ p − 1, (iii)
find prefix sums on the local sums, (iv) Pi uses the prefix sum value for the previous partition (i.e., Pi−1
j=0 sj ) to calculate
the prefix sum of its own subarray. For Step (iii), one processor can do this, or all processors can replicate this process.

 

Analyze the previous algorithm, i.e., find its Tp, Sp, Ep, cost, work, and its range of optimality (for what
range does the algorithm achieves O(p) speedup).

Expert Solution
steps

Step by step

Solved in 4 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY