diff --git a/src/KOKKOS/kokkos.cpp b/src/KOKKOS/kokkos.cpp index b3edb0e6a0..00676c7bf8 100644 --- a/src/KOKKOS/kokkos.cpp +++ b/src/KOKKOS/kokkos.cpp @@ -633,15 +633,24 @@ void KokkosLMP::accelerator(int narg, char **arg) // set neighbor binsize, same as neigh_modify command force->newton = force->newton_pair = force->newton_bond = newtonflag; - - if (neigh_thread && newtonflag) - error->all(FLERR,"Must use KOKKOS package option 'newton off' with 'neigh/thread on'"); + newton_check(); neighbor->binsize_user = binsize; if (binsize <= 0.0) neighbor->binsizeflag = 0; else neighbor->binsizeflag = 1; } +/* ---------------------------------------------------------------------- */ + +void KokkosLMP::newton_check() +{ + if (neighflag == FULL && force->newton) + error->all(FLERR,"Must use 'newton off' with KOKKOS package option 'neigh full'"); + + if (neigh_thread && force->newton) + error->all(FLERR,"Must use 'newton off' with KOKKOS package option 'neigh/thread on'"); +} + /* ---------------------------------------------------------------------- called by Finish ------------------------------------------------------------------------- */ diff --git a/src/KOKKOS/kokkos.h b/src/KOKKOS/kokkos.h index 419de62dec..f88fb6e685 100644 --- a/src/KOKKOS/kokkos.h +++ b/src/KOKKOS/kokkos.h @@ -64,6 +64,7 @@ class KokkosLMP : protected Pointers { static void initialize(const Kokkos::InitializationSettings&, Error *); static void finalize(); void accelerator(int, char **); + void newton_check(); bigint neigh_count(int); template diff --git a/src/accelerator_kokkos.h b/src/accelerator_kokkos.h index 36a376bff8..dec52b2363 100644 --- a/src/accelerator_kokkos.h +++ b/src/accelerator_kokkos.h @@ -59,6 +59,7 @@ class KokkosLMP { void accelerator(int, char **) {} int neigh_list_kokkos(int) { return 0; } int neigh_count(int) { return 0; } + void newton_check() {}; }; class AtomKokkos : public Atom { diff --git a/src/input.cpp b/src/input.cpp index 38c38ca2ee..25211ba848 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -1687,6 +1687,8 @@ void Input::newton() if (newton_pair || newton_bond) force->newton = 1; else force->newton = 0; + + if (lmp->kokkos) lmp->kokkos->newton_check(); } /* ---------------------------------------------------------------------- */