diff options
author | allen <allen@b61c5cb5-eaca-4651-9a7a-d64986f99364> | 2000-03-23 15:18:57 +0000 |
---|---|---|
committer | allen <allen@b61c5cb5-eaca-4651-9a7a-d64986f99364> | 2000-03-23 15:18:57 +0000 |
commit | 3641f4c7513fffd1f0d026f1a859ecaa78712682 (patch) | |
tree | 322b86eeaf723d4940ffaff81d5b02819146d39c /src/SetupGroup.c | |
parent | a5844c641aa3c1b179d0176acf16fcd3607d439c (diff) |
Major changes to PUGH as the dearly loved pGF is removed, and a grid function
is lowered to being simply a special case of a grid array, pGA. Grid arrays
can all have different sizes, which means that now the size of a GA is moved
from the GH to a structure on the GA, along with a lot of other connectivity
and additional information which was formerly on the GH.
If you need to care about these changes, take a look at the files in
src/include/pGH.h and src/include/pGA.h, to see the new structures
(I'll leave the old files pGF.h and SetupPGF.c around for a while to compare with).
Also, look at a PUGH dependent file which has already been converted, such
as CactusPUGHIO/IOASCII/src/Write1D.c.
Warning:
This commit breaks the development versions of IOHDF5 and IsoSurfacer, these
will be fixed real quick.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGH/trunk@182 b61c5cb5-eaca-4651-9a7a-d64986f99364
Diffstat (limited to 'src/SetupGroup.c')
-rw-r--r-- | src/SetupGroup.c | 128 |
1 files changed, 68 insertions, 60 deletions
diff --git a/src/SetupGroup.c b/src/SetupGroup.c index 43127e0..50708e3 100644 --- a/src/SetupGroup.c +++ b/src/SetupGroup.c @@ -16,36 +16,27 @@ static char *rcisd = "$Header$"; -pGExtras *pugh_SetupPGExtras - ( - int dim, - int periodic, - int stagger, - int *sh, - int *nghosts, - int total_procs, - int *nprocs, - int this_proc - ); - -pConnectivity *pugh_SetupConnectivity - ( - int dim, - int total_procs, - int *nprocs, - int periodic - ); - -pGF *SetupPGF - ( - pGH *GH, - const char *name, - int dim, - int varsize, - int vtype, - int staggercode - ); - +pGExtras *pugh_SetupPGExtras(int dim, + int *perme, + int stagger, + int *sh, + int *nghosts, + int total_procs, + int *nprocs, + int this_proc); + +pConnectivity *pugh_SetupConnectivity(int dim, + int total_procs, + int *nprocs, + int *perme); + +/*pGF *SetupPGF(pGH *GH, + const char *name, + int dim, + int varsize, + int vtype, + int staggercode); +*/ pGA *SetupPGA ( void *parent, @@ -163,20 +154,42 @@ int pugh_SetupArrayGroup pConnectivity *connectivity; pGExtras *extras; - int periodic=0; + int *perme; int *nprocs; - /* FIXME: Arrays can't have manual set up yet GAB */ + /* Arrays can't (yet) have periodicity */ + perme = (int *) malloc(dim*sizeof(int)); + if (perme) + { + for (i=0;i<dim;i++) + { + perme[i]=0; + } + } + else + { + CCTK_WARN(0,"Memory error in PUGH"); + } + + /* Arrays can't (yet) have manual set up */ nprocs = (int *) malloc(dim*sizeof(int)); - for (i=0;i<dim;i++) + if (nprocs) { - nprocs[i]=0; + for (i=0;i<dim;i++) + { + nprocs[i]=0; + } } + else + { + CCTK_WARN(0,"Memory error in PUGH"); + } + - connectivity = pugh_SetupConnectivity(dim,newGH->nprocs,nprocs,periodic); + connectivity = pugh_SetupConnectivity(dim,newGH->nprocs,nprocs,perme); extras = pugh_SetupPGExtras(dim, - periodic, + perme, staggercode, nsize, ghostsize, @@ -185,6 +198,7 @@ int pugh_SetupArrayGroup newGH->myproc); free(nprocs); + free(perme); temp = (void ***)realloc (newGH->variables,(newGH->nvariables+n_variables)*sizeof(void **)); @@ -202,14 +216,15 @@ int pugh_SetupArrayGroup { for(level = 0; level < n_timelevels; level++) { - newGH->variables[newGH->nvariables][level] = SetupPGA(newGH, - extras, - connectivity, - CCTK_VarName(newGH->nvariables), - newGH->nvariables, - var_size, - vtype, - staggercode); + newGH->variables[newGH->nvariables][level] = + SetupPGA(newGH, + extras, + connectivity, + CCTK_VarName(newGH->nvariables), + newGH->nvariables, + var_size, + vtype, + staggercode); } newGH->nvariables++; } @@ -275,22 +290,15 @@ int pugh_SetupGFGroup(pGH *newGH, { for(level = 0; level < n_timelevels; level++) { - newGH->variables[newGH->nvariables][level] = - SetupPGF(newGH, - CCTK_VarName(newGH->nvariables), - dim, - var_size, - vtype, - staggercode); - /* newGH->variables[newGH->nvariables][level] = - SetupPGA(newGH, - newGH->GFExtras[dim-1], - newGH->Connectivity[dim-1], - CCTK_VarName(newGH->nvariables), - newGH->nvariables, - var_size, - vtype, - staggercode);*/ + newGH->variables[newGH->nvariables][level] = + SetupPGA(newGH, + newGH->GFExtras[dim-1], + newGH->Connectivity[dim-1], + CCTK_VarName(newGH->nvariables), + newGH->nvariables, + var_size, + vtype, + staggercode); } newGH->nvariables++; } |