diff --git a/doc/src/package.txt b/doc/src/package.txt index 02afb8d6200ed159de48fb7003c5e25e5291e87e..e79c0fdce1ac532337ec6b7aa230f0d37aa9d284 100644 --- a/doc/src/package.txt +++ b/doc/src/package.txt @@ -62,12 +62,13 @@ args = arguments specific to the style :l {no_affinity} values = none {kokkos} args = keyword value ... zero or more keyword/value pairs may be appended - keywords = {neigh} or {newton} or {binsize} or {comm} or {comm/exchange} or {comm/forward} - {neigh} value = {full} or {half} or {n2} or {full/cluster} + keywords = {neigh} or {neigh/qeq} or {newton} or {binsize} or {comm} or {comm/exchange} or {comm/forward} + {neigh} value = {full} or {half} + full = full neighbor list + half = half neighbor list built in thread-safe manner + {neigh/qeq} value = {full} or {half} full = full neighbor list half = half neighbor list built in thread-safe manner - n2 = non-binning neighbor list build, O(N^2) algorithm - full/cluster = full neighbor list with clustered groups of atoms {newton} = {off} or {on} off = set Newton pairwise and bonded flags off (default) on = set Newton pairwise and bonded flags on @@ -392,10 +393,7 @@ default value as listed below. The {neigh} keyword determines how neighbor lists are built. A value of {half} uses a thread-safe variant of half-neighbor lists, -the same as used by most pair styles in LAMMPS. A value of -{n2} uses an O(N^2) algorithm to build the neighbor list without -binning, where N = # of atoms on a processor. It is typically slower -than the other methods, which use binning. +the same as used by most pair styles in LAMMPS. A value of {full} uses a full neighbor lists and is the default. This performs twice as much computation as the {half} option, however that @@ -403,15 +401,8 @@ is often a win because it is thread-safe and doesn't require atomic operations in the calculation of pair forces. For that reason, {full} is the default setting. However, when running in MPI-only mode with 1 thread per MPI task, {half} neighbor lists will typically be faster, -just as it is for non-accelerated pair styles. - -A value of {full/cluster} is an experimental neighbor style, where -particles interact with all particles within a small cluster, if at -least one of the clusters particles is within the neighbor cutoff -range. This potentially allows for better vectorization on -architectures such as the Intel Phi. If also reduces the size of the -neighbor list by roughly a factor of the cluster size, thus reducing -the total memory footprint considerably. +just as it is for non-accelerated pair styles. Similarly, the {neigh/qeq} +keyword determines how neighbor lists are built for "fix qeq/reax/kk"_fix_qeq_reax.html. The {newton} keyword sets the Newton flags for pairwise and bonded interactions to {off} or {on}, the same as the "newton"_newton.html diff --git a/src/KOKKOS/fix_qeq_reax_kokkos.cpp b/src/KOKKOS/fix_qeq_reax_kokkos.cpp index cf75a0424ef45e289c92437a5b7393ed798489d0..3b8d5a85ea600db699b128f75c59d62a33aa64c2 100644 --- a/src/KOKKOS/fix_qeq_reax_kokkos.cpp +++ b/src/KOKKOS/fix_qeq_reax_kokkos.cpp @@ -82,7 +82,7 @@ void FixQEqReaxKokkos<DeviceType>::init() FixQEqReax::init(); - neighflag = lmp->kokkos->neighflag; + neighflag = lmp->kokkos->neighflag_qeq; int irequest = neighbor->nrequest - 1; neighbor->requests[irequest]-> diff --git a/src/KOKKOS/kokkos.cpp b/src/KOKKOS/kokkos.cpp index 763c97d69b407ac329842d3732619205d0de7fda..b8be74ac1ed392979f7209f1745e88daab934b62 100644 --- a/src/KOKKOS/kokkos.cpp +++ b/src/KOKKOS/kokkos.cpp @@ -119,6 +119,8 @@ KokkosLMP::KokkosLMP(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) // default settings for package kokkos command neighflag = FULL; + neighflag_qeq = FULL; + neighflag_qeq_set = 0; exchange_comm_classic = 0; forward_comm_classic = 0; exchange_comm_on_host = 0; @@ -152,6 +154,8 @@ void KokkosLMP::accelerator(int narg, char **arg) // defaults neighflag = FULL; + neighflag_qeq = FULL; + neighflag_qeq_set = 0; int newtonflag = 0; double binsize = 0.0; exchange_comm_classic = forward_comm_classic = 0; @@ -169,6 +173,19 @@ void KokkosLMP::accelerator(int narg, char **arg) neighflag = HALF; } else if (strcmp(arg[iarg+1],"n2") == 0) neighflag = N2; else error->all(FLERR,"Illegal package kokkos command"); + if (!neighflag_qeq_set) neighflag_qeq = neighflag; + iarg += 2; + } else if (strcmp(arg[iarg],"neigh/qeq") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal package kokkos command"); + if (strcmp(arg[iarg+1],"full") == 0) neighflag_qeq = FULL; + else if (strcmp(arg[iarg+1],"half") == 0) { + if (num_threads > 1 || ngpu > 0) + neighflag_qeq = HALFTHREAD; + else + neighflag_qeq = HALF; + } else if (strcmp(arg[iarg+1],"n2") == 0) neighflag_qeq = N2; + else error->all(FLERR,"Illegal package kokkos command"); + neighflag_qeq_set = 1; iarg += 2; } else if (strcmp(arg[iarg],"binsize") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal package kokkos command"); diff --git a/src/KOKKOS/kokkos.h b/src/KOKKOS/kokkos.h index 3b91a56ea7e18a2534316fa69fffd32373099ce9..8e28b38cbf45b1e14c2a6e6da7fc59ff0f7b0920 100644 --- a/src/KOKKOS/kokkos.h +++ b/src/KOKKOS/kokkos.h @@ -23,6 +23,8 @@ class KokkosLMP : protected Pointers { public: int kokkos_exists; int neighflag; + int neighflag_qeq; + int neighflag_qeq_set; int exchange_comm_classic; int forward_comm_classic; int exchange_comm_on_host;