Add missing GMX_ASSERT(haveCopiedXFromGpu)
authorAndrey Alekseenko <al42and@gmail.com>
Wed, 24 Mar 2021 10:52:51 +0000 (13:52 +0300)
committerArtem Zhmurov <zhmurov@gmail.com>
Wed, 24 Mar 2021 11:04:41 +0000 (11:04 +0000)
We make this assertion every time we call
stateGpu->waitCoordinatesReadyOnHost(AtomLocality::Local) in the
do_force function.

This does not fix any bugs, just makes the code a bit more consistent in
how it checks self-consistency.

Refs #3988.

src/gromacs/mdlib/sim_util.cpp

index 8850f06ac6a011e0035e7371c5e3528ce6eb298d..6f42594ed010fd8ffb858cc3e04fb4efdaa1310f 100644 (file)
@@ -1298,6 +1298,8 @@ void do_force(FILE*                               fplog,
         /* Send particle coordinates to the pme nodes */
         if (!stepWork.doNeighborSearch && simulationWork.useGpuUpdate)
         {
+            GMX_ASSERT(haveCopiedXFromGpu,
+                       "a wait should only be triggered if copy has been scheduled");
             stateGpu->waitCoordinatesReadyOnHost(AtomLocality::Local);
         }