ScaLAPACK 2.1  2.1
ScaLAPACK: Scalable Linear Algebra PACKage
blacs_pinfo_.c
Go to the documentation of this file.
1 #include "Bdef.h"
2 
3 #if (INTFACE == C_CALL)
4 void Cblacs_pinfo(int *mypnum, int *nprocs)
5 #else
6 F_VOID_FUNC blacs_pinfo_(int *mypnum, int *nprocs)
7 #endif
8 {
9  int ierr;
10  extern int BI_Iam, BI_Np;
11  int argc=0;
12  char **argv=NULL;
13  if (BI_COMM_WORLD == NULL)
14  {
15  MPI_Initialized(nprocs);
16 
17  if (!(*nprocs))
18  ierr = MPI_Init(&argc,&argv); // call Init and ignore argc and argv
19 
20  BI_COMM_WORLD = (int *) malloc(sizeof(int));
21  *BI_COMM_WORLD = MPI_Comm_c2f(MPI_COMM_WORLD);
22  MPI_Comm_size(MPI_COMM_WORLD, &BI_Np);
23  MPI_Comm_rank(MPI_COMM_WORLD, &BI_Iam);
24  }
25  *mypnum = BI_Iam;
26  *nprocs = BI_Np;
27 }
blacs_pinfo_
F_VOID_FUNC blacs_pinfo_(int *mypnum, int *nprocs)
Definition: blacs_pinfo_.c:6
BI_Iam
int BI_Iam
Definition: BI_GlobalVars.c:7
Cblacs_pinfo
void Cblacs_pinfo()
BI_Np
int BI_Np
Definition: BI_GlobalVars.c:7
F_VOID_FUNC
#define F_VOID_FUNC
Definition: Bdef.h:232
Bdef.h
BI_COMM_WORLD
int * BI_COMM_WORLD
Definition: BI_GlobalVars.c:13