alexxy/gromacs.git
6 years agoMake in-source OpenCL kernel path a per-module parameter
Aleksei Iupinov [Thu, 12 Apr 2018 14:31:43 +0000 (16:31 +0200)]
Make in-source OpenCL kernel path a per-module parameter

Change-Id: I19cd66b441fec6ceba74eb648bea3409b6521917

6 years agoRemove use of where(), if DEBUG etc.
Mark Abraham [Fri, 2 Mar 2018 21:08:23 +0000 (22:08 +0100)]
Remove use of where(), if DEBUG etc.

The where() debugging function causes run-time branches in
release-mode builds, and replaces functionality for which one should
use a debugger.

Other such preprocessing clutter should also go away. Since we don't
check whether any of it compiles or produces useful data, we may as
well delete it.

This coincidentally simplifies the call sigatures of some
functionality, too.

Retained some useful essentialdynamics debug code, which is now always
compiled, and written from setup code only at debug level 2.

Refs #2423
Fixes #2122

Change-Id: I2c60c162734f4c2ec1d56153853a36d28e6a66ff

6 years agoRemove CUDA_FUNC macros from many functions in PME GPU
Aleksei Iupinov [Thu, 12 Apr 2018 12:42:48 +0000 (14:42 +0200)]
Remove CUDA_FUNC macros from many functions in PME GPU

As pme-gpu*.cpp files are not compiled during CPU builds anymore,
PME GPU functions that are not exposed to mdrun/tests do not need
to be hidden.

Change-Id: Id39c0bb6e586b508f5bbe8c7501ffd560d3cf14c

6 years agoStop PME GPU code from compiling on non-CUDA builds
Aleksei Iupinov [Tue, 27 Mar 2018 11:18:51 +0000 (13:18 +0200)]
Stop PME GPU code from compiling on non-CUDA builds

On non-CUDA builds: all entrypoints into PME GPU code are
marked as stubs; pme-gpu.cpp and pme-gpu-internal.cpp are
excluded from compiling. Several common functions (such as
check for GPU support at the end of PME initialization)
are moved to pme.cpp, to still work with non-GPU builds.

Change-Id: Iaa9ea7b3e42665c60b788e76510a810457a69f20

6 years agoReorganize energy evaluation for EM
Mark Abraham [Mon, 26 Feb 2018 16:47:24 +0000 (17:47 +0100)]
Reorganize energy evaluation for EM

Used aggregate initialized structs to simplify future refactoring.

Refs #1793, #2423

Change-Id: Iedb8bf3b4cb2d7f238c4b674ce459564a3f76a20

6 years agoMinor text edits and fix of broken link in user guide.
Viveca Lindahl [Tue, 10 Apr 2018 13:52:25 +0000 (15:52 +0200)]
Minor text edits and fix of broken link in user guide.

Link to domain decomposition section was broken. Also:
* removed a TODO that was already done
* reordered words in SIMD to make it a definition

Change-Id: I7943e4f59e2de82c2c6e94d15a6089a92f196132

6 years agoConvert gmx_molblock_t to C++
Berk Hess [Wed, 14 Feb 2018 08:46:59 +0000 (09:46 +0100)]
Convert gmx_molblock_t to C++

Changed posres pointers in molblock to std vector.
Also moved the derived helper index data into a separate struct.
That is merged into this change to keep MPI broadcasting simple.
natoms_mol will be moved into the new struct in a child change.

Change-Id: I131fd14ab53cec98800c7e0731d3a92df3f93422

6 years agoSimplified handling of simulation runners
Mark Abraham [Wed, 28 Feb 2018 15:20:03 +0000 (16:20 +0100)]
Simplified handling of simulation runners

Argments to runners are now passed via struct members. That struct is
expected to change over the medium term, as most of its contents
should either be in a container of modules, or data with such a
module. As such, it does not make sense to do a lot of coding to
manage its contents in a sound way. The practical effects of using
this struct are almost the same as the old approach of passing a
forest of arguments - some variables are declared in a scope,
initialized with values, then used once.

The form is chosen so that
* the do_md() etc. functions do not need a large number of useless
  textual changes now
* future changes to names and types of the former parameters do not
  need to be edited in matching way in multiple places of code and
  their doxygen
* we don't need to mark things gmx_unused anywhere

Useless unchecked return values have been removed.

Some excessive includes in integrator.h were removed, which
generates a few minor fixes elsewhere.

Refs #1793

Change-Id: I678598175192c9c68113fdd79fcee17f8e5c504e

6 years agoCreate gromacs/mdrun module and move code there
Mark Abraham [Wed, 28 Feb 2018 14:54:26 +0000 (15:54 +0100)]
Create gromacs/mdrun module and move code there

Improving how we dispatch the work for do_md and friends requires that
they all compile as part of libgromacs (or all outside of it). The
code currently in src/programs/mdrun is there simply because it hasn't
been moved from the old src/kernel layout, rather than through any
clear design, so we should move it now that we have a reason.

Other code from src/programs/mdrun now needs to move into libgromacs
also, but we currently don't have a module for miscellanous mdrun
features, so we're adding to the abuse of mdlib for now.

Refs #1793
Refs #2423

Change-Id: I4f9ad5d0bf6585675472b49b2d5654f588b7214e

6 years agoRefactor cj preload in the nonbonded OpenCL kernels
Szilárd Páll [Tue, 29 Mar 2016 20:20:22 +0000 (22:20 +0200)]
Refactor cj preload in the nonbonded OpenCL kernels

This change hides the implementation detail of preload/load operation in
inline functions configured based on the source flavor.
One of the main benefits is that this corrects the "nowarp" force and
pruning kernels removing a warp assumption (that was violated on
hardware with <32 wide wavefronts).

