SCALAPACK 2.2.2
LAPACK: Linear Algebra PACKage
All Classes Files Functions Variables Typedefs Macros
BI_SringBR.c
Go to the documentation of this file.
1#include "Bdef.h"
2
3void BI_SringBR(BLACSCONTEXT *ctxt, BLACBUFF *bp, SDRVPTR send, Int src)
4{
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}
void BI_Srecv(BLACSCONTEXT *ctxt, Int src, Int msgid, BLACBUFF *bp)
Definition BI_Srecv.c:3
void BI_SringBR(BLACSCONTEXT *ctxt, BLACBUFF *bp, SDRVPTR send, Int src)
Definition BI_SringBR.c:3
#define Int
Definition Bconfig.h:22
#define Mscopeid(ctxt)
Definition Bdef.h:179
void(* SDRVPTR)(BLACSCONTEXT *, Int, Int, BLACBUFF *)
Definition Bdef.h:69
#define BANYNODE
Definition Bdef.h:76
BLACSSCOPE * scp
Definition Bdef.h:26
Int Np
Definition Bdef.h:17
Int Iam
Definition Bdef.h:17