Also, please use the syntax :issue:`number` to reference issues on redmine, without the
a space between the colon and number!
+Extend supported use-cases for GPU version of update and constraints
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+GPU version of update and constraints can now be used for FEP, except mass and constraints
+free-energy perturbation.
Setting "gpu" requires that a compatible CUDA GPU is available,
the simulation uses a single rank.
Update and constraints on a GPU is currently not supported
- with domain decomposition, free-energy, virtual sites,
- Ewald surface correction, replica exchange, constraint pulling,
- orientation restraints and computational electrophysiology.
+ with mass and constraints free-energy perturbation, domain
+ decomposition, virtual sites, Ewald surface correction,
+ replica exchange, constraint pulling, orientation restraints
+ and computational electrophysiology.
``-gpu_id``
A string that specifies the ID numbers of the GPUs that
"Constraints pulling is not supported with the GPU update.\n");
GMX_RELEASE_ASSERT(fcd->orires.nr == 0,
"Orientation restraints are not supported with the GPU update.\n");
- GMX_RELEASE_ASSERT(ir->efep == efepNO,
- "Free energy perturbations are not supported with the GPU update.");
+ GMX_RELEASE_ASSERT(
+ ir->efep == efepNO
+ || (!haveFreeEnergyType(*ir, efptBONDED) && !haveFreeEnergyType(*ir, efptMASS)),
+ "Free energy perturbation of masses and constraints are not supported with the GPU "
+ "update.");
GMX_RELEASE_ASSERT(graph == nullptr, "The graph is not supported with GPU update.");
if (constr != nullptr && constr->numConstraintsTotal() > 0)
{
return EEL_PME_EWALD(ir.coulombtype) && (ir.ewald_geometry == eewg3DC || ir.epsilon_surface != 0);
}
+
+bool haveFreeEnergyType(const t_inputrec& ir, const int fepType)
+{
+ for (int i = 0; i < ir.fepvals->n_lambda; i++)
+ {
+ if (ir.fepvals->all_lambda[fepType][i] > 0)
+ {
+ return true;
+ }
+ }
+ return false;
+}
*/
bool haveEwaldSurfaceContribution(const t_inputrec& ir);
+/*! \brief Check if calculation of the specific FEP type was requested.
+ *
+ * \param[in] ir Input record.
+ * \param[in] fepType Free-energy perturbation type to check for.
+ *
+ * \returns If the \p fepType is perturbed in this run.
+ */
+bool haveFreeEnergyType(const t_inputrec& ir, int fepType);
+
#endif /* GMX_MDTYPES_INPUTREC_H */
// The graph is needed, but not supported
errorMessage += "Orientation restraints are not supported.\n";
}
- if (inputrec.efep != efepNO)
+ if (inputrec.efep != efepNO
+ && (haveFreeEnergyType(inputrec, efptBONDED) || haveFreeEnergyType(inputrec, efptMASS)))
{
- // Actually all free-energy options except for mass and constraint perturbation are supported
- errorMessage += "Free energy perturbations are not supported.\n";
+ errorMessage += "Free energy perturbation for mass and constraints are not supported.\n";
}
const auto particleTypes = gmx_mtop_particletype_count(mtop);
if (particleTypes[eptShell] > 0)