20 int N,
VVFUNPTR Xvvop,
int dest,
int nbranches)
75 int Np, Iam, msgid, Rmsgid, i, j;
88 if (REBS = (dest == -1)) dest = 0;
90 mydist = (Np + Iam - dest) % Np;
97 if (nbranches ==
FULLCON) nbranches = Np;
98 rightedge = Np - 1 - (Np-1)%nbranches;
100 for (i=1; (i < Np); i *= nbranches)
102 if (mydist%nbranches)
104 BI_Ssend(ctxt, (dest + (mydist-mydist%nbranches)*i)%Np, msgid, bp);
109 if (mydist != rightedge) nrcvs = nbranches - 1;
110 else nrcvs = (Np + i - 1) / i - rightedge - 1;
112 rightedge /= nbranches;
113 rightedge -= (rightedge % nbranches);
117 for (j=nrcvs; j; j--)
125 src = (Iam + i) % Np;
126 for (j=nrcvs; j; j--)
130 src = (src + i) % Np;
142 for (i=2; i < Np; i <<= 1);
151 if (dist < Np)
BI_Rsend(ctxt, dist, Rmsgid, bp);