From: Pascal Merz Date: Thu, 11 Feb 2021 06:23:24 +0000 (-0700) Subject: Disable cos acceleration for non leap-frog code paths X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=6c10c4466121307e5842bda207034bb7a441e384;p=alexxy%2Fgromacs.git Disable cos acceleration for non leap-frog code paths The cos acceleration is only applied in leap-frog. grompp and mdrun would, however, happily accept non-zero cos-accel input, and report viscosity-related quantities without ever applying the acceleration for all other integrators. This change adds a check at grompp time (to avoid new tprs with non-implemented parameter combinations being created), and at runner time (to catch older tprs). Should probably be backported to the supported releases. Refs #3903 --- diff --git a/docs/release-notes/2020/2020.6.rst b/docs/release-notes/2020/2020.6.rst index be79e901f1..b067a7d0b6 100644 --- a/docs/release-notes/2020/2020.6.rst +++ b/docs/release-notes/2020/2020.6.rst @@ -14,6 +14,20 @@ previous 2020.5 version, to fix known issues. Fixes where mdrun could behave incorrectly ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Cosine acceleration failed to abort if it could not be run +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Cosine acceleration is only compatible with the leap-frog +integrator (mdp option `integrator = md`). Gromacs did, however, +accept input files requesting cosine acceleration for other +integration algorithms, and did report viscosity-related +quantities from these simulations. Since the cosine acceleration +was never applied in these cases, any results obtained from +simulations with enabled cosine acceleration and integrators +other than `md` should be regarded as invalid. + +:issue:`3903` + Fixes for ``gmx`` tools ^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/gromacs/gmxpreprocess/readir.cpp b/src/gromacs/gmxpreprocess/readir.cpp index 9e0eaf33b3..553df84e15 100644 --- a/src/gromacs/gmxpreprocess/readir.cpp +++ b/src/gromacs/gmxpreprocess/readir.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013-2020, by the GROMACS development team, led by + * Copyright (c) 2013-2020,2021, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -1403,6 +1403,12 @@ void check_ir(const char* mdparin, { gmx_fatal(FARGS, "AdResS simulations are no longer supported"); } + + // cosine acceleration is only supported in leap-frog + if (ir->cos_accel != 0.0 && ir->eI != eiMD) + { + warning_error(wi, "cos-acceleration is only supported by integrator = md"); + } } /* interpret a number of doubles from a string and put them in an array, diff --git a/src/gromacs/mdrun/runner.cpp b/src/gromacs/mdrun/runner.cpp index 3c9def3eaa..c2b3c088d7 100644 --- a/src/gromacs/mdrun/runner.cpp +++ b/src/gromacs/mdrun/runner.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2011-2019,2020, by the GROMACS development team, led by + * Copyright (c) 2011-2019,2020,2021, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -1521,6 +1521,11 @@ int Mdrunner::mdrunner() gmx_enerdata_t enerd(mtop.groups.groups[SimulationAtomGroupType::EnergyOutput].size(), inputrec->fepvals->n_lambda); + // cos acceleration is only supported by md, but older tpr + // files might still combine it with other integrators + GMX_RELEASE_ASSERT(inputrec->cos_accel == 0.0 || inputrec->eI == eiMD, + "cos_acceleration is only supported by integrator=md"); + /* Kinetic energy data */ gmx_ekindata_t ekind; init_ekindata(fplog, &mtop, &(inputrec->opts), &ekind, inputrec->cos_accel);