SCALAPACK 2.2.2
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ BI_BeComb()

void BI_BeComb ( BLACSCONTEXT ctxt,
BLACBUFF bp,
BLACBUFF bp2,
Int  N,
VVFUNPTR  Xvvop 
)

Definition at line 10 of file BI_BeComb.c.

49{
57
58 Int Np, Iam, dest, msgid, Rmsgid, np2, bit, ierr;
59 extern MPI_Status *BI_Stats;
60
61 Np = ctxt->scp->Np;
62 if (Np < 2) return;
63 Iam = ctxt->scp->Iam;
64 msgid = Mscopeid(ctxt);
65 Rmsgid = Mscopeid(ctxt);
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) /* I'm node beyond power of 2 */
74 {
75 BI_Arecv(ctxt, dest, Rmsgid, bp);
76 BI_Ssend(ctxt, dest, msgid, bp);
77 BI_BuffIsFree(bp, 1);
78 }
79 else if (Iam < (Np^np2)) /* need to fan in contents of */
80 { /* non-power of 2 nodes */
81 BI_Srecv(ctxt, dest, msgid, bp2);
82 Xvvop(N, bp->Buff, bp2->Buff);
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,
92 bp2->N, bp2->dtype, dest, msgid, ctxt->scp->comm,
93 BI_Stats);
94 Xvvop(N, bp->Buff, bp2->Buff);
95 }
96/*
97 * For nodes that are not part of the hypercube proper, we must
98 * send data back.
99 */
100 if (Iam < (Np^np2)) BI_Rsend(ctxt, (Iam ^ np2), Rmsgid, bp);
101 } /* end if (nodes inside power of 2) */
102}
void BI_Arecv(BLACSCONTEXT *ctxt, Int src, Int msgid, BLACBUFF *bp)
Definition BI_Arecv.c:3
Int BI_BuffIsFree(BLACBUFF *bp, Int Wait)
BLACBUFF * BI_GetBuff(Int length)
Definition BI_GetBuff.c:37
MPI_Status * BI_Stats
void BI_Rsend(BLACSCONTEXT *ctxt, Int dest, Int msgid, BLACBUFF *bp)
Definition BI_Rsend.c:4
void BI_Srecv(BLACSCONTEXT *ctxt, Int src, Int msgid, BLACBUFF *bp)
Definition BI_Srecv.c:3
void BI_Ssend(BLACSCONTEXT *ctxt, Int dest, Int msgid, BLACBUFF *bp)
Definition BI_Ssend.c:3
void BI_UpdateBuffs(BLACBUFF *Newbp)
#define Int
Definition Bconfig.h:22
#define Mscopeid(ctxt)
Definition Bdef.h:179
Int N
Definition Bdef.h:61
MPI_Datatype dtype
Definition Bdef.h:60
char * Buff
Definition Bdef.h:56
BLACSSCOPE * scp
Definition Bdef.h:26
Int Np
Definition Bdef.h:17
MPI_Comm comm
Definition Bdef.h:15
Int Iam
Definition Bdef.h:17
Here is the call graph for this function:
Here is the caller graph for this function: