并行程序设计导论第一章.ppt
《并行程序设计导论第一章.ppt》由会员分享,可在线阅读,更多相关《并行程序设计导论第一章.ppt(43页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、1Copyright 2010,Elsevier Inc.All rights ReservedChapter 1Why Parallel Computing?An Introduction to Parallel ProgrammingPeter Pacheco2Copyright 2010,Elsevier Inc.All rights ReservedRoadmapnWhy we need ever-increasing performance.nWhy were building parallel systems.nWhy we need to write parallel progr
2、ams.nHow do we write parallel programs?nWhat well be doing.nConcurrent,parallel,distributed!#Chapter Subtitle3Changing timesCopyright 2010,Elsevier Inc.All rights ReservednFrom 1986 2002,microprocessors were speeding like a rocket,increasing in performance an average of 50%per year.nSince then,its d
3、ropped to about 20%increase per year.4An intelligent solutionCopyright 2010,Elsevier Inc.All rights ReservednInstead of designing and building faster microprocessors,put multiple processors on a single integrated circuit.5Now its up to the programmersnAdding more processors doesnt help much if progr
4、ammers arent aware of themn or dont know how to use them.nSerial programs dont benefit from this approach(in most cases).Copyright 2010,Elsevier Inc.All rights Reserved6Why we need ever-increasing performancenComputational power is increasing,but so are our computation problems and needs.nProblems w
5、e never dreamed of have been solved because of past increases,such as decoding the human genome.nMore complex problems are still waiting to be solved.Copyright 2010,Elsevier Inc.All rights Reserved7Climate modelingCopyright 2010,Elsevier Inc.All rights Reserved8Protein foldingCopyright 2010,Elsevier
6、 Inc.All rights Reserved9Drug discoveryCopyright 2010,Elsevier Inc.All rights Reserved10Energy researchCopyright 2010,Elsevier Inc.All rights Reserved11Data analysisCopyright 2010,Elsevier Inc.All rights Reserved12Why were building parallel systemsnUp to now,performance increases have been attributa
7、ble to increasing density of transistors.nBut there areinherent problems.Copyright 2010,Elsevier Inc.All rights Reserved13A little physics lessonnSmaller transistors=faster processors.nFaster processors=increased power consumption.nIncreased power consumption=increased heat.nIncreased heat=unreliabl
8、e processors.Copyright 2010,Elsevier Inc.All rights Reserved14Solution nMove away from single-core systems to multicore processors.n“core”=central processing unit(CPU)Copyright 2010,Elsevier Inc.All rights ReservednIntroducing parallelism!15Why we need to write parallel programsnRunning multiple ins
9、tances of a serial program often isnt very useful.nThink of running multiple instances of your favorite game.nWhat you really want is forit to run faster.Copyright 2010,Elsevier Inc.All rights Reserved16Approaches to the serial problemnRewrite serial programs so that theyre parallel.nWrite translati
10、on programs that automatically convert serial programs into parallel programs.nThis is very difficult to do.nSuccess has been limited.Copyright 2010,Elsevier Inc.All rights Reserved17More problemsnSome coding constructs can be recognized by an automatic program generator,and converted to a parallel
11、construct.nHowever,its likely that the result will be a very inefficient program.nSometimes the best parallel solution is to step back and devise an entirely new algorithm.Copyright 2010,Elsevier Inc.All rights Reserved18ExamplenCompute n values and add them together.nSerial solution:Copyright 2010,
12、Elsevier Inc.All rights Reserved19Example(cont.)nWe have p cores,p much smaller than n.nEach core performs a partial sum of approximately n/p values.Copyright 2010,Elsevier Inc.All rights ReservedEach core uses its own private variablesand executes this block of codeindependently of the other cores.
13、20Example(cont.)nAfter 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.nEx.,8 cores,n=24,then the calls to Compute_next_value return:Copyright 2010,Elsevier Inc.All rights Reserved1,4,3,9,2,8,5,1,1,5,2,
14、7,2,5,0,4,1,8,6,5,1,2,3,921Example(cont.)nOnce 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.Copyright 2010,Elsevier Inc.All rights Reserved22Example(cont.)Copyright 2010,Elsevier Inc.All rights
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 并行 程序设计 导论 第一章
限制150内