并行计算课程 矩阵向量乘积并行算法 (基于MPI) 潘建瑜 华东师范大学
1 矩阵向量乘积并行算法 潘建瑜 华东师范大学 (基于 MPI) 并行计算课程
案 串行算法 http://math.ecnu.edu.cn/~jypan
http://math.ecnu.edu.cn/~jypan 串行算法
y=Ax (A∈R",x∈R” fori=1tom/i-j循环 for j=1 to n y(i)=y(i)+A(i,j)*x(j) end for end for forj=1ton/j-i循环 for i=1 to m y(i)=y(i)+A(i,j)*x(j) end for end for
y Ax = ( , ) m n n A x × ∈ ∈ for i=1 to m // i-j 循环 for j=1 to n y(i)=y(i)+A(i,j)*x(j) end for end for for j=1 to n // j-i 循环 for i=1 to m y(i)=y(i)+A(i,j)*x(j) end for end for
数据分配 ij循环 口口 ji循环
... ... ... ... ... i-j 循环 数据分配 j-i 循环
案 并行算法 一按行划分 注:P,表示第i个处理器或第i个进程 http://math.ecnu.edu.cn/~jypan
http://math.ecnu.edu.cn/~jypan 并行算法 —— 按行划分 注:Pi 表示第 i 个处理器或第 i 个进程