The fix_shardlow_kokkos.cpp code had already factored out a redundant
sqrt() calculation in the innermost loop of ssa_update_dpde(). This
changeset propagates an equivilent optimization to:
fix_shardlow.cpp
pair_dpd_fdt_energy.cpp
pair_dpd_fdt_energy_kokkos.cpp
The alpha_ij variable was really just an [itype][jtype] lookup parameter,
replacing a sqrt() and two multiplies per interacting particle pair
by a cached memory read. Even if there isn't much time savings, the
code is now consistent across the various versions.
Also, cleaned up UCG_MASK and UCGNEW_MASK usage in atom_vec_dpd_kokkos.cpp
Fixes a crash when using the python interface on a 2nd LAMMPS invocation
when using the restart (or replicate) commands, because of garbage
in the uCG and uCGnew arrays leftover from the previous LAMMPS invocation.
This was accomplished with several key changes:
1) Modified fix_shardlow's control flow to match fix_shardlow_kokkos so
that random numbers are pulled fromn the RNGs in exactly the same order.
2) Created random_external_state.h, a simplified version of the Kokkos
random number generator that keeps its state variables external to itself.
Thus it can be used both with and without Kokkos enabled, as long as the
caller stores and passes in the required state variable.
3) Replaced all references to random_mars.h and Kokkos_Random.hpp code in
the fix_shardlow* files with calls to the random_external_state.h code,
guaranteeing that fix_shardlow* is using an identical RNG in all cases.
Result: most (56 of 61) of our internal tests now generate the same results
with kokkos turned on or off. Four cases still differ due to what appear
to be vectorization caused rounding differences, and the fifth case
appears to be something triggered by the kokkos "atom_style hybrid" code.
Eliminates a special case version of a loop just for Subphase 0.
NOTE: pair evaluation order changes, causing numerical differences!
This changed the order that close neighbors of ghosts are processed.