simplify checking for intel neighbor list requests
This commit is contained in:
11
src/atom.cpp
11
src/atom.cpp
@ -38,10 +38,6 @@
|
||||
#include <algorithm>
|
||||
#include <cstring>
|
||||
|
||||
#ifdef LMP_INTEL
|
||||
#include "neigh_request.h"
|
||||
#endif
|
||||
|
||||
#ifdef LMP_GPU
|
||||
#include "fix_gpu.h"
|
||||
#include <cmath>
|
||||
@ -2177,12 +2173,7 @@ void Atom::setup_sort_bins()
|
||||
bininvz = nbinz / (bboxhi[2]-bboxlo[2]);
|
||||
|
||||
#ifdef LMP_INTEL
|
||||
int intel_neigh = 0;
|
||||
if (neighbor->nrequest) {
|
||||
if (neighbor->requests[0]->intel) intel_neigh = 1;
|
||||
} else if (neighbor->old_nrequest)
|
||||
if (neighbor->old_requests[0]->intel) intel_neigh = 1;
|
||||
if (intel_neigh && userbinsize == 0.0) {
|
||||
if (neighbor->has_intel_request() && userbinsize == 0.0) {
|
||||
if (neighbor->binsizeflag) bininv = 1.0/neighbor->binsize_user;
|
||||
|
||||
double nx_low = neighbor->bboxlo[0];
|
||||
|
||||
@ -2091,6 +2091,13 @@ NeighRequest *Neighbor::add_request(Command *requestor, const char *style, int f
|
||||
return req;
|
||||
}
|
||||
|
||||
/* report if there is a neighbor list with the intel flag set */
|
||||
bool Neighbor::has_intel_request() const
|
||||
{
|
||||
return (((nrequest > 0) && (requests[0]->intel > 0))
|
||||
|| ((old_nrequest > 0) && (old_requests[0]->intel > 0)));
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
setup neighbor binning and neighbor stencils
|
||||
called before run and every reneighbor if box size/shape changes
|
||||
|
||||
@ -133,6 +133,9 @@ class Neighbor : protected Pointers {
|
||||
NeighRequest *add_request(class Compute *, int);
|
||||
NeighRequest *add_request(class Command *, const char *, int);
|
||||
|
||||
// report if we have INTEL package neighbor lists
|
||||
bool has_intel_request() const;
|
||||
|
||||
int decide(); // decide whether to build or not
|
||||
virtual int check_distance(); // check max distance moved since last build
|
||||
void setup_bins(); // setup bins based on box and cutoff
|
||||
|
||||
Reference in New Issue
Block a user