Merge remote-tracking branch 'lammps-ro/master' into lammps-icms

Resolved Conflicts:
	src/USER-FEP/fix_adapt_fep.cpp
This commit is contained in:
Axel Kohlmeyer
2014-10-11 20:43:03 -04:00
10 changed files with 89 additions and 169 deletions

View File

@ -1,4 +1,5 @@
2 ### DATE: 2012-06-25 CONTRIBUTOR: Don Ward, donward@sandia.gov CITATION: Ward, Zhou, Wong, Doty, and Zimmerman, Phys Rev B, 85, 115206 (2012)
### DATE: 2012-06-25 CONTRIBUTOR: Don Ward, donward@sandia.gov CITATION: Ward, Zhou, Wong, Doty, and Zimmerman, Phys Rev B, 85, 115206 (2012)
2
48 0.11241180E+03 Cd
52 0.12760300E+03 Te
2000 2000

View File

@ -1,4 +1,5 @@
2 ### DATE: 2012-06-25 CONTRIBUTOR: Don Ward, donward@sandia.gov CITATION: Ward, Zhou, Wong, Doty, and Zimmerman, Phys Rev B, 85, 115206 (2012)
### DATE: 2012-06-25 CONTRIBUTOR: Don Ward, donward@sandia.gov CITATION: Ward, Zhou, Wong, Doty, and Zimmerman, Phys Rev B, 85, 115206 (2012)
2
31 0.69723000E+02 Ga
33 0.74921593E+02 As
2000 2000

View File

@ -8027,7 +8027,7 @@ void PairBOP::read_file(char *filename)
MPI_Comm_rank(world,&me);
// read file on proc 0
// read file on proc 0
rcore=0.1;
@ -8039,7 +8039,7 @@ void PairBOP::read_file(char *filename)
error->one(FLERR,str);
}
// read parameters
// read parameters
fgets(s,MAXLINE,fp);
fgets(s,MAXLINE,fp);
@ -8047,6 +8047,7 @@ void PairBOP::read_file(char *filename)
fclose(fp);
npairs=bop_types*(bop_types+1)/2;
}
MPI_Bcast(&bop_types,1,MPI_INT,0,world);
MPI_Bcast(&npairs,1,MPI_INT,0,world);
allocate();
@ -8262,6 +8263,7 @@ void PairBOP::read_table(char *filename)
sprintf(str,"Cannot open BOP potential file %s",filename);
error->one(FLERR,str);
}
fgets(s,MAXLINE,fp); // skip first comment line
fgets(s,MAXLINE,fp);
sscanf(s,"%d",&bop_types);
words = new char*[bop_types];

View File

@ -188,6 +188,8 @@ FixAdaptFEP::~FixAdaptFEP()
}
delete [] adapt;
if (force->kspace) force->kspace->qsum_update_flag = 0;
// check nfix in case all fixes have already been deleted
if (id_fix_diam && modify->nfix) modify->delete_fix(id_fix_diam);
@ -289,8 +291,10 @@ void FixAdaptFEP::init()
if (adapt[i].which == ATOM)
error->all(FLERR,"Cannot use dynamic group with fix adapt/fep atom");
// when using kspace, we need to recompute some additional parameters in kspace->setup()
if (chgflag && force->kspace) force->kspace->qsum_update_flag = 1;
// when using kspace, we need to recompute
// some additional parameters in kspace->setup()
if (force->kspace) force->kspace->qsum_update_flag = 1;
// setup and error checks
@ -506,12 +510,13 @@ void FixAdaptFEP::change_settings()
if (anypair) force->pair->reinit();
if (chgflag && force->kspace) force->kspace->setup();
// re-setup KSpace if using it, since charges may have changed
if (force->kspace) force->kspace->setup();
}
/* ----------------------------------------------------------------------
restore pair,kspace.atom parameters to original values
restore pair,kspace,atom parameters to original values
------------------------------------------------------------------------- */
void FixAdaptFEP::restore_settings()
@ -560,6 +565,5 @@ void FixAdaptFEP::restore_settings()
}
if (anypair) force->pair->reinit();
if (chgflag && force->kspace) force->kspace->setup();
if (force->kspace) force->kspace->setup();
}

