diff options
author | tradke <tradke@b61c5cb5-eaca-4651-9a7a-d64986f99364> | 2000-04-18 13:55:26 +0000 |
---|---|---|
committer | tradke <tradke@b61c5cb5-eaca-4651-9a7a-d64986f99364> | 2000-04-18 13:55:26 +0000 |
commit | 22728b617a02f1609635719a956abb5b8ffb22a5 (patch) | |
tree | 23ee53b55bec7c80442fda56c8300ab0d311071e /src/SetupPGV.c | |
parent | c91fa6cfd6e1864077b13e1c82bf52d26c73f532 (diff) |
Fixing rscid warnings, untabified files, combined identical case statements
for GROUP_GF and GROUP_ARRAY.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGH/trunk@203 b61c5cb5-eaca-4651-9a7a-d64986f99364
Diffstat (limited to 'src/SetupPGV.c')
-rw-r--r-- | src/SetupPGV.c | 168 |
1 files changed, 90 insertions, 78 deletions
diff --git a/src/SetupPGV.c b/src/SetupPGV.c index d099421..bf50869 100644 --- a/src/SetupPGV.c +++ b/src/SetupPGV.c @@ -20,6 +20,8 @@ static char *rcsid = "$Header$"; +CCTK_FILEVERSION (CactusPUGH_PUGH_SetupPGV_c); + /* Prototypes */ @@ -40,10 +42,10 @@ pConnectivity *pugh_SetupConnectivity(int dim, int pugh_GenerateTopology(int dim, int total_procs, int *nprocs); int pugh_GenerateNeighbours(int dim, - int total_procs, - int *nprocs, - int **neighbours, - int *perme); + int total_procs, + int *nprocs, + int **neighbours, + int *perme); int pugh_DecomposeIJK(int dim, int ijk, int *nprocs, int *pos); @@ -113,6 +115,16 @@ int pugh_EnablePGAStorage(pGA *GA, int pugh_DisableGADataStorage(pGA *GA); +int pugh_SetupPGExtrasStaggering(int dim, + int *perme, + int stagger, + int *sh, + int *nghosts, + int total_procs, + int *nprocs, + int this_proc, + pGExtras *this); + /*@@ @routine pugh_SetupPGExtras @@ -260,7 +272,7 @@ pConnectivity *pugh_SetupConnectivity(int dim, this->neighbours[i] = this->neighbours[0]+(2*dim*i); } - this->perme = (int *)malloc(dim*sizeof(int)); + this->perme = (int *)malloc(dim*sizeof(int)); this->perme = perme; } @@ -429,10 +441,10 @@ int pugh_GenerateTopology(int dim, int total_procs, int *nprocs) @@*/ int pugh_GenerateNeighbours(int dim, - int total_procs, - int *nprocs, - int **neighbours, - int *perme) + int total_procs, + int *nprocs, + int **neighbours, + int *perme) { int retval; int i; @@ -859,12 +871,12 @@ int pugh_SetupPGExtrasSizes(int dim, if (sh[dir] < 0 && nprocs[dir] > 1) { this->nsize[dir] = (nprocs[dir]-2) * - (-sh[dir] - 2*nghosts[dir]) + - 2 * (-sh[dir] - nghosts[dir]); + (-sh[dir] - 2*nghosts[dir]) + + 2 * (-sh[dir] - nghosts[dir]); if (stagger == PUGH_STAGGER) { - this->nsize[dir] -= nprocs[dir]-1; + this->nsize[dir] -= nprocs[dir]-1; } } else @@ -882,24 +894,24 @@ int pugh_SetupPGExtrasSizes(int dim, /* Setup the bounding box stuff */ pugh_SetupBoundingBox(dim, - perme, - stagger, - sh, - nghosts, - total_procs, - nprocs, - this); + perme, + stagger, + sh, + nghosts, + total_procs, + nprocs, + this); /* Set the remote sizes */ pugh_SetupRemoteSizes(dim, - perme, - stagger, - sh, - nghosts, - total_procs, - nprocs, - this); + perme, + stagger, + sh, + nghosts, + total_procs, + nprocs, + this); /* Set the local sizes */ @@ -943,9 +955,7 @@ int pugh_SetupPGExtrasOwnership(int dim, { int tmp; int dir, idir; - int i,j,k; int istart, iend; - int staglcv; /* Ownership is pretty easy. Remember ownership is indexed as [stagger][ijk][min/max]. See pGF_Reduction for a use of this, @@ -966,10 +976,10 @@ int pugh_SetupPGExtrasOwnership(int dim, { if(perme[dir]) { - this->ownership[PUGH_VERTEXCTR][0][dir] = - this->nghostzones[dir]; - this->ownership[PUGH_VERTEXCTR][1][dir] = - this->lnsize[dir] - this->nghostzones[dir]; + this->ownership[PUGH_VERTEXCTR][0][dir] = + this->nghostzones[dir]; + this->ownership[PUGH_VERTEXCTR][1][dir] = + this->lnsize[dir] - this->nghostzones[dir]; } } @@ -1057,14 +1067,14 @@ int pugh_SetupPGExtrasOwnership(int dim, } int pugh_SetupPGExtrasStaggering(int dim, - int *perme, - int stagger, - int *sh, - int *nghosts, - int total_procs, - int *nprocs, - int this_proc, - pGExtras *this) + int *perme, + int stagger, + int *sh, + int *nghosts, + int total_procs, + int *nprocs, + int this_proc, + pGExtras *this) { int s,d,k,dir; int *upperbnd; @@ -1167,27 +1177,27 @@ int pugh_SetupBoundingBox(int dim, for(dir = 0 ; dir < dim; dir++) { - if (pos[dir] == 0) - { - this->lb[pnum][dir] = 0; - } - else - { - this->lb[pnum][dir] = bounds[dir][pos[dir]] +1 - nghosts[dir]; - if(stagger == PUGH_STAGGER) - { - this->lb[pnum][dir] --; - } - } - - if (pos[dir] == nprocs[dir]-1) - { - this->ub[pnum][dir] = this->nsize[dir]-1; - } - else - { - this->ub[pnum][dir] = bounds[dir][pos[dir]+1] + this->nghostzones[dir]; - } + if (pos[dir] == 0) + { + this->lb[pnum][dir] = 0; + } + else + { + this->lb[pnum][dir] = bounds[dir][pos[dir]] +1 - nghosts[dir]; + if(stagger == PUGH_STAGGER) + { + this->lb[pnum][dir] --; + } + } + + if (pos[dir] == nprocs[dir]-1) + { + this->ub[pnum][dir] = this->nsize[dir]-1; + } + else + { + this->ub[pnum][dir] = bounds[dir][pos[dir]+1] + this->nghostzones[dir]; + } } } @@ -1202,8 +1212,8 @@ int pugh_SetupBoundingBox(int dim, for(i=0; i<total_procs; i++) { printf(" setup_Bounding_Box (%d):", i); for (dir = 0 ; dir < dim; dir++) - printf(" (%d,%d)", - this->lb[i][dir], this->ub[i][dir]); + printf(" (%d,%d)", + this->lb[i][dir], this->ub[i][dir]); printf(" \n"); } } @@ -1406,9 +1416,11 @@ int pugh_EnablePGAStorage(pGA *GA, int dir; int sz; int ldir; - int special_pad, cache_size; char *temp_byte; +#if 0 + int special_pad, cache_size; long start; +#endif retval = 0; if(GA->storage == PUGH_NOSTORAGE) @@ -1514,21 +1526,21 @@ int pugh_EnablePGAStorage(pGA *GA, retval = 0; #endif - /* Use the Cactus Cache alignment function */ - GA->data = Util_CacheMalloc(GA->id, - GA->extras->npoints * GA->varsize, - &(GA->padddata)); + /* Use the Cactus Cache alignment function */ + GA->data = Util_CacheMalloc(GA->id, + GA->extras->npoints * GA->varsize, + &(GA->padddata)); - /* Zero the memory if desired. */ - if(GA->data && zero_memory) - { - for(temp_byte = (char *)GA->data; - temp_byte < ((char *)GA->data)+GA->extras->npoints * GA->varsize; - temp_byte++) - { - *temp_byte = 0; - } - } + /* Zero the memory if desired. */ + if(GA->data && zero_memory) + { + for(temp_byte = (char *)GA->data; + temp_byte < ((char *)GA->data)+GA->extras->npoints * GA->varsize; + temp_byte++) + { + *temp_byte = 0; + } + } } } |