并行程序设计导论.pptx
《并行程序设计导论.pptx》由会员分享,可在线阅读,更多相关《并行程序设计导论.pptx(43页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、RoadmapWhy we need ever-increasing performance.Why were building parallel systems.Why we need to write parallel programs.How do we write parallel programs?What well be doing.Concurrent,parallel,distributed!#Chapter Subtitle第1页/共43页Changing timesFrom 1986 2002,microprocessors were speeding like a roc
2、ket,increasing in performance an average of 50%per year.Since then,its dropped to about 20%increase per year.第2页/共43页An intelligent solutionInstead of designing and building faster microprocessors,put multiple processors on a single integrated circuit.第3页/共43页Now its up to the programmersAdding more
3、 processors doesnt help much if programmers arent aware of them or dont know how to use them.Serial programs dont benefit from this approach(in most cases).第4页/共43页Why we need ever-increasing performanceComputational power is increasing,but so are our computation problems and needs.Problems we never
4、 dreamed of have been solved because of past increases,such as decoding the human genome.More complex problems are still waiting to be solved.第5页/共43页Climate modeling第6页/共43页Protein folding第7页/共43页Drug discovery第8页/共43页Energy research第9页/共43页Data analysis第10页/共43页Why were building parallel systemsUp
5、 to now,performance increases have been attributable to increasing density of transistors.But there areinherent problems.第11页/共43页A little physics lessonSmaller transistors=faster processors.Faster processors=increased power consumption.Increased power consumption=increased heat.Increased heat=unrel
6、iable processors.第12页/共43页Solution Move away from single-core systems to multicore processors.“core”=central processing unit(CPU)nIntroducing parallelism!第13页/共43页Why we need to write parallel programsRunning multiple instances of a serial program often isnt very useful.Think of running multiple ins
7、tances of your favorite game.What you really want is forit to run faster.第14页/共43页Approaches to the serial problemRewrite serial programs so that theyre parallel.Write translation programs that automatically convert serial programs into parallel programs.This is very difficult to do.Success has been
8、 limited.第15页/共43页More problemsSome coding constructs can be recognized by an automatic program generator,and converted to a parallel construct.However,its likely that the result will be a very inefficient program.Sometimes the best parallel solution is to step back and devise an entirely new algori
9、thm.第16页/共43页ExampleCompute n values and add them together.Serial solution:第17页/共43页Example(cont.)We have p cores,p much smaller than n.Each core performs a partial sum of approximately n/p values.Each core uses its own private variablesand executes this block of codeindependently of the other cores
10、.第18页/共43页Example(cont.)After each core completes execution of the code,is a private variable my_sum contains the sum of the values computed by its calls to Compute_next_value.Ex.,8 cores,n=24,then the calls to Compute_next_value return:1,4,3,9,2,8,5,1,1,5,2,7,2,5,0,4,1,8,6,5,1,2,3,9第19页/共43页Example
11、(cont.)Once all the cores are done computing their private my_sum,they form a global sum by sending results to a designated“master”core which adds the final result.第20页/共43页Example(cont.)第21页/共43页Example(cont.)Core01234567my_sum8197157131214Global sum8+19+7+15+7+13+12+14=95Core01234567my_sum95197157
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 并行 程序设计 导论
限制150内