正在加载图片...
I Recursive Halving and Doubling The first processor first sends f(myRank==0)t the data to only two other send to processors 1 and 2 processors. Then each of these processors send the data to two other processors, and so else on At each stage the number of processors sending and receive from processors receiving data doubles. The int((myRank-1)/2) code is simple and looks similar to torank 1=2 myRank+1 torank2=2 myRank+2 if (torank1 exists) send to trank 1 if (torank2 exists) send to torank2Recursive Halving and Doubling • The first processor first sends the data to only two other processors. Then each of these processors send the data to two other processors, and so on. At each stage, the number of processors sending and receiving data doubles. The code is simple and looks similar to If (myRank==0) { send to processors 1 and 2; } else { receive from processors int((myRank-1)/2); torank1=2*myRank+1; torank2=2*myRank+2; if (torank1 exists) send to torank1; if (torank2 exists) send to torank2; }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有