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

Go to the source code of this file.

Functions/Subroutines

void Cblacs_gridexit (int ConTxt)

Function/Subroutine Documentation

void Cblacs_gridexit ( int  ConTxt)

Definition at line 4 of file blacs_grid_.c.

{
   int i;
   BLACSCONTEXT *ctxt;
   extern int BI_MaxNCtxt;
   extern BLACSCONTEXT **BI_MyContxts;

   if ( (Mpval(ConTxt) < 0) || (Mpval(ConTxt) >= BI_MaxNCtxt) )
      BI_BlacsErr(Mpval(ConTxt), __LINE__, __FILE__,
                  "Trying to exit non-existent context");

   if (BI_MyContxts[Mpval(ConTxt)] == NULL)
      BI_BlacsErr(Mpval(ConTxt), __LINE__, __FILE__,
                  "Trying to exit an already freed context");

   MGetConTxt(Mpval(ConTxt), ctxt);
/*
 * Destroy context
 */
   MPI_Comm_free(&ctxt->pscp.comm);
   MPI_Comm_free(&ctxt->ascp.comm);
   MPI_Comm_free(&ctxt->rscp.comm);
   MPI_Comm_free(&ctxt->cscp.comm);
   free(ctxt);
   BI_MyContxts[Mpval(ConTxt)] = NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function: