3 int N,
VVFUNPTR Xvvop,
int dest,
int nrings)
10 int Np, Iam, msgid, i, inc, mysrc, mydest, Np_1;
11 int mydist, ringlen, myring;
12 int nearedge, faredge;
19 if (REBS = (dest == -1)) dest = 0;
23 mydist = (Np + dest - Iam) % Np;
28 mydist = (Np + Iam - dest) % Np;
33 if (nrings > Np_1) nrings = Np_1;
40 ringlen = Np_1 / nrings;
41 myring = (mydist-1) / ringlen;
42 if (myring >= nrings) myring = nrings - 1;
43 nearedge = (myring*ringlen) + 1;
44 faredge = nearedge + ringlen - 1;
45 if (myring == nrings-1) faredge += Np_1 % nrings;
46 if (mydist == nearedge) mydest = dest;
47 else mydest = (Np + Iam + inc) % Np;
48 if (mydist != faredge)
50 BI_Srecv(ctxt, (Np + Iam - inc) % Np, msgid, bp2);
71 ringlen = Np_1 / nrings;
72 if (inc == 1) mysrc = (Np + Iam - 1) % Np;
73 else mysrc = (Iam + 1) % Np;
78 if (inc == 1) mysrc = (Np + mysrc - ringlen) % Np;
79 else mysrc = (mysrc + ringlen) % Np;