From: Magnus Lundborg Date: Mon, 23 Nov 2020 06:55:13 +0000 (+0100) Subject: Properly check if there are perturbed constraints or masses X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=e10c7a359d517e98a7d8e03d546e37a8fd1ffefa;p=alexxy%2Fgromacs.git 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. --- 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"; }