From d8f8a3a36ab2fafdb63447fb2ffb841175fcc4b6 Mon Sep 17 00:00:00 2001 From: Vsevak Date: Sat, 28 May 2022 00:24:24 +0300 Subject: [PATCH] Handle inconsistent J molecules in tip4p/gpu --- lib/gpu/geryon/hip_device.h | 2 +- lib/gpu/lal_lj_tip4p_long.cu | 42 ++++++++++++++++++++------ src/GPU/pair_lj_cut_tip4p_long_gpu.cpp | 7 +++-- 3 files changed, 38 insertions(+), 13 deletions(-) diff --git a/lib/gpu/geryon/hip_device.h b/lib/gpu/geryon/hip_device.h index fadeec8711..f809323ee7 100644 --- a/lib/gpu/geryon/hip_device.h +++ b/lib/gpu/geryon/hip_device.h @@ -394,7 +394,7 @@ UCL_Device::~UCL_Device() { clear(); } -int UCL_Device::set_platform(const int) { +int UCL_Device::set_platform(const int pid) { clear(); #ifdef UCL_DEBUG assert(pid=0 && iH2>=0) { + compute_newsite(iO,iH1,iH2, &m[iO], qO, alpha, x_); + } else { + m[iO] = ix; + m[iO].w = qO; + hneigh[i*4] = iO; + hneigh[i*4+1] = iO; + } } } } diff --git a/src/GPU/pair_lj_cut_tip4p_long_gpu.cpp b/src/GPU/pair_lj_cut_tip4p_long_gpu.cpp index 5c2c391136..f6e528676d 100644 --- a/src/GPU/pair_lj_cut_tip4p_long_gpu.cpp +++ b/src/GPU/pair_lj_cut_tip4p_long_gpu.cpp @@ -186,8 +186,9 @@ void PairLJCutTIP4PLongGPU::init_style() alpha = qdist / (cos(0.5 * theta) * blen); cut_coulsq = cut_coul * cut_coul; - double cut_coulsqplus = (cut_coul + qdist + blen) * (cut_coul + qdist + blen); - if (maxcut < cut_coulsqplus) { cell_size = (cut_coul + qdist + blen) + neighbor->skin; } + double cut_coulplus = cut_coul + qdist + blen; + double cut_coulsqplus = cut_coulplus*cut_coulplus; + if (sqrt(maxcut) < cut_coulplus+blen) { cell_size = (cut_coulplus + blen) + neighbor->skin; } if (comm->cutghostuser < cell_size) { if (comm->me == 0) error->warning(FLERR, @@ -205,7 +206,7 @@ void PairLJCutTIP4PLongGPU::init_style() GPU_EXTRA::check_flag(success, error, world); if (gpu_mode == GPU_FORCE) { auto req = neighbor->add_request(this, NeighConst::REQ_FULL); - req->set_cutoff(cut_coul + qdist + blen + neighbor->skin); + req->set_cutoff(cut_coulplus + neighbor->skin); } }