14.07.2013 Views

PRAM Algorithms Parallel Random Access Machine ... - Washington

PRAM Algorithms Parallel Random Access Machine ... - Washington

PRAM Algorithms Parallel Random Access Machine ... - Washington

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

LIST-PREFIX(L)<br />

Prefix computation<br />

1. for each processor i, in parallel<br />

2. do y[i]← x[i]<br />

3. while there exists an object i such that prev[i]≠nil<br />

4. do for each processor i, in parallel<br />

5. do if prev[i]≠nil<br />

6. then y[prev[i]]← y[i] ⊗ y[prev[i]]<br />

7. prev[i] ← prev[prev[i]]<br />

Readings:<br />

Announcements<br />

Lecture notes from Sid Chatterjee and Jans Prins<br />

Prefix scan applications paper by Guy Blelloch<br />

Lecture notes from Ranade (for list ranking algorithms)<br />

Homework:<br />

First theory homework will be on website tonight<br />

To be done individually<br />

TA office hours will be posted on the website soon<br />

Optimizing List Prefix<br />

4 3 6 7 4 3<br />

Eliminate some elements:<br />

4 3 9 7 11 3<br />

Perform list prefix on remainder:<br />

4 3 13 7 24 27<br />

Integrate eliminated elements:<br />

4 7 13 20 24 27<br />

What is S(n)?<br />

What is W(n)?<br />

List Prefix Operations<br />

What is speedup on n/logn processors?<br />

List Prefix<br />

4 3 6 7 4 3<br />

4 7 9 13 11 7<br />

4 7 13 20 20 20<br />

4 7 13 20 24 27<br />

<strong>Random</strong>ized algorithm:<br />

Goal: achieve W(n) = O(n)<br />

Sketch of algorithm:<br />

Optimizing List Prefix<br />

1. Select a set of list elements that are non adjacent<br />

2. Eliminate the selected elements from the list<br />

3. Repeat steps 1 and 2 until only one element remains<br />

4. Fill in values for the elements eliminated in preceding steps in the<br />

reverse order of their elimination<br />

5

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!