MPI并行程序设计初步1.ppt

B 按节拍循环发送数据 (同“全收集”) do step=0,P-1 id_send=mod(myid+step,P) id_recv=mod(myid-step,P) call MPI_Send(B1,N*N/P,MPI_REAL,id_send, ……) call MPI_Recv(B_tmp, N*N/P, MPI_REAL, id_recv, … ) …… 计算出 C1(id_recv) …… (C1(id_recv)=A1*B_tmp) enddo * Copyright by Li Xinliang …… send to ID 0 0 1 2 3 N-1 工作数组,存放接受来的矩阵Bk 服务器/前端机 计算节点 a.exe a.exe a.exe 回顾 MPI 程序的运行原理: 服务器(前端机)编译 可执行代码复制 N 份,每个节点运行一份 调用MPI库函数 得到每个节点号 myid

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档