正在加载图片...
end if ⑥ Compu a[i, b[]=bpp, al, b0]=bqq a[i, blll=bpg, al, b[al=bqp /*用empl保存本处理器主行的行号和旋转参数* mpl[o=sinl, templ[1]=co templ[2](float)b[, templ[3]=(float)bUI else ⑦ Compute end if (i)将所有处理器 templ中的旋转参数及主行的行号按处理 器编号连接起来并广播给所有处理器,存于lemp2中 (currer (iv )for I=l to p do /*根据temp2中的其它处理器的旋转参数及主行的行号 对相关的列在本处理器的部分进行旋转变换* 2[(-1)*4+0], il-( int)temp2[(v-1)*4+2],=int)emp2[(v-1)*4+3] ②i(s1、cl、ij1中有一不为0)then if( my-rank≠ current) then for =0 to m-1 de -=a[=,i]*cl+a{=1]*sl a[=j1]=-a=, iIsl+ a= cl end for r=0 to m-1 do r,il==iEl d if d f endl ior (3)Data-exchange() 进行一轮中的最后一次处理器间的数据交换,使数据回到原来的位置* (4) ocalmax=max/+ localmax为本处理器中非对角元最大的绝对值* for户=0ton-ld if((m*my-ranki)+) thenend if end for ⑥Compute: a[i, b[i]]=bpp , a[j, b[j]]=bqq , a[i, b[j]]=bpq , a[j, b[i]]=bqp /*用 temp1 保存本处理器主行的行号和旋转参数*/ temp1[0]=sin1 , temp1[1]=cos1, temp1[2]=(float)b[i] , temp1[3]= (float)b[j] else ⑦Compute: temp1[0]=0,temp1[1]= 0, temp1[2]= 0,temp1[3]= 0 end if (ii)将所有处理器 temp1 中的旋转参数及主行的行号按处理 器编号连接起来并广播给所有处理器,存于 temp2 中 (iii)current=0 (iv)for v=1 to p do /*根据 temp2 中的其它处理器的旋转参数及主行的行号 对相关的列在本处理器的部分进行旋转变换*/ ①Compute: s1=temp2[(v-1)*4+0], c1=temp2[(v-1)*4+1], i1=(int)temp2[(v-1)*4+2], j1=(int)temp2[(v-1)*4+3] ②if (s1、c1、 i1、 j1 中有一不为 0) then if (my-rank ≠ current) then for z=0 to m-1 do zi[z]=a[z,i1]*c1 + a[z,j1]*s1 a[ z,j1]=- a[z,i1]s1 + a[z,j1]*c1 end for for z=0 to m-1 do a[z,i1]= zi[z] end for end if end if ③current=current+1 end for end for end for end for (3)Data-exchange( ) /*进行一轮中的最后一次处理器间的数据交换,使数据回到原来的位置*/ (4)localmax=max /*localmax 为本处理器中非对角元最大的绝对值*/ (5)for i=0 to m-1 do for j=0 to n-1 do if ((m*my-rank+i) ≠ j) then
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有