Remove unnecessary data tranfer in fix_nve_sphere_kokkos

This commit is contained in:
Stan Moore
2021-08-26 13:36:32 -06:00
parent 49b0623d6b
commit ddbb8f1aa6

View File

@ -31,8 +31,8 @@ FixNVESphereKokkos<DeviceType>::FixNVESphereKokkos(LAMMPS *lmp, int narg, char *
atomKK = (AtomKokkos *)atom;
execution_space = ExecutionSpaceFromDevice<DeviceType>::space;
datamask_read = X_MASK | V_MASK | OMEGA_MASK| F_MASK | TORQUE_MASK | RMASS_MASK | RADIUS_MASK | MASK_MASK;
datamask_modify = X_MASK | V_MASK | OMEGA_MASK;
datamask_read = EMPTY_MASK;
datamask_modify = EMPTY_MASK;
}
/* ---------------------------------------------------------------------- */
@ -61,8 +61,7 @@ void FixNVESphereKokkos<DeviceType>::init()
template<class DeviceType>
void FixNVESphereKokkos<DeviceType>::initial_integrate(int /*vflag*/)
{
atomKK->sync(execution_space,datamask_read);
atomKK->modified(execution_space,datamask_modify);
atomKK->sync(execution_space, X_MASK | V_MASK | OMEGA_MASK| F_MASK | TORQUE_MASK | RMASS_MASK | RADIUS_MASK | MASK_MASK);
x = atomKK->k_x.view<DeviceType>();
v = atomKK->k_v.view<DeviceType>();
@ -78,6 +77,8 @@ void FixNVESphereKokkos<DeviceType>::initial_integrate(int /*vflag*/)
FixNVESphereKokkosInitialIntegrateFunctor<DeviceType> f(this);
Kokkos::parallel_for(nlocal,f);
atomKK->modified(execution_space, X_MASK | V_MASK | OMEGA_MASK);
}
/* ---------------------------------------------------------------------- */
@ -109,8 +110,7 @@ void FixNVESphereKokkos<DeviceType>::initial_integrate_item(const int i) const
template<class DeviceType>
void FixNVESphereKokkos<DeviceType>::final_integrate()
{
atomKK->sync(execution_space,datamask_read);
atomKK->modified(execution_space,datamask_modify);
atomKK->sync(execution_space, V_MASK | OMEGA_MASK| F_MASK | TORQUE_MASK | RMASS_MASK | RADIUS_MASK | MASK_MASK);
v = atomKK->k_v.view<DeviceType>();
omega = atomKK->k_omega.view<DeviceType>();
@ -125,6 +125,8 @@ void FixNVESphereKokkos<DeviceType>::final_integrate()
FixNVESphereKokkosFinalIntegrateFunctor<DeviceType> f(this);
Kokkos::parallel_for(nlocal,f);
atomKK->modified(execution_space, V_MASK | OMEGA_MASK);
}
/* ---------------------------------------------------------------------- */