SCALAPACK 2.2.2
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
blacs_grid_.c
Go to the documentation of this file.
1#include "Bdef.h"
2
3#if (INTFACE == C_CALL)
4void Cblacs_gridexit(Int ConTxt)
5#else
7#endif
8{
9 Int i;
10 BLACSCONTEXT *ctxt;
11 extern Int BI_MaxNCtxt;
13
14 if ( (Mpval(ConTxt) < 0) || (Mpval(ConTxt) >= BI_MaxNCtxt) )
15 BI_BlacsErr(Mpval(ConTxt), __LINE__, __FILE__,
16 "Trying to exit non-existent context");
17
18 if (BI_MyContxts[Mpval(ConTxt)] == NULL)
19 BI_BlacsErr(Mpval(ConTxt), __LINE__, __FILE__,
20 "Trying to exit an already freed context");
21
22 MGetConTxt(Mpval(ConTxt), ctxt);
23/*
24 * Destroy context
25 */
26 MPI_Comm_free(&ctxt->pscp.comm);
27 MPI_Comm_free(&ctxt->ascp.comm);
28 MPI_Comm_free(&ctxt->rscp.comm);
29 MPI_Comm_free(&ctxt->cscp.comm);
30 free(ctxt);
31 BI_MyContxts[Mpval(ConTxt)] = NULL;
32}
BLACSCONTEXT ** BI_MyContxts
Int BI_MaxNCtxt
#define Int
Definition Bconfig.h:22
void BI_BlacsErr(Int ConTxt, Int line, char *file, char *form,...)
Definition BI_BlacsErr.c:3
#define MGetConTxt(Context, ctxtptr)
Definition Bdef.h:200
#define F_VOID_FUNC
Definition Bdef.h:232
#define Mpval(para)
Definition Bdef.h:261
void Cblacs_gridexit()
F_VOID_FUNC blacs_gridexit_(Int *ConTxt)
Definition blacs_grid_.c:6
BLACSSCOPE pscp
Definition Bdef.h:25
BLACSSCOPE ascp
Definition Bdef.h:25
BLACSSCOPE rscp
Definition Bdef.h:25
BLACSSCOPE cscp
Definition Bdef.h:25
MPI_Comm comm
Definition Bdef.h:15