From e10c7a359d517e98a7d8e03d546e37a8fd1ffefa Mon Sep 17 00:00:00 2001 From: Magnus Lundborg Date: Mon, 23 Nov 2020 07:55:13 +0100 Subject: [PATCH] Properly check if there are perturbed constraints or masses 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 | 2 +- src/gromacs/taskassignment/decidegpuusage.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gromacs/mdrun/md.cpp b/src/gromacs/mdrun/md.cpp index 792ca30550..caa25a7a43 100644 --- a/src/gromacs/mdrun/md.cpp +++ b/src/gromacs/mdrun/md.cpp @@ -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."); diff --git a/src/gromacs/taskassignment/decidegpuusage.cpp b/src/gromacs/taskassignment/decidegpuusage.cpp index 5fb2410a70..7d96638fde 100644 --- a/src/gromacs/taskassignment/decidegpuusage.cpp +++ b/src/gromacs/taskassignment/decidegpuusage.cpp @@ -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"; } -- 2.11.4.GIT