4{
9 Int Np, Iam, msgid, Np_1, dir;
10
12 if (Np < 2) return;
15 Np_1 = Np - 1;
16 if (npaths ==
FULLCON) npaths = Np_1;
17
18 if (npaths > 0)
19 {
20 pdest = Iam;
21 dir = 1;
22 }
23 else
24 {
25 pdest = Np + Iam;
26 dir = -1;
27 npaths = -npaths;
28 }
29
30
31
32 if (npaths > Np_1) npaths = Np_1;
33 pathlen = Np_1 / npaths;
34
35
36
37
38 lastlong = (Np_1 % npaths) * (pathlen+1);
39 for (dist=1; dist < lastlong; dist += pathlen+1)
40 send(ctxt, (pdest+dir*dist)%Np, msgid, bp);
41
42
43
44
45 while (dist < Np)
46 {
47 send(ctxt, (pdest+dir*dist)%Np, msgid, bp);
48 dist += pathlen;
49 }
50}