diff options
-rw-r--r-- | src/GHExtension.c | 4 | ||||
-rw-r--r-- | src/SetupPGF.c | 5 | ||||
-rw-r--r-- | src/SetupPGH.c | 31 | ||||
-rw-r--r-- | src/include/pGH.h | 3 |
4 files changed, 12 insertions, 31 deletions
diff --git a/src/GHExtension.c b/src/GHExtension.c index 683e5f0..0190b7c 100644 --- a/src/GHExtension.c +++ b/src/GHExtension.c @@ -22,7 +22,7 @@ static char *rcsid = "$Header$"; extern int PUGH_GHExtension; -pGH *SetupPGH(int nx, int ny, int nz, int ghost_size, int stagger); +pGH *SetupPGH(void *callerid, int nx, int ny, int nz, int ghost_size, int stagger); void *pugh_SetupGH(tFleshConfig *config, int convergence_level, @@ -33,7 +33,7 @@ void *pugh_SetupGH(tFleshConfig *config, int group; int gtype, vtype, dim, n_variables, n_timelevels; - newGH = SetupPGH(global_nx, global_ny, global_nz, + newGH = SetupPGH(GH,global_nx, global_ny, global_nz, ghost_size, PUGH_NO_STAGGER); if(!newGH) diff --git a/src/SetupPGF.c b/src/SetupPGF.c index 6d22b56..95f15f0 100644 --- a/src/SetupPGF.c +++ b/src/SetupPGF.c @@ -142,7 +142,6 @@ pGF *SetupPGF(pGH *GH, const char *name, int dim, int varsize, int vtype) return res; } -#if 0 /*@@ @routine DestroyPGF @date Thu Aug 21 11:44:22 1997 @@ -162,9 +161,6 @@ void DestroyPGF(pGH *GH, pGF **GFin) { free(GF->name); free(GF->padddata); - free(GF->xgfile); - free(GF->zerodfile); - GF->data = NULL; free(GF); @@ -172,7 +168,6 @@ void DestroyPGF(pGH *GH, pGF **GFin) { } -#endif /*@@ @routine EnableGFDataStorage diff --git a/src/SetupPGH.c b/src/SetupPGH.c index b9b86a0..321f4ee 100644 --- a/src/SetupPGH.c +++ b/src/SetupPGH.c @@ -54,9 +54,12 @@ static char *rcsid = "$Id$"; @hdate 30 Mar 1999 @hauthor Thomas Radke @hdesc Added sync_verbose and comm_time + @hauthor Gabrielle Allen + @hdesc Added GH_parent + @hdate 4 June 1999 @@*/ -pGH *SetupPGH(int nx, int ny, int nz, int stencil_width,int staggertype) { +pGH *SetupPGH(void *callerid, int nx, int ny, int nz, int stencil_width,int staggertype) { pGH *GH; @@ -67,6 +70,9 @@ pGH *SetupPGH(int nx, int ny, int nz, int stencil_width,int staggertype) { /* Allocate for myself */ GH = (pGH*) malloc(sizeof(pGH)); + /* Set an identifier for my parent */ + GH->callerid = callerid ; + pGH_SetupBasics(GH,nx,ny,nz,stencil_width,staggertype); pGH_SetupBounds(GH,nx,ny,nz); pGH_SetupOwnership(GH); @@ -848,7 +854,6 @@ void pGH_SetupOwnership(pGH *GH) { } -#if 0 /*@@ @routine DestroyPGH @@ -860,7 +865,6 @@ void pGH_SetupOwnership(pGH *GH) { @@*/ void DestroyPGH(pGH **GHin) { /* First remove me from the list. */ - pGHList *tmp, *x; pGH *GH; int i; int didit; @@ -872,31 +876,11 @@ void DestroyPGH(pGH **GHin) { #endif didit = 0; - if (GHList->GH == GH) { - x = GHList; - GHList = GHList->next; - didit = 1; - } else { - for (tmp = GHList; tmp->next && tmp->next->GH != GH; tmp = tmp->next) { - /* Do nothing */ - } - if (tmp->next) { - x = tmp->next; - tmp->next = tmp->next->next; - didit = 1; - } - } - if (!didit) { - printf ("Can't find GH in list\n"); - } else { - free(x); - } /* Great. Now go about the work of destroying me. */ for (i=0;i<GH->nvariables;i++) DestroyPGF(GH, &(GH->variables[i])); - free(GH->variables); free(GH->lb[0]); @@ -919,7 +903,6 @@ void DestroyPGH(pGH **GHin) { fflush(stdout); } -#endif /*@@ @routine ProcTop diff --git a/src/include/pGH.h b/src/include/pGH.h index f7d91a5..ad03598 100644 --- a/src/include/pGH.h +++ b/src/include/pGH.h @@ -34,6 +34,9 @@ typedef struct PGH { MPI_Comm PUGH_COMM_WORLD; /* A MPIcommunicator */ #endif + /* pGH identifier */ + void * callerid; + /* Size of the processor group */ int nprocs; /* Number of processors */ int myproc; /* My processor */ |