|
ScaLAPACK
2.0.2
ScaLAPACK: Scalable Linear Algebra PACKage
|
#include "Bdef.h"Go to the source code of this file.
Functions/Subroutines | |
| void | Cblacs_gridexit (int ConTxt) |
| 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;
}