A step towards correctness on alternative GPU hardware, so
Refs #2030

Change-Id: If88d11df6613eadc9b59e5f03c34bac52df3514b

6 years agoQuiet checkpoint reading
Mark Abraham [Fri, 26 Jan 2018 16:28:01 +0000 (17:28 +0100)]
Quiet checkpoint reading

If reading succeeds, it should write anything of interest to the log
file. If it does not, it should make a fatal error.  Code here might
be run as part of mdrun (possibly in a multi-simulation), or grompp,
or compare, or dump, or eventually from an API caller, so we can't
make assumptions about what should be reported to a terminal.

Removed support for issuing a warning about restarting from very old
checkpoint formats, instead issuing a fatal error. Elsewhere, we
anyway observe that checkpoint restarts across major version
differences are not supported.

Change-Id: Id2b084bf0792a6992931609fb78d4a38a5f255fe

6 years agoMove checkNumberOfBondedInteractions
Pascal Merz [Mon, 19 Mar 2018 18:59:57 +0000 (12:59 -0600)]
Move checkNumberOfBondedInteractions

In task #1868, we will move the rerun functionality from do_md to
a separate function in a new file. As both do_md and the new
do_rerun need access to checkNumberOfBondedInteractions(), it needs
to be moved to a more central location.

Change-Id: Iae0ace11db2f83e5034fdfae21ccac3e7b9e34d1

6 years agoConvert gmx_mtop_t to C++
Berk Hess [Tue, 13 Feb 2018 13:30:22 +0000 (14:30 +0100)]
Convert gmx_mtop_t to C++

gmx_mtop_t now uses std vectors for moltype and molblock.
gmx_mtop_t, gmx_moltype_t and gmx_molblock_t now have constructors
and destructors.
Changed declarations of gmx_mtop_t* to not use a pointer or to use
std::unique_ptr.
Several sub-structs still use C style pointers and will be converted
later.

Change-Id: Iee802e4382a0a389496bb9395389e5926918d0f8

6 years agoMerge "Merge branch release-2018"
Mark Abraham [Tue, 3 Apr 2018 09:44:09 +0000 (11:44 +0200)]
Merge "Merge branch release-2018"

6 years agoDo not calculate COM for pull group 0
Berk Hess [Fri, 23 Mar 2018 10:10:56 +0000 (11:10 +0100)]
Do not calculate COM for pull group 0

Pull group 0 is an absolute reference with coordinates 0,0,0,
so it is clearer to never compute its center of mass.

Refs #2143

Change-Id: Ifa974ab84afe303594c3b65e9567e0568bb151a9

6 years agoMove file opening out of init_pull()
Berk Hess [Fri, 23 Mar 2018 11:14:23 +0000 (12:14 +0100)]
Move file opening out of init_pull()

This is a step towards making a constructor for t_pull.

Change-Id: I24583fa32066503ccfbe0abaef6a412241974b12

6 years agoTweak/enable icc 18 post-submit tests
Szilárd Páll [Mon, 26 Mar 2018 20:18:07 +0000 (22:18 +0200)]
Tweak/enable icc 18 post-submit tests

SIMD was disabled due to #2335

Change-Id: Ia55742958cfbdfb75e96c8d2b0ba5620a57a6f56

6 years agoImproved check of if only forces are computed in do_pairs()
Magnus Lundborg [Thu, 1 Mar 2018 07:39:18 +0000 (08:39 +0100)]
Improved check of if only forces are computed in do_pairs()

Use the check introduced in I67bdb0cba9c6ec20b to see if the
SIMD version can be used.

Change-Id: I3dfd401aa1dc421757bf243809ac85e17a9062b6

6 years agoFix cmake Sphinx detection for versions >1.6.4
Paul Bauer [Wed, 28 Mar 2018 11:33:02 +0000 (13:33 +0200)]
Fix cmake Sphinx detection for versions >1.6.4

The output from sphinx-build --version changed between version 1.6.4 and
1.7.x, leading to the cmake detection script to fail and reporting no
version at all. This fixes detection for both before and after the
change to the output format.

Change-Id: I34e50067f52f8127d137db28e9411420559d44cf

6 years agoSwitch CUDA 9.0/gcc 5 test to CUDA 9.1/gcc 6
Szilárd Páll [Fri, 2 Mar 2018 21:23:06 +0000 (22:23 +0100)]
Switch CUDA 9.0/gcc 5 test to CUDA 9.1/gcc 6

Change-Id: If3e7277243c986ce96bf31de314edb1a255a44a6

6 years agoModularize pull_coord_work_t
Berk Hess [Tue, 13 Mar 2018 20:00:00 +0000 (21:00 +0100)]
Modularize pull_coord_work_t

Organized the 19 members of pull_coord_work_t into 5 sub-groups
and moved some into a new external PullCoordVectorForces struct.
Added a constructor and changed the pointer to coord in pull_t
to std::vector.

Also fixes #2446

Change-Id: I48d176ddbf3f5649f9072aacfb6bcb2d69785f91

6 years agoFree more memory in grompp and mdrun
Mark Abraham [Sun, 11 Mar 2018 18:11:31 +0000 (19:11 +0100)]
Free more memory in grompp and mdrun

This will be increasingly useful as we start adding more GoogleTest
cases that call grompp and mdrun repeatedly.

Refs #1793, #1868

Change-Id: Ic0faaa4c3dec2891d0cdc6166561f8ccd4391f44

6 years agoRemove mols from gmx_mtop_t
Berk Hess [Wed, 14 Feb 2018 14:36:49 +0000 (15:36 +0100)]
Remove mols from gmx_mtop_t

