ScaLAPACK 2.1  2.1
ScaLAPACK: Scalable Linear Algebra PACKage
BI_SringBR.c
Go to the documentation of this file.
1 #include "Bdef.h"
2 
3 void BI_SringBR(BLACSCONTEXT *ctxt, BLACBUFF *bp, SDRVPTR send, int src)
4 {
5  void BI_Srecv(BLACSCONTEXT *, int, int, BLACBUFF *);
6 
7  int mydist; /* my distance from source */
8  int Np, Iam, msgid, rightedge;
9 
10  Np = ctxt->scp->Np;
11  Iam = ctxt->scp->Iam;
12  msgid = Mscopeid(ctxt);
13 
14  mydist = (Np + Iam - src) % Np;
15  rightedge = Np/2;
16  BI_Srecv(ctxt, BANYNODE, msgid, bp);
17 
18 /*
19  * If I'm between source & right edge of split ring, send to right
20  */
21  if (mydist < rightedge)
22  send(ctxt, (Iam+1)%Np, msgid, bp);
23 /*
24  * If I'm between source and left edge of split ring, send to left
25  */
26  else if (mydist > rightedge+1)
27  send(ctxt, (Np+Iam-1)%Np, msgid, bp);
28 }
BI_SringBR
void BI_SringBR(BLACSCONTEXT *ctxt, BLACBUFF *bp, SDRVPTR send, int src)
Definition: BI_SringBR.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