diff options
author | dstark <dstark@b61c5cb5-eaca-4651-9a7a-d64986f99364> | 2005-06-20 16:42:30 +0000 |
---|---|---|
committer | dstark <dstark@b61c5cb5-eaca-4651-9a7a-d64986f99364> | 2005-06-20 16:42:30 +0000 |
commit | decfbe2af929ab8ad92ae337f83880dfe95d9875 (patch) | |
tree | 673eae1eba134647890352fcb0fe2e7c0913efb3 | |
parent | fbff190c5ffd966aa60c32ad3444b56f0df37c51 (diff) |
Using neighbours to correctly setup bbox and ownership arrays.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGH/trunk@466 b61c5cb5-eaca-4651-9a7a-d64986f99364
-rw-r--r-- | src/SetupGroup.c | 3 | ||||
-rw-r--r-- | src/SetupPGH.c | 1 | ||||
-rw-r--r-- | src/SetupPGV.c | 38 | ||||
-rw-r--r-- | src/include/pughi.h | 1 |
4 files changed, 26 insertions, 17 deletions
diff --git a/src/SetupGroup.c b/src/SetupGroup.c index 26f3be4..8fdca77 100644 --- a/src/SetupGroup.c +++ b/src/SetupGroup.c @@ -156,7 +156,8 @@ static int PUGH_SetupGAGroup (pGH *newGH, connectivity = PUGH_SetupConnectivity (dim, newGH->nprocs, nprocs, perme); extras = PUGH_SetupPGExtras (0, dim, perme, staggercode, nsize, ghostsize, - newGH->nprocs, connectivity->nprocs, newGH->myproc); + newGH->nprocs, connectivity->nprocs, + connectivity->neighbours, newGH->myproc); free (nprocs); free (perme); diff --git a/src/SetupPGH.c b/src/SetupPGH.c index f7008db..8b56808 100644 --- a/src/SetupPGH.c +++ b/src/SetupPGH.c @@ -151,6 +151,7 @@ pGH *PUGH_SetupPGH (void *callerid, nsize, nghostzones, pughGH->nprocs, pughGH->Connectivity[idim-1]->nprocs, + pughGH->Connectivity[idim-1]->neighbours, pughGH->myproc); } diff --git a/src/SetupPGV.c b/src/SetupPGV.c index 8475475..49c87ea 100644 --- a/src/SetupPGV.c +++ b/src/SetupPGV.c @@ -21,6 +21,8 @@ #include "pugh.h" #include "pughi.h" + + static const char *rcsid = "$Header$"; CCTK_FILEVERSION(CactusPUGH_PUGH_SetupPGV_c); @@ -39,6 +41,7 @@ static int PUGH_SetupPGExtrasOwnership(int dim, int *perme, int this_proc, int nprocs, + int **neighbours, pGExtras *this); static int PUGH_SetupPGExtrasStaggering(int dim, int this_proc, pGExtras *this); static int PUGH_SetupBoundingBox(int is_gf, @@ -92,6 +95,7 @@ pGExtras *PUGH_SetupPGExtras(int is_gf, int *nghosts, int total_procs, int *nprocs, + int **neighbours, int this_proc) { pGExtras *this; @@ -107,7 +111,8 @@ pGExtras *PUGH_SetupPGExtras(int is_gf, PUGH_SetupPGExtrasSizes(is_gf, dim, stagger, sh, nghosts, total_procs, nprocs, this_proc,this); - PUGH_SetupPGExtrasOwnership(dim, perme, this_proc, total_procs, this); + PUGH_SetupPGExtrasOwnership(dim, perme, this_proc, total_procs, + neighbours, this); PUGH_SetupPGExtrasStaggering(dim, this_proc, this); } } @@ -903,6 +908,7 @@ static int PUGH_SetupPGExtrasOwnership(int dim, int *perme, int this_proc, int nprocs, + int **neighbours, pGExtras *this) { int tmp; @@ -917,27 +923,27 @@ static int PUGH_SetupPGExtrasOwnership(int dim, */ for (dir = 0 ; dir < dim; dir++) { - this->ownership[PUGH_VERTEXCTR][0][dir] = - (this->lb[this_proc][dir] == 0 ? 0 : this->nghostzones[dir]); - this->ownership[PUGH_VERTEXCTR][1][dir] = - (this->ub[this_proc][dir] == this->nsize[dir]-1 ? - this->lnsize[dir] : this->lnsize[dir] - this->nghostzones[dir]); - this->bbox[2*dir+0] = this->lb[this_proc][dir] == 0; - this->bbox[2*dir+1] = this->ub[this_proc][dir] == this->nsize[dir]-1; - } - - /* correct for periodic identification : Tue Jun 17 08:40:15 CDT 1997 */ - for (dir = 0; dir < dim; dir++) - { - if(perme[dir]) - { + /* Setup ownership and bbox using neighbours. */ + if (neighbours[this_proc][2*dir] == -1 + || neighbours[this_proc][2*dir+1] == -1) { + this->ownership[PUGH_VERTEXCTR][0][dir] = + (this->lb[this_proc][dir] == 0 ? 0 : this->nghostzones[dir]); + this->ownership[PUGH_VERTEXCTR][1][dir] = + (this->ub[this_proc][dir] == this->nsize[dir]-1 ? + this->lnsize[dir] : this->lnsize[dir] - this->nghostzones[dir]); + this->bbox[2*dir+0] = this->lb[this_proc][dir] == 0; + this->bbox[2*dir+1] = this->ub[this_proc][dir] == this->nsize[dir]-1; + } else { this->ownership[PUGH_VERTEXCTR][0][dir] = this->nghostzones[dir]; this->ownership[PUGH_VERTEXCTR][1][dir] = this->lnsize[dir] - this->nghostzones[dir]; this->bbox[2*dir+0] = 0; this->bbox[2*dir+1] = 0; + } - /* sanity check for periodic BC */ + /* Do sanity check for periodic BC */ + if(perme[dir]) + { if (this->ownership[PUGH_VERTEXCTR][1][dir] - this->ownership[PUGH_VERTEXCTR][0][dir] < this->nghostzones[dir]) { diff --git a/src/include/pughi.h b/src/include/pughi.h index 766a6ab..c2c45a7 100644 --- a/src/include/pughi.h +++ b/src/include/pughi.h @@ -29,6 +29,7 @@ pGExtras *PUGH_SetupPGExtras(int is_gf, int *nghosts, int total_procs, int *nprocs, + int **neighbours, int this_proc); pComm *PUGH_SetupGArrayGroupComm(pGH *pughGH, |