The molecule atom begin/end information in gmx_mtop_t was derived
information. Now the mols struct is removed and the information is
derived when necessary.
Introduced BlockRanges, a C++ verion of t_block.

This is preparation for converison of gmx_mtop_t to C++.

Change-Id: I1717a101de82354a7f9cf14fd7f43c7227e554ef

6 years agoMerge branch release-2018
Mark Abraham [Wed, 28 Mar 2018 11:19:26 +0000 (13:19 +0200)]
Merge branch release-2018

Some meaningful conflicts in init_multisim associated with multisim
fixes and clarifications in release-2018 combining with reorganization
in master branch.

Preserved the master-branch pre-submit matrix, since all branches have
separate changes that cope with gpu_id=2 no longer being valid.

Change-Id: Idefe4f1ec3bbbc76dfedf03a81abef8233328de2

6 years agoMore gcc-8 fixes for POWER
Mark Abraham [Tue, 20 Mar 2018 07:39:37 +0000 (08:39 +0100)]
More gcc-8 fixes for POWER

Fixes #2421

Change-Id: I43c13df3a217d0f2154dca0ef215efd9cd27474a

6 years agominor fix to flag strings for gmx potential
Joe Jordan [Thu, 22 Mar 2018 08:59:25 +0000 (09:59 +0100)]
minor fix to flag strings for gmx potential

Change-Id: I2dadc8d74888dc2ebcd4fcf71e275c21fdd23cd6

6 years agoUpdated to prepare for 2018.2 release
Mark Abraham [Wed, 21 Mar 2018 15:04:44 +0000 (16:04 +0100)]
Updated to prepare for 2018.2 release

Change-Id: I1c72e8a3ac1b6b2e29b39c2d52bad5b87a884912

6 years agoAdded cool quote.
Viveca Lindahl [Thu, 22 Mar 2018 09:36:31 +0000 (10:36 +0100)]
Added cool quote.

Change-Id: I89d86d788f45f0d9124f5d00133709de83a73f38

6 years agoRenamed entropy.* to thermochemistry.*
David van der Spoel [Tue, 20 Mar 2018 21:04:42 +0000 (22:04 +0100)]
Renamed entropy.* to thermochemistry.*

This is a content-less patch to get the renaming history
correct in git.
Change-Id: I34f1d15f2e9136962b1718a60863b3b20a66fda5

6 years agoVersion 2018.1
Mark Abraham [Fri, 23 Feb 2018 13:20:17 +0000 (14:20 +0100)]
Version 2018.1

Change-Id: I3285c77fc557c1a6f34796c4bfb4843846b0d8a5

6 years agoMerge "Merge branch release-2016 into release-2018" into release-2018
Mark Abraham [Wed, 21 Mar 2018 11:07:16 +0000 (12:07 +0100)]
Merge "Merge branch release-2016 into release-2018" into release-2018

6 years agoUpdate release notes for 2018.1
Mark Abraham [Tue, 27 Feb 2018 16:10:15 +0000 (17:10 +0100)]
Update release notes for 2018.1

Change-Id: Ia60d523647e1915856ae3b00a0cb9eacd939fc56

6 years agoMerge branch release-2016 into release-2018
Mark Abraham [Tue, 20 Mar 2018 22:17:51 +0000 (23:17 +0100)]
Merge branch release-2016 into release-2018

Conflict in pre-submit matrix, kept 2018 content that already
has the same logical change made.

Change-Id: I40b2db8d149388bed07471fcdb8082b0fc92b9b5

6 years agoDocument matrix_convert function in PBC
Vedran Miletić [Tue, 20 Mar 2018 11:27:45 +0000 (12:27 +0100)]
Document matrix_convert function in PBC

The brief documentation was in place, but the documentation of the
function parameters was missing. This patch adds it and also fixes
incorrect Doxygen syntax at pbc_dx_d.

Change-Id: Ic897911bf4b8866bb7c4dc3aea982493cc03874c

6 years agoFix gmx dump AWH formatting issue
Berk Hess [Tue, 20 Mar 2018 12:19:01 +0000 (13:19 +0100)]
Fix gmx dump AWH formatting issue

A comma was missing in the list of AWH checkpoint entry string
which caused the naming to be messed up in the gmx dump output.

Change-Id: I85d0722236f3f9559c1117fdcee39766d04b424d

6 years agoUpdate use of gpu_id in Jenkins
Mark Abraham [Tue, 20 Mar 2018 11:50:17 +0000 (12:50 +0100)]
Update use of gpu_id in Jenkins

We plan to remove one of the GPUs from the slave that had three, so we
need to update the testing configurations. The new configuration might
balance load a little better.

Refs #2408, #2410

Change-Id: I3b5d9c8702c021f0676ea3ca12f9e7f1d3317ed1

6 years agoDisallow single simulation with multisim
Berk Hess [Mon, 19 Mar 2018 13:33:47 +0000 (14:33 +0100)]
Disallow single simulation with multisim

To avoid many untested code paths, we, at least temporarily,
disable a single simulation with mdrun -multisim and -multidir.

Refs #2448

Change-Id: I9befdb677f3c77bcc6dc0c77abc3478f0b83ba8d

6 years agoUpdate use of gpu_id in Jenkins
Mark Abraham [Tue, 20 Mar 2018 11:51:56 +0000 (12:51 +0100)]
Update use of gpu_id in Jenkins

We plan to remove one of the GPUs from the slave that had three, so we
need to update the testing configurations. The new configuration might
balance load a little better.

Refs #2408, #2410

