else:
return []
-
def get_opencl_packages(args) -> typing.Iterable[str]:
if (args.doxygen is None) and (args.oneapi is None):
return _opencl_extra_packages
else:
return []
-
def get_compiler(args, compiler_build_stage: hpccm.Stage = None) -> bb_base:
# Compiler
if args.icc is not None:
.. _MKL: https://software.intel.com/en-us/intel-mkl
.. _VMD: http://www.ks.uiuc.edu/Research/vmd/
.. _PyMOL: http://www.pymol.org
-.. _continuous integration server used by GROMACS: http://jenkins.gromacs.org
-.. _Jenkins: http://jenkins-ci.org
.. _webpage: http://www.gromacs.org
.. _ftp site: ftp://ftp.gromacs.org/pub/gromacs/
.. _tutorials: http://www.gromacs.org/Documentation/Tutorials
.. _issue tracker: https://gitlab.com/gromacs/gromacs/-/issues/
-.. _issues: https://gitlab.com/gromacs/gromacs/-/issues/
.. _gitlab: https://gitlab.com/gromacs/gromacs/
-.. _redmine: http://redmine.gromacs.org
-.. _gerrit: http://gerrit.gromacs.org
.. _download: ../download.html
.. |thisyear| replace:: {thisyear_string}
""".format(gmx_version_string=gmx_version_string, regressiontest_version=regressiontest_version, thisyear_string=thisyear_string)
widespread adoption of the method.
* *Advance discussion*: Please communicate with the other developers,
- e.g. on the `developer mailing list`_ mailing list, or `issue tracker`_ to let them know of the general
+ e.g. on the `developer mailing list`_ mailing list, or
+ `issue tracker`_ to let them know of the general
nature of your plans. This will prevent duplicate or wasted
effort. It is also a good idea to search those resources as well as
the literature and WWW for other projects that may be relevant.
.. _releng-workflow-release:
-Release engineering with Gitlab
+Release engineering with GitLab
===============================
.. toctree::
:hidden:
-We are currently switching our build and testing system to use Gitlab
-CI pipelines run on GitLab Runner. This section is going to be extended
-with individual build information as it comes available. For now we are
-using a combination of building with the previous system on Jenkins
-and post-submit verification on Gitlab.
+We are currently switching our build and testing system to use GitLab
+and the integrated CI system, with information for the general system found
+in the official `GitLab documentation <https://docs.gitlab.com/ee/ci/yaml/>`_.
+The new configuration for the builds and tests can be found in the file
+``.gitlab-ci.yml``, with the templates for configuring is found in the files in the
+``admin/ci-templates/`` directory. This section is going to be extended
+with individual build information as it comes available.
.. seealso:: :doc:`../infrastructure`
.. _releng-triggering-builds:
-Triggering builds on Gitlab
+Triggering builds on GitLab
---------------------------
Pipelines can be triggered through the web interface, with different
not be considered as *real*, or at the minimum it will be much harder to analyse to find the actual issue.
-If your inputs are sensitive, then it is possible to create private `issues`_ so that the
-developer team can have access to solve the problem, while preventing widespread
+If your inputs are sensitive, then it is possible to create private `issues <issue tracker>`_
+so that the developer team can have access to solve the problem, while preventing widespread
visibility on the internet.
Change management
-----------------
-|Gromacs| change management is supported by the following tools.
+|Gromacs| change management uses git and `GitLab`_ for code uploading and testing as well as issues tracking.
(For change submission guidelines, refer to :doc:`contribute`.)
git
.. highlight:: bash
A number of short guides are presented here to help users getting started with simulations.
-More detailed tutorials are available for example at the http://www.mdtutorials.com/.
+Useful third-party tutorials provided by Justin Lemkul are found here http://www.mdtutorials.com/.
.. toctree::
:maxdepth: 2
a beta version of oneAPI containing Intel's compiler.
For this testing, we use Ubuntu 18.04 or 20.04 operating system.
Other compiler, library, and OS versions are tested less frequently.
-For details, you can
-have a look at the `continuous integration server used by GROMACS`_,
+For details, you can have a look at the
+`continuous integration server used by GROMACS <gitlab>`_,
which uses GitLab runner on a local k8s x86 cluster with NVIDIA and
AMD GPU support.
the mailing lists (see our `webpage`_ or this section on
how to :ref:`contribute <gmx-contribute>`), or open an issue
on our `issue tracker`_. Corrections can also be made in the |Gromacs| git
-source repository and uploaded to the |Gromacs| `gerrit`_.
+source repository and uploaded to the |Gromacs| `GitLab`_.
We release an updated version of the manual whenever
we release a new version of the software, so in general
introduced into the release-2016 branch since it diverged from
release-5-1. These will not appear in the final release notes, because
no formal release is thought to have had the problem. Of course, the
-tracked `issues`_ remain available should further discussion arise.
+tracked `issues <issue tracker>`_ remain available should further discussion arise.
Fixed bug in v-rescale thermostat & replica exchange
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Fixes where mdrun could behave incorrectly
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Fix mdrun writing zero dH/dlambda and foreign lambda energies before checkpointing
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+With free-energy runs with separate-dhdl-file=no and nstdhdl not a multiple of
+nstenergy, mdrun would write zeros for dH/dlambda and foreign energies to
+the energy file for steps between the last energy frame and the checkpoint.
+This would lead to errors in free-energy estimates which could go unnoticed
+as values only deviate for a few steps.
+
+:issue:`3763`
+
+Fixed bugs with COM pulling and domain decompostion with weight or >32 ranks
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+When using COM pulling and domain decomposition, the results would be
+incorrect when using relative weights per atom or when using more than
+32 DD MPI ranks. This would usually lead to crashes or obviously wrong
+results.
+
+:issue:`3750`
+
+Fixed conserved energy for MTTK
+"""""""""""""""""""""""""""""""
+
+When using `pcoupl=MTTK` and `tcoupl=nose-hoover`, the calculated conserved
+energy was incorrect due to two errors dating back to GROMACS 4.6 and 2018,
+respectively. As a result, all reported conserved energies using this
+combination of temperature and pressure coupling algorithms in any GROMACS
+version since GROMACS 4.6 are likely to be wrong. Note that these errors did
+not impact the dynamics, as the conserved energy is only reported, but never
+used in calculations. Also note that this bug only affects this exact
+combination of temperature / pressure coupling algorithms.
+
+:issue:`3796`
+
+
Fixes for ``gmx`` tools
^^^^^^^^^^^^^^^^^^^^^^^
+Improve CHARMM support in gmx do_dssp
+"""""""""""""""""""""""""""""""""""""
+
+:issue:`3568`
+
+Fix non-funtioning gmx h2order -d option
+""""""""""""""""""""""""""""""""""""""""
+
+The gmx h2order tool would always take the normal along the z-axis.
+
+:issue:`3820`
+
Fixes that affect portability
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
release is made, the 2020 series will no longer be maintained.
Where issue numbers are reported in these release notes, more details
-can be found at https://gitlab.com/gromacs/gromacs/-/issues at that issue number.
+can be found on the `issue tracker`_ at that issue number.
|Gromacs| 2021 series
---------------------
2021/major/portability
2021/major/miscellaneous
-
|Gromacs| 2020 series
---------------------
Tutorial material
-----------------
-There are `several tutorials`_ available that cover aspects of using |Gromacs|.
+There are several third-party `tutorials`_ available that cover aspects of using |Gromacs|.
Further information can also be found in the :doc:`How to <../how-to/index>` section.
-.. _several tutorials: http://www.mdtutorials.com/gmx/
-
Background reading
------------------
* Berendsen, H.J.C., Postma, J.P.M., van Gunsteren, W.F., Hermans, J. (1981)
mdatoms->sigmaB, dd_pme_maxshift_x(dd), dd_pme_maxshift_y(dd));
}
- if (ir->bPull)
- {
- /* Update the local pull groups */
- dd_make_local_pull_groups(cr, pull_work);
- }
-
if (dd->atomSets != nullptr)
{
/* Update the local atom sets */
dd->atomSets->setIndicesInDomainDecomposition(*(dd->ga2la));
}
+ // The pull group construction can need the atom sets updated above
+ if (ir->bPull)
+ {
+ /* Update the local pull groups */
+ dd_make_local_pull_groups(cr, pull_work);
+ }
+
/* Update the local atoms to be communicated via the IMD protocol if bIMD is TRUE. */
imdSession->dd_make_local_IMD_atoms(dd);
#include "gromacs/pbcutil/rmpbc.h"
#include "gromacs/topology/index.h"
#include "gromacs/topology/topology.h"
+#include "gromacs/utility/arrayref.h"
#include "gromacs/utility/arraysize.h"
#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/exceptions.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/utility/sysinfo.h"
+
+namespace gmx
+{
+
+namespace
+{
+
+/*! \brief Throw an error if any element in index exceeds a given number.
+ *
+ * \param[in] indices to be acessed
+ * \param[in] largestOkayIndex to be accessed
+ * \param[in] indexUsagePurpose to be more explicit in the error message
+ *
+ * \throws RangeError if largestOkayIndex is larger than any element in indices
+ *
+ */
+void throwErrorIfIndexOutOfBounds(ArrayRef<const int> indices,
+ const int largestOkayIndex,
+ const std::string& indexUsagePurpose)
+{
+ // do nothing if index is empty
+ if (indices.ssize() == 0)
+ {
+ return;
+ }
+ const int largestIndex = *std::max_element(indices.begin(), indices.end());
+ if (largestIndex < largestOkayIndex)
+ {
+ GMX_THROW(RangeError("The provided structure file only contains "
+ + std::to_string(largestOkayIndex) + " coordinates, but coordinate index "
+ + std::to_string(largestIndex) + " was requested for " + indexUsagePurpose
+ + ". Make sure to update structure files "
+ "and index files if you store only a part of your system."));
+ }
+};
+
+} // namespace
+
+} // namespace gmx
+
int gmx_covar(int argc, char* argv[])
{
const char* desc[] = {
{
printf("\nChoose a group for the least squares fit\n");
get_index(atoms, ndxfile, 1, &nfit, &ifit, &fitname);
+ // Make sure that we never attempt to access a coordinate out of range
+ gmx::throwErrorIfIndexOutOfBounds({ ifit, ifit + nfit }, atoms->nr, "fitting");
if (nfit < 3)
{
gmx_fatal(FARGS, "Need >= 3 points to fit!\n");
}
printf("\nChoose a group for the covariance analysis\n");
get_index(atoms, ndxfile, 1, &natoms, &index, &ananame);
+ gmx::throwErrorIfIndexOutOfBounds({ index, index + natoms }, atoms->nr, "analysis");
bDiffMass1 = FALSE;
if (bFit)
nat = read_first_x(oenv, &status, trxfile, &t, &xread, box);
if (nat != atoms->nr)
{
- fprintf(stderr, "\nWARNING: number of atoms in tpx (%d) and trajectory (%d) do not match\n",
+ fprintf(stderr,
+ "\nWARNING: number of atoms in structure file (%d) and trajectory (%d) do not "
+ "match\n",
natoms, nat);
}
+ gmx::throwErrorIfIndexOutOfBounds({ ifit, ifit + nfit }, nat, "fitting");
+ gmx::throwErrorIfIndexOutOfBounds({ index, index + natoms }, nat, "analysis");
+
do
{
nframes0++;
static void check_oo(t_atoms* atoms)
{
- char* OOO;
+ char* OOO = gmx_strdup("O");
- int i;
-
- OOO = gmx_strdup("O");
-
- for (i = 0; (i < atoms->nr); i++)
+ for (int i = 0; (i < atoms->nr); i++)
{
if ((std::strcmp(*(atoms->atomname[i]), "OXT") == 0)
|| (std::strcmp(*(atoms->atomname[i]), "O1") == 0)
- || (std::strcmp(*(atoms->atomname[i]), "OC1") == 0))
+ || (std::strcmp(*(atoms->atomname[i]), "OC1") == 0)
+ || (std::strcmp(*(atoms->atomname[i]), "OT1") == 0))
{
*atoms->atomname[i] = OOO;
}
xvgrclose(ord);
}
+enum
+{
+ axisSEL,
+ axisZ,
+ axisY,
+ axisX,
+ axisNR
+};
+
int gmx_h2order(int argc, char* argv[])
{
const char* desc[] = {
"dipole and the axis from the center of mass to the oxygen is calculated",
"instead of the angle between the dipole and a box axis."
};
- static int axis = 2; /* normal to memb. default z */
- static const char* axtitle = "Z";
- static int nslices = 0; /* nr of slices defined */
- t_pargs pa[] = { { "-d",
+ static const char* axisOption[axisNR + 1] = { nullptr, "Z", "Y", "X", nullptr };
+ static int nslices = 0; /* nr of slices defined */
+ // The struct that will hold the parsed user input
+ t_pargs pa[] = { { "-d",
FALSE,
- etSTR,
- { &axtitle },
+ etENUM,
+ { axisOption },
"Take the normal on the membrane in direction X, Y or Z." },
{ "-sl",
FALSE,
{ &nslices },
"Calculate order parameter as function of boxlength, dividing the box"
" in this number of slices." } };
- const char* bugs[] = {
+ const char* bugs[] = {
"The program assigns whole water molecules to a slice, based on the first "
"atom of three in the index file group. It assumes an order O,H,H. "
"Name is not important, but the order is. If this demand is not met, "
#define NFILE asize(fnm)
+ // Parse the user input in argv into pa
if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME, NFILE, fnm, asize(pa), pa,
asize(desc), desc, asize(bugs), bugs, &oenv))
{
return 0;
}
+
+ // Process the axis option chosen by the user to set the
+ // axis used for the computation. The useful choice is an
+ // axis normal to the membrane. Default is z-axis.
+ int axis = ZZ;
+ switch (nenum(axisOption))
+ {
+ case axisX: axis = XX; break;
+ case axisY: axis = YY; break;
+ case axisZ: axis = ZZ; break;
+ default: axis = ZZ;
+ }
+
bMicel = opt2bSet("-nm", NFILE, fnm);
top = read_top(ftp2fn(efTPR, NFILE, fnm), &pbcType); /* read topology file */
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013,2014,2015,2016 by the GROMACS development team.
+ * Copyright (c) 2012,2013,2014,2015,2016, The GROMACS development team.
* Copyright (c) 2017,2018,2019,2020, 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
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013,2014,2015,2016 by the GROMACS development team.
+ * Copyright (c) 2012,2013,2014,2015,2016, The GROMACS development team.
* Copyright (c) 2017,2018,2019,2020, 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
* declared noexcept, but at least icc 19.1 and 21-beta08 with the
* libstdc++-7.5 has difficulty implementing a std::vector of
* std::thread started with this function when declared noexcept. It
- * is not clear whether the problem is the compiler or the standard
- * library. Fortunately, this function is not performance sensitive,
+ * is a known compiler bug that should be fixed after 19.1.
+ * Fortunately, this function is not performance sensitive,
* and only runs on platforms other than x86 and POWER (ie ARM),
* so the possible overhead introduced by omitting noexcept is not
* important.
if (nd > 0.0)
{
- if (inputrecNvtTrotter(ir))
+ if (inputrecNvtTrotter(ir) || inputrecNptTrotter(ir))
{
/* contribution from the thermal momenta of the NH chain */
for (int j = 0; j < nh; j++)
double iQinv = MassQ->QPinv[i * nh + j];
if (iQinv > 0)
{
- energy += 0.5 * gmx::square(state->nhpres_vxi[i * nh + j] / iQinv);
+ energy += 0.5 * gmx::square(state->nhpres_vxi[i * nh + j]) / iQinv;
/* contribution from the thermal variable of the NH chain */
energy += state->nhpres_xi[i * nh + j] * kT;
}
{
std::vector<real>& dh = deltaH->dh[i];
dh.resize(dhc->dh[i].ndh);
- std::copy(dh.begin(), dh.end(), dhc->dh[i].dh);
+ std::copy(dhc->dh[i].dh, dhc->dh[i].dh + dhc->dh[i].ndh, dh.begin());
}
deltaH->start_time = dhc->start_time;
deltaH->start_lambda = dhc->start_lambda;
// All things public
int natoms; //!< Number of atoms, local + non-local; this is the size of \p x, \p v and \p cg_p, when used
int ngtc; //!< The number of temperature coupling groups
- int nnhpres; //!< The NH-chain length for the MTTK barostat
- int nhchainlength; //!< The NH-chain length for temperature coupling
+ int nnhpres; //!< The number of NH-chains for the MTTK barostat (always 1 or 0)
+ int nhchainlength; //!< The NH-chain length for temperature coupling and MTTK barostat
int flags; //!< Set of bit-flags telling which entries are present, see enum at the top of the file
int fep_state; //!< indicates which of the alchemical states we are in
std::array<real, efptNR> lambda; //!< Free-energy lambda vector
int initSelectionGroups(Selection* sel, const gmx_mtop_t* top, GroupType type)
{
e_index_t indexType = INDEX_UNKNOWN;
- switch (type)
+ // If the selection type is INDEX_UNKNOWN (e.g. a position not associated
+ // with a set of particles), don't overwrite the selection type.
+ if (sel->type() != INDEX_UNKNOWN)
{
- case GroupType::All: indexType = INDEX_ALL; break;
- case GroupType::Residue: indexType = INDEX_RES; break;
- case GroupType::Molecule: indexType = INDEX_MOL; break;
- case GroupType::None: indexType = INDEX_ATOM; break;
- case GroupType::Count: GMX_THROW(InternalError("Invalid GroupType"));
+ switch (type)
+ {
+ case GroupType::All: indexType = INDEX_ALL; break;
+ case GroupType::Residue: indexType = INDEX_RES; break;
+ case GroupType::Molecule: indexType = INDEX_MOL; break;
+ case GroupType::None: indexType = INDEX_ATOM; break;
+ case GroupType::Count: GMX_THROW(InternalError("Invalid GroupType"));
+ }
}
return sel->initOriginalIdsToGroup(top, indexType);
}
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014,2015,2019, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2019,2020, 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.
runTest(CommandLine(cmdline));
}
+TEST_F(PairDistanceModuleTest, CoordinateSelectionIsNotOverwritten)
+{
+ const char* const cmdline[] = { "pairdist", "-ref", "[0.0, 1.5, 2.9]", "-sel", "resindex 3",
+ "-type", "max" };
+ setTopology("simple.gro");
+ setOutputFile("-o", ".xvg", NoTextMatch());
+ runTest(CommandLine(cmdline));
+}
+
+TEST_F(PairDistanceModuleTest, CoordinateSelectionIsNotOverwrittenWithExplicitGroup)
+{
+ const char* const cmdline[] = { "pairdist", "-ref", "[0.0, 1.5, 2.9]", "-sel", "resindex 3",
+ "-type", "max", "-refgrouping", "res" };
+ setTopology("simple.gro");
+ setOutputFile("-o", ".xvg", NoTextMatch());
+ runTest(CommandLine(cmdline));
+}
+
} // namespace
--- /dev/null
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+ <String Name="CommandLine">pairdist -ref '[0.0, 1.5, 2.9]' -sel 'resindex 3' -type max</String>
+ <OutputData Name="Data">
+ <AnalysisData Name="dist">
+ <DataFrame Name="Frame0">
+ <Real Name="X">0</Real>
+ <DataValues>
+ <Int Name="Count">1</Int>
+ <DataValue>
+ <Real Name="Value">4.3197222132910351</Real>
+ </DataValue>
+ </DataValues>
+ </DataFrame>
+ </AnalysisData>
+ </OutputData>
+ <OutputFiles Name="Files">
+ <File Name="-o"></File>
+ </OutputFiles>
+</ReferenceData>
--- /dev/null
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+ <String Name="CommandLine">pairdist -ref '[0.0, 1.5, 2.9]' -sel 'resindex 3' -type max -refgrouping res</String>
+ <OutputData Name="Data">
+ <AnalysisData Name="dist">
+ <DataFrame Name="Frame0">
+ <Real Name="X">0</Real>
+ <DataValues>
+ <Int Name="Count">1</Int>
+ <DataValue>
+ <Real Name="Value">4.3197222132910351</Real>
+ </DataValue>
+ </DataValues>
+ </DataFrame>
+ </AnalysisData>
+ </OutputData>
+ <OutputFiles Name="Files">
+ <File Name="-o"></File>
+ </OutputFiles>
+</ReferenceData>