Performance ¡of ¡Parallel ¡Programs ¡
Michelle ¡Ku3el ¡
1 ¡
Performance of Parallel Programs Michelle Ku3el 1 - - PowerPoint PPT Presentation
Performance of Parallel Programs Michelle Ku3el 1 Analyzing algorithms Like all algorithms, parallel algorithms should be: Correct Efficient
1 ¡
2 ¡
e.g. ¡for ¡divide-‑and-‑conquer, ¡just ¡“sequenHalize” ¡the ¡recursive ¡forking ¡
– The ¡longest ¡dependence-‑chain ¡ – Example: ¡O(log ¡n) ¡for ¡summing ¡an ¡array ¡with ¡divide-‑and-‑conquer ¡ method ¡ ¡
– Also ¡called ¡“criHcal ¡path ¡length” ¡or ¡“computaHonal ¡depth” ¡
3 ¡ slide ¡adapted ¡from: ¡Sophomoric ¡Parallelism ¡and ¡Concurrency, ¡Lecture ¡2 ¡
Speedup ¡is ¡the ¡factor ¡by ¡which ¡the ¡Hme ¡is ¡ reduced ¡compared ¡to ¡a ¡single ¡processor ¡ Speedup ¡for ¡P ¡processes ¡= ¡
Hme ¡for ¡1 ¡process ¡ ¡ Hme ¡for ¡P ¡processes ¡ ¡= ¡T1/TP. ¡ In ¡the ¡ideal ¡situaHon, ¡as ¡P ¡increases, ¡so ¡ TP ¡should ¡decrease ¡by ¡a ¡factor ¡of ¡P. ¡ ¡ ¡
Figure ¡from ¡“Parallel ¡Programming ¡in ¡OpenMP, ¡by ¡Chandra ¡et ¡al. ¡ ¡
– perfect ¡linear ¡speedup ¡= ¡P ¡
– running ¡Hme ¡is ¡inversely ¡proporHonal ¡to ¡the ¡number ¡of ¡processors ¡
5 ¡ slide ¡adapted ¡from: ¡Sophomoric ¡Parallelism ¡and ¡Concurrency, ¡Lecture ¡2 ¡
6 ¡ slide ¡adapted ¡from: ¡Sophomoric ¡Parallelism ¡and ¡Concurrency, ¡Lecture ¡2 ¡
slide from: Art of Multiprocessor Programming
User ¡code ¡ TradiHonal ¡ Uniprocessor ¡ ¡ Speedup ¡
8 ¡
User ¡code ¡ MulHcore ¡ Speedup ¡
slide from: Art of Multiprocessor Programming
9 ¡
User ¡code ¡ MulHcore ¡ Speedup ¡
slide from: Art of Multiprocessor Programming
10 ¡
Gene ¡Amdahl,1967 ¡
IBM ¡-‑ ¡the ¡designer ¡of ¡IBM ¡360 ¡series ¡of ¡mainframe ¡architecture ¡ ¡
“Nine ¡women ¡can’t ¡make ¡one ¡baby ¡in ¡one ¡month” ¡
12 ¡ slide ¡adapted ¡from: ¡Sophomoric ¡Parallelism ¡and ¡Concurrency, ¡Lecture ¡2 ¡
13 ¡
Total ¡running ¡Hme ¡for ¡a ¡program ¡can ¡be ¡divided ¡into ¡two ¡parts: ¡
Serial ¡part ¡ ¡(s) ¡ Parallel ¡part ¡ ¡(p) ¡ ¡
For ¡n ¡processors: ¡
* ¡G. ¡M. ¡Amdahl, ¡“Validity ¡of ¡the ¡single ¡processor ¡approach ¡to ¡achieving ¡large ¡scale ¡compuHng ¡
capabiliHes”, ¡AFIPS ¡Proc. ¡Of ¡the ¡SJCC, ¡30,438-‑485,1967 ¡
14 ¡
Art of Multiprocessor Programming 15 ¡
Art of Multiprocessor Programming 16 ¡
Art of Multiprocessor Programming 17 ¡
Art of Multiprocessor Programming
18 ¡
capabiliHes”, ¡AFIPS ¡Proc. ¡Of ¡the ¡SJCC, ¡30,438-‑485,1967 ¡
19 ¡
Art of Multiprocessor Programming 20 ¡
Art of Multiprocessor Programming 21 ¡
Art of Multiprocessor Programming 22 ¡
Art of Multiprocessor Programming 23 ¡
graphic ¡from ¡lecture ¡slides: ¡Defining ¡Computer ¡“Speed”: ¡An ¡Unsolved ¡Challenge, ¡Dr. ¡John ¡L. ¡Gustafson, ¡ Director ¡Intel ¡Labs, ¡30 ¡Jan ¡2011 ¡
25 ¡ slide ¡adapted ¡from: ¡Sophomoric ¡Parallelism ¡and ¡Concurrency, ¡Lecture ¡2 ¡
26 ¡
27 ¡
28 ¡ slide ¡adapted ¡from: ¡Sophomoric ¡Parallelism ¡and ¡Concurrency, ¡Lecture ¡2 ¡
From ¡lecture ¡slides: ¡Defining ¡Computer ¡“Speed”: ¡An ¡Unsolved ¡Challenge ¡
Intel ¡Labs, ¡30 ¡Jan ¡2011 ¡ Sounds ¡reasonable, ¡right? ¡ Yet, ¡this ¡approach ¡held ¡back ¡ parallel ¡processing ¡for ¡20 ¡years! ¡
29 ¡
From ¡lecture ¡slides: ¡Defining ¡Computer ¡“Speed”: ¡An ¡Unsolved ¡Challenge, ¡Dr. ¡John ¡L. ¡Gustafson, ¡Director ¡ Intel ¡Labs, ¡30 ¡Jan ¡2011 ¡
30 ¡
31 ¡
32 ¡
From ¡lecture ¡slides: ¡Defining ¡Computer ¡“Speed”: ¡An ¡Unsolved ¡Challenge, ¡Dr. ¡John ¡L. ¡Gustafson, ¡Director ¡ Intel ¡Labs, ¡30 ¡Jan ¡2011 ¡
33 ¡
34 ¡
– Coverage ¡is ¡the ¡percentage ¡of ¡a ¡program ¡that ¡is ¡parallel. ¡
– how ¡much ¡work ¡is in ¡each ¡parallel ¡region. ¡
– how ¡evenly ¡balanced ¡the work ¡load ¡is ¡among ¡the ¡different ¡processors. ¡
– loop ¡scheduling ¡determines ¡how ¡iteraHons ¡of ¡a parallel ¡loop ¡are ¡assigned ¡to ¡threads ¡
– cost ¡to ¡communicate ¡informaHon ¡between ¡different ¡processors on ¡the ¡ underlying ¡system. ¡
– need ¡to ¡understand ¡machine ¡architecture ¡
35 ¡
36 ¡
37 ¡