Change-Id: Ie253ef07998cf45c5fc2e118a5394f0817e66f75

6 years agoUpdate use of gpu_id in Jenkins
Mark Abraham [Sun, 18 Mar 2018 19:34:53 +0000 (20:34 +0100)]
Update use of gpu_id in Jenkins

We plan to remove one of the GPUs from the slave that had three, so we
need to update the testing configurations. The new configuration might
balance load a little better.

Refs #2408, #2410

Change-Id: Ia63cb701049a02ad86fdd9f9c03388cd11a14bcc

6 years agoClarify the mdrun GPU options docs
Aleksei Iupinov [Thu, 1 Mar 2018 22:32:03 +0000 (23:32 +0100)]
Clarify the mdrun GPU options docs

Refs #2359

Change-Id: If112077a59f875ffb1c689b2ac67dad7cdf2adb9

6 years agoAdd helper function to make a vector from an ArrayRef
Mark Abraham [Tue, 6 Mar 2018 09:53:19 +0000 (10:53 +0100)]
Add helper function to make a vector from an ArrayRef

This syntactic sugar makes it easy to make a vector with a copy of the
contents.

Change-Id: Ib51c8a1d88aee7ca35fe1715d6f094b60e90e0b2

6 years agoFix VSX SIMD with gcc 8
Mark Abraham [Fri, 16 Mar 2018 21:21:48 +0000 (22:21 +0100)]
Fix VSX SIMD with gcc 8

gcc 8 apparently generates different code for the former GROMACS
code, which seems buggy. See
https://bugzilla.redhat.com/show_bug.cgi?id=1556989#c3
and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84907

Fixes #2421

Change-Id: I31492cd582b785cdfb42e8b999a165a7339ce4be

6 years agoOnly free topology when allocated
Paul Bauer [Wed, 14 Mar 2018 09:15:42 +0000 (10:15 +0100)]
Only free topology when allocated

Fix trjconv so that the topology only gets free'd when it has been
previously allocated.

Fixes #2430

Change-Id: Idc9a4219d988e1794ef86f7cc79f0d00750394ca

6 years agoAdd a basic TPI sanity test
Aleksei Iupinov [Thu, 1 Feb 2018 16:16:52 +0000 (17:16 +0100)]
Add a basic TPI sanity test

The floating point exceptions are for now toggled off
in the test body instead of mdrun itself.

Refs #2391

Change-Id: I41b584f4753b9b0e126256a94c1304f0a870aa73

6 years agoStop gmx_feenableexcept() from returning previous exception settings on Apple
Aleksei Iupinov [Fri, 16 Mar 2018 10:18:47 +0000 (11:18 +0100)]
Stop gmx_feenableexcept() from returning previous exception settings on Apple

This makes the function return value unambiguous.

Change-Id: I3e64e769b27fb0fa59b650d18b2fd099a9181025

6 years agoSplit off entropy calculation to separate file.
David van der Spoel [Fri, 29 Dec 2017 20:56:09 +0000 (21:56 +0100)]
Split off entropy calculation to separate file.

The calculation of the quasiharmonic entropy or the one
through the Schlitter formula has some popularity. In
order to allow computation from a normal mode analysis
as well as from a PCA (essential dynamics analysis) the
code was split off into a separate file. Proper documentation
and five tests are provided as well. Minor cleanups
were done as well.

Change-Id: Ic5e4feab6a304946947d6e69be75c06b46aff75c

6 years agoCorrect PMF sign error in AWH bias sharing
Berk Hess [Fri, 16 Mar 2018 10:00:41 +0000 (11:00 +0100)]
Correct PMF sign error in AWH bias sharing

Recent commit 229c8f63 was though to fix a sign error in
the calculation of the deconvolution of the AWH PMF when sharing
the bias over multiple simulations, but this sign was misplaced.

Fixes #2439

Change-Id: I67ec06ff4d832a857467b58b362f9f6f88671aa8

6 years agoFix recent mdrun signaling bug
Berk Hess [Thu, 15 Mar 2018 17:09:55 +0000 (18:09 +0100)]
Fix recent mdrun signaling bug

Recent commit e4deba12 accidentally negated the locality condition
for signaling checkpoint and termination in mdrun.

Fixes #2457

Change-Id: I1b7a4c26637766a44cad2581c9c9ec420aa4ab6e

6 years agoRestore the lost mc_temp check in grompp
Aleksei Iupinov [Tue, 23 Jan 2018 11:45:04 +0000 (12:45 +0100)]
Restore the lost mc_temp check in grompp

The expression for checking whether the reference temperature
is defined is moved into a helper function.

Change-Id: Ib331f52e8031a5e5d7c32234cfe936024c49ac28

6 years agoFix virial with external pull potential and MPI
Berk Hess [Thu, 15 Mar 2018 10:25:50 +0000 (11:25 +0100)]
Fix virial with external pull potential and MPI

When using an external pull potential with domain decomposition,
currently this is only used by AWH, the virial contribution would
be multiplied with the number of MPI ranks.

Fixes #2455

Change-Id: I61452fb9eca6e68fea3256cc25b39033a9c5d8e7

6 years agoImprove inter-simulation signaling
Berk Hess [Wed, 14 Mar 2018 10:59:53 +0000 (11:59 +0100)]
Improve inter-simulation signaling

Use a single boolean for controlling inter-simulation signaling.
This would have prevented issue #2447.
Introduce an inter-simulating signaling frequency. This both
simplifies the code and significantly reduces communiation overhead
for many simulations and/or many ranks per simulation.
Correct the terminimation step print with replica exchange.

Refs #2440 and #2447

Change-Id: I8ed50c5b11564d9a967bcacb15c4fcd3be05caea