View File

@ -226,6 +226,7 @@ void IntelBuffers<flt_t, acc_t>::free_local()
{
if (_off_map_maxlocal > 0) {
int * cnumneigh = _cnumneigh;
int * atombin = _atombin;
#ifdef _LMP_INTEL_OFFLOAD
if (_off_map_ilist != NULL) {
const int * ilist = _off_map_ilist;
@ -233,11 +234,12 @@ void IntelBuffers<flt_t, acc_t>::free_local()
_off_map_ilist = NULL;
if (numneigh != 0 && ilist != 0) {
#pragma offload_transfer target(mic:_cop) \
nocopy(ilist,numneigh,cnumneigh:alloc_if(0) free_if(1))
nocopy(ilist,numneigh,cnumneigh,atombin:alloc_if(0) free_if(1))
}
}
#endif
lmp->memory->destroy(cnumneigh);
lmp->memory->destroy(atombin);
_off_map_maxlocal = 0;
}
}
@ -251,6 +253,7 @@ void IntelBuffers<flt_t, acc_t>::_grow_local(NeighList *list,
free_local();
int size = list->get_maxlocal();
lmp->memory->create(_cnumneigh, size, "_cnumneigh");
lmp->memory->create(_atombin, size, "_atombin");
_off_map_maxlocal = size;
#ifdef _LMP_INTEL_OFFLOAD
@ -258,11 +261,13 @@ void IntelBuffers<flt_t, acc_t>::_grow_local(NeighList *list,
int * numneigh = list->numneigh;
int * ilist = list->ilist;
int * cnumneigh = _cnumneigh;
if (cnumneigh != 0) {
int * atombin = _atombin;
if (cnumneigh != 0 && atombin != 0) {
#pragma offload_transfer target(mic:_cop) \
nocopy(ilist:length(size) alloc_if(1) free_if(0)) \
nocopy(numneigh:length(size) alloc_if(1) free_if(0)) \
nocopy(cnumneigh:length(size) alloc_if(1) free_if(0))
nocopy(cnumneigh:length(size) alloc_if(1) free_if(0)) \
nocopy(atombin:length(size) alloc_if(1) free_if(0))
}
_off_map_ilist = ilist;
_off_map_numneigh = numneigh;
@ -420,7 +425,7 @@ double IntelBuffers<flt_t, acc_t>::memory_usage(const int nthreads)
if (_off_f) tmem += fstride*_off_threads * sizeof(vec3_acc_t);
#endif
tmem += _off_map_maxlocal * sizeof(int);
tmem += _off_map_maxlocal * sizeof(int) * 2;
tmem += (_list_alloc_atoms + _off_threads) * get_max_nbors() * sizeof(int);
tmem += _ntypes * _ntypes * sizeof(int);

View File

@ -126,6 +126,7 @@ class IntelBuffers {
inline int * firstneigh(const NeighList *list) { return _list_alloc; }
inline int * cnumneigh(const NeighList *list) { return _cnumneigh; }
inline int * get_atombin() { return _atombin; }
inline atom_t * get_x(const int offload = 1) {
#ifdef _LMP_INTEL_OFFLOAD
if (_separate_buffers && offload == 0) return _host_x;
@ -249,6 +250,7 @@ class IntelBuffers {
int _list_alloc_atoms;
int * _list_alloc;
int * _cnumneigh;
int * _atombin;
flt_t **_cutneighsq;
int _ntypes;

View File

@ -32,47 +32,6 @@ using namespace LAMMPS_NS;
#pragma offload_attribute(push,target(mic))
#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) \
{ \
which = 0; \
@ -104,20 +63,14 @@ inline int mcoord2bin(const flt_t x0, const flt_t x1, const flt_t x2,
#endif
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;
int nlocal = atom->nlocal;
const int nall = nlocal + atom->nghost;
const flt_t bininvx = this->bininvx;
const flt_t bininvy = this->bininvy;
const flt_t bininvz = this->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];
const double sboxlo0 = bboxlo[0] + mbinxlo/bininvx;
const double sboxlo1 = bboxlo[1] + mbinylo/bininvy;
const double sboxlo2 = bboxlo[2] + mbinzlo/bininvz;
int i, ibin;
@ -129,25 +82,26 @@ void Neighbor::bin_atoms(void * xin) {
int bitmask = group->bitmask[includegroup];
for (i = nall-1; i >= nlocal; i--) {
if (mask[i] & bitmask) {
ibin = mcoord2bin(x[i].x, x[i].y, x[i].z, bboxlo0, bboxlo1, bboxlo2,
bboxhi0, bboxhi1, bboxhi2, bininvx, bininvy, bininvz, nbinx, nbiny,
nbinz, mbinx, mbiny, mbinz, mbinxlo, mbinylo, mbinzlo);
ibin = coord2bin(atom->x[i]);
bins[i] = binhead[ibin];
binhead[ibin] = i;
}
}
for (i = atom->nfirst-1; i >= 0; i--) {
ibin = mcoord2bin(x[i].x, x[i].y, x[i].z, bboxlo0, bboxlo1, bboxlo2,
bboxhi0, bboxhi1, bboxhi2, bininvx, bininvy, bininvz, nbinx, nbiny,
nbinz, mbinx, mbiny, mbinz, mbinxlo, mbinylo, mbinzlo);
ibin = coord2bin(atom->x[i]);
atombin[i] = ibin;
bins[i] = binhead[ibin];
binhead[ibin] = i;
}
} else {
for (i = nall-1; i >= 0; i--) {
ibin = mcoord2bin(x[i].x, x[i].y, x[i].z, bboxlo0, bboxlo1, bboxlo2,
bboxhi0, bboxhi1, bboxhi2, bininvx, bininvy, bininvz, nbinx, nbiny,
nbinz, mbinx, mbiny, mbinz, mbinxlo, mbinylo, mbinzlo);
for (i = nall-1; i >= nlocal; i--) {
ibin = coord2bin(atom->x[i]);
bins[i] = binhead[ibin];
binhead[ibin] = i;
}
for (i = nlocal-1; i >= 0; i--) {
ibin = coord2bin(atom->x[i]);
atombin[i]=ibin;
bins[i] = binhead[ibin];
binhead[ibin] = i;
}
@ -228,7 +182,7 @@ void Neighbor::hbnni(const int offload, NeighList *list, void *buffers_in,
fix->stop_watch(TIME_PACK);
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)
pad = INTEL_MIC_NBOR_PAD * sizeof(float) / sizeof(flt_t);
} else {
@ -295,22 +249,13 @@ void Neighbor::hbnni(const int offload, NeighList *list, void *buffers_in,
}
const int nthreads = tnum;
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
{
const flt_t dx = (INTEL_BIGP - bboxhi0);
const flt_t dy = (INTEL_BIGP - bboxhi1);
const flt_t dz = (INTEL_BIGP - bboxhi2);
const flt_t dx = (INTEL_BIGP - bboxhi[0]);
const flt_t dy = (INTEL_BIGP - bboxhi[1]);
const flt_t dz = (INTEL_BIGP - bboxhi[2]);
if (dx * dx + dy * dy + dz * dz < static_cast<flt_t>(cutneighmaxsq))
error->one(FLERR,
"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
const int * _noalias const binhead = this->binhead;
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 cop = fix->coprocessor_number();
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)) \
out(numneigh: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(special_flag:length(0) alloc_if(0) free_if(0)) \
in(maxnbors,nthreads,maxspecial,nstencil,nbinx,nbiny,nbinz) \
in(mbinxlo,mbinylo,mbinzlo,mbinx,mbiny,mbinz,pad_width,offload) \
in(bininvx,bininvy,bininvz,bboxlo0,bboxlo1,bboxlo2,separate_buffers) \
in(bboxhi0, bboxhi1, bboxhi2, astart, aend, nlocal, molecular, ntypes) \
in(maxnbors,nthreads,maxspecial,nstencil,pad_width,offload) \
in(separate_buffers, astart, aend, nlocal, molecular, ntypes) \
out(overflow:length(5) alloc_if(0) free_if(0)) \
out(timer_compute:length(1) alloc_if(0) free_if(0)) \
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/ghost pairs on both procs
ibin = mcoord2bin(x[i].x, x[i].y, x[i].z, bboxlo0, bboxlo1, bboxlo2,
bboxhi0, bboxhi1, bboxhi2, bininvx, bininvy, bininvz,
nbinx, nbiny, nbinz, mbinx, mbiny, mbinz,
mbinxlo, mbinylo, mbinzlo);
ibin = atombin[i];
for (k = 0; k < nstencil; k++) {
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->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)
pad = INTEL_MIC_NBOR_PAD * sizeof(float) / sizeof(flt_t);
} else {
@ -718,21 +650,13 @@ void Neighbor::hbni(const int offload, NeighList *list, void *buffers_in,
}
const int nthreads = tnum;
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
{
const flt_t dx = (INTEL_BIGP - bboxhi0);
const flt_t dy = (INTEL_BIGP - bboxhi1);
const flt_t dz = (INTEL_BIGP - bboxhi2);
const flt_t dx = (INTEL_BIGP - bboxhi[0]);
const flt_t dy = (INTEL_BIGP - bboxhi[1]);
const flt_t dz = (INTEL_BIGP - bboxhi[2]);
if (dx * dx + dy * dy + dz * dz < static_cast<flt_t>(cutneighmaxsq))
error->one(FLERR,
"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
const int * _noalias const binhead = this->binhead;
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 cop = fix->coprocessor_number();
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)) \
out(numneigh: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(special_flag:length(0) alloc_if(0) free_if(0)) \
in(maxnbors,nthreads,maxspecial,nstencil,nbinx,nbiny,nbinz,e_nall,offload)\
in(mbinxlo,mbinylo,mbinzlo,mbinx,mbiny,mbinz,pad_width,offload_end) \
in(bininvx,bininvy,bininvz,bboxlo0,bboxlo1,bboxlo2,separate_buffers) \
in(bboxhi0, bboxhi1, bboxhi2, astart, aend, nlocal, molecular, ntypes) \
in(maxnbors,nthreads,maxspecial,nstencil,e_nall,offload,pad_width) \
in(offload_end,separate_buffers,astart, aend, nlocal, molecular, ntypes) \
out(overflow:length(5) alloc_if(0) free_if(0)) \
out(timer_compute:length(1) alloc_if(0) free_if(0)) \
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
ibin = mcoord2bin(x[i].x, x[i].y, x[i].z, bboxlo0, bboxlo1, bboxlo2,
bboxhi0, bboxhi1, bboxhi2, bininvx, bininvy, bininvz,
nbinx, nbiny, nbinz, mbinx, mbiny, mbinz,
mbinxlo, mbinylo, mbinzlo);
ibin = atombin[i];
for (k = 0; k < nstencil; k++) {
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->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)
pad = INTEL_MIC_NBOR_PAD * sizeof(float) / sizeof(flt_t);
} else {
@ -1184,21 +1095,13 @@ void Neighbor::hbnti(const int offload, NeighList *list, void *buffers_in,
}
const int nthreads = tnum;
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
{
const flt_t dx = (INTEL_BIGP - bboxhi0);
const flt_t dy = (INTEL_BIGP - bboxhi1);
const flt_t dz = (INTEL_BIGP - bboxhi2);
const flt_t dx = (INTEL_BIGP - bboxhi[0]);
const flt_t dy = (INTEL_BIGP - bboxhi[1]);
const flt_t dz = (INTEL_BIGP - bboxhi[2]);
if (dx * dx + dy * dy + dz * dz < static_cast<flt_t>(cutneighmaxsq))
error->one(FLERR,
"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
const int * _noalias const binhead = this->binhead;
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 cop = fix->coprocessor_number();
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)) \
out(numneigh: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(special_flag:length(0) alloc_if(0) free_if(0)) \
in(maxnbors,nthreads,maxspecial,nstencil,nbinx,nbiny,nbinz,offload_end) \
in(mbinxlo,mbinylo,mbinzlo,mbinx,mbiny,mbinz,pad_width,e_nall,offload) \
in(bininvx,bininvy,bininvz,bboxlo0,bboxlo1,bboxlo2,separate_buffers) \
in(bboxhi0, bboxhi1, bboxhi2, astart, aend, nlocal, molecular, ntypes) \
in(maxnbors,nthreads,maxspecial,nstencil,offload_end,pad_width,e_nall) \
in(offload,separate_buffers, astart, aend, nlocal, molecular, ntypes) \
out(overflow:length(5) alloc_if(0) free_if(0)) \
out(timer_compute:length(1) alloc_if(0) free_if(0)) \
signal(numneigh)
@ -1291,10 +1184,7 @@ void Neighbor::hbnti(const int offload, NeighList *list, void *buffers_in,
// (equal zyx and j <= i)
// latter excludes self-self interaction but allows superposed atoms
ibin = mcoord2bin(x[i].x, x[i].y, x[i].z, bboxlo0, bboxlo1, bboxlo2,
bboxhi0, bboxhi1, bboxhi2, bininvx, bininvy, bininvz,
nbinx, nbiny, nbinz, mbinx, mbiny, mbinz,
mbinxlo, mbinylo, mbinzlo);
ibin = atombin[i];
for (k = 0; k < nstencil; k++) {
for (j = binhead[ibin + stencil[k]]; j >= 0; j = bins[j]) {

View File

@ -32,7 +32,7 @@
void *fix_intel;
template <class flt_t, class acc_t>
void bin_atoms(void *);
void bin_atoms(void *, int *);
template <class flt_t, class acc_t, int>
void hbni(const int, NeighList *, void *, const int, const int, void *,

View File

@ -174,6 +174,8 @@ FixAdapt::~FixAdapt()
}
delete [] adapt;
if (chgflag && force->kspace) force->kspace->qsum_update_flag = 0;
// check nfix in case all fixes have already been deleted
if (id_fix_diam && modify->nfix) modify->delete_fix(id_fix_diam);
@ -349,6 +351,11 @@ void FixAdapt::init()
}
}
// when adapting charge and using kspace,
// need to recompute additional params in kspace->setup()
if (chgflag && force->kspace) force->kspace->qsum_update_flag = 1;
// fixes that store initial per-atom values
if (id_fix_diam) {
@ -475,6 +482,11 @@ void FixAdapt::change_settings()
// and also offset and tail corrections
if (anypair) force->pair->reinit();
// re-setup KSpace if it exists and adapting charges
// since charges have changed
if (chgflag && force->kspace) force->kspace->setup();
}
/* ----------------------------------------------------------------------
@ -527,4 +539,5 @@ void FixAdapt::restore_settings()
}
if (anypair) force->pair->reinit();
if (chgflag && force->kspace) force->kspace->setup();
}

View File

@ -24,6 +24,7 @@
#include "force.h"
#include "group.h"
#include "comm.h"
#include "neighbor.h"
#include "irregular.h"
#include "modify.h"
#include "fix_deform.h"
@ -836,12 +837,13 @@ void FixNH::final_integrate()
nve_v();
// re-compute temp before nh_v_press()
// only needed for temperature computes with BIAS:
// only needed for temperature computes with BIAS on reneighboring steps:
// b/c some biases store per-atom values (e.g. temp/profile)
// per-atom values are invalid if reneigh/comm occurred
// since temp->compute() in initial_integrate()
if (which == BIAS) t_current = temperature->compute_scalar();
if (which == BIAS && neighbor->ago == 0)
t_current = temperature->compute_scalar();
if (pstat_flag) nh_v_press();