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=ca1f02e7248e4e4df42a35eb400d9aef4173bcb8;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/src/gromacs/gmxpreprocess/readir.cpp b/src/gromacs/gmxpreprocess/readir.cpp index 603fae0cdb..6595bff142 100644 --- a/src/gromacs/gmxpreprocess/readir.cpp +++ b/src/gromacs/gmxpreprocess/readir.cpp @@ -1477,6 +1477,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 cb76c778a3..9d509473f9 100644 --- a/src/gromacs/mdrun/runner.cpp +++ b/src/gromacs/mdrun/runner.cpp @@ -1858,6 +1858,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, &(inputrec->opts), &ekind, inputrec->cos_accel);