user-guide/mdrun-features.rst
user-guide/mdrun-performance.rst
user-guide/run-time-errors.rst
+ user-guide/security.rst
user-guide/system-preparation.rst
user-guide/terminology.rst
)
Fixes where mdrun could behave incorrectly
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Correct PME forces with free energy without perturbed charges/LJ
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+With free-energies calculations with lambda not set to zero and no
+actual perturbed charges or atom types for Lennard-Jones, the Coulomb
+or LJ PME mesh forces would be scaled with lambda. Note that this bug
+did not affect the, usual, setup where charges or atom types are actually
+perturbed.
+
+:issue: `2640`
+
+Add constraint contribution to foreign Hamiltonian differences
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+The contribution of perturbed constraints was missing from the foreign
+Hamiltonian values. This is important for free energy calculations,
+such as BAR.
+
+:issue: `2703`
+
+Add mass contribution to foreign Hamiltonian differences
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+For free energy calculations with perturbed masses, the kinetic energy
+contribution was missing from the foreign Hamiltonian values.
+
+:issue: `2703`
+
Fixes for ``gmx`` tools
^^^^^^^^^^^^^^^^^^^^^^^
+Fix mindist output file checks
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+mindist would not check if the output file needed to print residue names and
+residue contacts over time was actually defined, leading to errors with
+empty file name strings.
+
+:issue:`2653`
+
+Fix helix segmentation fault
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+The .tpr file is now read correctly.
+
+:issue:`2701`
+
+
Fixes to improve portability
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Miscellaneous
^^^^^^^^^^^^^
+
+Fixed an issue where the log file could sometimes report an incorrect
+initial dynamic load balancing state
+
+:issue:`2631`
terminology
environment-variables
floating-point
+ security
deprecation-policy
.. mdp-value:: Berendsen
Exponential relaxation pressure coupling with time constant
- :mdp:`tau-p`. The box is scaled every timestep. It has been
+ :mdp:`tau-p`. The box is scaled every :mdp:`nstpcouple` steps. It has been
argued that this does not yield a correct thermodynamic
ensemble, but it is the most efficient way to scale a box at the
beginning of a run.
--- /dev/null
+Security when using |Gromacs|
+=============================
+
+.. _gmx-security:
+
+We advise the users of |Gromacs| to be careful when using |Gromacs|
+with files obtained from an unknown source (e.g. the Internet).
+
+We cannot guarantee that the program won't crash with serious errors
+that could cause execution of code with the same privileges as |Gromacs|
+and e.g. delete the contents of your home directory..
+
+Files that the user has created themselves don't carry those risks, but may
+still misbehave and crash or consume large amounts of resources upon
+malformed input.
+
+Run input files obtained from outside sources should be treated with the
+same caution as an executable file from the same source.
+
const gmx_bool bBackFFT = (flags & (GMX_PME_CALC_F | GMX_PME_CALC_POT)) != 0;
const gmx_bool bCalcF = (flags & GMX_PME_CALC_F) != 0;
+ /* We could be passing lambda!=1 while no q or LJ is actually perturbed */
+ if (!pme->bFEP_q)
+ {
+ lambda_q = 1;
+ }
+ if (!pme->bFEP_lj)
+ {
+ lambda_lj = 1;
+ }
+
assert(pme->nnodes > 0);
assert(pme->nnodes == 1 || pme->ndecompdim > 0);
fio = open_tpx(fn, "r");
ePBC = do_tpx(fio, TRUE, ir, &state, x, v, mtop);
close_tpx(fio);
- *natoms = mtop->natoms;
+ if (mtop != nullptr && natoms != nullptr)
+ {
+ *natoms = mtop->natoms;
+ }
if (box)
{
copy_mat(state.box, box);
void read_tpx_state(const char *fn,
t_inputrec *ir, t_state *state,
gmx_mtop_t *mtop);
+
+/*! \brief
+ * Read a file and close it again.
+ *
+ * Reads a topology input file and populates the fields if the passed
+ * variables are valid. It is possible to pass \p ir, \p natoms,
+ * \p x, \p v or \p mtop as nullptr to the function. In those cases,
+ * the variables will not be populated from the input file. Passing both
+ * \p x and \p v as nullptr is not supported. If both \p natoms and
+ * \p mtop are passed as valid objects to the function, the total atom
+ * number from \p mtop will be set in \p natoms. Otherwise \p natoms
+ * will not be changed. If \p box is valid, the box will be set from
+ * the information read in from the file.
+ *
+ * \param[in] fn Input file name.
+ * \param[out] ir Input parameters to be set, or nullptr.
+ * \param[out] box Box matrix.
+ * \param[out] natoms Total atom numbers to be set, or nullptr.
+ * \param[out] x Positions to be filled from file, or nullptr.
+ * \param[out] v Velocities to be filled from file, or nullptr.
+ * \param[out] mtop Topology to be populated, or nullptr.
+ * \returns ir->ePBC if it was read from the file.
+ */
int read_tpx(const char *fn,
t_inputrec *ir, matrix box, int *natoms,
rvec *x, rvec *v, gmx_mtop_t *mtop);
-/* Read a file, and close it again.
- * When step, t or lambda are NULL they will not be stored.
- * Returns ir->ePBC, if it could be read from the file.
- */
int read_tpx_top(const char *fn,
t_inputrec *ir, matrix box, int *natoms,
/* Read reference frame from tpx file to compute helix length */
snew(xref, top->atoms.nr);
read_tpx(ftp2fn(efTPR, NFILE, fnm),
- nullptr, nullptr, &natoms, xref, nullptr, nullptr);
+ nullptr, nullptr, nullptr, xref, nullptr, nullptr);
calc_hxprops(nres, bb, xref);
do_start_end(nres, bb, &nbb, bbindex, &nca, caindex, bRange, rStart, rEnd);
sfree(xref);
dump_res(debug, nres, residues, index[0]);
}
}
+ else if (bEachResEachTime || bPrintResName)
+ {
+ gmx_fatal(FARGS, "Option -or needs to be set to print residues");
+ }
if (bPI)
{
void sum_dhdl(gmx_enerdata_t *enerd, gmx::ArrayRef<const real> lambda, t_lambda *fepvals)
{
int index;
- double dlam;
enerd->dvdl_lin[efptVDW] += enerd->term[F_DVDL_VDW]; /* include dispersion correction */
enerd->term[F_DVDL] = 0.0;
}
}
- /* Notes on the foreign lambda free energy difference evaluation:
- * Adding the potential and ekin terms that depend linearly on lambda
- * as delta lam * dvdl to the energy differences is exact.
- * For the constraints this is not exact, but we have no other option
- * without literally changing the lengths and reevaluating the energies at each step.
- * (try to remedy this post 4.6 - MRS)
- */
if (fepvals->separate_dvdl[efptBONDED])
{
enerd->term[F_DVDL_BONDED] += enerd->term[F_DVDL_CONSTR];
{
enerd->term[F_DVDL] += enerd->term[F_DVDL_CONSTR];
}
- enerd->term[F_DVDL_CONSTR] = 0;
for (int i = 0; i < fepvals->n_lambda; i++)
{
current lambda, because the contributions to the current
lambda are automatically zeroed */
+ double &enerpart_lambda = enerd->enerpart_lambda[i + 1];
+
for (gmx::index j = 0; j < lambda.size(); j++)
{
/* Note that this loop is over all dhdl components, not just the separated ones */
- dlam = (fepvals->all_lambda[j][i] - lambda[j]);
- enerd->enerpart_lambda[i+1] += dlam*enerd->dvdl_lin[j];
+ const double dlam = fepvals->all_lambda[j][i] - lambda[j];
+
+ enerpart_lambda += dlam*enerd->dvdl_lin[j];
+
+ /* Constraints can not be evaluated at foreign lambdas, so we add
+ * a linear extrapolation. This is an approximation, but usually
+ * quite accurate since constraints change little between lambdas.
+ */
+ if ((j == efptBONDED && fepvals->separate_dvdl[efptBONDED]) ||
+ (j == efptFEP && !fepvals->separate_dvdl[efptBONDED]))
+ {
+ enerpart_lambda += dlam*enerd->term[F_DVDL_CONSTR];
+ }
+
+ if (j == efptMASS)
+ {
+ enerpart_lambda += dlam*enerd->term[F_DKDL];
+ }
+
if (debug)
{
fprintf(debug, "enerdiff lam %g: (%15s), non-linear %f linear %f*%f\n",
fepvals->all_lambda[j][i], efpt_names[j],
- (enerd->enerpart_lambda[i+1] - enerd->enerpart_lambda[0]),
+ enerpart_lambda - enerd->enerpart_lambda[0],
dlam, enerd->dvdl_lin[j]);
}
}
}
+
+ /* The constrain contribution is now included in other terms, so clear it */
+ enerd->term[F_DVDL_CONSTR] = 0;
}
}
mtop->natoms -= n;
- state->natoms -= n;
+ state_change_natoms(state, state->natoms - n);
snew(x_tmp, state->natoms);
snew(v_tmp, state->natoms);
struct gmx_grppairener_t grpp;
double dvdl_lin[efptNR]; /* Contributions to dvdl with linear lam-dependence */
double dvdl_nonlin[efptNR]; /* Idem, but non-linear dependence */
+ /* The idea is that dvdl terms with linear lambda dependence will be added
+ * automatically to enerpart_lambda. Terms with non-linear lambda dependence
+ * should explicitly determine the energies at foreign lambda points
+ * when n_lambda > 0. */
+
int n_lambda;
int fep_state; /*current fep state -- just for printing */
- double *enerpart_lambda; /* Partial energy for lambda and flambda[] */
+ double *enerpart_lambda; /* Partial Hamiltonian for lambda and flambda[], includes at least all perturbed terms */
real foreign_term[F_NRE]; /* alternate array for storing foreign lambda energies */
struct gmx_grppairener_t foreign_grpp; /* alternate array for storing foreign lambda energies */
};