ScaLAPACK 2.1  2.1
ScaLAPACK: Scalable Linear Algebra PACKage
blacs_get_.c
Go to the documentation of this file.
1 #include "Bdef.h"
2 #if (INTFACE == C_CALL)
3 void Cblacs_get(int ConTxt, int what, int *val)
4 #else
5 F_VOID_FUNC blacs_get_(int *ConTxt, int *what, int *val)
6 #endif
7 {
8  int ierr, *iptr;
9  int comm;
10  BLACSCONTEXT *ctxt;
11 
12  switch( Mpval(what) )
13  {
14  case SGET_SYSCONTXT:
15  if (BI_COMM_WORLD == NULL) Cblacs_pinfo(val, &ierr);
16 #if (INTFACE == C_CALL)
17  *val = Csys2blacs_handle(MPI_COMM_WORLD);
18 #else
19  *val = *BI_COMM_WORLD;
20 #endif
21  break;
22  case SGET_MSGIDS:
23  if (BI_COMM_WORLD == NULL) Cblacs_pinfo(val, &val[1]);
24  iptr = &val[1];
25  ierr=MPI_Comm_get_attr(MPI_COMM_WORLD, MPI_TAG_UB, (BVOID **) &iptr,val);
26  val[0] = 0;
27  val[1] = *iptr;
28  break;
29  case SGET_DEBUGLVL:
30  *val = BlacsDebugLvl;
31  break;
32  case SGET_BLACSCONTXT:
33  MGetConTxt(Mpval(ConTxt), ctxt);
34 #if (INTFACE == C_CALL)
35  *val = Csys2blacs_handle(ctxt->pscp.comm);
36 #else /* if user called the fortran interface to the BLACS */
37  *val = MPI_Comm_c2f(ctxt->pscp.comm);
38 #endif
39  break;
40  case SGET_NR_BS:
41  MGetConTxt(Mpval(ConTxt), ctxt);
42  *val = ctxt->Nr_bs;
43  break;
44  case SGET_NB_BS:
45  MGetConTxt(Mpval(ConTxt), ctxt);
46  *val = ctxt->Nb_bs - 1;
47  break;
48  case SGET_NR_CO:
49  MGetConTxt(Mpval(ConTxt), ctxt);
50  *val = ctxt->Nr_co;
51  break;
52  case SGET_NB_CO:
53  MGetConTxt(Mpval(ConTxt), ctxt);
54  *val = ctxt->Nb_co - 1;
55  break;
56  case SGET_TOPSREPEAT:
57  MGetConTxt(Mpval(ConTxt), ctxt);
58  *val = ctxt->TopsRepeat;
59  break;
60  case SGET_TOPSCOHRNT:
61  MGetConTxt(Mpval(ConTxt), ctxt);
62  *val = ctxt->TopsCohrnt;
63  break;
64  default:
65  BI_BlacsWarn(Mpval(ConTxt), __LINE__, __FILE__, "Unknown WHAT (%d)",
66  Mpval(what));
67  }
68 }
bLaCsCoNtExT::TopsRepeat
int TopsRepeat
Definition: Bdef.h:27
BlacsDebugLvl
#define BlacsDebugLvl
Definition: Bconfig.h:98
Cblacs_pinfo
void Cblacs_pinfo()
MGetConTxt
#define MGetConTxt(Context, ctxtptr)
Definition: Bdef.h:200
SGET_NR_BS
#define SGET_NR_BS
Definition: Bdef.h:118
SGET_SYSCONTXT
#define SGET_SYSCONTXT
Definition: Bdef.h:114
SGET_NB_CO
#define SGET_NB_CO
Definition: Bdef.h:121
bLaCsCoNtExT::pscp
BLACSSCOPE pscp
Definition: Bdef.h:25
BVOID
#define BVOID
Definition: Bdef.h:136
blacs_get_
F_VOID_FUNC blacs_get_(int *ConTxt, int *what, int *val)
Definition: blacs_get_.c:5
bLaCsCoNtExT::TopsCohrnt
int TopsCohrnt
Definition: Bdef.h:28
bLaCsCoNtExT::Nb_co
int Nb_co
Definition: Bdef.h:30
bLaCsCoNtExT::Nb_bs
int Nb_bs
Definition: Bdef.h:29
Mpval
#define Mpval(para)
Definition: Bdef.h:261
bLaCsCoNtExT
Definition: Bdef.h:23
SGET_MSGIDS
#define SGET_MSGIDS
Definition: Bdef.h:115
Cblacs_get
void Cblacs_get()
bLaCsCoNtExT::Nr_bs
int Nr_bs
Definition: Bdef.h:29
F_VOID_FUNC
#define F_VOID_FUNC
Definition: Bdef.h:232
Bdef.h
bLaCsScOpE::comm
MPI_Comm comm
Definition: Bdef.h:15
SGET_NB_BS
#define SGET_NB_BS
Definition: Bdef.h:119
SGET_NR_CO
#define SGET_NR_CO
Definition: Bdef.h:120
SGET_TOPSCOHRNT
#define SGET_TOPSCOHRNT
Definition: Bdef.h:123
bLaCsCoNtExT::Nr_co
int Nr_co
Definition: Bdef.h:30
BI_BlacsWarn
void BI_BlacsWarn(int ConTxt, int line, char *file, char *form,...)
Definition: BI_BlacsWarn.c:3
SGET_BLACSCONTXT
#define SGET_BLACSCONTXT
Definition: Bdef.h:117
BI_COMM_WORLD
int * BI_COMM_WORLD
Definition: BI_GlobalVars.c:13
SGET_TOPSREPEAT
#define SGET_TOPSREPEAT
Definition: Bdef.h:122
SGET_DEBUGLVL
#define SGET_DEBUGLVL
Definition: Bdef.h:116