Avoid division by zero is pruning part calculation
authorSzilárd Páll <pall.szilard@gmail.com>
Mon, 28 Aug 2017 12:31:25 +0000 (14:31 +0200)
committerBerk Hess <hess@kth.se>
Tue, 29 Aug 2017 07:51:31 +0000 (09:51 +0200)
Added assert on manually set pruning interval.

Change-Id: I438f98a0a42335d8f79bf7604b53b51943e7db8c

docs/user-guide/environment-variables.rst
src/gromacs/mdlib/nbnxn_tuning.cpp

index 15059694788bd1bb853497b9a1fc5df7eab0982b..ac78d8f0dc7c8c2c3687507aaaad2f8bd084475f 100644 (file)
@@ -358,7 +358,8 @@ Performance and Run Control
 
 ``GMX_NSTLIST_DYNAMICPRUNING``
         overrides the dynamic pair-list pruning interval chosen heuristically
-        by mdrun. Values should be between 1 and :mdp:`nstlist - 1`.
+        by mdrun. Values should be between the pruning frequency value
+        (1 for CPU and 2 for GPU) and :mdp:`nstlist - 1`.
 
 ``GMX_USE_TREEREDUCE``
         use tree reduction for nbnxn force reduction. Potentially faster for large number of
index 58d48e33cd8ef5d5ac97756b790d5ea676d05808..6b616c6ee0f3344e7d4d032a5eb14773f9693364 100644 (file)
@@ -488,6 +488,10 @@ void setupDynamicPairlistPruning(FILE                      *fplog,
              * rolling pruning interval slightly shorter than nstlistTune,
              * thus giving correct results, but a slightly lower efficiency.
              */
+            GMX_RELEASE_ASSERT(listParams->nstlistPrune >= c_nbnxnGpuRollingListPruningInterval,
+                               ( "With dynamic list pruning on GPUs pruning frequency must be at least as large as the rolling pruning interval (" +
+                                 std::to_string(c_nbnxnGpuRollingListPruningInterval) +
+                                 ").").c_str() );
             listParams->numRollingParts = listParams->nstlistPrune/c_nbnxnGpuRollingListPruningInterval;
         }
         else