Remove unnecessary condition in DD force buffer resizing
authorBerk Hess <hess@kth.se>
Wed, 16 Sep 2020 13:33:12 +0000 (15:33 +0200)
committerArtem Zhmurov <zhmurov@gmail.com>
Wed, 16 Sep 2020 17:16:04 +0000 (17:16 +0000)
Removed a condition that was no longer necessary, as exactly
the same condition is checked inside the resize() method of
ForceHelperBuffers.

src/gromacs/domdec/partition.cpp

index c7a01ae473b785fee4bc134ef612d1ab82d9a8ce..4d3f88340bf7d4c5357fb8e7003feab7c29b7433 100644 (file)
@@ -3117,28 +3117,21 @@ void dd_partition_system(FILE*                     fplog,
 
     state_change_natoms(state_local, state_local->natoms);
 
-    if (fr->forceHelperBuffers->haveDirectVirialContributions())
+    if (vsite && vsite->numInterUpdategroupVirtualSites())
     {
-        if (vsite && vsite->numInterUpdategroupVirtualSites())
+        nat_f_novirsum = comm->atomRanges.end(DDAtomRanges::Type::Vsites);
+    }
+    else
+    {
+        if (EEL_FULL(ir->coulombtype) && dd->haveExclusions)
         {
-            nat_f_novirsum = comm->atomRanges.end(DDAtomRanges::Type::Vsites);
+            nat_f_novirsum = comm->atomRanges.end(DDAtomRanges::Type::Zones);
         }
         else
         {
-            if (EEL_FULL(ir->coulombtype) && dd->haveExclusions)
-            {
-                nat_f_novirsum = comm->atomRanges.end(DDAtomRanges::Type::Zones);
-            }
-            else
-            {
-                nat_f_novirsum = comm->atomRanges.numHomeAtoms();
-            }
+            nat_f_novirsum = comm->atomRanges.numHomeAtoms();
         }
     }
-    else
-    {
-        nat_f_novirsum = 0;
-    }
 
     /* Set the number of atoms required for the force calculation.
      * Forces need to be constrained when doing energy