Fix clang-tidy warnings in pme and sim_utils
[alexxy/gromacs.git] / src / gromacs / mdrun / md.cpp
index 57fb86149a639299c94c1423d734c1acacab1ce5..1e7479b3046a212d2e0bf806c8fd3a476b68b633 100644 (file)
@@ -1506,16 +1506,13 @@ void gmx::LegacySimulator::do_md()
                     }
                 }
 
-                if (simulationWork.useGpuPme && simulationWork.useCpuPmePpCommunication)
+                if ((simulationWork.useGpuPme && simulationWork.useCpuPmePpCommunication)
+                    || (!runScheduleWork->stepWork.useGpuFBufferOps))
                 {
-                    // The PME forces were recieved to the host, and reduced on the CPU with the rest of the
-                    // forces computed on the GPU, so the final forces have to be copied back to the GPU
-                    stateGpu->copyForcesToGpu(f.view().force(), AtomLocality::Local);
-                }
-                else if (!runScheduleWork->stepWork.useGpuFBufferOps)
-                {
-                    // The buffer ops were not offloaded this step, so the forces are on the
-                    // host and have to be copied
+                    // The PME forces were recieved to the host, and reduced on the CPU with the
+                    // rest of the forces computed on the GPU, so the final forces have to be copied
+                    // back to the GPU. Or the buffer ops were not offloaded this step, so the
+                    // forces are on the host and have to be copied
                     stateGpu->copyForcesToGpu(f.view().force(), AtomLocality::Local);
                 }
                 const bool doTemperatureScaling =