ScaLAPACK 2.1  2.1
ScaLAPACK: Scalable Linear Algebra PACKage
blacs_info_.c
Go to the documentation of this file.
1 #include "Bdef.h"
2 
3 #if (INTFACE == C_CALL)
4 void Cblacs_gridinfo(int ConTxt, int *nprow, int *npcol, int *myrow, int *mycol)
5 #else
6 F_VOID_FUNC blacs_gridinfo_(int *ConTxt, int *nprow, int *npcol,
7  int *myrow, int *mycol)
8 #endif
9 {
10  extern BLACSCONTEXT **BI_MyContxts;
11  extern int BI_MaxNCtxt;
12  BLACSCONTEXT *ctxt;
13 /*
14  * Make sure context handle is in range
15  */
16  if ( (Mpval(ConTxt) >= 0) && (Mpval(ConTxt) < BI_MaxNCtxt) )
17  {
18 /*
19  * Make sure context is still defined
20  */
21  ctxt = BI_MyContxts[Mpval(ConTxt)];
22  if (ctxt != NULL)
23  {
24  *nprow = ctxt->cscp.Np;
25  *npcol = ctxt->rscp.Np;
26  *myrow = ctxt->cscp.Iam;
27  *mycol = ctxt->rscp.Iam;
28  }
29  else *nprow = *npcol = *myrow = *mycol = -1;
30  }
31  else *nprow = *npcol = *myrow = *mycol = -1;
32 }
bLaCsCoNtExT::rscp
BLACSSCOPE rscp
Definition: Bdef.h:25
bLaCsScOpE::Iam
int Iam
Definition: Bdef.h:17
blacs_gridinfo_
F_VOID_FUNC blacs_gridinfo_(int *ConTxt, int *nprow, int *npcol, int *myrow, int *mycol)
Definition: blacs_info_.c:6
Mpval
#define Mpval(para)
Definition: Bdef.h:261
bLaCsCoNtExT
Definition: Bdef.h:23
BI_MaxNCtxt
int BI_MaxNCtxt
Definition: BI_GlobalVars.c:5
F_VOID_FUNC
#define F_VOID_FUNC
Definition: Bdef.h:232
bLaCsCoNtExT::cscp
BLACSSCOPE cscp
Definition: Bdef.h:25
Bdef.h
Cblacs_gridinfo
void Cblacs_gridinfo()
BI_MyContxts
BLACSCONTEXT ** BI_MyContxts
Definition: BI_GlobalVars.c:11
bLaCsScOpE::Np
int Np
Definition: Bdef.h:17