网站大量收购独家精品文档,联系QQ:2885784924

ParallelProgramminginCwithMPISorting文件材料.ppt

  1. 1、本文档共50页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Hyperquicksort 0, 8, 12, 15 19, 20, 21, 22, 40, 47, 47, 50, 54, 54 61, 64, 65, 66, 66, 67, 70, 72, 75, 82 83, 85, 86, 88, 89, 91, 98, 99 P0 P1 P2 P3 After exchange-and-merge step Complexity Analysis Assumptions Average-case analysis Lists stay reasonably balanced Communication time dominated by message transmission time, rather than message latency Complexity Analysis Initial quicksort step has time complexity ?((n/p) log (n/p)) Total comparisons needed for log p merge steps: ?((n/p) log p) Total communication time for log p exchange steps: ?((n/p) log p) Isoefficiency Analysis Sequential time complexity: ?(n log n) Parallel overhead: ?(n log p) Isoefficiency relation: n log n ? C n log p ? log n ? C log p ? n ? pC The value of C determines the scalability. Scalability depends on ratio of communication speed to computation speed. Another Scalability Concern Our analysis assumes lists remain balanced As p increases, each processor’s share of list decreases Hence as p increases, likelihood of lists becoming unbalanced increases Unbalanced lists lower efficiency Would be better to get sample values from all processes before choosing median Copyright ? The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Copyright ? The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Parallel Programming in C with MPI and OpenMP Michael J. Quinn Chapter 14 Sorting Sequential Quicksort 17 14 65 4 22 63 11 Choose pivot value Sequential Quicksort 17 14 65 4 22 63 11 Low list (? 17) High list ( 17) Sequential Quicksort 17 4 65 11 22 63 14 Recursively apply quicksort to low list Sequential Quicksort 17 4 22 11 63 65 14 Recursively apply quicksort to high list Sequential Quicksort 17 4 22 11 63 65 14 Sorted list of values Attributes of Sequential Quicksort Average-case time complexity: ?(n log n) Worst-case time complexity: ?(n2) Occurs when low, high lists maximally unbalanced at every partitioning step Can make worst-case less

文档评论(0)

youngyu0329 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档