Properly check if there are perturbed constraints or masses
authorMagnus Lundborg <magnus.lundborg@scilifelab.se>
Mon, 23 Nov 2020 06:55:13 +0000 (07:55 +0100)
committerArtem Zhmurov <zhmurov@gmail.com>
Mon, 23 Nov 2020 18:48:51 +0000 (18:48 +0000)
Instead of just checking, when running updates on GPU, if
there are lambda states that involve constraints or masses
(e.g. if using fep-lambdas) check if any constraints or masses
are actually perturbed.

src/gromacs/mdrun/md.cpp
src/gromacs/taskassignment/decidegpuusage.cpp

index 792ca305502983e3a55edb91dee3fede79a45126..caa25a7a43c484d0214eb2c4a1e4f779f6f800db 100644 (file)
@@ -392,7 +392,7 @@ void gmx::LegacySimulator::do_md()
                            "Orientation restraints are not supported with the GPU update.\n");
         GMX_RELEASE_ASSERT(
                 ir->efep == efepNO
-                        || (!haveFreeEnergyType(*ir, efptBONDED) && !haveFreeEnergyType(*ir, efptMASS)),
+                        || (!haveFepPerturbedMasses(*top_global) && !havePerturbedConstraints(*top_global)),
                 "Free energy perturbation of masses and constraints are not supported with the GPU "
                 "update.");
 
index 5fb2410a7036272ad077d9e2e5f3c389183de4f4..7d96638fde3fe7c3ad8444fac2575a9d7a53b1c4 100644 (file)
@@ -650,8 +650,7 @@ bool decideWhetherToUseGpuForUpdate(const bool                     isDomainDecom
         // The graph is needed, but not supported
         errorMessage += "Orientation restraints are not supported.\n";
     }
-    if (inputrec.efep != efepNO
-        && (haveFreeEnergyType(inputrec, efptBONDED) || haveFreeEnergyType(inputrec, efptMASS)))
+    if (inputrec.efep != efepNO && (haveFepPerturbedMasses(mtop) || havePerturbedConstraints(mtop)))
     {
         errorMessage += "Free energy perturbation for mass and constraints are not supported.\n";
     }