diff options
Diffstat (limited to 'src/SetupPGV.c')
-rw-r--r-- | src/SetupPGV.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/src/SetupPGV.c b/src/SetupPGV.c index 49c87ea..b01403b 100644 --- a/src/SetupPGV.c +++ b/src/SetupPGV.c @@ -846,7 +846,7 @@ static int PUGH_SetupPGExtrasSizes(int is_gf, } else { - this->nsize[dir] = abs(sh[dir]); + this->nsize[dir] = sh[dir]; } } @@ -944,14 +944,20 @@ static int PUGH_SetupPGExtrasOwnership(int dim, /* 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]) + const int is_single_proc_in_dim + = (this->lb[this_proc][dir] == 0 + && this->ub[this_proc][dir] == this->nsize[dir]-1); + if (! is_single_proc_in_dim + && this->ownership[PUGH_VERTEXCTR][1][dir] - + this->ownership[PUGH_VERTEXCTR][0][dir] < this->nghostzones[dir]) { CCTK_VWarn (0, __LINE__, __FILE__, CCTK_THORNSTRING, "Not enough interior grid points in dimension %d ! " "Please set the number of global grid points (currently " "%d) to something >= (nprocs+2) * the number of ghostzones " - "(currently (%d+2)*%d=%d) !", + "(currently (%d+2)*%d=%d), " + "or make sure that there is only one processor in this " + "dimension.", dir, this->nsize[dir], nprocs, this->nghostzones[dir], (nprocs+2) * this->nghostzones[dir]); } @@ -1256,15 +1262,15 @@ pComm *PUGH_SetupGArrayGroupComm(pGH *pughGH, #endif this->docomm = malloc (2 * dim * sizeof (int)); - if(this->buffer_sz && - this->send_buffer && - this->recv_buffer && + if((dim==0 || this->buffer_sz) && + (dim==0 || this->send_buffer) && + (dim==0 || this->recv_buffer) && #ifdef CCTK_MPI - this->sreq && - this->rreq && - this->sstatus && + (dim==0 || this->sreq) && + (dim==0 || this->rreq) && + (dim==0 || this->sstatus) && #endif - this->docomm) + (dim==0 || this->docomm)) { this->commflag = PUGH_NOCOMM; this->first_var = first_var; |