debugged kokkos support to dynamical_matrix command

This commit is contained in:
Sievers
2021-12-13 14:14:14 -08:00
parent 7544f1bcf8
commit a887d880c6
2 changed files with 25 additions and 2 deletions

View File

@ -135,6 +135,13 @@ void DynamicalMatrixKokkos::setup()
update->setupflag = 0; update->setupflag = 0;
lmp->kokkos->auto_sync = 0; lmp->kokkos->auto_sync = 0;
//if all then skip communication groupmap population
if (gcount == atom->natoms)
for (bigint i=0; i<atom->natoms; i++)
groupmap[i] = i;
else
create_groupmap();
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
@ -155,6 +162,7 @@ void DynamicalMatrixKokkos::update_force()
f_merge_copy = DAT::t_f_array("DynamicalMatrixKokkos::f_merge_copy",atomKK->k_f.extent(0)); f_merge_copy = DAT::t_f_array("DynamicalMatrixKokkos::f_merge_copy",atomKK->k_f.extent(0));
atomKK->modified(Host,X_MASK);
atomKK->sync(Device,X_MASK); atomKK->sync(Device,X_MASK);
force_clear(); force_clear();
@ -305,8 +313,10 @@ void DynamicalMatrixKokkos::update_force()
} }
// force modifications // force modifications
if (n_post_force) modify->post_force(vflag); if (n_post_force) {
timer->stamp(Timer::MODIFY); modify->post_force(vflag);
timer->stamp(Timer::MODIFY);
}
atomKK->sync(Host,F_MASK); atomKK->sync(Host,F_MASK);
lmp->kokkos->auto_sync = 1; lmp->kokkos->auto_sync = 1;

View File

@ -783,6 +783,19 @@ int Input::execute_command()
// invoke commands added via style_command.h // invoke commands added via style_command.h
if (lmp && lmp->suffix_enable && utils::strmatch(command,"^dynamical_matrix")) {
if (utils::strmatch(lmp->suffix, "^kk")) {
std::string cstyle = command + std::string("/") + lmp->suffix;
if (command_map->find(command) != command_map->end()) {
CommandCreator &command_creator = (*command_map)[cstyle];
Command *cmd = command_creator(lmp);
cmd->command(narg, arg);
delete cmd;
return 0;
}
}
}
if (command_map->find(command) != command_map->end()) { if (command_map->find(command) != command_map->end()) {
CommandCreator &command_creator = (*command_map)[command]; CommandCreator &command_creator = (*command_map)[command];
Command *cmd = command_creator(lmp); Command *cmd = command_creator(lmp);