ScaLAPACK  2.0.2
ScaLAPACK: Scalable Linear Algebra PACKage
blacs_info_.c File Reference
#include "Bdef.h"
Include dependency graph for blacs_info_.c:

Go to the source code of this file.

Functions/Subroutines

void Cblacs_gridinfo (int ConTxt, int *nprow, int *npcol, int *myrow, int *mycol)

Function/Subroutine Documentation

void Cblacs_gridinfo ( int  ConTxt,
int *  nprow,
int *  npcol,
int *  myrow,
int *  mycol 
)

Definition at line 4 of file blacs_info_.c.

{
   extern BLACSCONTEXT **BI_MyContxts;
   extern int BI_MaxNCtxt;
   BLACSCONTEXT *ctxt;
/*
 * Make sure context handle is in range
 */
   if ( (Mpval(ConTxt) >= 0) && (Mpval(ConTxt) < BI_MaxNCtxt) )
   {
/*
 *    Make sure context is still defined
 */
      ctxt = BI_MyContxts[Mpval(ConTxt)];
      if (ctxt != NULL)
      {
         *nprow = ctxt->cscp.Np;
         *npcol = ctxt->rscp.Np;
         *myrow = ctxt->cscp.Iam;
         *mycol = ctxt->rscp.Iam;
      }
      else *nprow = *npcol = *myrow = *mycol = -1;
   }
   else *nprow = *npcol = *myrow = *mycol = -1;
}