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

◆ BI_MpathBR()

void BI_MpathBR ( BLACSCONTEXT ctxt,
BLACBUFF bp,
SDRVPTR  send,
Int  src,
Int  npaths 
)

Definition at line 3 of file BI_MpathBR.c.

4{
7
8 Int pathlen; /* the minimal length of each path */
9 Int mydist; /* my distance from src */
10 Int faredge; /* node at far end of path */
11 Int lastlong; /* distance to node on end of last path with extra node */
12 Int Np, Iam, msgid, Np_1, dest;
13
14 msgid = Mscopeid(ctxt);
15 BI_Arecv(ctxt, BANYNODE, msgid, bp);
16 Np = ctxt->scp->Np;
17 Iam = ctxt->scp->Iam;
18 Np_1 = Np - 1;
19 if (npaths == FULLCON) npaths = Np_1;
20
21 if (npaths > 0)
22 {
23 dest = (Iam+1) % Np;
24 mydist = (Np + Iam - src) % Np;
25 }
26 else
27 {
28 dest = (Np_1+Iam) % Np;
29 mydist = (Np + src - Iam) % Np;
30 npaths = -npaths;
31 }
32/*
33 * Make sure npaths is cool
34 */
35 if (npaths > Np_1) npaths = Np_1;
36
37 pathlen = Np_1 / npaths;
38 lastlong = (Np_1%npaths) * (pathlen+1);
39 if (lastlong)
40 {
41 if (mydist <= lastlong) faredge = ((mydist-1)/(pathlen+1)+1)*(pathlen+1);
42 else faredge = ((lastlong-1)/(pathlen+1)+1) * (pathlen+1)
43 + ((mydist-lastlong-1)/pathlen + 1) * pathlen;
44 }
45 else faredge = ((mydist-1)/pathlen + 1) * pathlen;
46
47 BI_BuffIsFree(bp, 1); /* wait for recv to complete */
48 if (mydist < faredge) send(ctxt, dest, msgid, bp);
49}
void BI_Arecv(BLACSCONTEXT *ctxt, Int src, Int msgid, BLACBUFF *bp)
Definition BI_Arecv.c:3
Int BI_BuffIsFree(BLACBUFF *bp, Int Wait)
#define Int
Definition Bconfig.h:22
#define Mscopeid(ctxt)
Definition Bdef.h:179
#define FULLCON
Definition Bdef.h:100
#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: