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

◆ BI_TreeBR()

void BI_TreeBR ( BLACSCONTEXT ctxt,
BLACBUFF bp,
SDRVPTR  send,
Int  src,
Int  nbranches 
)

Definition at line 3 of file BI_TreeBR.c.

4{
6 Int Np, Iam, msgid, i, j;
7 Int mydist; /* my distance from src */
8 Int destdist; /* the distance of the destination node */
9
10 Np = ctxt->scp->Np;
11 if (Np < 2) return;
12 Iam = ctxt->scp->Iam;
13 msgid = Mscopeid(ctxt);
14 mydist = (Np + Iam - src) % Np;
15
16/*
17 * Go up to first step of tree where I send data to other nodes
18 */
19 for (i=nbranches; i < Np; i *= nbranches);
20 for (i /= nbranches; (mydist%i); i /= nbranches);
21 BI_Srecv(ctxt, BANYNODE, msgid, bp);
22
23/*
24 * While I need to send data to others
25 */
26 while ( (i > 1) && !(mydist%i) )
27 {
28 i /= nbranches;
29 j = 1;
30 do
31 {
32 destdist = mydist + j*i;
33 if (destdist < Np)
34 send(ctxt, (src+destdist)%Np, msgid, bp);
35 }
36 while(++j < nbranches);
37 }
38
39} /* end BI_TreeBR */
void BI_Srecv(BLACSCONTEXT *ctxt, Int src, Int msgid, BLACBUFF *bp)
Definition BI_Srecv.c:3
#define Int
Definition Bconfig.h:22
#define Mscopeid(ctxt)
Definition Bdef.h:179
#define BANYNODE
Definition Bdef.h:76
BLACSSCOPE * scp
Definition Bdef.h:26
Int Np
Definition Bdef.h:17
Int Iam
Definition Bdef.h:17
Here is the call graph for this function:
Here is the caller graph for this function: