Teemu Murtola [Sun, 9 Oct 2016 18:33:06 +0000 (21:33 +0300)]
Add support for reading values from refdata
This is the easiest way to support tests in child changes for
serialization. Some alternative approach may be possible in the future,
when the serialization approach matures, but I seem to recall there have
been requests for this functionality also in other contexts. There is
some less-than-ideal behavior (in particular, a newly created test fails
if it uses this functionality, and only succeeds when you actually
create the reference data).
Also add support for a separate type of unsigned char reference values,
to support serialization tests.
Change-Id: I35ee9d43a0737a342f756cda0e7a789273ce1d9e
Teemu Murtola [Sun, 2 Oct 2016 18:26:16 +0000 (21:26 +0300)]
Improved error handling for KeyValueTree operations
Support an error handler for operations involving KeyValueTrees to allow
for better error messages during mdp parsing.
Change-Id: I3738b956baafe7a4ecb96ec6f9e4729541d74bf8
Berk Hess [Sat, 15 Oct 2016 08:52:06 +0000 (10:52 +0200)]
Move energyhistory_t out of t_state
We have three different types of states in mdrun:
1) the microstate of the system we are simulating
2) history information for output
3) the state of the simulation machinery in mdrun
The struct energyhistory_t clearly belongs to 2) and is therefore
moved out of t_state, which should eventually only contain 1).
TODO: Consider what to do with the other structs in t_state that
(also) store history rather than the state of the simulated system.
Note: reverts recent commit
ec827264
Part of #2059.
Change-Id: Ie84a19efcd0a170c0aaafe18c06275b7fb15244a
Teemu Murtola [Tue, 12 Apr 2016 17:53:43 +0000 (20:53 +0300)]
Improved address sanitizer support
Use support in CTest 3.1+ for parsing ASAN output. Work around various
bugs in CTest to make this actually work. Remove an OS X workaround,
since it does not appear necessary with a recent XCode toolchain.
Use newer clang to get LeakSanitizer.
Change-Id: I37002bffd653e04b52ba340a97d2806851f692b8
Teemu Murtola [Sat, 15 Oct 2016 03:11:17 +0000 (06:11 +0300)]
Work around memory leak in t_state
Use std::shared_ptr for t_state.enerhist, which should have the same
semantics as the earlier plain pointer, but ensure that the memory gets
eventually freed.
Change-Id: Ibe291261eb4997035a5165130ee01d309a1dc395
Teemu Murtola [Fri, 14 Oct 2016 18:32:35 +0000 (21:32 +0300)]
Fix most memory leaks recently introduced
- Do not overwrite memory allocated in init_mtop() when creating
molecules in selection tests.
- Add function to properly deallocate t_topology and gmx_mtop_t when
gmx_mtop_t_to_t_topology(..., false) has been called.
- Free all memory in done_mtop().
These should be enough to (again) make the unit tests free of memory
leaks, except that t_state.enerhist is leaked in a few places. That
requires more complicated handling.
Change-Id: I84b853b9cb8a11c0458ea4f29316a83a41d7ae22
Berk Hess [Thu, 18 Aug 2016 20:40:48 +0000 (22:40 +0200)]
Apply Berendsen P-couple at nstpcouple steps
Berendsen pressure coupling was applied at step%nstpcouple=1. Since
there is no need for this, this is changed to step%nstpcouple=0.
This also simplifies the P-coupling management.
Note that this change prevents continuation from old checkpoint files
for Berendsen P-couple runs, since the step-1 pressure is removed.
Change-Id: I5e2e6b1a1d5cb347ebdd6c1a402b41280bedff68
David van der Spoel [Fri, 14 Oct 2016 06:41:25 +0000 (08:41 +0200)]
Fixes some memory leaks associated with testing applied forces
Fixes memory leaks associated with the electric
field test. Implemented a done_commrec function.
There may be need for a done_domdec as well but
that falls outside the scope of this patch.
Change-Id: Ib86629bb7959b064b6ac3a57d4bb96e2dd3bfe94
Teemu Murtola [Thu, 29 Sep 2016 18:44:49 +0000 (21:44 +0300)]
Use gmx_mtop_t in selections, part 3
Convert remainder of the selection code to use gmx_mtop_t.
Part of #1862.
Change-Id: Icb1c4a30cc5456e64ed2d73f93ca4a7d6dbfbfbd
Teemu Murtola [Tue, 21 Jun 2016 18:42:59 +0000 (21:42 +0300)]
Use gmx_mtop_t in selections, part 2
Use gmx_mtop_t throughout low-level selection routines, i.e.,
centerofmass.cpp, poscalc.cpp, and indexutil.cpp. Adapt test code,
which is now using gmx_mtop_t throughout as well.
In places where gmx_mtop_t is actually accessed, the changes are as
local as possible. In most cases, some additional restructuring could
give better performance and/or much clearer code, but that is outside
the scope of this change.
Part of #1862.
Change-Id: Icc99432bddec04a325aef733df56571d709130fb
Teemu Murtola [Tue, 21 Jun 2016 18:42:59 +0000 (21:42 +0300)]
Use gmx_mtop_t in selections, part 2
Use gmx_mtop_t throughout low-level selection routines, i.e.,
centerofmass.cpp, poscalc.cpp, and indexutil.cpp. Adapt test code,
which is now using gmx_mtop_t throughout as well.
In places where gmx_mtop_t is actually accessed, the changes are as
local as possible. In most cases, some additional restructuring could
give better performance and/or much clearer code, but that is outside
the scope of this change.
Part of #1862.
Change-Id: Icc99432bddec04a325aef733df56571d709130fb
Berk Hess [Thu, 13 Oct 2016 12:28:36 +0000 (14:28 +0200)]
Extend mtop_lookup.h
Added three lookup functions that will be used in the selection code.
Harmonized the functions by making all functions that look up
a single object return a reference.
Replaced uses of mtopGetAtomParameters() that only used the mass
(which is nearly all) by mtopGetAtomMass().
Change-Id: Ibbe9729502038cd1f863433ce03a80dc544e4003
Teemu Murtola [Sun, 2 Oct 2016 04:58:38 +0000 (07:58 +0300)]
Add back-mapping to KeyValueTreeTransform
Add ability to map paths from the output structure of the transform back
to the original structure, which will be useful for error messages.
Change-Id: I9dded5a517fa72177219294596e5c23bec7785ce
Teemu Murtola [Thu, 15 Sep 2016 19:08:02 +0000 (22:08 +0300)]
Update bundled TNG
This commit bundles
6e41191016 from the TNG repo.
Required TNG 1.7.10 in future, which is the first version to include
support for the build system features used here.
Update the build system to use imported targets and interface properties
that TNG now provides. Add support for building TNG that also bundles
zlib, which reduces the dependency footprint of GROMACS, which is
important for portability and ease of installation.
Refs #1908.
Change-Id: Ibc94d5a9470136331045738f105634ec95fdb455
Teemu Murtola [Sun, 2 Oct 2016 05:20:12 +0000 (08:20 +0300)]
Getter for mapped paths from KeyValueTreeTransform
This allows identifying which values the transform will use. In the
long run, this may be replaced with another mechanism (or removed
altogether), but for now, this makes it easier to do piecewise
transition from old mdp parsing to using KeyValueTree and options.
Currently, the values are returned in alphabetical order, but subsequent
work may need this in the order the rules are added. That will be easy
to change internally to the transform.
Change-Id: I3f225ce4f693644e5ac17685f0a887eec02807a8
Teemu Murtola [Mon, 20 Jun 2016 17:59:30 +0000 (20:59 +0300)]
Use gmx_mtop_t in selections, part 1
Make the C++ analysis framework (and insert-molecules, which is also
using selections) use a gmx_mtop_t as the initial internal format to
load the topology, and make SelectionCollection::setTopology() use an
mtop. Adapt tests. One test is disabled as it is much easier to
re-enable it after the next step in the conversion process than in this
intermediate state.
Internally, the mtop structure is still converted to t_topology for use
in lower levels and in the tool code.
This change also makes it possible to convert the analysis tools and gmx
insert-molecules to use gmx_mtop_t independently from changes in the
selection code.
Part of #1862.
Change-Id: I3ce03c6524b27f0f44168890ac1a4a491da52a4c
Teemu Murtola [Fri, 17 Jun 2016 05:49:40 +0000 (08:49 +0300)]
Wrap sel. method evaluation parameters to struct
This removes about 1/3 of t_topology instances in the selection code,
reducing the number of lines that need to be changed when switching to
gmx_mtop_t.
Also make most of the contents const.
Related to #1862.
Change-Id: Idcd71bc578a6daa4644f049a31f84e74717c258a
Mark Abraham [Wed, 12 Oct 2016 12:01:18 +0000 (14:01 +0200)]
Make regressiontests updater build work for master branch
Forgot to resolve this TODO in the merge.
Change-Id: I5ec487e5335ca34509ee1c0fc5f8b841d1718d0d
Berk Hess [Wed, 12 Oct 2016 14:35:21 +0000 (16:35 +0200)]
Fixed exception in usused result
Change
f2854f89 introduced an code path in NPT_energy() of which
the result is, as of yet, unused. Here MassQ->Winv was uninitialized.
This could cause tests to fail with a floating point exception.
Change-Id: I7973336fb34ed50e7eb87da63af964058fd1aef0
Berk Hess [Mon, 15 Aug 2016 09:51:56 +0000 (11:51 +0200)]
Refactor NPT energy calculation
The NPT conserved energy quantity calculation is now managed by
a single function with separate functions for each thermo- and
barostat.
Change-Id: Id7cf431e4da78bffe33caaddb0a7c806c9c29091
Berk Hess [Mon, 14 Dec 2015 14:18:40 +0000 (15:18 +0100)]
Restructure leap-frog integrators
There are now 2 template function for MD leap-frog integration
instead of 4 branches in multiple functions.
In addition to invmass, mdatoms now contains invMassPerDim.
invMassPerDim is set to zero for encode frozen dimensions, so LF
update functions no longer need to check the freeze groups.
Also removed the conditionals for vsites and shells in the LF update
functions. Their velocities are now set to zero at startup.
A template function for the most common leap-frog integrator setups
allows for full SIMD acceleration, at least for AVX with gcc5.
Changed dt from double to real in the update, since we need far less
than real precision.
Changed calculation of alpha for VV to real, as it is passed as real.
Fixed multiple time stepping with Parrinello-Rahman and Nose-Hoover.
Fixes #2031.
Fixes #2032.
Change-Id: Iae5e787f1338b99c2338c9d0c1f14e90393e9252
Teemu Murtola [Mon, 20 Jun 2016 17:55:59 +0000 (20:55 +0300)]
Support concurrent t_topology and gmx_mtop_t use
Make gmx_mtop_t_to_t_topology() take a boolean flag that specifies
whether to free memory from mtop or not. This makes it possible to
convert an mtop to a t_topology and then use both in subsequent code.
This in turn makes a piecewise conversion from t_topology to gmx_mtop_t
possible.
Using these two concurrently currently always leads to memory leaks, but
these should mostly be temporary during the conversion, and can be
sorted out separately if necessary.
Part of #1862.
Change-Id: Iccd6039c2226d1dc617963878e5640bb53f09ad6
Teemu Murtola [Wed, 15 Jun 2016 17:26:14 +0000 (20:26 +0300)]
Check atom mass availability in selections
Check for the availability of atom masses before using them in
selections, and give fatal errors early instead of asserts when
accessing the masses. Try to load the masses on demand if not
available.
Change-Id: If288d2b3920b92c6994aee8b7ff96c85ce3f6cb8
Berk Hess [Tue, 27 Sep 2016 12:50:05 +0000 (14:50 +0200)]
Speed up mtop_util atom lookup
The lookup of atom indices and properties on global atom index have
been sped up by moving functions to a new header file mtop_lookup.h
and by storing start and end global atom indices in gmx_mtop_t.
Another performance improvement is that the previous molblock index is
used as starting value for the next search.
The atom+residue lookup function now also returns the reside index.
This change also simplifies the code, since we no longer need a lookup
data structure.
A large number of files are touched because the t_atom return pointer
is changed to const also in the atomloop functions.
Change-Id: I185b8c2e614604e9561190dd5e447077d88933ca
Mark Abraham [Mon, 10 Oct 2016 22:49:37 +0000 (00:49 +0200)]
Merge "Merge branch release-2016"
Aleksei Iupinov [Mon, 10 Oct 2016 10:28:54 +0000 (12:28 +0200)]
Fix trivial PME memory leaks
This fixes still not all, but most of the memory leaks.
Change-Id: Iccd4ec5432df845665fedad411ac8fc83898c767
Mark Abraham [Sun, 9 Oct 2016 21:46:47 +0000 (23:46 +0200)]
Merge branch release-2016
Resolutions straightforward apart from the question about the
correctness of the gmx_wham fix in release-2016 branch.
Change-Id: I908a9a6d8f5767da49c3f00495beeec2a4f95ca7
Szilárd Páll [Mon, 26 Sep 2016 22:10:48 +0000 (00:10 +0200)]
Correct kernel launch bounds for CUDA sm_60
The GP100 architecture has half the SM size (64 ALUs) compared to 5.x
hence 64 threads/block already achieves maximum occupancy and the
incorrectly tweaked launch configuration is not optimal. This change
reverts the incorrectly increased block size in
cc4214a.
Change-Id: I9be10acfb3650c778401d04dfcd52aa200f78ff4
Berk Hess [Tue, 7 Jun 2016 14:03:47 +0000 (16:03 +0200)]
Add readConfAndTopology
readConfAndTopology will replace read_tps_conf, reading to gmx_mtop_t
instead of to the deprecated t_topology struct.
With requireMasses=TRUE, read_tps_conf will generate a fatal error when
an atom is not found in the mass database, as it was originally
intended, since we don't want to calculate with incorrect masses.
The availability of masses is signaled by the haveMass bool in t_atoms.
The trajectory analysis framework now works with optional masses.
This is done by not requiring masses and attempting to look up masses
from the database when they were not present in the structure file.
Refs #1862.
Change-Id: I045649fa458a08415fd319c568d15ad514a30a9f
Mark Abraham [Thu, 15 Sep 2016 15:29:27 +0000 (16:29 +0100)]
Add script for Jenkins regressiontest update job
This job can generate regressiontests reference data. Intended to be
triggered on regressiontests change that lacks some reference data,
either because it's a new test case, or the old data was deleted in
that patch. Jenkins will build the code, run the test harness to
generate new reference data and attempt to add it to the git index.
If files were added, then update the commit and push it back to
gerrit.
The actual implementation is in the releng repository.
When merging to master branch, update the gcc version to 4.8.
Change-Id: I70542022af00773f58646c617fbf818cdf8f577e
David van der Spoel [Mon, 23 Nov 2015 22:32:48 +0000 (23:32 +0100)]
Modularize electric field handling
Move external electric field code to a C++ class where only a single
place in the code is responsible for initializing it, and everything
else operates only on relatively general interaces. Details of the
electric field stuff is encapsulated within the class.
Moved the files into new directory applied-forces.
Added manual section for electric fields.
The interfaces may need more generalization to support more complicated
modules like the pull code, but that is better done when actually moving
those parts to this approach. Various considerations are documented in
mdmodules.h and inputrect.h.
Part of #1972.
Change-Id: I513632c74a8fae28b5f1087a3b5781791a2627bd
Berk Hess [Wed, 5 Oct 2016 19:47:43 +0000 (21:47 +0200)]
Changed fr->f_novirsum to PaddedRVecVector
Commit
74474d6f forgot to also change f_novirsum in t_forcerec
to PaddedRvecVector.
Change-Id: Ib8880d904dbad4049e6e2cee08fa74e2a17911a2
Teemu Murtola [Sat, 1 Oct 2016 04:53:34 +0000 (07:53 +0300)]
Support different key matching in KeyValueTreeTransform
Support case-insensitive and mdp-style dash-insensitive string
matching in KeyValueTreeTransform. Required to use this for mdp
transformations.
Change-Id: I20661f721880e26844f0c38a7582c26f376e6a62
Teemu Murtola [Wed, 5 Oct 2016 18:24:16 +0000 (20:24 +0200)]
Merge "Merge branch release-5-1 into release-2016" into release-2016
Mark Abraham [Mon, 3 Oct 2016 15:09:57 +0000 (17:09 +0200)]
Merge branch release-5-1 into release-2016
Change-Id: I38cba3159387519af07195a5995b0986dac5a2d6
Mark Abraham [Mon, 3 Oct 2016 10:00:52 +0000 (12:00 +0200)]
Replace use of deprecated readdir_r
clang 3.8+ warn about the deprecation of readdir_r. The main issue
here is support for concurrent access to the same directory stream,
which is never something GROMACS is likely to do. Currently the only
use is implementing enumerateFilesWithExtension which is used
single-threaded by pdb2gmx for discovering force fields in the
database. So we can replace the use of readdir_r with readdir, which
is simpler, and offers other advantages listed in man readdir_r.
Documented the new restriction on the interface of
DirectoryEnumerator. There are no current uses of nextFile that
would be affected by the change.
Change-Id: I0b80554493ff80e8857f0431192e22cfe7db5b22
Justin Lemkul [Mon, 3 Oct 2016 11:32:58 +0000 (07:32 -0400)]
Fix incorrect charge in HISE.
Revision
1a60bdbfb5e6b11e52783a6afa26e615f15f1be0 introduced an
incorrect charge on HISE CG, which leads to a fractional charge
on the residue. Any simulation with this charge will be wrong.
Fixes #2013
Change-Id: I9f80daf3dda2cd71715d4e15d6c868c6e47b48cc
Philip Loche [Wed, 28 Sep 2016 11:49:13 +0000 (13:49 +0200)]
EW3DC for non-neutral systems
Add the corrections to force and energy according to
Ballenegger, Arnold, and Cerdà, J. Chem. Phys. 131, 094107 2009
(http://dx.doi.org/10.1063/1.
3216473).
Added a warning in grompp for charged systems with Ewald.
Added a ref to Hub2014a too to help users change their mind.
Change-Id: I96a2ab51fede9b448d4c725d703faf71342e7346
Berk Hess [Fri, 30 Sep 2016 14:41:15 +0000 (16:41 +0200)]
Fix inputrec initialization in 4 tools
Commit
41e0f9cc changed t_inputrec initialization to a factory,
but forgot to convert 4 tools that had t_inputrec on the stack
(and thus all segv).
Change-Id: I0d75d7e62d66f5ff8d02d6970229db18a40a9d65
Berk Hess [Tue, 6 Sep 2016 09:32:58 +0000 (11:32 +0200)]
Use std::vector in t_state
Changed x, v and cg_p pointers in t_state to PaddedRVecVector.
PaddedRVecVector is currently std::vector<RVec> and is always
sized with one element extra for 4-wide SIMD (gather) loads.
But this will be replaced by a proper class.
t_state is now freed by the default destructor with some issues:
* ekinstate_t is fully converted to std::vector in a child change
* state struct of special algorithms still need conversion
Changes to t_state propagate over large parts of the core code.
This change extracts rvec pointers at intermediate levels to
make this single change manageable.
The state in EM also needed to be updated, which led to a lot
of changes in minimize.cpp, especially to do_lbfgs() which was not
yet converted to use em_state_t.
Change-Id: Ib6ead1f13741ead8dbeeddd118ecdd4bf1cc6584
Berk Hess [Wed, 8 Jun 2016 11:40:59 +0000 (13:40 +0200)]
Add flags for optional t_atoms entries
Instead of checking for (non-)NULL pointer, we can now determine
the presence of optional entries in t_atoms using booleans.
Moved the mass generation from confio.cpp to a function in atoms.cpp.
Most changes are caused by checking havePdbInfo iso pdbinfo!=NULL.
Change-Id: I6e2c8ffaa2240056f34da4c93f1713c40a00f391
Jochen Hub [Thu, 21 Jul 2016 10:03:40 +0000 (12:03 +0200)]
Fixed bug in gmx wham for reading pullx files.
Because the order of columns in the pullx files has changed recently, gmx wham
did not pick the reaction coordinate from pullx.xvg if the COM of the pull
groups were written. gmx wham was tested with various pull options and geometries.
Change-Id: If487e0493992c76649dc9a596c8df56d331abf22
David van der Spoel [Mon, 12 Sep 2016 11:15:20 +0000 (13:15 +0200)]
Fixed script xplor2gmx.pl to work with GMXDATA
Change-Id: I25c8857cfdd992679f3be9a6ab59c9a74c0df0c8
David van der Spoel [Tue, 20 Sep 2016 19:03:44 +0000 (21:03 +0200)]
Fixes issue with Release build in correlation functions.
Introduced build-type dependent code in the manyautocorrelation.cpp
but without the corresponding ifdef in the test. Now the test fails
in Release type. Error introduced in commit
Ief04a37de3d3bc9695603f025517ce169bf9e49a
Change-Id: I4ceffbe309c848f730d733421a2c95052ef04794
Teemu Murtola [Sat, 24 Sep 2016 18:57:16 +0000 (21:57 +0300)]
Fix default nice level in mdrun-only build
Now an mdrun-only build should default to zero nice level, the same as
'gmx mdrun' in a normal build.
Change-Id: I50dcf3be93bdba0d03bf6816c15c7c6729db0005
Berk Hess [Mon, 19 Sep 2016 13:52:16 +0000 (15:52 +0200)]
Fix gcc warning in AlignedAllocator
Both gcc4.8 and gcc5 warn about an unused parameter,
despite the gmx_unused qualifier.
Change-Id: I0896a4ea8c9cb94af90a1f72ae4d6a593a082c33
Berk Hess [Mon, 12 Sep 2016 08:49:06 +0000 (10:49 +0200)]
Remove state duplication in serial runs
Without domain decomposition the local and global state should be
identical. This is easier to ensure with a pointer copy and this also
uses less memory than copying all data. It also gets rid of copy code.
Change-Id: Idad2748a83290b8506e03bb699ebede4d5987dcb
David van der Spoel [Tue, 21 Jun 2016 11:34:24 +0000 (13:34 +0200)]
Made correlation function routine use std::vector
In order to clean up the correlation function routine presented
the data as std::vector<std::vector<real> > rather than real **.
manyautocorrelation.cpp does not use snew and friends more.
Routine throws gmx::InconsistentInputError when the input is
inconsistent.
Change-Id: Ief04a37de3d3bc9695603f025517ce169bf9e49a
Roland Schulz [Fri, 16 Sep 2016 00:45:33 +0000 (17:45 -0700)]
Fix math-test false positive
Depending on the accuracy of the floating point division, the
input of the test function could be 1ulp too large or too small.
If it was too large the result of the test function wasn't
within 4ulp and the test failed.
Change-Id: Ia322b136d1db9b25c7c733e4067f927a4c77e372
Roland Schulz [Fri, 16 Sep 2016 01:14:49 +0000 (18:14 -0700)]
Better optimized ICC release flags
Add those flags included in -fast which both helps performance
and are appropriate for GROMACS.
The flags included in -fast for Linux we weren't using were:
-ipo, -no-prec-div, -static, -fimf-domain-exclusion=15
Full static depends on static libraries to be installed and thus
will not always work. IPO increases compile time by a huge factor.
We do require that extreme values (e.g. large negative arguments
to exp and large positive to erfc) are computed correctly.
This leaves -no-prec-div -fimf-domain-exclusion=14 -static-intel
as safe and useful flags for GROMACS.
Change-Id: Ifbee69431841e3051c95f0b4c0ad204aac965c4e
Berk Hess [Fri, 16 Sep 2016 07:38:24 +0000 (09:38 +0200)]
Fixed unused variables in domdec.cpp
Fixed unused variables in domdec.cpp when configured without MPI.
Change-Id: I844ab59e16eb2fbde97ed3893ba6dea5679dca34
Berk Hess [Fri, 16 Sep 2016 11:40:25 +0000 (13:40 +0200)]
Merge branch release-2016
Change-Id: I0c8c02d4fbd56042ad77e7b646323b2570d06c7c
Berk Hess [Wed, 10 Aug 2016 10:23:03 +0000 (12:23 +0200)]
Made distance restraints work with threads and DD
The NMR distance restraints use several buffers for summing distances
that were indexed based on the index of the thread+domain local ilist
force atoms. This gives incorrect results with OpenMP and/or domain
decomposition. Using the type index for the restraint and a domain-
local, but not thread-local index for the pair resolves these issues.
The are now only two limitations left:
* Time-averaged restraint don't work with DD.
* Multiple copies of molecules in the same system without ensemble
averaging does not work with DD.
Fixes #1117.
Fixes #1989.
Fixes #2029.
Change-Id: Ic51230aa19a4640caca29a7d7ff471e30a3d9f09
Aleksei Iupinov [Tue, 13 Sep 2016 12:50:11 +0000 (14:50 +0200)]
Move the PME Ewald coefficients to the PME structure
Ewald coefficients no longer get passed every step to gmx_pme_do().
Instead, they are passed to gmx_pme_(re)init,
as they only change together with the grid size, not every MD step.
Change-Id: Iea75063cf060317e3f0fcfd147431520b6c83a90
Berk Hess [Thu, 8 Sep 2016 14:24:40 +0000 (16:24 +0200)]
Moved expanded ensemble history to pointer in t_state
Data of special modules such as expanded ensemble should be stored
in pointers in t_state. This is also needed for converting t_state
to C++ without converting all special modules at the same time.
Change-Id: I22e5a939638ac318eb8167fee5f1097c1f1981e0
Roland Schulz [Thu, 1 Sep 2016 21:15:42 +0000 (14:15 -0700)]
Tidy: modernize-use-emplace
run-clang-tidy.py -checks=modernize-use-emplace -header-filter=.* -fix -j80
http://llvm.org/releases/3.9.0/tools/clang/tools/extra/docs/clang-tidy/checks/modernize-use-emplace.html
Change-Id: I57a17487837f7afacc915d1c3cbf13c802c2a83c
Berk Hess [Thu, 8 Sep 2016 13:27:05 +0000 (15:27 +0200)]
Change ED and swapstate to pointers in t_state
Data of special modules such as ED and swapstate should be stored in
pointers in t_state.
This is also needed for converting t_state to C++ without converting
all special modules at the same time.
Change-Id: If8c7cb197f325ccf113aeebd807491ebd5a7b169
Mark Abraham [Wed, 31 Aug 2016 21:42:34 +0000 (23:42 +0200)]
Preliminary clean up of NVML code
Restructured logic so that it's simpler - there's multiple reasons why
we might not be able to change clocks, so now we just return after any
check that fails. No functionality changes here.
nvml_initialized does not need to persist.
Reading driver and runtime version is not needed.
Fixed some spelling.
Noted TODOs for subsequent cleanup.
Change-Id: I5e4cf73a470e60f53f098f7d28742403111f7da0
Berk Hess [Wed, 7 Sep 2016 07:58:57 +0000 (09:58 +0200)]
Add const to thread-MPI functions
Added const qualifiers to send buffer pointers for Several thread-MPI
functions. This is required by the MPI 2 standard and allows us to
use more const qualifiers in the GROMACS communication code.
Note that internally thread-MPI does not distinguish send and receive
buffers, so we need cast away the const.
Change-Id: I0fe03fd92325b9030c8584349c958deb20b30bfd
Vedran Miletić [Wed, 31 Aug 2016 18:52:46 +0000 (20:52 +0200)]
Document wallcycle counters and subcounters
List the available counters and explain how they are used. For subcounters,
explain the difference to counters and mention how to enable them.
Change-Id: Id5ce0e99b37a899f84d10b799840abad27d15c9c
Teemu Murtola [Sun, 11 Sep 2016 06:04:03 +0000 (09:04 +0300)]
Fix various memory leaks
These leaks are reported when building and running the tests with
LeakSanitizer (ignoring regression tests and tests marked as integration
tests).
- Free memory on 'gmx help -export completion' paths, which also fixes
all 'gmx help <module>' paths.
- Free all memory in genconf on exit to make the gmxpreprocess tests not
leak memory.
- Add settle_free() to free memory properly in mdlib tests.
- Add missing sfree in done_state() (fixes leaks in read_tps_conf() for
tpr files).
- Add missing virtual destructor in IOptionValueStore (various leaks
from correct destructors not getting called).
- Free the final symbol in selection parser in case the parsing ends
after the maximum number of selections has already been provided.
- Add missing frees in selection test helper for atom type strings.
Change-Id: I0d796033ce3b30cda0a18743a28f4d3133fd477f
Vedran Miletić [Tue, 30 Aug 2016 18:18:13 +0000 (20:18 +0200)]
Print OpenCL error string instead of error code
Change-Id: I00871b7f295373d8497a13d0bc3cbd0c0ff99668
Berk Hess [Wed, 7 Sep 2016 08:53:29 +0000 (10:53 +0200)]
Remove continuation from convert_tpr
Removed the obsolote option of convert_tpr to write a tpr file for
continuation using a trajectory and energy file. This is superseded
by checkpointing.
Change-Id: I46c49621a8cca247d5a9429961d85e6028fefb14
Aleksei Iupinov [Fri, 15 Apr 2016 14:34:12 +0000 (16:34 +0200)]
Fix PME data destructor not being called
The existing function gmx_pme_destroy is now being called at MD run end.
Erroneous memory freeing has been fixed.
Added freeing of pme_atomcomm_t.
Change-Id: I8761d2dbc168ec9d4e0e042fec788e39fb3e3ae5
Mark Abraham [Thu, 8 Sep 2016 10:40:51 +0000 (12:40 +0200)]
Merge branch release-5-1 into release-2016
Trivial conflicts in minimize.cpp from bug fix in same region that now
has exceptions caught within an OpenMP region.
Change-Id: I8b3c269a2afd7d4967e0f7310c96af6022533ddd
Mark Abraham [Thu, 8 Sep 2016 08:07:13 +0000 (10:07 +0200)]
Bumped patch number to prepare for future 5.1.5 release
Change-Id: I37e3120ec8ab257f0aeb1cf137dff27391e0689f
Mark Abraham [Wed, 7 Sep 2016 12:39:33 +0000 (14:39 +0200)]
Version 5.1.4
Bumped SOVERSION_MINOR and REGRESSIONTEST_HASH
Change-Id: Ib8404367c7ac15e0de567bf103f5ceb5d4dd5091
Mark Abraham [Mon, 5 Sep 2016 15:49:22 +0000 (17:49 +0200)]
Removed HIS1 from oplsaa and charmm definitions
HIS1 is intended for linking with heme, which oplsaa doesn't
define. charmm converts HIS1 to HSD in its .r2b.
This makes the recent fix for oplsaa HISD "consistent" with HIS1.
Fixes #2047
Refs #2049
Change-Id: Ibc0463c779e76689dc7ef65e48aedc716de9e032
Mark Abraham [Mon, 5 Sep 2016 15:32:19 +0000 (17:32 +0200)]
Fix LYN charges in amber03
These charges now match those found in AMBER 14 and 16. The
validation of the AMBER ports was done with AMBER 8.0, and
this fix was made afterwards in
http://ambermd.org/bugfixes/8.0/bugfix.19 (and perhaps LYN wasn't
in the validation set).
Fixes #2046.
Change-Id: Ibcaab337b527a44e42d5a7c68f71ef4fde2acf66
Mark Abraham [Tue, 6 Sep 2016 13:57:00 +0000 (15:57 +0200)]
Fix amber03 HIP charges
These were changed in Nov 2005, and now match AmberTools 16
Fixes #2050
Change-Id: I191b60c6acd2f521b3481578114ff48fca0979e5
Teemu Murtola [Mon, 30 May 2016 19:56:22 +0000 (22:56 +0300)]
Clean up CTest test management
- Add explicit timeouts to CTest tests. These should work better than
the current Jenkins timeout: it should produce better JUnit test
reports, and should catch also tests that end up in an infinite loop
printing stuff. The timeouts are still quite generous, since at least
the coverage run can take a while.
- Use a more easily extensible and better encapsulated mechanism for
producing the messages about missing tests with 'make check'.
- Abort if running a non-MPI test binary with MPI instead of trying to
run it on the master rank, since it might deadlock.
- Clean up the macros used to register CTest tests and use a clearer set
of test labels, and move more logic into src/testutils/CMakeLists.txt.
- Resolve various TODOs.
Change-Id: Ia1370d99eabd5839682832e8c3c60668a667cdde
Erik Lindahl [Fri, 5 Aug 2016 10:05:26 +0000 (12:05 +0200)]
Bump oldest cmake, compiler and CUDA versions required
For release 2017 we now require gcc-4.8.1, clang-3.3 and icc-15, so we
can rely on full C++11 support. We now also require CUDA-6.5 and
CMake-3.4.3. This in turn means we can remove some older cmake tests,
and since many users won't read the install guide there are now
version tests that produce fatal errors during CMake configuration for
compiler versions we know are too old.
Various hacks and workarounds in source and build system can
now be removed.
Fixed error in previous definition of GMX_ALIGNED
Updated C++11 compatibility tests in line with code we are now using.
Fixed that hwloc includes were not treated as system headers.
Treated including thread-MPI and TNG header files as system paths, to
be consistent with how we'd treat them if we were using external
versions of these.
Fixed icc 16 warnings in lapack routines.
Fixes #2012.
Change-Id: I36e02379a985b22c72f0f06481c65cae6e780c02
Mark Abraham [Mon, 27 Jun 2016 17:18:12 +0000 (19:18 +0200)]
Work around glibc 2.23 with CUDA
Note: Cherry-pick of
e2cd2e2e from the 2016 branch.
Fixes #2022
Change-Id: Id9881efb3f26af341b9c89b4bd1f983a2149c9e4
Berk Hess [Tue, 6 Sep 2016 13:14:17 +0000 (15:14 +0200)]
Fix bug with conjugate-gradient and OpenMP
The conjugate-gradient update routine re-used the pointer variable for
x for cg_p. This pointer was shared over threads and no barrier was
present before the pointer modification.
Fixes #1941.
Change-Id: I5f635fc3054147543820c4e5e74f3519637d541d
Berk Hess [Mon, 5 Sep 2016 09:27:43 +0000 (11:27 +0200)]
Consolidate MD algorithm atom setup
The setup of atom data for several MD algorithms that was called in
do_md, init_em and dd_partition_system has been moved to a single
routine called mdAlgorithmsSetupAtomData.
We should also move algorithm initialization cals to a single routine.
Change-Id: I3c87394e793e92d66555dc60388a47cedf6eeac9
David van der Spoel [Mon, 5 Sep 2016 13:49:10 +0000 (15:49 +0200)]
Merge "Merge branch release-2016"
Berk Hess [Mon, 5 Sep 2016 08:58:45 +0000 (10:58 +0200)]
Re-enable flexible constraints with DD
Commit
409edb80 added a fatal error in init_shell_flexcon() with DD.
But flexible constraints without shells work correctly with DD.
Change-Id: Ic3c5028a7aa6d956cf85f779347df16329d817bb
Berk Hess [Sun, 4 Sep 2016 16:29:34 +0000 (18:29 +0200)]
Merge branch release-2016
Change-Id: I11339f3f6ce583827af85fc8187c4f42ae5a8e52
Berk Hess [Fri, 2 Sep 2016 12:59:28 +0000 (14:59 +0200)]
Clean up PME flags variable use
PME flag bits for triggering Coulomb and/or LJ calculations were mixed
between different flags variables. These flag bits are now removed,
because they passed constant values based on inputrec.
Similarly, the free-energy calculation flags were never changed during
a run and have also been removed.
Note that these calculations probably could/can actually be run
selectively, but that should be tested.
Change-Id: Ib8e121fd08f2dd8776d29b0f896b3df2322ecf6d
Berk Hess [Fri, 2 Sep 2016 15:28:25 +0000 (17:28 +0200)]
Merge branch release-5-1 into release-2016
Change-Id: Ia1a7fad67f0ff11175ea24c46f813a445cd49ed6
Berk Hess [Mon, 15 Aug 2016 19:03:13 +0000 (21:03 +0200)]
Fix Parrinello-Rahman with nstpcouple>1
Fixes #2031.
Change-Id: I37cf18c40c6cf5e301d7981c9f10bbf963d8cda8
Teemu Murtola [Tue, 26 Jul 2016 13:05:13 +0000 (16:05 +0300)]
Basic support for transforming KeyValueTrees
Add support for writing transforms from one KeyValueTree to another.
For now, only a small subset of simple transforms is supported, but this
should be mostly sufficient for a proof-of-concept for MDP processing on
the electric field code, and new cases can be relatively easily added.
These transforms can support two use cases: specifying how a legacy MDP
file maps to a more structured format, and for supporting changes from
version to version in the structured format. However, versioning for
the structured format (in particular, if/when it will be necessary to
recognize the version from input) likely still needs some work.
There is not much in terms of consistency checks, error handling, or
documentation, but that is better to add once using code exists.
Change-Id: Ie2570eee8a62c2d64b79e00925bbf1e40b62b261
Berk Hess [Wed, 17 Aug 2016 13:27:49 +0000 (15:27 +0200)]
Make virial reproducible
OpenMP reduction was used to reduce virial contributions over threads,
which does not have a defined order. This leads to different rounding,
which makes runs non-reproducible (but still fully correct).
Now thread local buffers are used.
Also removed OpenMP parallezation for small count (e.g. shift forces).
Change-Id: I8d80def602337cc12ab601916bf40d7f66bf9bbc
Szilárd Páll [Wed, 24 Aug 2016 15:49:14 +0000 (17:49 +0200)]
Make ASAN/TSAN/MSAN build types easier to discover
While these build types are indeed aimed at developers, realistically
not many will be interested in changing the build type from the default
"Release" except in rare cases. Therefore, along Debug or RelWithAssert,
it makes sense to list the other developer-oriented build types
ASAN, TSAN, and MSAN if nothing else for the benefit having docs in the
ccmake gui.
Change-Id: Ie54fc57a06aee3be996c9a8ff62e54a3ac284065
Mark Abraham [Tue, 23 Aug 2016 22:40:04 +0000 (00:40 +0200)]
Stop using gmx_fatal in grompp
Added warning_error_and_exit to issue an error that describes the
location in the input file, and then halt processing (because data
structures would not be safe to use) while also describing where in
the code that occured. Either set of metadata can be useful to users
or developers diagnosing issues.
Refactored implementation of check_warning_error() so that
warning_error_and_exit() can have the gmx_noreturn qualifier, so that
analyzers understand the behaviour of the calling code, and compilers
can understand the implementation of warning_error_and_exit().
This permits more effective diagnostics in various places, and
eliminates some existing hacks.
Bumped all declarations of errbuf to have size STRLEN, since some of
the new uses might be safer that way.
Also made a minor fix to output to avoid redundant output from
done_warning when an error has occured.
Change-Id: I29f8afeb70d0da3598c6443c15090bca9bf5c639
Teemu Murtola [Fri, 29 Jul 2016 04:45:33 +0000 (07:45 +0300)]
Support KeyValueTree objects in refdata
Make it possible to check KeyValueTreeObject-rooted trees through
TestReferenceData. This is the simplest way to actually verify the
contents of such a data structure. For now, the contents can be
inspected through the XML output.
Change-Id: Ic6fc87c4934166acad4e9b5068c6d39c02866a73
Berk Hess [Wed, 24 Aug 2016 09:00:19 +0000 (11:00 +0200)]
Reduce rounding errors in SETTLE
The parameters for SETTLE are now computed in double precision.
This lowers the systematic error in settle.
Change-Id: I537a618830ab149d5f33251d9edca3aa9c43404c
Roland Schulz [Wed, 24 Aug 2016 20:57:28 +0000 (13:57 -0700)]
Fix build with GMX_USE_TNG=off
Change-Id: I305edfafbe87f0ad1e8ff410f419e5d32b23e1a7
Jochen Hub [Wed, 24 Aug 2016 15:50:08 +0000 (17:50 +0200)]
Fixed bug in gmx insert-molecules.
With option -ip, and if all trials were unsuccessful, a molecule was
eventually incorrectly placed at 0/0/0 due to a memory error
when referencing to rpos[XX][mol].
Change-Id: I367727210b893652af39217925906cc2dc703465
Roland Schulz [Fri, 5 Jun 2015 09:23:46 +0000 (05:23 -0400)]
Remove unnecessary ICC warning suppression
Change-Id: Icdb24d0fed40608a11a884fe5181778180bcc5e2
Berk Hess [Wed, 24 Aug 2016 11:00:14 +0000 (13:00 +0200)]
Fix Ewald surface+3DC corrections
Ewald surface and 3DC correction forces were only applied up to,
but not including, the last atom with exclusions. With water at
the end of the system only the last H would not be corrected.
With ions at the end all ions would be missing.
In addition, with the Verlet scheme and domain decomposition
no force correction was applied at all.
Fixes #2040.
Change-Id: I064bf01fab561dca40451763b75283b6f59e0fbd
Mark Abraham [Tue, 16 Aug 2016 09:42:00 +0000 (11:42 +0200)]
Remove hacks for outdated BlueGene support
GMX_BLUEGENE hasn't been a thing for a while now.
XL compiler is no longer supported on BG/Q (no C++11 support will ever
exist), so a bunch of accommodations for it can go away. bgclang
is still supported however.
Some BG/L workarounds can also go away.
Change-Id: I5b76c02b4fc421889d7ca60f41574c491af05f2f
David van der Spoel [Wed, 17 Aug 2016 07:05:15 +0000 (09:05 +0200)]
Added documentation for shell potentials.
Added documentation for simple and anharmonic shell potentials.
Added two references.
Change-Id: Ica2b694b9b57bcf52bfe8434cfb3f8fe4dc7b9a2
Berk Hess [Wed, 24 Aug 2016 11:12:21 +0000 (13:12 +0200)]
Merge branch release-5-1 into release-2016
Also applied the merged fix to nbnxn_cuda_kernel_fermi.cuh.
Change-Id: I79d0cb59214290097d6f356e35dd13c4eadaed75
Berk Hess [Tue, 23 Aug 2016 10:13:35 +0000 (12:13 +0200)]
Remove variable precision gro writing
The gro precision is now fixed to 3, 4 and 5 decimal places for
x, v and box respectively to ensure compatibility with other software.
Variable precision reading is still supported.
Fixes #2037.
Change-Id: I0e593622ee0380c3934a7b7b6826ae29aed00a59
Teemu Murtola [Mon, 1 Aug 2016 05:16:12 +0000 (08:16 +0300)]
Check for unused refdata values
Make a test using refdata fail if it does not produce some reference
values at all. Use this instead of checkPresent() for some cases where
the new functionality is a clearer fit for the purpose. It is possible
to trigger the check explicitly for a subtree, but if not done
otherwise, it is always done for all values at the end of the test.
Change-Id: I722abd978f0c8fa9dc279264ff90cdad02e02b9d
Teemu Murtola [Sat, 23 Jul 2016 18:23:25 +0000 (21:23 +0300)]
Generic structured key-value tree for options
Add classes KeyValueTree* for representing a JSON-like data structure
that allows mapping a hierarchical set of string keys to values with
dynamic types. Make it possible to assign options from such a
structure.
The tree objects only provide read-only accessors that are currently
used. To construct such trees, a separate set of builders is used.
Better error handling will be added once this is actually used somewhere
and the best way to construct the messages can be determined.
Change-Id: I08c2536f4b2eb4678c11a179e31f6a85693fc4ec
Teemu Murtola [Fri, 8 Jul 2016 15:10:12 +0000 (18:10 +0300)]
Support for non-string option value assignment
Make it possible to assign non-string values to options through
OptionsAssigner. For now, the only thing that actually works is
assigning std::string values, and assigning the exact type stored for
the option. Also, the list of supported conversions is initialized
separately for every instance of each option, but in practice that might
not matter that much.
This adds the infrastructure that allows assigning option values from
something like a JSON structure that already does data type conversions
during parsing. The same infrastructure can also support #653.
Change-Id: I8f81d57da1b6eeac06a6ac9a8ab68bfa8ed0c148
Teemu Murtola [Tue, 5 Jul 2016 18:24:27 +0000 (21:24 +0300)]
Basic support for array-of-structs in options
This makes it possible to parse structured data that has
arrays-of-struct type of constructs (as long as the structure for the
array elements is reasonably uniform). Iteration over the sections does
not work reasonably for these types of sections yet, and there are other
things that might not work. For complicated nested data structures,
there is also some unnecessary copying. But the tests show that basic
stuff does work.
Change-Id: Ib485248a5adabecc3ed126dfa3736a5e71577bfd
Teemu Murtola [Mon, 4 Jul 2016 18:52:02 +0000 (21:52 +0300)]
Generalize and simplify option value storage
Move responsibility of managing the final storage of parsed option
values out of OptionStorageTemplate to a separate OptionValueStore
interface. Reduce complexity by removing support for some unused cases
(like storing the values in more than one place), which allows complete
removal of refreshValues().
This turned out to be not strictly necessary for supporting repeating
sections in options, but it is a useful simplification nonetheless.
It also provides some reusable elements that are also used in later
changes.
Change-Id: Ib367ae987cd265a08777c2fe054b43fdd5310762