Fix defining of EXCLUSION_FORCES in CUDA/OpenCL kernels
authorAndrey Alekseenko <al42and@gmail.com>
Wed, 9 Dec 2020 11:24:13 +0000 (11:24 +0000)
committerPaul Bauer <paul.bauer.q@gmail.com>
Wed, 9 Dec 2020 11:24:13 +0000 (11:24 +0000)
For the case of cut-off electrostatics + Ewald LJ + no energy calculation,
the EXCLUSION_FORCES macro should be active.
However, LJ_EWALD macro is (conditionally) set only later, and so is
always undefined when it is being checked for EXCLUSION_FORCES.

docs/release-notes/2021/major/bugs-fixed.rst
src/gromacs/nbnxm/cuda/nbnxm_cuda_kernel.cuh
src/gromacs/nbnxm/opencl/nbnxm_ocl_kernel.clh

index cd2f2c78b33bd140697889ff11b18d8a7e18c99c..a38d2f26ba2dfbfa6e0785159e7ae0082f4b8144 100644 (file)
@@ -37,3 +37,11 @@ dimensions. The, now simplified, formula for the initial histogram size is
 given in the reference manual.
 
 :issue:`3751`
+
+Fixed LJ Ewald exclusions when used with cut-off electrostatics
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+The exclusion forces in CUDA and OpenCL kernels were computed incorrectly
+if LJ Ewald was used together with cut-off electrostatics.
+
+:issue:`3840`
index 9cddbc199942b957298edc794e9cea840628a7b2..6b307e4ca9e2e63856b9ac647994fb7e37e41d04 100644 (file)
 #    define EL_EWALD_ANY
 #endif
 
+#if defined LJ_EWALD_COMB_GEOM || defined LJ_EWALD_COMB_LB
+/* Note: convenience macro, needs to be undef-ed at the end of the file. */
+#    define LJ_EWALD
+#endif
+
 #if defined EL_EWALD_ANY || defined EL_RF || defined LJ_EWALD \
         || (defined EL_CUTOFF && defined CALC_ENERGIES)
 /* Macro to control the calculation of exclusion forces in the kernel
 #    define EXCLUSION_FORCES
 #endif
 
-#if defined LJ_EWALD_COMB_GEOM || defined LJ_EWALD_COMB_LB
-/* Note: convenience macro, needs to be undef-ed at the end of the file. */
-#    define LJ_EWALD
-#endif
-
 #if defined LJ_COMB_GEOM || defined LJ_COMB_LB
 #    define LJ_COMB
 #endif
index 11516fd4f1caf4214b93f3b5a288d20332e5e1a2..7f9925059c767e79e077a0d3e6df20c16c4163a2 100644 (file)
 #    define EL_EWALD_ANY
 #endif
 
+#if defined LJ_EWALD_COMB_GEOM || defined LJ_EWALD_COMB_LB
+/* Note: convenience macro, needs to be undef-ed at the end of the file. */
+#    define LJ_EWALD
+#endif
+
 #if defined EL_EWALD_ANY || defined EL_RF || defined LJ_EWALD \
         || (defined EL_CUTOFF && defined CALC_ENERGIES)
 /* Macro to control the calculation of exclusion forces in the kernel
 #    define EXCLUSION_FORCES
 #endif
 
-#if defined LJ_EWALD_COMB_GEOM || defined LJ_EWALD_COMB_LB
-/* Note: convenience macro, needs to be undef-ed at the end of the file. */
-#    define LJ_EWALD
-#endif
-
 #if defined LJ_COMB_GEOM || defined LJ_COMB_LB
 /* Note: convenience macro, needs to be undef-ed at the end of the file. */
 #    define LJ_COMB