49{
57
58 Int Np, Iam, dest, msgid, Rmsgid, np2, bit, ierr;
60
62 if (Np < 2) return;
66
67 for (np2=4; np2 < Np; np2 <<= 1);
68 if (np2 > Np) np2 >>= 1;
69
70 if (np2 != Np)
71 {
72 dest = (Iam ^ np2);
73 if (Iam >= np2)
74 {
78 }
79 else if (Iam < (Np^np2))
80 {
83 }
84 }
85
86 if (Iam < np2)
87 {
88 for (bit=1; (bit ^ np2); bit <<= 1)
89 {
90 dest = Iam ^ bit;
91 ierr=MPI_Sendrecv(bp->
Buff, bp->
N, bp->
dtype, dest, msgid, bp2->
Buff,
95 }
96
97
98
99
100 if (Iam < (Np^np2))
BI_Rsend(ctxt, (Iam ^ np2), Rmsgid, bp);
101 }
102}
void BI_Arecv(BLACSCONTEXT *ctxt, Int src, Int msgid, BLACBUFF *bp)
Int BI_BuffIsFree(BLACBUFF *bp, Int Wait)
BLACBUFF * BI_GetBuff(Int length)
void BI_Rsend(BLACSCONTEXT *ctxt, Int dest, Int msgid, BLACBUFF *bp)
void BI_Srecv(BLACSCONTEXT *ctxt, Int src, Int msgid, BLACBUFF *bp)
void BI_Ssend(BLACSCONTEXT *ctxt, Int dest, Int msgid, BLACBUFF *bp)
void BI_UpdateBuffs(BLACBUFF *Newbp)