Merge pull request #1415 from stanmoore1/kk_nh

Fix bug in fix_nh_kokkos
This commit is contained in:
Axel Kohlmeyer 2019-04-05 16:50:08 -04:00 committed by GitHub
commit 67f8c83661
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 10 deletions

View File

@ -106,8 +106,8 @@ void FixNHKokkos<DeviceType>::setup(int vflag)
if (t0 == 0.0) {
atomKK->sync(temperature->execution_space,temperature->datamask_read);
atomKK->modified(temperature->execution_space,temperature->datamask_modify);
t0 = temperature->compute_scalar();
atomKK->modified(temperature->execution_space,temperature->datamask_modify);
if (t0 == 0.0) {
if (strcmp(update->unit_style,"lj") == 0) t0 = 1.0;
else t0 = 300.0;
@ -119,8 +119,8 @@ void FixNHKokkos<DeviceType>::setup(int vflag)
if (pstat_flag) compute_press_target();
atomKK->sync(temperature->execution_space,temperature->datamask_read);
atomKK->modified(temperature->execution_space,temperature->datamask_modify);
t_current = temperature->compute_scalar();
atomKK->modified(temperature->execution_space,temperature->datamask_modify);
tdof = temperature->dof;
if (pstat_flag) {
@ -250,10 +250,11 @@ void FixNHKokkos<DeviceType>::final_integrate()
// per-atom values are invalid if reneigh/comm occurred
// since temp->compute() in initial_integrate()
if (which == BIAS && neighbor->ago == 0)
if (which == BIAS && neighbor->ago == 0) {
atomKK->sync(temperature->execution_space,temperature->datamask_read);
atomKK->modified(temperature->execution_space,temperature->datamask_modify);
t_current = temperature->compute_scalar();
atomKK->modified(temperature->execution_space,temperature->datamask_modify);
}
if (pstat_flag) nh_v_press();
@ -261,8 +262,8 @@ void FixNHKokkos<DeviceType>::final_integrate()
// compute appropriately coupled elements of mvv_current
atomKK->sync(temperature->execution_space,temperature->datamask_read);
atomKK->modified(temperature->execution_space,temperature->datamask_modify);
t_current = temperature->compute_scalar();
atomKK->modified(temperature->execution_space,temperature->datamask_modify);
tdof = temperature->dof;
if (pstat_flag) {
@ -476,8 +477,6 @@ void FixNHKokkos<DeviceType>::remap()
template<class DeviceType>
void FixNHKokkos<DeviceType>::nh_v_press()
{
atomKK->sync(execution_space,V_MASK | MASK_MASK);
v = atomKK->k_v.view<DeviceType>();
mask = atomKK->k_mask.view<DeviceType>();
int nlocal = atomKK->nlocal;
@ -493,6 +492,8 @@ void FixNHKokkos<DeviceType>::nh_v_press()
atomKK->modified(temperature->execution_space,temperature->datamask_modify);
}
atomKK->sync(execution_space,V_MASK | MASK_MASK);
copymode = 1;
if (pstyle == TRICLINIC)
Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, TagFixNH_nh_v_press<1> >(0,nlocal),*this);
@ -536,7 +537,6 @@ template<class DeviceType>
void FixNHKokkos<DeviceType>::nve_v()
{
atomKK->sync(execution_space,X_MASK | V_MASK | F_MASK | MASK_MASK | RMASS_MASK | TYPE_MASK);
atomKK->modified(execution_space,V_MASK);
v = atomKK->k_v.view<DeviceType>();
f = atomKK->k_f.view<DeviceType>();
@ -553,6 +553,8 @@ void FixNHKokkos<DeviceType>::nve_v()
else
Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, TagFixNH_nve_v<0> >(0,nlocal),*this);
copymode = 0;
atomKK->modified(execution_space,V_MASK);
}
template<class DeviceType>
@ -616,8 +618,6 @@ void FixNHKokkos<DeviceType>::operator()(TagFixNH_nve_x, const int &i) const {
template<class DeviceType>
void FixNHKokkos<DeviceType>::nh_v_temp()
{
atomKK->sync(execution_space,V_MASK | MASK_MASK);
v = atomKK->k_v.view<DeviceType>();
mask = atomKK->k_mask.view<DeviceType>();
int nlocal = atomKK->nlocal;
@ -629,6 +629,8 @@ void FixNHKokkos<DeviceType>::nh_v_temp()
atomKK->modified(temperature->execution_space,temperature->datamask_modify);
}
atomKK->sync(execution_space,V_MASK | MASK_MASK);
copymode = 1;
Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, TagFixNH_nh_v_temp>(0,nlocal),*this);
copymode = 0;