Fixing Kokkos bugs

git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14580 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
stamoor 2016-02-05 17:40:10 +00:00
parent 384aef4381
commit da41fcb74b
1 changed files with 39 additions and 39 deletions

View File

@ -43,14 +43,14 @@ void ModifyKokkos::setup(int vflag)
if (update->whichflag == 1)
for (int i = 0; i < nfix; i++) {
atomKK->sync(fix[i]->execution_space,fix[i]->datamask_read);
atomKK->modified(fix[i]->execution_space,fix[i]->datamask_modify);
fix[i]->setup(vflag);
atomKK->modified(fix[i]->execution_space,fix[i]->datamask_modify);
}
else if (update->whichflag == 2)
for (int i = 0; i < nfix; i++) {
atomKK->sync(fix[i]->execution_space,fix[i]->datamask_read);
atomKK->modified(fix[i]->execution_space,fix[i]->datamask_modify);
fix[i]->min_setup(vflag);
atomKK->modified(fix[i]->execution_space,fix[i]->datamask_modify);
}
}
@ -65,17 +65,17 @@ void ModifyKokkos::setup_pre_exchange()
for (int i = 0; i < n_pre_exchange; i++) {
atomKK->sync(fix[list_pre_exchange[i]]->execution_space,
fix[list_pre_exchange[i]]->datamask_read);
fix[list_pre_exchange[i]]->setup_pre_exchange();
atomKK->modified(fix[list_pre_exchange[i]]->execution_space,
fix[list_pre_exchange[i]]->datamask_modify);
fix[list_pre_exchange[i]]->setup_pre_exchange();
}
else if (update->whichflag == 2)
for (int i = 0; i < n_min_pre_exchange; i++) {
atomKK->sync(fix[list_min_pre_exchange[i]]->execution_space,
fix[list_min_pre_exchange[i]]->datamask_read);
fix[list_min_pre_exchange[i]]->min_setup_pre_exchange();
atomKK->modified(fix[list_min_pre_exchange[i]]->execution_space,
fix[list_min_pre_exchange[i]]->datamask_modify);
fix[list_min_pre_exchange[i]]->min_setup_pre_exchange();
}
}
@ -90,17 +90,17 @@ void ModifyKokkos::setup_pre_neighbor()
for (int i = 0; i < n_pre_neighbor; i++) {
atomKK->sync(fix[list_pre_neighbor[i]]->execution_space,
fix[list_pre_neighbor[i]]->datamask_read);
fix[list_pre_neighbor[i]]->setup_pre_neighbor();
atomKK->modified(fix[list_pre_neighbor[i]]->execution_space,
fix[list_pre_neighbor[i]]->datamask_modify);
fix[list_pre_neighbor[i]]->setup_pre_neighbor();
}
else if (update->whichflag == 2)
for (int i = 0; i < n_min_pre_neighbor; i++) {
atomKK->sync(fix[list_min_pre_neighbor[i]]->execution_space,
fix[list_min_pre_neighbor[i]]->datamask_read);
fix[list_min_pre_neighbor[i]]->min_setup_pre_neighbor();
atomKK->modified(fix[list_min_pre_neighbor[i]]->execution_space,
fix[list_min_pre_neighbor[i]]->datamask_modify);
fix[list_min_pre_neighbor[i]]->min_setup_pre_neighbor();
}
}
@ -115,17 +115,17 @@ void ModifyKokkos::setup_pre_force(int vflag)
for (int i = 0; i < n_pre_force; i++) {
atomKK->sync(fix[list_pre_force[i]]->execution_space,
fix[list_pre_force[i]]->datamask_read);
fix[list_pre_force[i]]->setup_pre_force(vflag);
atomKK->modified(fix[list_pre_force[i]]->execution_space,
fix[list_pre_force[i]]->datamask_modify);
fix[list_pre_force[i]]->setup_pre_force(vflag);
}
else if (update->whichflag == 2)
for (int i = 0; i < n_min_pre_force; i++) {
atomKK->sync(fix[list_min_pre_force[i]]->execution_space,
fix[list_min_pre_force[i]]->datamask_read);
fix[list_min_pre_force[i]]->min_setup_pre_force(vflag);
atomKK->modified(fix[list_min_pre_force[i]]->execution_space,
fix[list_min_pre_force[i]]->datamask_modify);
fix[list_min_pre_force[i]]->min_setup_pre_force(vflag);
}
}
@ -138,9 +138,9 @@ void ModifyKokkos::initial_integrate(int vflag)
for (int i = 0; i < n_initial_integrate; i++) {
atomKK->sync(fix[list_initial_integrate[i]]->execution_space,
fix[list_initial_integrate[i]]->datamask_read);
fix[list_initial_integrate[i]]->initial_integrate(vflag);
atomKK->modified(fix[list_initial_integrate[i]]->execution_space,
fix[list_initial_integrate[i]]->datamask_modify);
fix[list_initial_integrate[i]]->initial_integrate(vflag);
}
}
@ -153,9 +153,9 @@ void ModifyKokkos::post_integrate()
for (int i = 0; i < n_post_integrate; i++) {
atomKK->sync(fix[list_post_integrate[i]]->execution_space,
fix[list_post_integrate[i]]->datamask_read);
fix[list_post_integrate[i]]->post_integrate();
atomKK->modified(fix[list_post_integrate[i]]->execution_space,
fix[list_post_integrate[i]]->datamask_modify);
fix[list_post_integrate[i]]->post_integrate();
}
}
@ -168,9 +168,9 @@ void ModifyKokkos::pre_exchange()
for (int i = 0; i < n_pre_exchange; i++) {
atomKK->sync(fix[list_pre_exchange[i]]->execution_space,
fix[list_pre_exchange[i]]->datamask_read);
fix[list_pre_exchange[i]]->pre_exchange();
atomKK->modified(fix[list_pre_exchange[i]]->execution_space,
fix[list_pre_exchange[i]]->datamask_modify);
fix[list_pre_exchange[i]]->pre_exchange();
}
}
@ -183,9 +183,9 @@ void ModifyKokkos::pre_neighbor()
for (int i = 0; i < n_pre_neighbor; i++) {
atomKK->sync(fix[list_pre_neighbor[i]]->execution_space,
fix[list_pre_neighbor[i]]->datamask_read);
fix[list_pre_neighbor[i]]->pre_neighbor();
atomKK->modified(fix[list_pre_neighbor[i]]->execution_space,
fix[list_pre_neighbor[i]]->datamask_modify);
fix[list_pre_neighbor[i]]->pre_neighbor();
}
}
@ -198,9 +198,9 @@ void ModifyKokkos::pre_force(int vflag)
for (int i = 0; i < n_pre_force; i++) {
atomKK->sync(fix[list_pre_force[i]]->execution_space,
fix[list_pre_force[i]]->datamask_read);
fix[list_pre_force[i]]->pre_force(vflag);
atomKK->modified(fix[list_pre_force[i]]->execution_space,
fix[list_pre_force[i]]->datamask_modify);
fix[list_pre_force[i]]->pre_force(vflag);
}
}
@ -213,9 +213,9 @@ void ModifyKokkos::post_force(int vflag)
for (int i = 0; i < n_post_force; i++) {
atomKK->sync(fix[list_post_force[i]]->execution_space,
fix[list_post_force[i]]->datamask_read);
fix[list_post_force[i]]->post_force(vflag);
atomKK->modified(fix[list_post_force[i]]->execution_space,
fix[list_post_force[i]]->datamask_modify);
fix[list_post_force[i]]->post_force(vflag);
}
}
@ -228,9 +228,9 @@ void ModifyKokkos::final_integrate()
for (int i = 0; i < n_final_integrate; i++) {
atomKK->sync(fix[list_final_integrate[i]]->execution_space,
fix[list_final_integrate[i]]->datamask_read);
fix[list_final_integrate[i]]->final_integrate();
atomKK->modified(fix[list_final_integrate[i]]->execution_space,
fix[list_final_integrate[i]]->datamask_modify);
fix[list_final_integrate[i]]->final_integrate();
}
}
@ -245,9 +245,9 @@ void ModifyKokkos::end_of_step()
if (update->ntimestep % end_of_step_every[i] == 0) {
atomKK->sync(fix[list_end_of_step[i]]->execution_space,
fix[list_end_of_step[i]]->datamask_read);
fix[list_end_of_step[i]]->end_of_step();
atomKK->modified(fix[list_end_of_step[i]]->execution_space,
fix[list_end_of_step[i]]->datamask_modify);
fix[list_end_of_step[i]]->end_of_step();
}
}
@ -263,9 +263,9 @@ double ModifyKokkos::thermo_energy()
for (int i = 0; i < n_thermo_energy; i++) {
atomKK->sync(fix[list_thermo_energy[i]]->execution_space,
fix[list_thermo_energy[i]]->datamask_read);
energy += fix[list_thermo_energy[i]]->compute_scalar();
atomKK->modified(fix[list_thermo_energy[i]]->execution_space,
fix[list_thermo_energy[i]]->datamask_modify);
energy += fix[list_thermo_energy[i]]->compute_scalar();
}
return energy;
}
@ -279,9 +279,9 @@ void ModifyKokkos::post_run()
for (int i = 0; i < nfix; i++) {
atomKK->sync(fix[i]->execution_space,
fix[i]->datamask_read);
fix[i]->post_run();
atomKK->modified(fix[i]->execution_space,
fix[i]->datamask_modify);
fix[i]->post_run();
}
}
@ -294,9 +294,9 @@ void ModifyKokkos::setup_pre_force_respa(int vflag, int ilevel)
for (int i = 0; i < n_pre_force; i++) {
atomKK->sync(fix[list_pre_force[i]]->execution_space,
fix[list_pre_force[i]]->datamask_read);
fix[list_pre_force[i]]->setup_pre_force_respa(vflag,ilevel);
atomKK->modified(fix[list_pre_force[i]]->execution_space,
fix[list_pre_force[i]]->datamask_modify);
fix[list_pre_force[i]]->setup_pre_force_respa(vflag,ilevel);
}
}
@ -309,10 +309,10 @@ void ModifyKokkos::initial_integrate_respa(int vflag, int ilevel, int iloop)
for (int i = 0; i < n_initial_integrate_respa; i++) {
atomKK->sync(fix[list_initial_integrate_respa[i]]->execution_space,
fix[list_initial_integrate_respa[i]]->datamask_read);
atomKK->modified(fix[list_initial_integrate_respa[i]]->execution_space,
fix[list_initial_integrate_respa[i]]->datamask_modify);
fix[list_initial_integrate_respa[i]]->
initial_integrate_respa(vflag,ilevel,iloop);
atomKK->modified(fix[list_initial_integrate_respa[i]]->execution_space,
fix[list_initial_integrate_respa[i]]->datamask_modify);
}
}
@ -325,9 +325,9 @@ void ModifyKokkos::post_integrate_respa(int ilevel, int iloop)
for (int i = 0; i < n_post_integrate_respa; i++) {
atomKK->sync(fix[list_post_integrate_respa[i]]->execution_space,
fix[list_post_integrate_respa[i]]->datamask_read);
fix[list_post_integrate_respa[i]]->post_integrate_respa(ilevel,iloop);
atomKK->modified(fix[list_post_integrate_respa[i]]->execution_space,
fix[list_post_integrate_respa[i]]->datamask_modify);
fix[list_post_integrate_respa[i]]->post_integrate_respa(ilevel,iloop);
}
}
@ -340,9 +340,9 @@ void ModifyKokkos::pre_force_respa(int vflag, int ilevel, int iloop)
for (int i = 0; i < n_pre_force_respa; i++) {
atomKK->sync(fix[list_pre_force_respa[i]]->execution_space,
fix[list_pre_force_respa[i]]->datamask_read);
fix[list_pre_force_respa[i]]->pre_force_respa(vflag,ilevel,iloop);
atomKK->modified(fix[list_pre_force_respa[i]]->execution_space,
fix[list_pre_force_respa[i]]->datamask_modify);
fix[list_pre_force_respa[i]]->pre_force_respa(vflag,ilevel,iloop);
}
}
@ -355,9 +355,9 @@ void ModifyKokkos::post_force_respa(int vflag, int ilevel, int iloop)
for (int i = 0; i < n_post_force_respa; i++) {
atomKK->sync(fix[list_post_force_respa[i]]->execution_space,
fix[list_post_force_respa[i]]->datamask_read);
fix[list_post_force_respa[i]]->post_force_respa(vflag,ilevel,iloop);
atomKK->modified(fix[list_post_force_respa[i]]->execution_space,
fix[list_post_force_respa[i]]->datamask_modify);
fix[list_post_force_respa[i]]->post_force_respa(vflag,ilevel,iloop);
}
}
@ -370,9 +370,9 @@ void ModifyKokkos::final_integrate_respa(int ilevel, int iloop)
for (int i = 0; i < n_final_integrate_respa; i++) {
atomKK->sync(fix[list_final_integrate_respa[i]]->execution_space,
fix[list_final_integrate_respa[i]]->datamask_read);
fix[list_final_integrate_respa[i]]->final_integrate_respa(ilevel,iloop);
atomKK->modified(fix[list_final_integrate_respa[i]]->execution_space,
fix[list_final_integrate_respa[i]]->datamask_modify);
fix[list_final_integrate_respa[i]]->final_integrate_respa(ilevel,iloop);
}
}
@ -385,9 +385,9 @@ void ModifyKokkos::min_pre_exchange()
for (int i = 0; i < n_min_pre_exchange; i++) {
atomKK->sync(fix[list_min_pre_exchange[i]]->execution_space,
fix[list_min_pre_exchange[i]]->datamask_read);
fix[list_min_pre_exchange[i]]->min_pre_exchange();
atomKK->modified(fix[list_min_pre_exchange[i]]->execution_space,
fix[list_min_pre_exchange[i]]->datamask_modify);
fix[list_min_pre_exchange[i]]->min_pre_exchange();
}
}
@ -400,9 +400,9 @@ void ModifyKokkos::min_pre_neighbor()
for (int i = 0; i < n_min_pre_neighbor; i++) {
atomKK->sync(fix[list_min_pre_neighbor[i]]->execution_space,
fix[list_min_pre_neighbor[i]]->datamask_read);
fix[list_min_pre_neighbor[i]]->min_pre_neighbor();
atomKK->modified(fix[list_min_pre_neighbor[i]]->execution_space,
fix[list_min_pre_neighbor[i]]->datamask_modify);
fix[list_min_pre_neighbor[i]]->min_pre_neighbor();
}
}
@ -415,9 +415,9 @@ void ModifyKokkos::min_pre_force(int vflag)
for (int i = 0; i < n_min_pre_force; i++) {
atomKK->sync(fix[list_min_pre_force[i]]->execution_space,
fix[list_min_pre_force[i]]->datamask_read);
fix[list_min_pre_force[i]]->min_pre_force(vflag);
atomKK->modified(fix[list_min_pre_force[i]]->execution_space,
fix[list_min_pre_force[i]]->datamask_modify);
fix[list_min_pre_force[i]]->min_pre_force(vflag);
}
}
@ -430,9 +430,9 @@ void ModifyKokkos::min_post_force(int vflag)
for (int i = 0; i < n_min_post_force; i++) {
atomKK->sync(fix[list_min_post_force[i]]->execution_space,
fix[list_min_post_force[i]]->datamask_read);
fix[list_min_post_force[i]]->min_post_force(vflag);
atomKK->modified(fix[list_min_post_force[i]]->execution_space,
fix[list_min_post_force[i]]->datamask_modify);
fix[list_min_post_force[i]]->min_post_force(vflag);
}
}
@ -450,9 +450,9 @@ double ModifyKokkos::min_energy(double *fextra)
for (int i = 0; i < n_min_energy; i++) {
ifix = list_min_energy[i];
atomKK->sync(fix[ifix]->execution_space,fix[ifix]->datamask_read);
atomKK->modified(fix[ifix]->execution_space,fix[ifix]->datamask_modify);
eng += fix[ifix]->min_energy(&fextra[index]);
index += fix[ifix]->min_dof();
atomKK->modified(fix[ifix]->execution_space,fix[ifix]->datamask_modify);
}
return eng;
}
@ -466,9 +466,9 @@ void ModifyKokkos::min_store()
for (int i = 0; i < n_min_energy; i++) {
atomKK->sync(fix[list_min_energy[i]]->execution_space,
fix[list_min_energy[i]]->datamask_read);
fix[list_min_energy[i]]->min_store();
atomKK->modified(fix[list_min_energy[i]]->execution_space,
fix[list_min_energy[i]]->datamask_modify);
fix[list_min_energy[i]]->min_store();
}
}
@ -481,9 +481,9 @@ void ModifyKokkos::min_clearstore()
for (int i = 0; i < n_min_energy; i++) {
atomKK->sync(fix[list_min_energy[i]]->execution_space,
fix[list_min_energy[i]]->datamask_read);
fix[list_min_energy[i]]->min_clearstore();
atomKK->modified(fix[list_min_energy[i]]->execution_space,
fix[list_min_energy[i]]->datamask_modify);
fix[list_min_energy[i]]->min_clearstore();
}
}
@ -492,9 +492,9 @@ void ModifyKokkos::min_pushstore()
for (int i = 0; i < n_min_energy; i++) {
atomKK->sync(fix[list_min_energy[i]]->execution_space,
fix[list_min_energy[i]]->datamask_read);
fix[list_min_energy[i]]->min_pushstore();
atomKK->modified(fix[list_min_energy[i]]->execution_space,
fix[list_min_energy[i]]->datamask_modify);
fix[list_min_energy[i]]->min_pushstore();
}
}
@ -503,9 +503,9 @@ void ModifyKokkos::min_popstore()
for (int i = 0; i < n_min_energy; i++) {
atomKK->sync(fix[list_min_energy[i]]->execution_space,
fix[list_min_energy[i]]->datamask_read);
fix[list_min_energy[i]]->min_popstore();
atomKK->modified(fix[list_min_energy[i]]->execution_space,
fix[list_min_energy[i]]->datamask_modify);
fix[list_min_energy[i]]->min_popstore();
}
}
@ -521,9 +521,9 @@ void ModifyKokkos::min_step(double alpha, double *hextra)
for (int i = 0; i < n_min_energy; i++) {
ifix = list_min_energy[i];
atomKK->sync(fix[ifix]->execution_space,fix[ifix]->datamask_read);
atomKK->modified(fix[ifix]->execution_space,fix[ifix]->datamask_modify);
fix[ifix]->min_step(alpha,&hextra[index]);
index += fix[ifix]->min_dof();
atomKK->modified(fix[ifix]->execution_space,fix[ifix]->datamask_modify);
}
}
@ -540,10 +540,10 @@ double ModifyKokkos::max_alpha(double *hextra)
for (int i = 0; i < n_min_energy; i++) {
ifix = list_min_energy[i];
atomKK->sync(fix[ifix]->execution_space,fix[ifix]->datamask_read);
atomKK->modified(fix[ifix]->execution_space,fix[ifix]->datamask_modify);
double alpha_one = fix[ifix]->max_alpha(&hextra[index]);
alpha = MIN(alpha,alpha_one);
index += fix[ifix]->min_dof();
atomKK->modified(fix[ifix]->execution_space,fix[ifix]->datamask_modify);
}
return alpha;
}
@ -558,9 +558,9 @@ int ModifyKokkos::min_dof()
for (int i = 0; i < n_min_energy; i++) {
atomKK->sync(fix[list_min_energy[i]]->execution_space,
fix[list_min_energy[i]]->datamask_read);
ndof += fix[list_min_energy[i]]->min_dof();
atomKK->modified(fix[list_min_energy[i]]->execution_space,
fix[list_min_energy[i]]->datamask_modify);
ndof += fix[list_min_energy[i]]->min_dof();
}
return ndof;
}
@ -576,10 +576,10 @@ int ModifyKokkos::min_reset_ref()
for (int i = 0; i < n_min_energy; i++) {
atomKK->sync(fix[list_min_energy[i]]->execution_space,
fix[list_min_energy[i]]->datamask_read);
atomKK->modified(fix[list_min_energy[i]]->execution_space,
fix[list_min_energy[i]]->datamask_modify);
itmp = fix[list_min_energy[i]]->min_reset_ref();
if (itmp) itmpall = 1;
atomKK->modified(fix[list_min_energy[i]]->execution_space,
fix[list_min_energy[i]]->datamask_modify);
}
return itmpall;
}