6 years agoMake a persistent physical node communicator
Mark Abraham [Thu, 25 Jan 2018 14:47:35 +0000 (15:47 +0100)]
Make a persistent physical node communicator

Rather than make and re-make this communicator multiple times for for
almost all common run configurations, build one, and keep it in a
place distinct from commrec (which has too many responsibilities
already).

Note that the master thread-MPI rank builds a fake one initially,
because MPI is not yet initialized, then coordinates to build the real
one with the newly launched threads. However that communicator is not
actually used until after the execution paths have re-joined.

Simplifies IThreadAffinityAccess while retaining the ability to test
the affinity-setting logic without requiring specific attributes of
the node. Note that some of the tests already required that a
particular MPI environment exists.

Change-Id: Ie0800b07a65f9579ddc8af8f418cd14b85671de7

6 years agoFix mdrun signalling with AWH bias sharing
Berk Hess [Wed, 14 Mar 2018 08:32:23 +0000 (09:32 +0100)]
Fix mdrun signalling with AWH bias sharing

The recent commit 717fd5b8, which should have fixed issue #2440,
disabled checkpointing and termination by disabled signalling
between AWH runs that share a bias.

Fixes #2447
Refs #2440

Change-Id: Ic80ea07cfa1bde1b31fa9d660f00492b794b000f

6 years agoFix COM pulling with external potential with #ranks>32
Berk Hess [Mon, 12 Mar 2018 15:54:04 +0000 (16:54 +0100)]
Fix COM pulling with external potential with #ranks>32

With more than 32 PP-ranks, the pull code could use only a subset
of the PP-ranks. This change forces all ranks to do pulling when
external potentials are present (currently only used by AWH).

Fixes #2441

Change-Id: I8501024b7961600ec79f3707e239ddf25525aa79

6 years agoFix pull bug with geometry=direction-periodic
Berk Hess [Tue, 13 Mar 2018 13:59:19 +0000 (14:59 +0100)]
Fix pull bug with geometry=direction-periodic

When doing COM pulling with geometry direction-periodic,
the reference location needs to be used to compute the current
distance. This reference was taken from the previous step instead
of the current. In practice this only caused issues at restarts
when the distance was more than half the box length.

Fixes #2446

Change-Id: Ie0c0341ad8c6ce1e78951270cab27ecaf95d65eb

6 years agoAdd AWH fixes to release notes
Berk Hess [Tue, 13 Mar 2018 13:18:45 +0000 (14:18 +0100)]
Add AWH fixes to release notes

Change-Id: I17531da77495367b0e62b4e0b0e912bbd16659f9

6 years agoAdd more const to uses of t_commrec and t_inputrec
Mark Abraham [Mon, 26 Feb 2018 16:47:02 +0000 (17:47 +0100)]
Add more const to uses of t_commrec and t_inputrec

Also removed some pointless struct keywords.

Refs #2423

Change-Id: Iacc008fb11a31646e798364e253de322c16ccaee

6 years agoRequire OpenCL 1.2
Szilárd Páll [Tue, 13 Mar 2018 02:24:58 +0000 (03:24 +0100)]
Require OpenCL 1.2

This commit bumps the requirement and removes OpenCL 1.1 API
compatibility support.

Refs #2438

Change-Id: Iaedf5fbdfd24a2d020983847815c2c21bac0f74c

6 years agoFix AWH ensemble checkpointing
Berk Hess [Mon, 12 Mar 2018 15:43:53 +0000 (16:43 +0100)]
Fix AWH ensemble checkpointing

AWH multi-runs with shared bias could terminate at different steps
leading to checkpointing from which continuation was impossible.

Fixes #2440.

Change-Id: I728c6aea9d030fcfad04efc6082309dafe3408bd

6 years agoFix AWH deconvolution when sharing a bias
Berk Hess [Mon, 12 Mar 2018 20:36:07 +0000 (21:36 +0100)]
Fix AWH deconvolution when sharing a bias

When sharing an AWH bias over multiple simulations, the PMF output
was garbage due to a missing minus sign in the reduction.
Note that this only affected the PMF output, not the sampling.

Fixes #2439

Change-Id: I688cda045f5e757e58b392d64384705b3ac73a17

6 years agoIntroduce constrain_shake
Mark Abraham [Wed, 21 Feb 2018 15:02:46 +0000 (16:02 +0100)]
Introduce constrain_shake

Also move various functions and fields of general constraint code and
data to the SHAKE code and data structures. Made some use of inputrec
const, to suit later changes.

Change-Id: I09b7a719b58f8f8192762431edc139674eaf23ae

6 years agoFix clang 6.0 with CUDA 9.0
Szilárd Páll [Mon, 12 Mar 2018 23:23:07 +0000 (00:23 +0100)]
Fix clang 6.0 with CUDA 9.0

This enables clang 6.0 CUDA build for sm_70 and works around an issue
which seems to affect sm_37 support.

Fixes #2443

Change-Id: Ib9c52e4a3a8ac1e05e851c8166eec4a6b5df4825

6 years agoMerge "Merge branch release-2018"
Mark Abraham [Tue, 13 Mar 2018 08:52:50 +0000 (09:52 +0100)]
Merge "Merge branch release-2018"

6 years agoAvoid icc-specific -march=core-avx2 flag with gcc/clang
Szilárd Páll [Wed, 15 Nov 2017 19:48:50 +0000 (20:48 +0100)]
Avoid icc-specific -march=core-avx2 flag with gcc/clang

