- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
synchronous iteration同步迭代
To be continued… 另一个全同步迭代程序例子 用雅可比(Jacobi)迭代法解线性方程组 Solving a General System of Linear Equations by Iteration Suppose the equations are of a general form with n equations and n unknowns where the unknowns are x0, x1, x2, … xn-1 (0 = i n). 把第i个方程 This equation gives xi in terms of the other unknowns. 可以作为迭代公式计算每个未知数的逼近值。 改写成 即 Jacobi Iteration雅可比迭代法 All values of x are updated together.所有的x值同时更新 可以证明如果方程组对角线上a的绝对值大于同行中其他a的绝对值之和 (a方阵是对角占优的), 则雅可比法收敛 i.e. This condition is a sufficient but not a necessary condition. A simple, common approach. Compare values computed in one iteration to values obtained from the previous iteration. Terminate computation when all values are within given tolerance; i.e., when However, this does not guarantee the solution to that accuracy. Termination终止 前后两次结果的差异 Convergence Rate Parallel Code 每个未知数分配一个进程,每个进程迭代步数一样,进程 Pi 可写成下面的代码 x[i] = b[i]; /*initialize unknown*/ for (iteration = 0; iteration limit; iteration++) { sum = -a[i][i] * x[i]; for (j = 0; j n; j++) /* compute summation */ sum = sum + a[i][j] * x[j]; new_x[i] = (b[i] - sum) / a[i][i]; /* compute unknown */ allgather(new_x[i]); /*bcast/recv values */ global_barrier(); /* wait for all processes */ } allgather() sends the newly computed value of x[i] from process i to every other process and collects data broadcast from the other processes. Introduce a new message-passing operation - Allgather. Allgather Broadcast and gather values in one composite construction. MPI_Allgather(); MPI_Allreduce(); n = pSize; //每个进程对应一个未知数 if(!pID) input(); //根进程负责输入 MPI_Bcast(a, MAX_A, MPI_FLOAT, 0, MPI_COMM_WORLD); //广播系数 MPI_Bcast(b, MAX_N, MPI_FLOAT, 0, MPI_COMM_WORLD); //广播b for(i = 0; i n; i++) { x[i] = b[i]; new_x[i] = b[i]; } //初始化x的值 i = pID; //当前进程处理的元素为该进程的ID do{//迭代求x[i]的值 iteration++; //迭代次数加1 //将上一轮迭代的结果作为本轮迭代的起始值,并设置新的迭代结果为0 for(j
您可能关注的文档
- 激光测距仪hdp5100 长距离型.pdf
- 浅接面结构对功率电晶体电性改善之研究improvement on the .pdf
- page 1 之一“ 知觉规律在刑事侦察上的意义 一个被害人,在向刑侦人员 .pdf
- 6 系统安装与设置 - 档案软件.doc
- 技术时代的课程与教学变革.ppt
- 技术标准演进中的创立者专利声明行为研究.pdf
- 药材中微量元素测定方法的研究进展.pdf
- 技术经济评价与项目(投)融资 - 华中科技大学管理学院.doc
- 黄河干流大型水库水沙优化调度研究进展 - 黄河水利科学研究院.doc
- 新型交直流混合微电网结构设计 - 电力系统保护与控制.pdf
- association for computing machinery - 西北大学图书馆.ppt
- 抗震结构基于最大弹塑性位移耦合作用的滞回耗能谱 - 振动工程学报.pdf
- non-muscle myosin ii-a调节斑马鱼胚胎发育过程中肠内分泌细胞的极化.pdf
- 基于块稀疏度估计的压缩感知自适应重构算法 - 计算机应用研究.pdf
- 抗青枯病烟草种质资源在云南省的评价 - ingenta connect.pdf
- 胶体 - 梅县松口中学.ppt
- 结构: 功能.ppt
- 抗震维修和重建之关键问题 - world bank group.pdf
- 一种面向大规模社会网络的社区发现算法 - 南京大学学报(自然科学).pdf
- 抗烟草花叶病毒的转基因病毒.ppt
文档评论(0)