Adding full neighbor list check for new reduced comm

This commit is contained in:
Joel Clemmer
2020-12-20 17:18:32 -07:00
parent bce37abe8f
commit 5ae32146eb
3 changed files with 21 additions and 9 deletions

View File

@ -242,15 +242,13 @@ void Comm::init()
for (int i = 0; i < nfix; i++)
if (fix[i]->maxexchange_dynamic) maxexchange_fix_dynamic = 1;
// Can't used multi_reduce communication with Newton off
// TODO: need to somehow restrict this option with full neighbor lists
// CANNOT use multi_reduce communication with full nlist
// Could remove NP_NEWTON from npair_full_*multi_reduce*, but could be cryptic
// Also could be cases where you want newton off (hybrid) but don't use multi_reduce comm
// Could add check on neighbor build, if full and comm->multi_reduce error...
// or just add check on comm setup - is that run before every run? Only if box change...
if (force->newton == 0 && multi_reduce)
// Can't used multi/reduce communication with Newton off or full neighbor lits
if(multi_reduce){
if (force->newton == 0)
error->all(FLERR,"Cannot use multi/reduce communication with Newton off");
if (neighbor->any_full())
error->all(FLERR,"Cannot use multi/reduce communication with a full neighbor list");
}
}
/* ----------------------------------------------------------------------

View File

@ -2420,6 +2420,19 @@ int Neighbor::exclude_setting()
return exclude;
}
/* ----------------------------------------------------------------------
check if any of the old requested neighbor lists are full
------------------------------------------------------------------------- */
int Neighbor::any_full()
{
int any_full = 0;
for(int i = 0; i < old_nrequest; i++) {
if(old_requests[i]->full) any_full = 1;
}
return any_full;
}
/* ----------------------------------------------------------------------
return # of bytes of allocated memory
------------------------------------------------------------------------- */

View File

@ -122,6 +122,7 @@ class Neighbor : protected Pointers {
void exclusion_group_group_delete(int, int); // rm a group-group exclusion
int exclude_setting(); // return exclude value to accelerator pkg
class NeighRequest *find_request(void *); // find a neighbor request
int any_full(); // Check if any old requests had full neighbor lists
double memory_usage();