This change makes sure that the -march=core-avx2 icc-specific
optimization flag is only used for Intel compilers. It is not only
unnecessary for gcc/clang but also undocumented (and not proven to be
useful, actually potentually harmful with gcc <=6, measured 1-3% lower
perf.).

Change-Id: Ic2f05554ea6e460c53fa307fc1da3de1b6868e2f

6 years agoTest gcc-6 and cuda-9.0
Mark Abraham [Fri, 23 Feb 2018 12:20:56 +0000 (13:20 +0100)]
Test gcc-6 and cuda-9.0

Change-Id: Iba9436d9629a404290eb02d897b8d48f2a77b5ee

6 years agoCorrect pdb2gmx -missing option
Berk Hess [Wed, 7 Mar 2018 12:48:42 +0000 (13:48 +0100)]
Correct pdb2gmx -missing option

The help text for the pdb2gmx -missing option only mentioned
missing atoms, but when atoms are missing also bonded interactions
will be missing. Now bonds are mentioned in the help text.
Since -missing allows for missing bonds, it now also allows for
dangling bonds at termini (which can actually be useful in special
cases).

Change-Id: I8d7215691ffc7dbb49f41964af9639c01355d775

6 years agoFix memory leak in PME
Berk Hess [Wed, 7 Mar 2018 07:18:04 +0000 (08:18 +0100)]
Fix memory leak in PME

Now pme_spline_work is freed.

Change-Id: Ia959a85929b794c94a2befcce455151be1b6eca1

6 years agoExtend "Finding out how to run mdrun better" section
Szilárd Páll [Tue, 6 Mar 2018 18:10:55 +0000 (19:10 +0100)]
Extend "Finding out how to run mdrun better" section

Change-Id: I76c75504ef505e2547861015eb20d6d6b1f31383

6 years agoIsolate PME GPU spline parameter indexing in inline functions
Aleksei Iupinov [Fri, 2 Mar 2018 17:15:52 +0000 (18:15 +0100)]
Isolate PME GPU spline parameter indexing in inline functions

This makes the spread/gather kernels more readable and allows
to change the spline indexing scheme much easier in
the future. Performance should not be affected.
More TODO regarding the spline indexing scheme is marked.

Change-Id: If735cccf2ce82f46b483c9ada6f309425c51f67e

6 years agoConvert t_filenm to C++
Berk Hess [Fri, 23 Feb 2018 12:17:10 +0000 (13:17 +0100)]
Convert t_filenm to C++

This change is only refactoring.
Struct members opt and fn are now const char * const.
Replaced nfiles and fns by a vector of strings.
Removed, now unnecessary, copy and delete functions.

Change-Id: I7122f06e7264ad378022321b4c61acf1e3caabd6

6 years agoMerge branch release-2018
Mark Abraham [Tue, 6 Mar 2018 14:07:45 +0000 (15:07 +0100)]
Merge branch release-2018

Minor conflicts from separation of multisim from commrec,
and code movement in constraints code.

Change-Id: Id1fea8a7de0726e34eb2d43b2420b4753631f303

6 years agoFixed dvdlambda for SHAKE + FE
Mark Abraham [Fri, 2 Mar 2018 10:22:42 +0000 (11:22 +0100)]
Fixed dvdlambda for SHAKE + FE

Garbage values have been accumulated to dvdlambda whenever SHAKE was
used.

Refactoring in 513813b514 removed the lam variable. Previously, it was
used as a temporary iteration variable over SHAKE blocks, but that
refactoring to use the main variable changed the logic of the
following loop.

Fixes #2434

Change-Id: Ia9642f50358ab31ec98f8317f7a1dcda8622a9f1

6 years agoMake multi-atom TPI reproducible
Berk Hess [Mon, 5 Mar 2018 15:34:38 +0000 (16:34 +0100)]
Make multi-atom TPI reproducible

Test particle insertion of molecules of more than one atom called
a rotate function with multiple random calls in the arguments. This
lead to non-reproducible results, at least when switching compiler,
since the language does not define the argument evaluation order.
Note that this issue did not affect physical correctness.

Change-Id: I9ab07566878f381f11284d813d9077fa90e68866

6 years agoAdd checks for non-null log file pointer in AWH
Viveca Lindahl [Mon, 5 Mar 2018 18:31:20 +0000 (19:31 +0100)]
Add checks for non-null log file pointer in AWH

Mdp-option 'awh1-equilibrate-histogram=yes' and certain run setups could
lead to a segmentation fault due to fplog being null.

Fixes #2436

Change-Id: I0110325a8624c9d434af5eeeccace29814d40f2d

6 years agoWork around gcc bug with group kernel tables
Berk Hess [Wed, 28 Feb 2018 13:09:33 +0000 (14:09 +0100)]
Work around gcc bug with group kernel tables

The LJ-only interaction tables for the group kernels were incorrectly
copied with the combination of gcc-6, AVX and -O3.
Since this bug replaced -1/(6 r^6), 1/(12 r^-12) by 1/r,-1/(6 r^6)
for odd table indices, this could not cause silent errors.

Fixes #2424

Change-Id: I021d4f2fe81bd635e6f02686118d661af8c444a6

6 years agoStop using custom FindOpenCL.cmake, per TODO
Aleksei Iupinov [Tue, 27 Feb 2018 16:55:31 +0000 (17:55 +0100)]
Stop using custom FindOpenCL.cmake, per TODO

It was originally taken from cmake 3.1.0 and modified to produce
all-uppercase variable names (with OPENCL_ instead of OpenCL_),
so the surrounding cmake code is now changed to expect exact-case names.

Another (undocumented) modification was that it took into account
CUDA_HOME env.var. when searching for OpenCL, while standard cmake
only looks at seemingly less useful CUDA_PATH. This useful trick is
preserved by temporarily appending $ENV{CUDA_HOME} to CMAKE_PREFIX_PATH.

