diff --git a/src/KOKKOS/atom_kokkos.cpp b/src/KOKKOS/atom_kokkos.cpp index e97213cb4b..bc393b29d8 100644 --- a/src/KOKKOS/atom_kokkos.cpp +++ b/src/KOKKOS/atom_kokkos.cpp @@ -46,7 +46,6 @@ AtomKokkos::AtomKokkos(LAMMPS *lmp) : Atom(lmp) h_tag_max = Kokkos::subview(h_tag_min_max,1); nprop_atom = 0; - prop_atom = nullptr; fix_prop_atom = nullptr; } @@ -132,16 +131,18 @@ void AtomKokkos::init() void AtomKokkos::update_property_atom() { + nprop_atom = 0; std::vector prop_atom_fixes; for (auto &ifix : modify->get_fix_by_style("^property/atom")) { if (!ifix->kokkosable) error->all(FLERR, "KOKKOS package requires a Kokkos-enabled version of fix property/atom"); + ++nprop_atom; prop_atom_fixes.push_back(ifix); } delete[] fix_prop_atom; - fix_prop_atom = new FixPropertyAtomKokkos *[prop_atom_fixes.size()]; + fix_prop_atom = new FixPropertyAtomKokkos *[nprop_atom]; int n = 0; for (auto &ifix : prop_atom_fixes) diff --git a/src/KOKKOS/atom_kokkos.h b/src/KOKKOS/atom_kokkos.h index 26ea7da296..21a9aeebbd 100644 --- a/src/KOKKOS/atom_kokkos.h +++ b/src/KOKKOS/atom_kokkos.h @@ -27,7 +27,6 @@ class AtomKokkos : public Atom { public: bool sort_classic; int nprop_atom; - int* prop_atom; FixPropertyAtomKokkos** fix_prop_atom; DAT::tdual_tagint_1d k_tag;