Merge pull request #3615 from stanmoore1/kk_small_fixes

Small bugfixes for Kokkos
This commit is contained in:
Axel Kohlmeyer
2023-01-25 18:18:47 -05:00
committed by GitHub
5 changed files with 8 additions and 5 deletions

View File

@ -39,7 +39,7 @@ FixNVTKokkos<DeviceType>::FixNVTKokkos(LAMMPS *lmp, int narg, char **arg) :
// id = fix-ID + temp // id = fix-ID + temp
this->id_temp = utils::strdup(std::string(this->id)+"_temp"); this->id_temp = utils::strdup(std::string(this->id)+"_temp");
this->modify->add_compute(fmt::format("{} all temp/kk",this->id_temp)); this->modify->add_compute(fmt::format("{} {} temp/kk",this->id_temp,this->group->names[this->igroup]));
this->tcomputeflag = 1; this->tcomputeflag = 1;
} }

View File

@ -67,7 +67,7 @@ FixNVTSllodKokkos<DeviceType>::FixNVTSllodKokkos(LAMMPS *lmp, int narg, char **a
} }
this->id_temp = utils::strdup(std::string(this->id)+"_temp"); this->id_temp = utils::strdup(std::string(this->id)+"_temp");
this->modify->add_compute(fmt::format("{} all temp/deform/kk",this->id_temp)); this->modify->add_compute(fmt::format("{} {} temp/deform/kk",this->id_temp,this->group->names[this->igroup]));
this->tcomputeflag = 1; this->tcomputeflag = 1;
this->nondeformbias = 0; this->nondeformbias = 0;
} }

View File

@ -77,9 +77,8 @@ void FixSetForceKokkos<DeviceType>::init()
template<class DeviceType> template<class DeviceType>
void FixSetForceKokkos<DeviceType>::post_force(int /*vflag*/) void FixSetForceKokkos<DeviceType>::post_force(int /*vflag*/)
{ {
atomKK->sync(execution_space, X_MASK | F_MASK | MASK_MASK); atomKK->sync(execution_space, F_MASK | MASK_MASK);
x = atomKK->k_x.view<DeviceType>();
f = atomKK->k_f.view<DeviceType>(); f = atomKK->k_f.view<DeviceType>();
mask = atomKK->k_mask.view<DeviceType>(); mask = atomKK->k_mask.view<DeviceType>();
@ -88,6 +87,8 @@ void FixSetForceKokkos<DeviceType>::post_force(int /*vflag*/)
// update region if necessary // update region if necessary
if (region) { if (region) {
if (!utils::strmatch(region->style, "^block"))
error->all(FLERR,"Cannot (yet) use {}-style region with fix setforce/kk",region->style);
region->prematch(); region->prematch();
DAT::tdual_int_1d k_match = DAT::tdual_int_1d("setforce:k_match",nlocal); DAT::tdual_int_1d k_match = DAT::tdual_int_1d("setforce:k_match",nlocal);
KokkosBase* regionKKBase = dynamic_cast<KokkosBase*>(region); KokkosBase* regionKKBase = dynamic_cast<KokkosBase*>(region);

View File

@ -513,6 +513,7 @@ double MinKokkos::energy_force(int resetflag)
if (modify->n_min_post_force) { if (modify->n_min_post_force) {
timer->stamp(); timer->stamp();
modify->min_post_force(vflag); modify->min_post_force(vflag);
atomKK->sync(Device,F_MASK);
timer->stamp(Timer::MODIFY); timer->stamp(Timer::MODIFY);
} }

View File

@ -48,7 +48,8 @@ void RegBlockKokkos<DeviceType>::match_all_kokkos(int groupbit_in, DAT::tdual_in
groupbit = groupbit_in; groupbit = groupbit_in;
d_match = k_match_in.template view<DeviceType>(); d_match = k_match_in.template view<DeviceType>();
atomKK->sync(Device, X_MASK | MASK_MASK); auto execution_space = ExecutionSpaceFromDevice<DeviceType>::space;
atomKK->sync(execution_space, X_MASK | MASK_MASK);
x = atomKK->k_x.view<DeviceType>(); x = atomKK->k_x.view<DeviceType>();
mask = atomKK->k_mask.view<DeviceType>(); mask = atomKK->k_mask.view<DeviceType>();