Change-Id: I5ca60f88e657b064fb6f98b268c2c48e10f00986

6 years agoCorrect the nbnxn_gpu_compile_kernels() docs
Aleksei Iupinov [Thu, 1 Mar 2018 10:31:30 +0000 (11:31 +0100)]
Correct the nbnxn_gpu_compile_kernels() docs

Change-Id: Ieb9d3fd8a55754f6fe04d66b49c1cead1cd4b7c8

6 years agoLeave nullptr opt in t_filenm
Berk Hess [Fri, 23 Feb 2018 13:01:15 +0000 (14:01 +0100)]
Leave nullptr opt in t_filenm

File options that use the default extension of the file type by
setting opt=nullptr in t_filenm are no longer updated by
parse_common_args. Instead the (default) option name is looked up
based on the file type in the utilty functions.
This is preparation for converting t_filenm to C++.

Change-Id: I907c1e88f91ab2e524a72c03c27fd67ad641bc02

6 years agoAdd to the contributor section
Szilárd Páll [Fri, 2 Mar 2018 16:58:41 +0000 (17:58 +0100)]
Add to the contributor section

Change-Id: I1642f1ca247cf0e11781af4848b74e3d0ebd5082

6 years agoFix cppcheck warning
Berk Hess [Fri, 2 Mar 2018 22:45:29 +0000 (23:45 +0100)]
Fix cppcheck warning

Change-Id: Ib188b6da439d071a615158c4889b1a0f6edbda08

6 years agoMake TPI use double precision exp
Aleksei Iupinov [Thu, 1 Mar 2018 13:14:40 +0000 (14:14 +0100)]
Make TPI use double precision exp

This makes borderline results reproducible with different
compilers (e.g. with MSVC).

Change-Id: I7b7c50c4f857b4fe2966f49a6ef685eab6598ff6

6 years agoFix AWH bias-sharing with parallel simulation
Berk Hess [Thu, 1 Mar 2018 20:58:32 +0000 (21:58 +0100)]
Fix AWH bias-sharing with parallel simulation

Sharing the AWH bias over multiple simulations only worked when
each simulation was running on a single MPI rank. Now parallel
simulations also work.

Fixes #2433.

Change-Id: I71f9069a31b033151c772aac84c9912d91b213a1

6 years agoDetect AMD SMT topology
Berk Hess [Fri, 23 Feb 2018 14:22:50 +0000 (15:22 +0100)]
Detect AMD SMT topology

On AMD Zen the cpuinfo code detected hyperthreading but put all
threads on different cores in the topology. Now the correct
topology is detected using extended APIC.
Also disabled topology detection for non-AMD, non-x2APIC x86.

Fixes #2388

Change-Id: I194f3e09e669c20d1d62355a36be062e6cce264e

6 years agoFix mdrun multisim with separate PME ranks
Berk Hess [Thu, 1 Mar 2018 08:30:55 +0000 (09:30 +0100)]
Fix mdrun multisim with separate PME ranks

When running multiple simulations using separate PME ranks,
mdrun would call MPI_Barrier with MPI_COMM_NULL on some ranks.
Note: no new release note needed, since this fixes a fix.

Refs #2403
Fixes #2431
Fixes #2432

Change-Id: I7fe96a15b5030dea3e093d12850f89f00ccc9f48

6 years agoMoved and removed constraint code
Mark Abraham [Wed, 21 Feb 2018 11:42:27 +0000 (12:42 +0100)]
Moved and removed constraint code

No functionality changes here.

Removed code that was formerly called by the now-removed
combination of Andersen T coupling and constraints.

Removed crattle declaration from header, and moved its definition to
before the point of use, as normal for functions with file static
linkage.

Moved constr_r_max and support functions to constraintrange.cpp,
because conceptually the functionality is independent of which
algorithm implements the constraints. The current implementation only
works with LINCS, but that's because SHAKE and DD can't be used
together.

Refs #2423

Change-Id: I9e4fa1a4bb57118ca17c55f312103439b38190e3

6 years agoReorganized constraint code
Mark Abraham [Fri, 16 Feb 2018 17:12:54 +0000 (18:12 +0100)]
Reorganized constraint code

Renamed constraints files after just their algorithm, not the original
programming language, which matches the test file that they
have. Separated header files for each algorithm with matching
names. Removed extern C. Minimized header dependencies. Removed
excessive use of struct keyword.

Removed some header declarations of functions declared static.

Refs #2423

Change-Id: If60ab052ae73ad981fa031c2db6b3e206b380f4c

6 years agoMerge branch 'release-2018'
Aleksei Iupinov [Tue, 27 Feb 2018 13:08:17 +0000 (14:08 +0100)]
Merge branch 'release-2018'

Conflict: multisim barrier handling in src/programs/mdrun/runner.cpp

Amended the test introduced in I16a3705a0d59a to exclude the implicit
solvent output which was disabled in Ib241555ff3d8e60.

Change-Id: Idf382c9c7ba92439097fcc9008cb9cc813daaab7

6 years agoFix GPU utils test
Mark Abraham [Fri, 23 Feb 2018 14:15:46 +0000 (15:15 +0100)]
Fix GPU utils test

We should only attempt device-side work when we have compatible GPUs.

Fixes #2405 for CUDA

Change-Id: Idc28c7e89a5f08ee1d19943e3663385f2b23ff44

6 years agoChange TNG file opening
Paul Bauer [Fri, 23 Feb 2018 14:33:33 +0000 (15:33 +0100)]
Change TNG file opening

