diff --git a/src/fix_ave_grid.cpp b/src/fix_ave_grid.cpp index 763fc897ef..16beed1123 100644 --- a/src/fix_ave_grid.cpp +++ b/src/fix_ave_grid.cpp @@ -732,22 +732,36 @@ void FixAveGrid::atom2grid() iy = static_cast ((x[i][1]-boxlo[1])*dyinv + OFFSET) - OFFSET; if (ix < nxlo_out || ix > nxhi_out) { - if (periodicity[0]) flag = 1; - else if (discardflag == KEEP) { + if (periodicity[0]) { + flag = 1; + continue; + } else if (discardflag == KEEP) { if (ix < nxlo_out && nxlo_out == 0) ix = 0; else if (ix > nxhi_out && nxhi_out == nxgrid-1) ix = nxgrid-1; - else flag = 1; - } else skip[i] = 1; - continue; + else { + flag = 1; + continue; + } + } else { + skip[i] = 1; + continue; + } } if (iy < nylo_out || iy > nyhi_out) { - if (periodicity[1]) flag = 1; - else if (discardflag == KEEP) { + if (periodicity[1]) { + flag = 1; + continue; + } else if (discardflag == KEEP) { if (iy < nylo_out && nylo_out == 0) iy = 0; else if (iy > nyhi_out && nyhi_out == nygrid-1) iy = nygrid-1; - else flag = 1; - } else skip[i] = 1; - continue; + else { + flag = 1; + continue; + } + } else { + skip[i] = 1; + continue; + } } skip[i] = 0; diff --git a/src/grid2d.cpp b/src/grid2d.cpp index 87d3b68d6c..4bac76d162 100644 --- a/src/grid2d.cpp +++ b/src/grid2d.cpp @@ -593,6 +593,9 @@ void Grid2d::extract_comm_info() else if (rcbone.dim == 1) rcbone.cut = inylo; MPI_Allgather(&rcbone,sizeof(RCBinfo),MPI_CHAR, rcbinfo,sizeof(RCBinfo),MPI_CHAR,gridcomm); + printf("G2D ExtractCommInfo: 0 dim/cut: %d %d, 1 dim/cut: %d %d\n", + rcbinfo[0].dim,rcbinfo[0].cut, + rcbinfo[1].dim,rcbinfo[1].cut); } } @@ -1713,7 +1716,7 @@ void Grid2d::clean_overlap() /* ---------------------------------------------------------------------- recursively split a box until it doesn't overlap any periodic boundaries box = 4 integers = (xlo,xhi,ylo,yhi) - each lo/hi value may extend beyonw 0 to N-1 into another periodic image + each lo/hi value may extend beyond 0 to N-1 into another periodic image pbc = flags in each dim of which periodic image the caller box was in when a box straddles a periodic bounadry, split it in two when a box does not straddle, drop it down RCB tree @@ -1800,6 +1803,7 @@ void Grid2d::box_drop_grid(int *box, int proclower, int procupper, if (proclower == procupper) { plist[np++] = proclower; + printf(" proc %d plist np %d plist %d\n",comm->me,np,plist[np-1]); return; } @@ -1811,9 +1815,13 @@ void Grid2d::box_drop_grid(int *box, int proclower, int procupper, // dim = 0,1,2 dimension of cut int procmid = proclower + (procupper - proclower) / 2 + 1; + + printf("G2D BoxDropGrid: proc %d proc lum: %d %d %d np %d\n",comm->me,proclower,procupper,procmid,np); + //printf(" dim %d cut %d\n",rcbinfo[procmid].dim,rcbinfo[procmid].cut); + int dim = rcbinfo[procmid].dim; int cut = rcbinfo[procmid].cut; - + if (box[2*dim] < cut) box_drop_grid(box,proclower,procmid-1,np,plist); if (box[2*dim+1] >= cut) box_drop_grid(box,procmid,procupper,np,plist); }