midterm-Feb2011 - Programming for Performance (ECE459):...

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

View Full Document Right Arrow Icon
Programming for Performance (ECE459): Midterm February 17, 2010 This open-book midterm has 5 questions, worth 20 points each. Choose any 4 of these questions, for a total of 80 points. If you answer 5 questions, we’ll choose which 4 to mark. Answer the questions in your answer book. You may consult any printed material (books, notes, etc). Question 1: Parallelization Patterns (20 points) (5 points each) For each of the following situations, name an appropriate parallelization pattern and the granularity at which you would apply it, explain the necessary communication, and explain why your pattern is appropriate . (About 5 lines each.) build system, e.g. parallel make; optical character recognition system. (5 points each) Give a concrete example where you would use the following parallelization patterns. Explain the granularity at which you’d apply the pattern. single task, multiple threads; producer-consumer (no rendering frames, please). Question 2: Speculation (20 points) We saw this code: void doWork(int x, int y) { int value = longCalculation(x, y); return secondLongCalculation(value); } The notes included one way to parallelize this code using speculation. (5 points) State the conditions on longCalculation and secondLongCalculation under which it is safe to parallelize these calls. To clarify, are there any things that the implementations of longCalculation and secondLongCalculation should not do, if you’re going to parallelize 1
Background image of page 1

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

View Full DocumentRight Arrow Icon
them? (5 points) Write down a more sophisticated speculation for this method.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/22/2011 for the course ECE 459 taught by Professor Patricklam during the Spring '11 term at Waterloo.

Page1 / 4

midterm-Feb2011 - Programming for Performance (ECE459):...

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

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