Change to TNG file opening to return a pointer the same way as open_trx
does. This is needed in a follow-up change so that no memory is lost
there.

Also made sure it is possible to open TNG files if no input file is
specified, or if the input file is not of TNG type.

Change-Id: I47cf1625815e640b399ed5a0ed5bbc9a3ead6e1b

6 years agoPermit define .mdp field to assign values
Mark Abraham [Fri, 23 Feb 2018 10:45:56 +0000 (11:45 +0100)]
Permit define .mdp field to assign values

It is intended that the "define" .mdp field can set preprocessor
variables to values, but this got broken in some clean up. Added a
test to cover it.

Fixes #2392

Change-Id: I16a3705a0d59a912a8eb7bfad0b472f12d2dc377

6 years agoAdvice users on infinite output of TPI
Aleksei Iupinov [Mon, 19 Feb 2018 15:20:54 +0000 (16:20 +0100)]
Advice users on infinite output of TPI

Fixes #2416

Change-Id: I6202154bc2a24377d036e5c115f2c90b1c678dda

6 years agoOrganize for recording 2016-era release notes and add them
Mark Abraham [Tue, 9 Jan 2018 13:41:38 +0000 (14:41 +0100)]
Organize for recording 2016-era release notes and add them

This hierarchical organization will make it easy for us to present to
users that there were two maintained release series at the time of
writing, while making available links to the releases notes of
unmaintained series, and having a straightforward path for migrating
the 2016 folder to the older folder and updating the appropriate
links.

In master branch, we will have stub .rst files in
docs/release-notes/major/ that we can fill out as functionality
changes, and movev to docs/release-notes/2019/major when we
make the release-2019 branch.

Changes to release notes in release branches will merge naturally.

Later, we can make sure that tarballs can have a useful plain-text
version built into them via sphinx also.

Change-Id: Ie35f90a616cb89727f5a9600389fdf228ecd03cb

6 years agoFix md integrator with Nose-Hoover coupling
Berk Hess [Wed, 21 Feb 2018 22:02:32 +0000 (23:02 +0100)]
Fix md integrator with Nose-Hoover coupling

When applying NH T-coupling at an MD step and no PR P-coupling,
the md integrator could apply pressure scaling with an uninitialized
or outdated PR scaling matrix.

Fixes #2418

Change-Id: I835db72776e7782ac044807961bb899e4f8c6c7b

6 years agoSimplify mdrun tMPI thread spawning
Berk Hess [Thu, 22 Feb 2018 12:40:45 +0000 (13:40 +0100)]
Simplify mdrun tMPI thread spawning

During spawning of the tMPI threads in mdrunner, the mdrunner object
and filename pointer were copied twice. Now they are only copied once
and a const object/pointer is passed around.

Also made thread-MPI take a const argument to enable this and to
ensure correctness, as thread-MPI makes a copy of the argument pointer
for every thread which could cause problems without const.

Added an explicit MPI_Barrier after spawning, with documentation,
in preparation of removing the implicit barrier in MPI_Comm_split
in reinitialize_commrec_for_this_thread().

Change-Id: I31af8a8ff72aec28366c4aa20b357ed96bf95087

6 years agoEnhanced docs of pimpl pointer helper
Mark Abraham [Wed, 21 Feb 2018 09:24:17 +0000 (10:24 +0100)]
Enhanced docs of pimpl pointer helper

There are constraints on where the destructor can be defined, and
doing it wrongly can provoke confusing compiler errors.

Change-Id: I241d8713d5e9a74f17698397ef871784db9a7292

6 years agoSwitch pre-submit CUDA 8.0 test to 9.0
Szilárd Páll [Wed, 21 Feb 2018 00:12:59 +0000 (01:12 +0100)]
Switch pre-submit CUDA 8.0 test to 9.0

Noted in TODO to add a CUDA 9.1 + gcc 6 config.

Change-Id: I1e9e1a0bcd99237167335f475d65791f6059dbb3

6 years agoRemove unused OpenCL debug buffer
Aleksei Iupinov [Tue, 20 Feb 2018 12:50:06 +0000 (13:50 +0100)]
Remove unused OpenCL debug buffer

Change-Id: I8f5f8a7f1b099f7cf7b058213dedb4d35e35c50c

6 years agoAvoid aborting mdrun when GPU sanity check detects errors
Szilárd Páll [Fri, 16 Feb 2018 18:48:46 +0000 (19:48 +0100)]
Avoid aborting mdrun when GPU sanity check detects errors

A release assertion was added which assumed that the GPU
compatibility/sanity checks return with a clean CUDA API state.
Consequently, any run that encountered a non-success return value from
the CUDA API would abort the run instead of continuing the run without
using the GPU in question.
This change adds code to handle and issue a note on the error
encountered as well as ensures that the CUDA API error state cleared
at the return of the GPU detection.

Fixes #2415

Change-Id: I5d7ed59ef8e4052a75b51c9a526b8dcb465ff611

6 years agoRemove cycle suppression
Mark Abraham [Wed, 14 Feb 2018 13:26:13 +0000 (14:26 +0100)]
Remove cycle suppression

The dependency was recorded the wrong way around. t_state needs to
have a GPU-aware allocator, so needs to depend on GPU utility
functionality.

Change-Id: I4f67962a564cb6abdd83ba081e08a35fe27af6c3

6 years agoDisallowed change of ensemble for checkpoint restart
Mark Abraham [Fri, 26 Jan 2018 16:22:04 +0000 (17:22 +0100)]
Disallowed change of ensemble for checkpoint restart

Change-Id: I63a8330043fddffc9cfc98203f60d71497e6c2f7