ScaLAPACK 2.1  2.1
ScaLAPACK: Scalable Linear Algebra PACKage
BI_HypBR.c
Go to the documentation of this file.
1 #include "Bdef.h"
2 
3 int BI_HypBR(BLACSCONTEXT *ctxt, BLACBUFF *bp, SDRVPTR send, int src)
4 {
5  void BI_Srecv(BLACSCONTEXT *, int, int, BLACBUFF *);
6  int relnode, bit, Np, Iam, msgid;
7 
8  Np = ctxt->scp->Np;
9  Iam = ctxt->scp->Iam;
10  msgid = Mscopeid(ctxt);
11 
12  for (bit=2; bit < Np; bit <<= 1);
13  if (bit^Np) return(NPOW2); /* not a power of 2 */
14  relnode = Iam ^ src;
15 
16  BI_Srecv(ctxt, BANYNODE, msgid, bp);
17  for(bit=1; (bit^Np); bit <<= 1)
18  if (bit > relnode) send(ctxt, Iam^bit, msgid, bp);
19 
20  return(0);
21 }
BI_HypBR
int BI_HypBR(BLACSCONTEXT *ctxt, BLACBUFF *bp, SDRVPTR send, int src)
Definition: BI_HypBR.c:3
bLaCbUfF
Definition: Bdef.h:54
bLaCsScOpE::Iam
int Iam
Definition: Bdef.h:17
Mscopeid
#define Mscopeid(ctxt)
Definition: Bdef.h:179
bLaCsCoNtExT
Definition: Bdef.h:23
SDRVPTR
void(* SDRVPTR)(BLACSCONTEXT *, int, int, BLACBUFF *)
Definition: Bdef.h:69
bLaCsCoNtExT::scp
BLACSSCOPE * scp
Definition: Bdef.h:26
Bdef.h
BI_Srecv
void BI_Srecv(BLACSCONTEXT *ctxt, int src, int msgid, BLACBUFF *bp)
Definition: BI_Srecv.c:3
bLaCsScOpE::Np
int Np
Definition: Bdef.h:17
BANYNODE
#define BANYNODE
Definition: Bdef.h:76
NPOW2
#define NPOW2
Definition: Bdef.h:88