4{
6 Int Np, Iam, msgid, i, j;
9
11 if (Np < 2) return;
14 mydist = (Np + Iam - src) % Np;
15
16
17
18
19 for (i=nbranches; i < Np; i *= nbranches);
20 for (i /= nbranches; (mydist%i); i /= nbranches);
22
23
24
25
26 while ( (i > 1) && !(mydist%i) )
27 {
28 i /= nbranches;
29 j = 1;
30 do
31 {
32 destdist = mydist + j*i;
33 if (destdist < Np)
34 send(ctxt, (src+destdist)%Np, msgid, bp);
35 }
36 while(++j < nbranches);
37 }
38
39}
void BI_Srecv(BLACSCONTEXT *ctxt, Int src, Int msgid, BLACBUFF *bp)