From 42ef87755e82549f4c5530e7d308528668dae915 Mon Sep 17 00:00:00 2001 From: stamoor Date: Thu, 9 Jul 2015 22:44:52 +0000 Subject: [PATCH] Fixing Kokkos bug with restarts git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@13565 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/KOKKOS/atom_vec_angle_kokkos.cpp | 7 +++++++ src/KOKKOS/atom_vec_atomic_kokkos.cpp | 5 +++++ src/KOKKOS/atom_vec_bond_kokkos.cpp | 5 ++++- src/KOKKOS/atom_vec_charge_kokkos.cpp | 6 ++++++ src/KOKKOS/atom_vec_full_kokkos.cpp | 8 ++++++++ src/KOKKOS/atom_vec_molecular_kokkos.cpp | 8 ++++++++ 6 files changed, 38 insertions(+), 1 deletion(-) diff --git a/src/KOKKOS/atom_vec_angle_kokkos.cpp b/src/KOKKOS/atom_vec_angle_kokkos.cpp index d78014120f..5217435b51 100644 --- a/src/KOKKOS/atom_vec_angle_kokkos.cpp +++ b/src/KOKKOS/atom_vec_angle_kokkos.cpp @@ -1501,6 +1501,10 @@ int AtomVecAngleKokkos::size_restart() int AtomVecAngleKokkos::pack_restart(int i, double *buf) { + sync(Host,X_MASK | V_MASK | TAG_MASK | TYPE_MASK | + MASK_MASK | IMAGE_MASK | MOLECULE_MASK | BOND_MASK | + ANGLE_MASK | SPECIAL_MASK); + int m = 1; buf[m++] = h_x(i,0); buf[m++] = h_x(i,1); @@ -1551,6 +1555,9 @@ int AtomVecAngleKokkos::unpack_restart(double *buf) if (atom->nextra_store) memory->grow(atom->extra,nmax,atom->nextra_store,"atom:extra"); } + modified(Host,X_MASK | V_MASK | TAG_MASK | TYPE_MASK | + MASK_MASK | IMAGE_MASK | MOLECULE_MASK | BOND_MASK | + ANGLE_MASK | SPECIAL_MASK); int m = 1; h_x(nlocal,0) = buf[m++]; diff --git a/src/KOKKOS/atom_vec_atomic_kokkos.cpp b/src/KOKKOS/atom_vec_atomic_kokkos.cpp index bedda8a0bd..ddef28df2d 100644 --- a/src/KOKKOS/atom_vec_atomic_kokkos.cpp +++ b/src/KOKKOS/atom_vec_atomic_kokkos.cpp @@ -1179,6 +1179,9 @@ int AtomVecAtomicKokkos::size_restart() int AtomVecAtomicKokkos::pack_restart(int i, double *buf) { + sync(Host,X_MASK | V_MASK | TAG_MASK | TYPE_MASK | + MASK_MASK | IMAGE_MASK ); + int m = 1; buf[m++] = h_x(i,0); buf[m++] = h_x(i,1); @@ -1211,6 +1214,8 @@ int AtomVecAtomicKokkos::unpack_restart(double *buf) if (atom->nextra_store) memory->grow(atom->extra,nmax,atom->nextra_store,"atom:extra"); } + modified(Host,X_MASK | V_MASK | TAG_MASK | TYPE_MASK | + MASK_MASK | IMAGE_MASK ); int m = 1; h_x(nlocal,0) = buf[m++]; diff --git a/src/KOKKOS/atom_vec_bond_kokkos.cpp b/src/KOKKOS/atom_vec_bond_kokkos.cpp index a991c594f3..c04cc893be 100644 --- a/src/KOKKOS/atom_vec_bond_kokkos.cpp +++ b/src/KOKKOS/atom_vec_bond_kokkos.cpp @@ -1389,6 +1389,8 @@ int AtomVecBondKokkos::size_restart() int AtomVecBondKokkos::pack_restart(int i, double *buf) { + sync(Host,X_MASK | V_MASK | TAG_MASK | TYPE_MASK | + MASK_MASK | IMAGE_MASK | MOLECULE_MASK | BOND_MASK | SPECIAL_MASK); int m = 1; buf[m++] = h_x(i,0); buf[m++] = h_x(i,1); @@ -1431,7 +1433,8 @@ int AtomVecBondKokkos::unpack_restart(double *buf) if (atom->nextra_store) memory->grow(atom->extra,nmax,atom->nextra_store,"atom:extra"); } - + modified(Host,X_MASK | V_MASK | TAG_MASK | TYPE_MASK | + MASK_MASK | IMAGE_MASK | MOLECULE_MASK | BOND_MASK | SPECIAL_MASK); int m = 1; h_x(nlocal,0) = buf[m++]; h_x(nlocal,1) = buf[m++]; diff --git a/src/KOKKOS/atom_vec_charge_kokkos.cpp b/src/KOKKOS/atom_vec_charge_kokkos.cpp index 0bcc594f75..40b87c91b2 100644 --- a/src/KOKKOS/atom_vec_charge_kokkos.cpp +++ b/src/KOKKOS/atom_vec_charge_kokkos.cpp @@ -1256,6 +1256,9 @@ int AtomVecChargeKokkos::size_restart() int AtomVecChargeKokkos::pack_restart(int i, double *buf) { + sync(Host,X_MASK | V_MASK | TAG_MASK | TYPE_MASK | + MASK_MASK | IMAGE_MASK | Q_MASK); + int m = 1; buf[m++] = h_x(i,0); buf[m++] = h_x(i,1); @@ -1291,6 +1294,9 @@ int AtomVecChargeKokkos::unpack_restart(double *buf) memory->grow(atom->extra,nmax,atom->nextra_store,"atom:extra"); } + modified(Host,X_MASK | V_MASK | TAG_MASK | TYPE_MASK | + MASK_MASK | IMAGE_MASK | Q_MASK); + int m = 1; h_x(nlocal,0) = buf[m++]; h_x(nlocal,1) = buf[m++]; diff --git a/src/KOKKOS/atom_vec_full_kokkos.cpp b/src/KOKKOS/atom_vec_full_kokkos.cpp index 0d3893432e..a8472b4713 100644 --- a/src/KOKKOS/atom_vec_full_kokkos.cpp +++ b/src/KOKKOS/atom_vec_full_kokkos.cpp @@ -1794,6 +1794,10 @@ int AtomVecFullKokkos::size_restart() int AtomVecFullKokkos::pack_restart(int i, double *buf) { + sync(Host,X_MASK | V_MASK | TAG_MASK | TYPE_MASK | + MASK_MASK | IMAGE_MASK | Q_MASK | MOLECULE_MASK | BOND_MASK | + ANGLE_MASK | DIHEDRAL_MASK | IMPROPER_MASK | SPECIAL_MASK); + int m = 1; buf[m++] = h_x(i,0); buf[m++] = h_x(i,1); @@ -1864,6 +1868,10 @@ int AtomVecFullKokkos::unpack_restart(double *buf) memory->grow(atom->extra,nmax,atom->nextra_store,"atom:extra"); } + modified(Host,X_MASK | V_MASK | TAG_MASK | TYPE_MASK | + MASK_MASK | IMAGE_MASK | Q_MASK | MOLECULE_MASK | BOND_MASK | + ANGLE_MASK | DIHEDRAL_MASK | IMPROPER_MASK | SPECIAL_MASK); + int m = 1; h_x(nlocal,0) = buf[m++]; h_x(nlocal,1) = buf[m++]; diff --git a/src/KOKKOS/atom_vec_molecular_kokkos.cpp b/src/KOKKOS/atom_vec_molecular_kokkos.cpp index 256514eb7f..a577dda355 100644 --- a/src/KOKKOS/atom_vec_molecular_kokkos.cpp +++ b/src/KOKKOS/atom_vec_molecular_kokkos.cpp @@ -1722,6 +1722,10 @@ int AtomVecMolecularKokkos::size_restart() int AtomVecMolecularKokkos::pack_restart(int i, double *buf) { + sync(Host,X_MASK | V_MASK | TAG_MASK | TYPE_MASK | + MASK_MASK | IMAGE_MASK | MOLECULE_MASK | BOND_MASK | + ANGLE_MASK | DIHEDRAL_MASK | IMPROPER_MASK | SPECIAL_MASK); + int m = 1; buf[m++] = h_x(i,0); buf[m++] = h_x(i,1); @@ -1791,6 +1795,10 @@ int AtomVecMolecularKokkos::unpack_restart(double *buf) memory->grow(atom->extra,nmax,atom->nextra_store,"atom:extra"); } + modified(Host,X_MASK | V_MASK | TAG_MASK | TYPE_MASK | + MASK_MASK | IMAGE_MASK | MOLECULE_MASK | BOND_MASK | + ANGLE_MASK | DIHEDRAL_MASK | IMPROPER_MASK | SPECIAL_MASK); + int m = 1; h_x(nlocal,0) = buf[m++]; h_x(nlocal,1) = buf[m++];