|
|
|
@ -32,47 +32,6 @@ using namespace LAMMPS_NS;
|
|
|
|
#pragma offload_attribute(push,target(mic))
|
|
|
|
#pragma offload_attribute(push,target(mic))
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
template <class flt_t>
|
|
|
|
|
|
|
|
inline int mcoord2bin(const flt_t x0, const flt_t x1, const flt_t x2,
|
|
|
|
|
|
|
|
const flt_t bboxlo0, const flt_t bboxlo1,
|
|
|
|
|
|
|
|
const flt_t bboxlo2, const flt_t bboxhi0,
|
|
|
|
|
|
|
|
const flt_t bboxhi1, const flt_t bboxhi2,
|
|
|
|
|
|
|
|
const flt_t bininvx, const flt_t bininvy,
|
|
|
|
|
|
|
|
const flt_t bininvz, const int nbinx, const int nbiny,
|
|
|
|
|
|
|
|
const int nbinz, const int mbinx, const int mbiny,
|
|
|
|
|
|
|
|
const int mbinz, const int mbinxlo, const int mbinylo,
|
|
|
|
|
|
|
|
const int mbinzlo)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
int ix, iy, iz;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (x0 >= bboxhi0)
|
|
|
|
|
|
|
|
ix = static_cast<int> ((x0 - bboxhi0) * bininvx) + nbinx;
|
|
|
|
|
|
|
|
else if (x0 >= bboxlo0) {
|
|
|
|
|
|
|
|
ix = static_cast<int> ((x0 - bboxlo0) * bininvx);
|
|
|
|
|
|
|
|
ix = MIN(ix, nbinx-1);
|
|
|
|
|
|
|
|
} else
|
|
|
|
|
|
|
|
ix = static_cast<int> ((x0 - bboxlo0) * bininvx) - 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (x1 >= bboxhi1)
|
|
|
|
|
|
|
|
iy = static_cast<int> ((x1 - bboxhi1) * bininvy) + nbiny;
|
|
|
|
|
|
|
|
else if (x1 >= bboxlo1) {
|
|
|
|
|
|
|
|
iy = static_cast<int> ((x1 - bboxlo1) * bininvy);
|
|
|
|
|
|
|
|
iy = MIN(iy, nbiny-1);
|
|
|
|
|
|
|
|
} else
|
|
|
|
|
|
|
|
iy = static_cast<int> ((x1 - bboxlo1) * bininvy) - 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (x2 >= bboxhi2)
|
|
|
|
|
|
|
|
iz = static_cast<int> ((x2 - bboxhi2) * bininvz) + nbinz;
|
|
|
|
|
|
|
|
else if (x2 >= bboxlo2) {
|
|
|
|
|
|
|
|
iz = static_cast<int> ((x2 - bboxlo2) * bininvz);
|
|
|
|
|
|
|
|
iz = MIN(iz, nbinz - 1);
|
|
|
|
|
|
|
|
} else
|
|
|
|
|
|
|
|
iz = static_cast<int> ((x2 - bboxlo2) * bininvz) - 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (iz - mbinzlo) * mbiny * mbinx + (iy - mbinylo) * mbinx +
|
|
|
|
|
|
|
|
(ix - mbinxlo);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define ofind_special(which, special, nspecial, i, tag, special_flag) \
|
|
|
|
#define ofind_special(which, special, nspecial, i, tag, special_flag) \
|
|
|
|
{ \
|
|
|
|
{ \
|
|
|
|
which = 0; \
|
|
|
|
which = 0; \
|
|
|
|
@ -104,20 +63,14 @@ inline int mcoord2bin(const flt_t x0, const flt_t x1, const flt_t x2,
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
template <class flt_t, class acc_t>
|
|
|
|
template <class flt_t, class acc_t>
|
|
|
|
void Neighbor::bin_atoms(void * xin) {
|
|
|
|
void Neighbor::bin_atoms(void * xin, int * _noalias const atombin) {
|
|
|
|
const ATOM_T * _noalias const x = (const ATOM_T * _noalias const)xin;
|
|
|
|
const ATOM_T * _noalias const x = (const ATOM_T * _noalias const)xin;
|
|
|
|
int nlocal = atom->nlocal;
|
|
|
|
int nlocal = atom->nlocal;
|
|
|
|
const int nall = nlocal + atom->nghost;
|
|
|
|
const int nall = nlocal + atom->nghost;
|
|
|
|
|
|
|
|
|
|
|
|
const flt_t bininvx = this->bininvx;
|
|
|
|
const double sboxlo0 = bboxlo[0] + mbinxlo/bininvx;
|
|
|
|
const flt_t bininvy = this->bininvy;
|
|
|
|
const double sboxlo1 = bboxlo[1] + mbinylo/bininvy;
|
|
|
|
const flt_t bininvz = this->bininvz;
|
|
|
|
const double sboxlo2 = bboxlo[2] + mbinzlo/bininvz;
|
|
|
|
const flt_t bboxlo0 = this->bboxlo[0];
|
|
|
|
|
|
|
|
const flt_t bboxlo1 = this->bboxlo[1];
|
|
|
|
|
|
|
|
const flt_t bboxlo2 = this->bboxlo[2];
|
|
|
|
|
|
|
|
const flt_t bboxhi0 = this->bboxhi[0];
|
|
|
|
|
|
|
|
const flt_t bboxhi1 = this->bboxhi[1];
|
|
|
|
|
|
|
|
const flt_t bboxhi2 = this->bboxhi[2];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int i, ibin;
|
|
|
|
int i, ibin;
|
|
|
|
|
|
|
|
|
|
|
|
@ -129,25 +82,26 @@ void Neighbor::bin_atoms(void * xin) {
|
|
|
|
int bitmask = group->bitmask[includegroup];
|
|
|
|
int bitmask = group->bitmask[includegroup];
|
|
|
|
for (i = nall-1; i >= nlocal; i--) {
|
|
|
|
for (i = nall-1; i >= nlocal; i--) {
|
|
|
|
if (mask[i] & bitmask) {
|
|
|
|
if (mask[i] & bitmask) {
|
|
|
|
ibin = mcoord2bin(x[i].x, x[i].y, x[i].z, bboxlo0, bboxlo1, bboxlo2,
|
|
|
|
ibin = coord2bin(atom->x[i]);
|
|
|
|
bboxhi0, bboxhi1, bboxhi2, bininvx, bininvy, bininvz, nbinx, nbiny,
|
|
|
|
|
|
|
|
nbinz, mbinx, mbiny, mbinz, mbinxlo, mbinylo, mbinzlo);
|
|
|
|
|
|
|
|
bins[i] = binhead[ibin];
|
|
|
|
bins[i] = binhead[ibin];
|
|
|
|
binhead[ibin] = i;
|
|
|
|
binhead[ibin] = i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (i = atom->nfirst-1; i >= 0; i--) {
|
|
|
|
for (i = atom->nfirst-1; i >= 0; i--) {
|
|
|
|
ibin = mcoord2bin(x[i].x, x[i].y, x[i].z, bboxlo0, bboxlo1, bboxlo2,
|
|
|
|
ibin = coord2bin(atom->x[i]);
|
|
|
|
bboxhi0, bboxhi1, bboxhi2, bininvx, bininvy, bininvz, nbinx, nbiny,
|
|
|
|
atombin[i] = ibin;
|
|
|
|
nbinz, mbinx, mbiny, mbinz, mbinxlo, mbinylo, mbinzlo);
|
|
|
|
|
|
|
|
bins[i] = binhead[ibin];
|
|
|
|
bins[i] = binhead[ibin];
|
|
|
|
binhead[ibin] = i;
|
|
|
|
binhead[ibin] = i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
for (i = nall-1; i >= 0; i--) {
|
|
|
|
for (i = nall-1; i >= nlocal; i--) {
|
|
|
|
ibin = mcoord2bin(x[i].x, x[i].y, x[i].z, bboxlo0, bboxlo1, bboxlo2,
|
|
|
|
ibin = coord2bin(atom->x[i]);
|
|
|
|
bboxhi0, bboxhi1, bboxhi2, bininvx, bininvy, bininvz, nbinx, nbiny,
|
|
|
|
bins[i] = binhead[ibin];
|
|
|
|
nbinz, mbinx, mbiny, mbinz, mbinxlo, mbinylo, mbinzlo);
|
|
|
|
binhead[ibin] = i;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = nlocal-1; i >= 0; i--) {
|
|
|
|
|
|
|
|
ibin = coord2bin(atom->x[i]);
|
|
|
|
|
|
|
|
atombin[i]=ibin;
|
|
|
|
bins[i] = binhead[ibin];
|
|
|
|
bins[i] = binhead[ibin];
|
|
|
|
binhead[ibin] = i;
|
|
|
|
binhead[ibin] = i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -228,7 +182,7 @@ void Neighbor::hbnni(const int offload, NeighList *list, void *buffers_in,
|
|
|
|
fix->stop_watch(TIME_PACK);
|
|
|
|
fix->stop_watch(TIME_PACK);
|
|
|
|
|
|
|
|
|
|
|
|
fix->start_watch(TIME_HOST_NEIGHBOR);
|
|
|
|
fix->start_watch(TIME_HOST_NEIGHBOR);
|
|
|
|
bin_atoms<flt_t,acc_t>(buffers->get_x());
|
|
|
|
bin_atoms<flt_t,acc_t>(buffers->get_x(), buffers->get_atombin());
|
|
|
|
if (INTEL_MIC_NBOR_PAD > 1)
|
|
|
|
if (INTEL_MIC_NBOR_PAD > 1)
|
|
|
|
pad = INTEL_MIC_NBOR_PAD * sizeof(float) / sizeof(flt_t);
|
|
|
|
pad = INTEL_MIC_NBOR_PAD * sizeof(float) / sizeof(flt_t);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
@ -295,22 +249,13 @@ void Neighbor::hbnni(const int offload, NeighList *list, void *buffers_in,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const int nthreads = tnum;
|
|
|
|
const int nthreads = tnum;
|
|
|
|
const int maxnbors = buffers->get_max_nbors();
|
|
|
|
const int maxnbors = buffers->get_max_nbors();
|
|
|
|
|
|
|
|
int * _noalias const atombin = buffers->get_atombin();
|
|
|
|
const flt_t bboxlo0 = this->bboxlo[0];
|
|
|
|
|
|
|
|
const flt_t bboxlo1 = this->bboxlo[1];
|
|
|
|
|
|
|
|
const flt_t bboxlo2 = this->bboxlo[2];
|
|
|
|
|
|
|
|
const flt_t bboxhi0 = this->bboxhi[0];
|
|
|
|
|
|
|
|
const flt_t bboxhi1 = this->bboxhi[1];
|
|
|
|
|
|
|
|
const flt_t bboxhi2 = this->bboxhi[2];
|
|
|
|
|
|
|
|
const flt_t bininvx = this->bininvx;
|
|
|
|
|
|
|
|
const flt_t bininvy = this->bininvy;
|
|
|
|
|
|
|
|
const flt_t bininvz = this->bininvz;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Make sure dummy coordinates to eliminate loop remainder not within cutoff
|
|
|
|
// Make sure dummy coordinates to eliminate loop remainder not within cutoff
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const flt_t dx = (INTEL_BIGP - bboxhi0);
|
|
|
|
const flt_t dx = (INTEL_BIGP - bboxhi[0]);
|
|
|
|
const flt_t dy = (INTEL_BIGP - bboxhi1);
|
|
|
|
const flt_t dy = (INTEL_BIGP - bboxhi[1]);
|
|
|
|
const flt_t dz = (INTEL_BIGP - bboxhi2);
|
|
|
|
const flt_t dz = (INTEL_BIGP - bboxhi[2]);
|
|
|
|
if (dx * dx + dy * dy + dz * dz < static_cast<flt_t>(cutneighmaxsq))
|
|
|
|
if (dx * dx + dy * dy + dz * dz < static_cast<flt_t>(cutneighmaxsq))
|
|
|
|
error->one(FLERR,
|
|
|
|
error->one(FLERR,
|
|
|
|
"Intel package expects no atoms within cutoff of {1e15,1e15,1e15}.");
|
|
|
|
"Intel package expects no atoms within cutoff of {1e15,1e15,1e15}.");
|
|
|
|
@ -319,15 +264,6 @@ void Neighbor::hbnni(const int offload, NeighList *list, void *buffers_in,
|
|
|
|
#ifdef _LMP_INTEL_OFFLOAD
|
|
|
|
#ifdef _LMP_INTEL_OFFLOAD
|
|
|
|
const int * _noalias const binhead = this->binhead;
|
|
|
|
const int * _noalias const binhead = this->binhead;
|
|
|
|
const int * _noalias const special_flag = this->special_flag;
|
|
|
|
const int * _noalias const special_flag = this->special_flag;
|
|
|
|
const int nbinx = this->nbinx;
|
|
|
|
|
|
|
|
const int nbiny = this->nbiny;
|
|
|
|
|
|
|
|
const int nbinz = this->nbinz;
|
|
|
|
|
|
|
|
const int mbinxlo = this->mbinxlo;
|
|
|
|
|
|
|
|
const int mbinylo = this->mbinylo;
|
|
|
|
|
|
|
|
const int mbinzlo = this->mbinzlo;
|
|
|
|
|
|
|
|
const int mbinx = this->mbinx;
|
|
|
|
|
|
|
|
const int mbiny = this->mbiny;
|
|
|
|
|
|
|
|
const int mbinz = this->mbinz;
|
|
|
|
|
|
|
|
const int * _noalias const bins = this->bins;
|
|
|
|
const int * _noalias const bins = this->bins;
|
|
|
|
const int cop = fix->coprocessor_number();
|
|
|
|
const int cop = fix->coprocessor_number();
|
|
|
|
const int separate_buffers = fix->separate_buffers();
|
|
|
|
const int separate_buffers = fix->separate_buffers();
|
|
|
|
@ -343,12 +279,11 @@ void Neighbor::hbnni(const int offload, NeighList *list, void *buffers_in,
|
|
|
|
in(cnumneigh:length(0) alloc_if(0) free_if(0)) \
|
|
|
|
in(cnumneigh:length(0) alloc_if(0) free_if(0)) \
|
|
|
|
out(numneigh:length(0) alloc_if(0) free_if(0)) \
|
|
|
|
out(numneigh:length(0) alloc_if(0) free_if(0)) \
|
|
|
|
in(ilist:length(0) alloc_if(0) free_if(0)) \
|
|
|
|
in(ilist:length(0) alloc_if(0) free_if(0)) \
|
|
|
|
|
|
|
|
in(atombin:length(aend) alloc_if(0) free_if(0)) \
|
|
|
|
in(stencil:length(nstencil) alloc_if(0) free_if(0)) \
|
|
|
|
in(stencil:length(nstencil) alloc_if(0) free_if(0)) \
|
|
|
|
in(special_flag:length(0) alloc_if(0) free_if(0)) \
|
|
|
|
in(special_flag:length(0) alloc_if(0) free_if(0)) \
|
|
|
|
in(maxnbors,nthreads,maxspecial,nstencil,nbinx,nbiny,nbinz) \
|
|
|
|
in(maxnbors,nthreads,maxspecial,nstencil,pad_width,offload) \
|
|
|
|
in(mbinxlo,mbinylo,mbinzlo,mbinx,mbiny,mbinz,pad_width,offload) \
|
|
|
|
in(separate_buffers, astart, aend, nlocal, molecular, ntypes) \
|
|
|
|
in(bininvx,bininvy,bininvz,bboxlo0,bboxlo1,bboxlo2,separate_buffers) \
|
|
|
|
|
|
|
|
in(bboxhi0, bboxhi1, bboxhi2, astart, aend, nlocal, molecular, ntypes) \
|
|
|
|
|
|
|
|
out(overflow:length(5) alloc_if(0) free_if(0)) \
|
|
|
|
out(overflow:length(5) alloc_if(0) free_if(0)) \
|
|
|
|
out(timer_compute:length(1) alloc_if(0) free_if(0)) \
|
|
|
|
out(timer_compute:length(1) alloc_if(0) free_if(0)) \
|
|
|
|
signal(numneigh)
|
|
|
|
signal(numneigh)
|
|
|
|
@ -402,10 +337,7 @@ void Neighbor::hbnni(const int offload, NeighList *list, void *buffers_in,
|
|
|
|
// stores own/own pairs only once
|
|
|
|
// stores own/own pairs only once
|
|
|
|
// stores own/ghost pairs on both procs
|
|
|
|
// stores own/ghost pairs on both procs
|
|
|
|
|
|
|
|
|
|
|
|
ibin = mcoord2bin(x[i].x, x[i].y, x[i].z, bboxlo0, bboxlo1, bboxlo2,
|
|
|
|
ibin = atombin[i];
|
|
|
|
bboxhi0, bboxhi1, bboxhi2, bininvx, bininvy, bininvz,
|
|
|
|
|
|
|
|
nbinx, nbiny, nbinz, mbinx, mbiny, mbinz,
|
|
|
|
|
|
|
|
mbinxlo, mbinylo, mbinzlo);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (k = 0; k < nstencil; k++) {
|
|
|
|
for (k = 0; k < nstencil; k++) {
|
|
|
|
for (j = binhead[ibin + stencil[k]]; j >= 0; j = bins[j]) {
|
|
|
|
for (j = binhead[ibin + stencil[k]]; j >= 0; j = bins[j]) {
|
|
|
|
@ -648,7 +580,7 @@ void Neighbor::hbni(const int offload, NeighList *list, void *buffers_in,
|
|
|
|
fix->stop_watch(TIME_PACK);
|
|
|
|
fix->stop_watch(TIME_PACK);
|
|
|
|
|
|
|
|
|
|
|
|
fix->start_watch(TIME_HOST_NEIGHBOR);
|
|
|
|
fix->start_watch(TIME_HOST_NEIGHBOR);
|
|
|
|
bin_atoms<flt_t,acc_t>(buffers->get_x());
|
|
|
|
bin_atoms<flt_t,acc_t>(buffers->get_x(), buffers->get_atombin());
|
|
|
|
if (INTEL_MIC_NBOR_PAD > 1)
|
|
|
|
if (INTEL_MIC_NBOR_PAD > 1)
|
|
|
|
pad = INTEL_MIC_NBOR_PAD * sizeof(float) / sizeof(flt_t);
|
|
|
|
pad = INTEL_MIC_NBOR_PAD * sizeof(float) / sizeof(flt_t);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
@ -718,21 +650,13 @@ void Neighbor::hbni(const int offload, NeighList *list, void *buffers_in,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const int nthreads = tnum;
|
|
|
|
const int nthreads = tnum;
|
|
|
|
const int maxnbors = buffers->get_max_nbors();
|
|
|
|
const int maxnbors = buffers->get_max_nbors();
|
|
|
|
|
|
|
|
int * _noalias const atombin = buffers->get_atombin();
|
|
|
|
|
|
|
|
|
|
|
|
const flt_t bboxlo0 = this->bboxlo[0];
|
|
|
|
|
|
|
|
const flt_t bboxlo1 = this->bboxlo[1];
|
|
|
|
|
|
|
|
const flt_t bboxlo2 = this->bboxlo[2];
|
|
|
|
|
|
|
|
const flt_t bboxhi0 = this->bboxhi[0];
|
|
|
|
|
|
|
|
const flt_t bboxhi1 = this->bboxhi[1];
|
|
|
|
|
|
|
|
const flt_t bboxhi2 = this->bboxhi[2];
|
|
|
|
|
|
|
|
const flt_t bininvx = this->bininvx;
|
|
|
|
|
|
|
|
const flt_t bininvy = this->bininvy;
|
|
|
|
|
|
|
|
const flt_t bininvz = this->bininvz;
|
|
|
|
|
|
|
|
// Make sure dummy coordinates to eliminate loop remainder not within cutoff
|
|
|
|
// Make sure dummy coordinates to eliminate loop remainder not within cutoff
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const flt_t dx = (INTEL_BIGP - bboxhi0);
|
|
|
|
const flt_t dx = (INTEL_BIGP - bboxhi[0]);
|
|
|
|
const flt_t dy = (INTEL_BIGP - bboxhi1);
|
|
|
|
const flt_t dy = (INTEL_BIGP - bboxhi[1]);
|
|
|
|
const flt_t dz = (INTEL_BIGP - bboxhi2);
|
|
|
|
const flt_t dz = (INTEL_BIGP - bboxhi[2]);
|
|
|
|
if (dx * dx + dy * dy + dz * dz < static_cast<flt_t>(cutneighmaxsq))
|
|
|
|
if (dx * dx + dy * dy + dz * dz < static_cast<flt_t>(cutneighmaxsq))
|
|
|
|
error->one(FLERR,
|
|
|
|
error->one(FLERR,
|
|
|
|
"Intel package expects no atoms within cutoff of {1e15,1e15,1e15}.");
|
|
|
|
"Intel package expects no atoms within cutoff of {1e15,1e15,1e15}.");
|
|
|
|
@ -741,15 +665,6 @@ void Neighbor::hbni(const int offload, NeighList *list, void *buffers_in,
|
|
|
|
#ifdef _LMP_INTEL_OFFLOAD
|
|
|
|
#ifdef _LMP_INTEL_OFFLOAD
|
|
|
|
const int * _noalias const binhead = this->binhead;
|
|
|
|
const int * _noalias const binhead = this->binhead;
|
|
|
|
const int * _noalias const special_flag = this->special_flag;
|
|
|
|
const int * _noalias const special_flag = this->special_flag;
|
|
|
|
const int nbinx = this->nbinx;
|
|
|
|
|
|
|
|
const int nbiny = this->nbiny;
|
|
|
|
|
|
|
|
const int nbinz = this->nbinz;
|
|
|
|
|
|
|
|
const int mbinxlo = this->mbinxlo;
|
|
|
|
|
|
|
|
const int mbinylo = this->mbinylo;
|
|
|
|
|
|
|
|
const int mbinzlo = this->mbinzlo;
|
|
|
|
|
|
|
|
const int mbinx = this->mbinx;
|
|
|
|
|
|
|
|
const int mbiny = this->mbiny;
|
|
|
|
|
|
|
|
const int mbinz = this->mbinz;
|
|
|
|
|
|
|
|
const int * _noalias const bins = this->bins;
|
|
|
|
const int * _noalias const bins = this->bins;
|
|
|
|
const int cop = fix->coprocessor_number();
|
|
|
|
const int cop = fix->coprocessor_number();
|
|
|
|
const int separate_buffers = fix->separate_buffers();
|
|
|
|
const int separate_buffers = fix->separate_buffers();
|
|
|
|
@ -765,12 +680,11 @@ void Neighbor::hbni(const int offload, NeighList *list, void *buffers_in,
|
|
|
|
in(cnumneigh:length(0) alloc_if(0) free_if(0)) \
|
|
|
|
in(cnumneigh:length(0) alloc_if(0) free_if(0)) \
|
|
|
|
out(numneigh:length(0) alloc_if(0) free_if(0)) \
|
|
|
|
out(numneigh:length(0) alloc_if(0) free_if(0)) \
|
|
|
|
in(ilist:length(0) alloc_if(0) free_if(0)) \
|
|
|
|
in(ilist:length(0) alloc_if(0) free_if(0)) \
|
|
|
|
|
|
|
|
in(atombin:length(aend) alloc_if(0) free_if(0)) \
|
|
|
|
in(stencil:length(nstencil) alloc_if(0) free_if(0)) \
|
|
|
|
in(stencil:length(nstencil) alloc_if(0) free_if(0)) \
|
|
|
|
in(special_flag:length(0) alloc_if(0) free_if(0)) \
|
|
|
|
in(special_flag:length(0) alloc_if(0) free_if(0)) \
|
|
|
|
in(maxnbors,nthreads,maxspecial,nstencil,nbinx,nbiny,nbinz,e_nall,offload)\
|
|
|
|
in(maxnbors,nthreads,maxspecial,nstencil,e_nall,offload,pad_width) \
|
|
|
|
in(mbinxlo,mbinylo,mbinzlo,mbinx,mbiny,mbinz,pad_width,offload_end) \
|
|
|
|
in(offload_end,separate_buffers,astart, aend, nlocal, molecular, ntypes) \
|
|
|
|
in(bininvx,bininvy,bininvz,bboxlo0,bboxlo1,bboxlo2,separate_buffers) \
|
|
|
|
|
|
|
|
in(bboxhi0, bboxhi1, bboxhi2, astart, aend, nlocal, molecular, ntypes) \
|
|
|
|
|
|
|
|
out(overflow:length(5) alloc_if(0) free_if(0)) \
|
|
|
|
out(overflow:length(5) alloc_if(0) free_if(0)) \
|
|
|
|
out(timer_compute:length(1) alloc_if(0) free_if(0)) \
|
|
|
|
out(timer_compute:length(1) alloc_if(0) free_if(0)) \
|
|
|
|
signal(numneigh)
|
|
|
|
signal(numneigh)
|
|
|
|
@ -861,10 +775,7 @@ void Neighbor::hbni(const int offload, NeighList *list, void *buffers_in,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// loop over all atoms in other bins in stencil, store every pair
|
|
|
|
// loop over all atoms in other bins in stencil, store every pair
|
|
|
|
|
|
|
|
|
|
|
|
ibin = mcoord2bin(x[i].x, x[i].y, x[i].z, bboxlo0, bboxlo1, bboxlo2,
|
|
|
|
ibin = atombin[i];
|
|
|
|
bboxhi0, bboxhi1, bboxhi2, bininvx, bininvy, bininvz,
|
|
|
|
|
|
|
|
nbinx, nbiny, nbinz, mbinx, mbiny, mbinz,
|
|
|
|
|
|
|
|
mbinxlo, mbinylo, mbinzlo);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (k = 0; k < nstencil; k++) {
|
|
|
|
for (k = 0; k < nstencil; k++) {
|
|
|
|
for (j = binhead[ibin + stencil[k]]; j >= 0; j = bins[j]) {
|
|
|
|
for (j = binhead[ibin + stencil[k]]; j >= 0; j = bins[j]) {
|
|
|
|
@ -1114,7 +1025,7 @@ void Neighbor::hbnti(const int offload, NeighList *list, void *buffers_in,
|
|
|
|
fix->stop_watch(TIME_PACK);
|
|
|
|
fix->stop_watch(TIME_PACK);
|
|
|
|
|
|
|
|
|
|
|
|
fix->start_watch(TIME_HOST_NEIGHBOR);
|
|
|
|
fix->start_watch(TIME_HOST_NEIGHBOR);
|
|
|
|
bin_atoms<flt_t,acc_t>(buffers->get_x());
|
|
|
|
bin_atoms<flt_t,acc_t>(buffers->get_x(), buffers->get_atombin());
|
|
|
|
if (INTEL_MIC_NBOR_PAD > 1)
|
|
|
|
if (INTEL_MIC_NBOR_PAD > 1)
|
|
|
|
pad = INTEL_MIC_NBOR_PAD * sizeof(float) / sizeof(flt_t);
|
|
|
|
pad = INTEL_MIC_NBOR_PAD * sizeof(float) / sizeof(flt_t);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
@ -1184,21 +1095,13 @@ void Neighbor::hbnti(const int offload, NeighList *list, void *buffers_in,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const int nthreads = tnum;
|
|
|
|
const int nthreads = tnum;
|
|
|
|
const int maxnbors = buffers->get_max_nbors();
|
|
|
|
const int maxnbors = buffers->get_max_nbors();
|
|
|
|
|
|
|
|
int * _noalias const atombin = buffers->get_atombin();
|
|
|
|
|
|
|
|
|
|
|
|
const flt_t bboxlo0 = this->bboxlo[0];
|
|
|
|
|
|
|
|
const flt_t bboxlo1 = this->bboxlo[1];
|
|
|
|
|
|
|
|
const flt_t bboxlo2 = this->bboxlo[2];
|
|
|
|
|
|
|
|
const flt_t bboxhi0 = this->bboxhi[0];
|
|
|
|
|
|
|
|
const flt_t bboxhi1 = this->bboxhi[1];
|
|
|
|
|
|
|
|
const flt_t bboxhi2 = this->bboxhi[2];
|
|
|
|
|
|
|
|
const flt_t bininvx = this->bininvx;
|
|
|
|
|
|
|
|
const flt_t bininvy = this->bininvy;
|
|
|
|
|
|
|
|
const flt_t bininvz = this->bininvz;
|
|
|
|
|
|
|
|
// Make sure dummy coordinates to eliminate loop remainder not within cutoff
|
|
|
|
// Make sure dummy coordinates to eliminate loop remainder not within cutoff
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const flt_t dx = (INTEL_BIGP - bboxhi0);
|
|
|
|
const flt_t dx = (INTEL_BIGP - bboxhi[0]);
|
|
|
|
const flt_t dy = (INTEL_BIGP - bboxhi1);
|
|
|
|
const flt_t dy = (INTEL_BIGP - bboxhi[1]);
|
|
|
|
const flt_t dz = (INTEL_BIGP - bboxhi2);
|
|
|
|
const flt_t dz = (INTEL_BIGP - bboxhi[2]);
|
|
|
|
if (dx * dx + dy * dy + dz * dz < static_cast<flt_t>(cutneighmaxsq))
|
|
|
|
if (dx * dx + dy * dy + dz * dz < static_cast<flt_t>(cutneighmaxsq))
|
|
|
|
error->one(FLERR,
|
|
|
|
error->one(FLERR,
|
|
|
|
"Intel package expects no atoms within cutoff of {1e15,1e15,1e15}.");
|
|
|
|
"Intel package expects no atoms within cutoff of {1e15,1e15,1e15}.");
|
|
|
|
@ -1207,15 +1110,6 @@ void Neighbor::hbnti(const int offload, NeighList *list, void *buffers_in,
|
|
|
|
#ifdef _LMP_INTEL_OFFLOAD
|
|
|
|
#ifdef _LMP_INTEL_OFFLOAD
|
|
|
|
const int * _noalias const binhead = this->binhead;
|
|
|
|
const int * _noalias const binhead = this->binhead;
|
|
|
|
const int * _noalias const special_flag = this->special_flag;
|
|
|
|
const int * _noalias const special_flag = this->special_flag;
|
|
|
|
const int nbinx = this->nbinx;
|
|
|
|
|
|
|
|
const int nbiny = this->nbiny;
|
|
|
|
|
|
|
|
const int nbinz = this->nbinz;
|
|
|
|
|
|
|
|
const int mbinxlo = this->mbinxlo;
|
|
|
|
|
|
|
|
const int mbinylo = this->mbinylo;
|
|
|
|
|
|
|
|
const int mbinzlo = this->mbinzlo;
|
|
|
|
|
|
|
|
const int mbinx = this->mbinx;
|
|
|
|
|
|
|
|
const int mbiny = this->mbiny;
|
|
|
|
|
|
|
|
const int mbinz = this->mbinz;
|
|
|
|
|
|
|
|
const int * _noalias const bins = this->bins;
|
|
|
|
const int * _noalias const bins = this->bins;
|
|
|
|
const int cop = fix->coprocessor_number();
|
|
|
|
const int cop = fix->coprocessor_number();
|
|
|
|
const int separate_buffers = fix->separate_buffers();
|
|
|
|
const int separate_buffers = fix->separate_buffers();
|
|
|
|
@ -1231,12 +1125,11 @@ void Neighbor::hbnti(const int offload, NeighList *list, void *buffers_in,
|
|
|
|
in(cnumneigh:length(0) alloc_if(0) free_if(0)) \
|
|
|
|
in(cnumneigh:length(0) alloc_if(0) free_if(0)) \
|
|
|
|
out(numneigh:length(0) alloc_if(0) free_if(0)) \
|
|
|
|
out(numneigh:length(0) alloc_if(0) free_if(0)) \
|
|
|
|
in(ilist:length(0) alloc_if(0) free_if(0)) \
|
|
|
|
in(ilist:length(0) alloc_if(0) free_if(0)) \
|
|
|
|
|
|
|
|
in(atombin:length(aend) alloc_if(0) free_if(0)) \
|
|
|
|
in(stencil:length(nstencil) alloc_if(0) free_if(0)) \
|
|
|
|
in(stencil:length(nstencil) alloc_if(0) free_if(0)) \
|
|
|
|
in(special_flag:length(0) alloc_if(0) free_if(0)) \
|
|
|
|
in(special_flag:length(0) alloc_if(0) free_if(0)) \
|
|
|
|
in(maxnbors,nthreads,maxspecial,nstencil,nbinx,nbiny,nbinz,offload_end) \
|
|
|
|
in(maxnbors,nthreads,maxspecial,nstencil,offload_end,pad_width,e_nall) \
|
|
|
|
in(mbinxlo,mbinylo,mbinzlo,mbinx,mbiny,mbinz,pad_width,e_nall,offload) \
|
|
|
|
in(offload,separate_buffers, astart, aend, nlocal, molecular, ntypes) \
|
|
|
|
in(bininvx,bininvy,bininvz,bboxlo0,bboxlo1,bboxlo2,separate_buffers) \
|
|
|
|
|
|
|
|
in(bboxhi0, bboxhi1, bboxhi2, astart, aend, nlocal, molecular, ntypes) \
|
|
|
|
|
|
|
|
out(overflow:length(5) alloc_if(0) free_if(0)) \
|
|
|
|
out(overflow:length(5) alloc_if(0) free_if(0)) \
|
|
|
|
out(timer_compute:length(1) alloc_if(0) free_if(0)) \
|
|
|
|
out(timer_compute:length(1) alloc_if(0) free_if(0)) \
|
|
|
|
signal(numneigh)
|
|
|
|
signal(numneigh)
|
|
|
|
@ -1291,10 +1184,7 @@ void Neighbor::hbnti(const int offload, NeighList *list, void *buffers_in,
|
|
|
|
// (equal zyx and j <= i)
|
|
|
|
// (equal zyx and j <= i)
|
|
|
|
// latter excludes self-self interaction but allows superposed atoms
|
|
|
|
// latter excludes self-self interaction but allows superposed atoms
|
|
|
|
|
|
|
|
|
|
|
|
ibin = mcoord2bin(x[i].x, x[i].y, x[i].z, bboxlo0, bboxlo1, bboxlo2,
|
|
|
|
ibin = atombin[i];
|
|
|
|
bboxhi0, bboxhi1, bboxhi2, bininvx, bininvy, bininvz,
|
|
|
|
|
|
|
|
nbinx, nbiny, nbinz, mbinx, mbiny, mbinz,
|
|
|
|
|
|
|
|
mbinxlo, mbinylo, mbinzlo);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (k = 0; k < nstencil; k++) {
|
|
|
|
for (k = 0; k < nstencil; k++) {
|
|
|
|
for (j = binhead[ibin + stencil[k]]; j >= 0; j = bins[j]) {
|
|
|
|
for (j = binhead[ibin + stencil[k]]; j >= 0; j = bins[j]) {
|
|
|
|
|