From d27836952aa4a753c931935d4f818c734282b9f7 Mon Sep 17 00:00:00 2001 From: Trung Nguyen Date: Mon, 27 Sep 2021 16:12:49 -0500 Subject: [PATCH] Fixed a bug in neighbor.cpp to make special_flag consistent between amoeba and hippo (to be 2 instead of 0), that caused missing neighbors with hippo --- lib/gpu/lal_hippo.cpp | 4 ++-- src/AMOEBA/pair_amoeba.cpp | 45 ++------------------------------------ src/GPU/pair_hippo_gpu.cpp | 2 +- src/neighbor.cpp | 2 ++ 4 files changed, 7 insertions(+), 46 deletions(-) diff --git a/lib/gpu/lal_hippo.cpp b/lib/gpu/lal_hippo.cpp index 77bbebbb9a..d31370be73 100644 --- a/lib/gpu/lal_hippo.cpp +++ b/lib/gpu/lal_hippo.cpp @@ -430,8 +430,8 @@ int** HippoT::compute_multipole_real(const int ago, const int inum_full, // leave the answers (forces, energies and virial) on the device, // only copy them back in the last kernel (this one, or polar_real once done) - this->ans->copy_answers(eflag_in,vflag_in,eatom,vatom,red_blocks); - this->device->add_ans_object(this->ans); + //this->ans->copy_answers(eflag_in,vflag_in,eatom,vatom,red_blocks); + //this->device->add_ans_object(this->ans); this->hd_balancer.stop_timer(); diff --git a/src/AMOEBA/pair_amoeba.cpp b/src/AMOEBA/pair_amoeba.cpp index 59d85814ec..5157739f0e 100644 --- a/src/AMOEBA/pair_amoeba.cpp +++ b/src/AMOEBA/pair_amoeba.cpp @@ -242,47 +242,6 @@ void PairAmoeba::compute(int eflag, int vflag) time_induce = time_polar = time_qxfer = 0.0; } - { // DEBUGGING - double **x = atom->x; - int inum,jnum; - int *ilist,*jlist,*numneigh,**firstneigh; - - inum = list->inum; - ilist = list->ilist; - numneigh = list->numneigh; - firstneigh = list->firstneigh; - - if (use_ewald) choose(MPOLE_LONG); - else choose(MPOLE); - - int i,ii,j,jj; - for (ii = 0; ii < inum; ii++) { - i = ilist[ii]; - double xi = x[i][0]; - double yi = x[i][1]; - double zi = x[i][2]; - - jlist = firstneigh[i]; - jnum = numneigh[i]; - - for (jj = 0; jj < jnum; jj++) { - j = jlist[jj]; - double factor_mpole = special_mpole[sbmask15(j)]; - j &= NEIGHMASK15; - - double xr = x[j][0] - xi; - double yr = x[j][1] - yi; - double zr = x[j][2] - zi; - double r2 = xr*xr + yr*yr + zr*zr; - //if (r2 > off2) continue; - double r = sqrt(r2); - if (i == 0) printf("j = %d: tag = %d; r = %f; factor_mpole = %f\n", j, r, atom->tag[j], factor_mpole); - } - } - - - } // DEBUGGING - double evdwl; evdwl = 0.0; @@ -1014,8 +973,8 @@ void PairAmoeba::init_style() int irequest = neighbor->request(this,instance_me); // for DEBUGGING with GPU - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->full = 1; + //neighbor->requests[irequest]->half = 0; + //neighbor->requests[irequest]->full = 1; // open debug output files // names are hard-coded diff --git a/src/GPU/pair_hippo_gpu.cpp b/src/GPU/pair_hippo_gpu.cpp index 4da0056029..1067969c7b 100644 --- a/src/GPU/pair_hippo_gpu.cpp +++ b/src/GPU/pair_hippo_gpu.cpp @@ -138,7 +138,7 @@ PairHippoGPU::PairHippoGPU(LAMMPS *lmp) : PairAmoeba(lmp), gpu_mode(GPU_FORCE) gpu_multipole_real_ready = true; gpu_udirect2b_ready = false; gpu_umutual2b_ready = false; - gpu_polar_real_ready = false; + gpu_polar_real_ready = true; GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); } diff --git a/src/neighbor.cpp b/src/neighbor.cpp index 0ee4051d4b..dcb6a21b7c 100644 --- a/src/neighbor.cpp +++ b/src/neighbor.cpp @@ -527,6 +527,7 @@ void Neighbor::init() int flag=0; for (int isub=0; isub < ph->nstyles; ++isub) { if (force->pair_match("amoeba",0,isub) + || force->pair_match("hippo",0,isub) || force->pair_match("coul/wolf",0,isub) || force->pair_match("coul/dsf",0,isub) || force->pair_match("coul/exclude",0) @@ -537,6 +538,7 @@ void Neighbor::init() special_flag[1] = special_flag[2] = special_flag[3] = 2; } else { if (force->pair_match("amoeba",0) + || force->pair_match("hippo",0) || force->pair_match("coul/wolf",0) || force->pair_match("coul/dsf",0) || force->pair_match("coul/exclude",0)