diff options
-rw-r--r-- | param.ccl | 50 | ||||
-rw-r--r-- | src/SetupPGH.c | 20 |
2 files changed, 55 insertions, 15 deletions
@@ -2,29 +2,69 @@ # $Header$ restricted: - + INT global_nx "The size of the grid in the x direction" { - *:* :: "Grid of this size distributed across all processors" + 0:* :: "Grid of this size distributed across all processors" } 10 INT global_ny "The size of the grid in the y direction" { - *:* :: "Grid of this size distributed across all processors" + 0:* :: "Grid of this size distributed across all processors" } 10 INT global_nz "The size of the grid in the z direction" { - *:* :: "Grid of this size distributed across all processors" + 0:* :: "Grid of this size distributed across all processors" } 10 -INT ghost_size "The width of the ghost zone" +INT global_nsize "The size of the grid in each spatial direction" +{ + -1:* :: "Grid of this size in each dir distributed across all processors" +} -1 + +INT ghost_size_x "The width of the ghost zone in the x direction" +{ + 1:* :: "Must be a positive integer" +} 1 + +INT ghost_size_y "The width of the ghost zone in the y direction" +{ + 1:* :: "Must be a positive integer" +} 1 + +INT ghost_size_z "The width of the ghost zone in the z direction" { 1:* :: "Must be a positive integer" } 1 +INT ghost_size "The width of the ghost zone in each direction" +{ + -1:* :: "Must be a positive integer" +} -1 + private: +INT local_nx "The size of the grid in the x direction" +{ + -1:* :: "Grid of this size on each processor" +} -1 + +INT local_ny "The size of the grid in the y direction" +{ + -1:* :: "Grid of this size on each processor" +} -1 + +INT local_nz "The size of the grid in the z direction" +{ + -1:* :: "Grid of this size on each processor" +} -1 + +INT local_nsize "The size of the grid in each spatial direction" +{ + -1:* :: "Grid of this size in each dir on each processor" +} -1 + BOOLEAN sync_verbose "Verbose output during synchronization ?" { } no diff --git a/src/SetupPGH.c b/src/SetupPGH.c index 6c83662..1b5089c 100644 --- a/src/SetupPGH.c +++ b/src/SetupPGH.c @@ -145,10 +145,10 @@ void pGH_SetupBasics(pGH *GH, for (j=0;j<2;j++) { GH->ownership[i][j] = (int *)malloc(dim*sizeof(int)); - GH->ghosts[i][j] = (int *)malloc(2*dim*sizeof(int)); + GH->ghosts[i][j] = (int **)malloc(2*dim*sizeof(int)); for (k=0;k<2*dim;k++) GH->ghosts[i][j][k] = (int *)malloc(dim*sizeof(int)); - GH->overlap[i][j] = (int *)malloc(2*dim*sizeof(int)); + GH->overlap[i][j] = (int **)malloc(2*dim*sizeof(int)); for (k=0;k<2*dim;k++) GH->overlap[i][j][k] = (int *)malloc(dim*sizeof(int)); @@ -294,18 +294,17 @@ void pGH_SetupBounds(pGH *GH,int dim, int *nsize) /* Bounding box information */ - if (i == 0) GH->lb[pnum][0] = 0; - else {GH->lb[pnum][0] = GH->ub[pnum-1][0] + 1 - - 2*(GH->nghostzones); - if(staggertype == PUGH_STAGGER) GH->lb[pnum][0] --; - } - else + if (i == 0) { + GH->lb[pnum][0] = 0; + } + else + { GH->lb[pnum][0] = GH->ub[pnum-1][0] + 1 - 2*(GH->nghostzones[0]); if(staggertype == PUGH_STAGGER) GH->lb[pnum][0] --; - GH->ub[pnum][0] = GH->lb[pnum][0] + abs(nsize[0]) - 1; - } + } + GH->ub[pnum][0] = GH->lb[pnum][0] + abs(nsize[0]) - 1; if (j == 0) { @@ -729,6 +728,7 @@ void pGH_SetupOwnership(pGH *GH,int dim) { for (i=0;GH->commmodel==PUGH_DERIVEDTYPES && i<PUGH_NSTAGGER;i++) { int *dtindices, *one, dir; int ii,jj,kk,ll; + int maxghosts; /* OK so now lets set up the communications datatypes */ dirs[0] = GH->lnsize[1] * GH->lnsize[2]; |