more changes to rRESPA neighbor lists

This commit is contained in:
Steve Plimpton
2017-10-17 17:33:01 -06:00
parent 59de1a71c8
commit 0966e14e73
41 changed files with 417 additions and 624 deletions

View File

@ -662,7 +662,7 @@ int Neighbor::init_pair()
// purpose is to avoid duplicate or inefficient builds
// may add new requests if a needed request to derive from does not exist
// methods:
// (1) other = point rRESPA lists at their partner lists
// (1) unique = create unique lists if cutoff is explicitly set
// (2) skip = create any new non-skip lists needed by pair hybrid skip lists
// (3) granular = adjust parent and skip lists for granular onesided usage
// (4) h/f = pair up any matching half/full lists
@ -675,7 +675,7 @@ int Neighbor::init_pair()
int nrequest_original = nrequest;
morph_other();
morph_unique();
morph_skip();
morph_granular(); // this method can change flags set by requestor
morph_halffull();
@ -828,7 +828,6 @@ int Neighbor::init_pair()
}
// first-time allocation of per-atom data for lists that are built and store
// lists that are not built: respa inner/middle (no neigh_pair)
// lists that do not store: copy
// use atom->nmax for both grow() args
// i.e. grow first time to expanded size to avoid future reallocs
@ -908,32 +907,16 @@ int Neighbor::init_pair()
/* ----------------------------------------------------------------------
scan NeighRequests to set additional flags
only for respaouter, custom cutoff lists
only for custom cutoff lists
------------------------------------------------------------------------- */
void Neighbor::morph_other()
void Neighbor::morph_unique()
{
NeighRequest *irq;
for (int i = 0; i < nrequest; i++) {
irq = requests[i];
// if respaouter, point all associated rRESPA lists at each other
if (irq->respaouter) {
if (requests[i-1]->respainner) {
irq->respainnerlist = i-1;
requests[i-1]->respaouterlist = i;
} else {
irq->respamiddlelist = i-1;
requests[i-1]->respaouterlist = i;
requests[i-1]->respainnerlist = i-1;
irq->respainnerlist = i-2;
requests[i-2]->respaouterlist = i;
requests[i-2]->respamiddlelist = i-1;
}
}
// if cut flag set by requestor, set unique flag
// this forces Pair,Stencil,Bin styles to be instantiated separately
@ -964,7 +947,6 @@ void Neighbor::morph_skip()
// halffull list and its full parent may both skip,
// but are checked to insure matching skip info
if (irq->respainner || irq->respamiddle) continue;
if (irq->halffull) continue;
if (irq->copy) continue;
@ -997,7 +979,6 @@ void Neighbor::morph_skip()
// else 2 lists do not store same pairs
// or their data structures are different
// this includes custom cutoff set by requestor
// no need to check respaouter b/c it stores same pairs
// NOTE: need check for 2 Kokkos flags?
if (irq->ghost != jrq->ghost) continue;
@ -1134,7 +1115,6 @@ void Neighbor::morph_halffull()
// these lists are created other ways, no need for halffull
// do want to process skip lists
if (irq->respainner || irq->respamiddle) continue;
if (irq->copy) continue;
// check all other lists
@ -1153,7 +1133,6 @@ void Neighbor::morph_halffull()
// else 2 lists do not store same pairs
// or their data structures are different
// this includes custom cutoff set by requestor
// no need to check respaouter b/c it stores same pairs
if (irq->ghost != jrq->ghost) continue;
if (irq->size != jrq->size) continue;
@ -1204,11 +1183,6 @@ void Neighbor::morph_copy()
if (irq->copy) continue;
// these lists are created other ways, no need to copy
// skip lists are eligible to become a copy list
if (irq->respainner || irq->respamiddle) continue;
// check all other lists
for (j = 0; j < nrequest; j++) {
@ -1245,7 +1219,8 @@ void Neighbor::morph_copy()
if (irq->ghost && !jrq->ghost) continue;
// do not copy from a respa middle/inner list
// do not copy from a list with respa middle/inner
// b/c its outer list will not be complete
if (jrq->respamiddle) continue;
if (jrq->respainner) continue;
@ -1254,7 +1229,6 @@ void Neighbor::morph_copy()
// else 2 lists do not store same pairs
// or their data structures are different
// this includes custom cutoff set by requestor
// no need to check respaouter b/c it stores same pairs
// no need to check omp b/c it stores same pairs
// NOTE: need check for 2 Kokkos flags?
@ -1532,9 +1506,8 @@ void Neighbor::print_pairwise_info()
if (rq->size) fprintf(out,", size");
if (rq->history) fprintf(out,", history");
if (rq->granonesided) fprintf(out,", onesided");
if (rq->respainner) fprintf(out,", respa outer");
if (rq->respamiddle) fprintf(out,", respa middle");
if (rq->respaouter) fprintf(out,", respa inner");
if (rq->respamiddle) fprintf(out,", respa outer/middle/inner");
else if (rq->respainner) fprintf(out,", respa outer/inner");
if (rq->bond) fprintf(out,", bond");
if (rq->omp) fprintf(out,", omp");
if (rq->intel) fprintf(out,", intel");
@ -1629,7 +1602,6 @@ int Neighbor::choose_bin(NeighRequest *rq)
if (style == NSQ) return 0;
if (rq->skip || rq->copy || rq->halffull) return 0;
if (rq->respainner || rq->respamiddle) return 0;
// use request settings to match exactly one NBin class mask
// checks are bitwise using NeighConst bit masks
@ -1670,7 +1642,6 @@ int Neighbor::choose_stencil(NeighRequest *rq)
if (style == NSQ) return 0;
if (rq->skip || rq->copy || rq->halffull) return 0;
if (rq->respainner || rq->respamiddle) return 0;
// convert newton request to newtflag = on or off
@ -1761,10 +1732,6 @@ int Neighbor::choose_stencil(NeighRequest *rq)
int Neighbor::choose_pair(NeighRequest *rq)
{
// no neighbor list build performed
if (rq->respainner || rq->respamiddle) return 0;
// error check for includegroup with ghost neighbor request
if (includegroup && rq->ghost)