ScaLAPACK  2.0.2
ScaLAPACK: Scalable Linear Algebra PACKage
BI_SringBR.c
Go to the documentation of this file.
00001 #include "Bdef.h"
00002 
00003 void BI_SringBR(BLACSCONTEXT *ctxt, BLACBUFF *bp, SDRVPTR send, int src)
00004 {
00005    void BI_Srecv(BLACSCONTEXT *, int, int, BLACBUFF *);
00006 
00007    int mydist;          /* my distance from source */
00008    int Np, Iam, msgid, rightedge;
00009 
00010    Np = ctxt->scp->Np;
00011    Iam = ctxt->scp->Iam;
00012    msgid = Mscopeid(ctxt);
00013 
00014    mydist = (Np + Iam - src) % Np;
00015    rightedge = Np/2;
00016    BI_Srecv(ctxt, BANYNODE, msgid, bp);
00017 
00018 /*
00019  * If I'm between source & right edge of split ring, send to right
00020  */
00021    if (mydist < rightedge)
00022       send(ctxt, (Iam+1)%Np, msgid, bp);
00023 /*
00024  * If I'm between source and left edge of split ring, send to left
00025  */
00026    else if (mydist > rightedge+1)
00027       send(ctxt, (Np+Iam-1)%Np, msgid, bp);
00028 }