cs140-multicoresort

cs140-multicoresort - CS 140 : Non-numerical Examples with...

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

View Full Document Right Arrow Icon
1 CS 140 : Non-numerical Examples with Cilk++ Divide and conquer paradigm for Cilk++ Quicksort Mergesort Thanks to Charles E. Leiserson for some of these slides
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 T P = execution time on P processors T 1 = work T = span * * Also called critical-path length or computational depth . Speedup on p processors T 1 /T p Parallelism T 1 /T Work and Span (Recap)
Background image of page 2
3 Scheduling Cilk++ allows the programmer to express potential parallelism in an application. The Cilk++ scheduler maps strands onto processors dynamically at runtime. Since on-line schedulers are complicated, we’ll explore the ideas with an off-line scheduler. Network Memory I/O P P P P $ $ $
Background image of page 3

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

View Full DocumentRight Arrow Icon
4 Greedy Scheduling I DEA : Do as much as possible on every step. Definition: A strand is ready if all its predecessors have executed.
Background image of page 4
5 Greedy Scheduling I DEA : Do as much as possible on every step. Definition: A strand is ready if all its predecessors have executed. Completestep ≥ P strands ready. Run any P . P = 3
Background image of page 5

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

View Full DocumentRight Arrow Icon
6 Greedy Scheduling I DEA : Do as much as possible on every step. Definition: A strand is ready if all its predecessors have executed. Completestep ≥ P strands ready. Run any P . P = 3 Incompletestep < P strands ready. Run all of them.
Background image of page 6
7 Theorem [G68, B75, BL93] . Any greedy scheduler achieves T P T 1 /P + T . Analysis of Greedy Proof. # complete steps T 1 /P , since each complete step performs P work. # incomplete steps T , since each incomplete step reduces the span of the unexecuted dag by 1 . P = 3
Background image of page 7

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

View Full DocumentRight Arrow Icon
8 Optimality of Greedy Corollary. Any greedy scheduler achieves within a factor of 2 of optimal. Proof. Let T P * be the execution time produced by the optimal scheduler. Since T P * ≥ max{T 1 /P, T } by the Work and Span Laws , we have T P ≤ T 1 /P + T ≤ 2⋅max{T 1 /P, T } ≤ 2T P * .
Background image of page 8
9 Linear Speedup Corollary. Any greedy scheduler achieves near-perfect linear speedup whenever P ≪ T 1 /T . Proof. Since P ≪ T 1 /T is equivalent to T ≪ T 1 /P , the Greedy Scheduling Theorem gives us T P ≤ T 1 /P + T ≈ T 1 /P . Thus, the speedup is T 1 /T P ≈ P . Definition. The quantity T 1 /PT is called the parallel slackness .
Background image of page 9

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

View Full DocumentRight Arrow Icon
10 Sorting Sorting is possibly the most frequently executed operation in computing! Quicksort is the fastest sorting algorithm in practice with an average running time of O(N log N), (but O(N 2 ) worst case performance) Mergesort has worst case performance of O(N log N) for sorting N elements Both based on the recursive divide-and- conquer paradigm
Background image of page 10
11 Parallelizing Quicksort Serial Quicksort sorts an array S as follows: If the number of elements in S is 0 or 1 , then return.
Background image of page 11

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

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

This note was uploaded on 12/27/2011 for the course CMPSC 140 taught by Professor Gilbert during the Fall '11 term at UCSB.

Page1 / 39

cs140-multicoresort - CS 140 : Non-numerical Examples with...

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

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