diff --git a/src/comm.cpp b/src/comm.cpp index afd4d891ee..84e3b9ad65 100644 --- a/src/comm.cpp +++ b/src/comm.cpp @@ -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) - error->all(FLERR,"Cannot use multi/reduce communication with Newton off"); + // 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"); + } } /* ---------------------------------------------------------------------- diff --git a/src/neighbor.cpp b/src/neighbor.cpp index fe34e738b0..d130219931 100644 --- a/src/neighbor.cpp +++ b/src/neighbor.cpp @@ -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 ------------------------------------------------------------------------- */ diff --git a/src/neighbor.h b/src/neighbor.h index 2943f7e082..d1a5cf9112 100644 --- a/src/neighbor.h +++ b/src/neighbor.h @@ -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();