alexxy/gromacs.git
7 years agoMake -cl-fast-relaxed-math default
Szilárd Páll [Tue, 25 Oct 2016 23:29:01 +0000 (01:29 +0200)]
Make -cl-fast-relaxed-math default

The change makes fastmath default and changes the previous env-var
trigger to GMX_OCL_DISABLE_FASTMATH to allow disabling it for testing.
It is known to be faster on all supported platforms (and we use it in
CUDA too) and it has been planned to be enabled for the r'16 release.

Change-Id: I8d196c9a14785ff43aae144ed95c3cb29241c83b

7 years agoAdd GMX_DISABLE_GPU_TIMING env var
Szilárd Páll [Tue, 25 Oct 2016 22:52:37 +0000 (00:52 +0200)]
Add GMX_DISABLE_GPU_TIMING env var

It disables timing for both CUDA and OpenCL so on the long run
it can replace both.

Change-Id: I3556d87c135eba2e24935e77a0d608b72219b284

7 years agoUpdate install guide
Mark Abraham [Fri, 21 Oct 2016 21:12:04 +0000 (23:12 +0200)]
Update install guide

Some recent traffic on gmx-users suggested some
improvements.

Change-Id: Iaaf116ebf582755a466048aed1cd30bc123dc817

7 years agoFix SIMD suggestion for VMX
Mark Abraham [Tue, 18 Oct 2016 15:16:02 +0000 (17:16 +0200)]
Fix SIMD suggestion for VMX

Change-Id: Iebf55611512bf02d2a1a5780a1d6c05ce4b16023

7 years agoSet maxwarn to INT_MAX if GMX_MAXCONSTRWARN < 0
James W. Barnett [Tue, 11 Oct 2016 13:09:55 +0000 (08:09 -0500)]
Set maxwarn to INT_MAX if GMX_MAXCONSTRWARN < 0

maxwarn is set to the value of the environmental variable
GMX_MAXCONSTRWARN, and we tell users to set that variable to -1 to have
no maximum. This condition was not being checked, so when set to -1 just
1 SETTLE warning was enough to halt the program. This commit fixes
that behavior by setting maxwarn to INT_MAX if GMX_MAXCONSTRWARN is -1
(or any other negative number).

Fixes #2058.

Change-Id: Ie6e2cb57f8402dd9a327f72f7fad36db19b8bb68

7 years agoFixed print bug in gmx wham
Berk Hess [Mon, 10 Oct 2016 07:08:05 +0000 (09:08 +0200)]
Fixed print bug in gmx wham

Change-Id: I1957d1213498c25dff0f9257a51aa89af8cf03b8

7 years agofix typo
James W. Barnett [Tue, 11 Oct 2016 16:07:36 +0000 (11:07 -0500)]
fix typo

Change-Id: Iee8170173b5c4f02361e588260985d7ddf24f198

7 years agoUpdate for FFTW 3.3.5
Mark Abraham [Sat, 8 Oct 2016 23:35:10 +0000 (01:35 +0200)]
Update for FFTW 3.3.5

The auto-download now gets FFTW 3.3.5 and builds it properly,
including with --enable-vsx when GMX_SIMD is set to VSX, i.e. for
Power8, and --enable-avx512 when GMX_SIMD is any of the AVX flavours
(which is safe on non-512 now, works on KNL, and is presumed useful
for future AVX512 architectures).

Note that 3.3.5 does not automatically add avx and sse support if
configured with --enable-avx2, so changed the documentation
accordingly.

Change-Id: I2a48ec1cb4f812dcae18870e0afcaf1120da251b

7 years agoCorrect kernel launch bounds for CUDA sm_60
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

7 years agoAdd script for Jenkins regressiontest update job
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

7 years agoMerge "Merge branch release-5-1 into release-2016" into release-2016
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

7 years agoMerge branch release-5-1 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

7 years agoReplace use of deprecated readdir_r
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

7 years agoFix incorrect charge in HISE.
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

7 years agoFixed bug in gmx wham for reading pullx files.
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

7 years agoFixed script xplor2gmx.pl to work with GMXDATA
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

7 years agoFix default nice level in mdrun-only build
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

7 years agoFix math-test false positive
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

7 years agoFixed unused variables in domdec.cpp
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

7 years agoMade distance restraints work with threads and DD
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

7 years agoDocument wallcycle counters and subcounters
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

7 years agoPrint OpenCL error string instead of error code
Vedran Miletić [Tue, 30 Aug 2016 18:18:13 +0000 (20:18 +0200)]
Print OpenCL error string instead of error code

Change-Id: I00871b7f295373d8497a13d0bc3cbd0c0ff99668

7 years agoMerge branch release-5-1 into release-2016
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

7 years agoBumped patch number to prepare for future 5.1.5 release
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

7 years agoVersion 5.1.4
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

7 years agoRemoved HIS1 from oplsaa and charmm definitions
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

7 years agoFix LYN charges in amber03
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

7 years agoFix amber03 HIP charges
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

7 years agoWork around glibc 2.23 with CUDA
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

7 years agoFix bug with conjugate-gradient and OpenMP
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

7 years agoRe-enable flexible constraints with DD
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

7 years agoMerge branch release-5-1 into release-2016
Berk Hess [Fri, 2 Sep 2016 15:28:25 +0000 (17:28 +0200)]
Merge branch release-5-1 into release-2016

Change-Id: Ia1a7fad67f0ff11175ea24c46f813a445cd49ed6

7 years agoFix Parrinello-Rahman with nstpcouple>1
Berk Hess [Mon, 15 Aug 2016 19:03:13 +0000 (21:03 +0200)]
Fix Parrinello-Rahman with nstpcouple>1

Fixes #2031.

Change-Id: I37cf18c40c6cf5e301d7981c9f10bbf963d8cda8

7 years agoMake virial reproducible
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

7 years agoStop using gmx_fatal in grompp
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

7 years agoFix build with GMX_USE_TNG=off
Roland Schulz [Wed, 24 Aug 2016 20:57:28 +0000 (13:57 -0700)]
Fix build with GMX_USE_TNG=off

Change-Id: I305edfafbe87f0ad1e8ff410f419e5d32b23e1a7

7 years agoFixed bug in gmx insert-molecules.
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

7 years agoFix Ewald surface+3DC corrections
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

7 years agoMerge branch release-5-1 into release-2016
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

7 years agoRemove variable precision gro writing
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

7 years agoFixed opening of wall table files
Berk Hess [Wed, 17 Aug 2016 13:35:05 +0000 (15:35 +0200)]
Fixed opening of wall table files

Fixes #2033.

Change-Id: Ie5092476f021d0578bbcbd84c7e4f895959fd06e

7 years agoFixes for BG/Q platform files and install guide
Mark Abraham [Fri, 12 Aug 2016 08:19:34 +0000 (10:19 +0200)]
Fixes for BG/Q platform files and install guide

Renamed the platform file to reflect normal practice
and the install guide.

Change-Id: Icffde855789f561faa0249d095838fea9f97ce1d

7 years agoReduce FE pair-list memory usage
Berk Hess [Mon, 8 Aug 2016 13:24:14 +0000 (15:24 +0200)]
Reduce FE pair-list memory usage

Refs #2014.

Change-Id: Ia8bbc55eed7e3590e6944127ab94dd41f475e6a7

7 years agoBump number to prepare for first patch release
Mark Abraham [Fri, 12 Aug 2016 08:11:49 +0000 (10:11 +0200)]
Bump number to prepare for first patch release

Change-Id: I1cdfd715d2681677460945ed6670adb2a35f9839

7 years agoFix deadlock with thread-MPI
Berk Hess [Tue, 9 Aug 2016 20:26:04 +0000 (22:26 +0200)]
Fix deadlock with thread-MPI

With thread-MPI mdrun could deadlock while pinning threads.

Fixes #2025.

Change-Id: Ib42e9625134531b1e2f910b11339aa0f78b80624

7 years agoFix twin-cutoff for GPU LJ pot-switch
Berk Hess [Tue, 9 Aug 2016 11:24:49 +0000 (13:24 +0200)]
Fix twin-cutoff for GPU LJ pot-switch

With rcoulomb>rvdw, as used with PME tuning, the GPU kernels performed
the LJ cut-off check before applying the potential-switch to the LJ
forces and energies.

Fixes #2007.

Change-Id: Ie2f6fdfec10bdb8800123e6fa299839a31bc0f93

7 years agoVersion 2016
Mark Abraham [Wed, 3 Aug 2016 13:13:10 +0000 (15:13 +0200)]
Version 2016

Removed "-rc1" per policy. Bumped regressiontests hash.

Change-Id: If94c03e280fce13143d238fa3e7f2df3b8b659cf

7 years agoFix/improve doc links in template/README
Teemu Murtola [Thu, 4 Aug 2016 04:23:46 +0000 (07:23 +0300)]
Fix/improve doc links in template/README

For installations from a tarball, put a link to an appropriate version
at manual.gromacs.org instead of Jenkins-generated documentation which
might be for a newer version.  For builds from the repository, the links
still point to the nightly Jenkins job.

The first link was also pointing to an obsolete Jenkins job.

Change-Id: Ib56c62cd572879c8dadde6881507e54f6d22a784

7 years agoThree new quotes.
David van der Spoel [Tue, 2 Aug 2016 21:23:55 +0000 (23:23 +0200)]
Three new quotes.

Change-Id: I9a7ed8343a0133a68bf7790e85bff9d331dd6294

7 years agoUse only legal characters in OpenCL cache filename
Vedran Miletić [Tue, 12 Jul 2016 17:07:30 +0000 (19:07 +0200)]
Use only legal characters in OpenCL cache filename

The device name from the vendor could contain anything, and we need to
avoid dot and slash when we try to make a filename from it. To help
keep it valid for all possible users, we permit only alphanumeric
characters from the current locale.

Change-Id: Ie55959a9a2161d0cfc7effa6ab57fffc8160f4e2

7 years agoMerge "Merge branch release-5-1 into release-2016" into release-2016
David van der Spoel [Sun, 31 Jul 2016 07:18:27 +0000 (09:18 +0200)]
Merge "Merge branch release-5-1 into release-2016" into release-2016

7 years agoDocument gmx_cgsort_t and gmx_domdec_sort_t structs
Vedran Miletić [Wed, 27 Jul 2016 15:01:25 +0000 (17:01 +0200)]
Document gmx_cgsort_t and gmx_domdec_sort_t structs

Add descriptions to fields of gmx_cgsort_t and gmx_domdec_sort_t
structs used in domain decomposition code.

Change-Id: Ie64664ed46413e51ba22504270ab11350c39b84a

7 years agoImprove handling of gmock and gcc6
Mark Abraham [Fri, 29 Jul 2016 11:56:19 +0000 (13:56 +0200)]
Improve handling of gmock and gcc6

This patch reverts commit d6e35c96 that used gcc
-fno-delete-null-pointer-checks to work around implementation errors
in gmock 1.7. There's been no new release of gmock for several years,
but a patch is now available to address this issue.

This commit applies that patch, found at
https://github.com/google/googletest/issues/705#issuecomment-235067917. Updated
our README describing modifications GROMACS has found it necessary to
make.

Fixes #1911

Change-Id: I0d5abe9bf8172f6749bcad97a13765edaa3d4c80

7 years agoMerge branch release-5-1 into release-2016
Mark Abraham [Fri, 29 Jul 2016 12:32:44 +0000 (14:32 +0200)]
Merge branch release-5-1 into release-2016

Change-Id: Id782b78da4b2080fec208d29b9b4afc363f1418c

7 years agoFixes incorrect charges in OPLS/AA-L for HISD and HISE
David van der Spoel [Fri, 22 Jul 2016 07:43:02 +0000 (09:43 +0200)]
Fixes incorrect charges in OPLS/AA-L for HISD and HISE

With the present charges results from Michael Shirts et al.
J. Chem. Phys. 119 (2003) 5740 can be reproduced.

Fixes #2013

Change-Id: Ifb037961499633210d26ff32ec6bf3bebc505461

7 years agoAdd toolchain flags for SSE2 compilation
Mark Abraham [Thu, 28 Jul 2016 17:53:50 +0000 (19:53 +0200)]
Add toolchain flags for SSE2 compilation

This is how the code should be, though my testing didn't need it.

Also fixed function documentation.

Fixes #2008

Change-Id: Ic1e1c16d22e054e9f741d91c667305de7398cd30

7 years agoBumped patch number to prepare for future 5.1.4 release
Mark Abraham [Thu, 21 Jul 2016 18:40:39 +0000 (20:40 +0200)]
Bumped patch number to prepare for future 5.1.4 release

Change-Id: I813e0d8c976d0afca316f5cfe095c5647b8fd66c

7 years agoFix issues with using int for number of steps
Mark Abraham [Thu, 14 Jul 2016 15:31:49 +0000 (17:31 +0200)]
Fix issues with using int for number of steps

Mostly we use a 64-bit integer, but we messed up a few
things.

During mdrun -rerun, edr writing complained about the negative step
number, implied it might be working around it, and threatened to
crash, which it can't do. Silenced the complaint during writing,
and reduced the scope of the message when reading.

Fixed TNG wrapper routines to pass a 64-bit integer like they should.

Made various infrastructure use gmx_int64_t for consistency, and noted
where in a few places the practical range of the value stored in such
a type is likely to be smaller. We can't extend the definition of XTC
or TRR, so we're stuck. TNG is already good, though.

Fixes #2006

Change-Id: If485d9d92cb4b99a3bbe25e8e9fa082fc3fccd5f

7 years agoVersion 5.1.3
Mark Abraham [Wed, 13 Jul 2016 10:27:17 +0000 (12:27 +0200)]
Version 5.1.3

Bumped minor soversion and regressiontest hash

Change-Id: I55f1cc4f1154f053512c8cc3509fd0be8e3c347b

7 years agoFix trr magic number reading
Mark Abraham [Tue, 12 Jul 2016 13:55:46 +0000 (15:55 +0200)]
Fix trr magic number reading

The trr header-reading routine returned an "OK" value if the magic
number was wrong, which might lead to chaotic results everywhere,
because checking of return values tends not to happen (even when
they're right). Other GROMACS magic-number reading routines tend to
give a fatal error if the the number is wrong, e.g. by reading a file
written in wrong endianness. (This should never be a thing for XDR
files, which are defined to be big endian, but such code has existed.)

This change adds/restores that behaviour to trr reading, along
with separating the behaviour of failing to read a magic integer
from reading one that doesn't match.

Fixes #1926

Change-Id: I3cdd8ae9172e3b95fc232d8fa31a442d239233db

7 years agoFix gmx mdrun -membed -ntmpi -1
Mark Abraham [Mon, 11 Jul 2016 14:43:44 +0000 (16:43 +0200)]
Fix gmx mdrun -membed -ntmpi -1

This used to give a fatal error if we'd chosen more than one rank, but
instead we should choose to use a single rank. Now that we have
several kinds of things that want to trigger such handling, build some
infrastructure to handle it. This allows us to separate the trigger
logic from how we report back to the user.

Change-Id: If01177b590c1a817113c642c30fd30d6d4bc3eab

7 years agoFix membed with partial revert of 29943f
Erik Lindahl [Sat, 9 Jul 2016 21:32:58 +0000 (23:32 +0200)]
Fix membed with partial revert of 29943f

The membrane embedding algorithm must be initialized before
we call init_forcerec(), so it cannot trivially be moved into
do_md(). This has to be cleaned up anyway for release-2017
since we will remove the group scheme be then, but for now
this fix will allow us have the method working in release-2016.

Fixes #1998.

Change-Id: I8e16a67b8df16999793649d79eebca051b8b474f

7 years agoFix for incorrectly setting expanded ensemble when fep_state = 0
Michael Shirts [Mon, 27 Jun 2016 04:19:26 +0000 (22:19 -0600)]
Fix for incorrectly setting expanded ensemble when fep_state = 0

Expanded ensemble lambda values were not being copied over when the
proposed fep_state was 0.  This commit fixes that by removing a
a conditonal that was incorrectly added.

Fixes #1995

Change-Id: I3d49b0936d973fb70a9a79799743f5069ba4fff4

7 years agoFix regressiontest download md5sum
Mark Abraham [Mon, 11 Jul 2016 12:24:52 +0000 (14:24 +0200)]
Fix regressiontest download md5sum

I forgot that the md5sum changes with the decision to
name it rc1 rather than beta3, because the directory
name within the tarball changes.

Change-Id: I5b5f5b9de43ee5771fbdfb53842609f1635f3f38

7 years agoFirst 2016 release candidate
Mark Abraham [Thu, 23 Jun 2016 14:12:06 +0000 (16:12 +0200)]
First 2016 release candidate

Change-Id: I54a3e3c33015eb42ba5c18994ef76ce1bb2888c5

7 years agoHardware detection clean-up and pre/post-processing
Erik Lindahl [Thu, 7 Jul 2016 14:01:13 +0000 (16:01 +0200)]
Hardware detection clean-up and pre/post-processing

This change cleans up the various tests and hacks we have
had in different places to remove a number of false warnings
and errors. It also unifies all this processing to two
small routines that are called just before/after the
hardware is detected, so the user can choose whether it
should be done or not in other places.

- Rather than trying to guess when we should or shouldn't
  override the number of cores online, the preprocessing
  uses a piece of code that allows sleeping cores to come
  online automatically by running a small C++11 thread loop before
  doing the hardware topology detection. This way we can
  remove all ARM-specific paths. To avoid wasting a second
  on systems where SMT is disabled, we avoid calling it on x86.
- All SMT warnings are handled in the post-processing call,
  but only as notes in the log file to avoid writing
  warnings on stderr.
- The check for OpenMP thread mismatch has been removed
  since it caused incorrect warnings by comparing the number
  or threads configured for each OpenMP process with the
  total number of cores in the entire system. We will have
  to rewrite this later as a test in the MPI/OpenMP
  parallelization setup instead.

By sticking with the hwloc/sysconf-online detection, we should
now also handle all special cases where cores have been taken
offline manually in a correct way without using hardware-specific
paths.

Change-Id: I37edb3eada3f4c8c0906c641c7041cc0270985e8

7 years agoPrevent fragile use cases of checkpoint appending
Erik Lindahl [Tue, 24 May 2016 23:04:50 +0000 (01:04 +0200)]
Prevent fragile use cases of checkpoint appending

There are way too many ways we allow runs to be continued
and extended. We still allow the checkpoint file to be
missing (so -cpi can be used for all command lines), but
we warn if it is not found. To avoid mistakes with file
appending when restarting from checkpoints, we now require
that all previous output files must be present
(unless -noappend is used), and that the file names must
match the ones used in the previous run.

Fixes #1777.

Change-Id: Id9e89773a4a9214be6dbb76676c526e98e12bd37

7 years agoUpdate affinity checking for Intel compiler
Erik Lindahl [Thu, 7 Jul 2016 18:29:33 +0000 (20:29 +0200)]
Update affinity checking for Intel compiler

Since release 2013, the Intel compiler no longer sets
OpenMP affinity by default according to intel docs. This
means the code that tried to disable it by setting
environment variables no longer had any effect (and we
likely have not checked it the last few years). In
addition, it is not ideal behaviour in a library either to
assume that no other code has executed OpenMP prior to a call
or to set environment variables that influence other code
execution too. However, we will still disable Gromacs' own
thread affinity if it has been set by the user or calling code.

Change-Id: I57a952766e87a35483f1960b349f7c30d5b85f24

7 years agoPrint working dir before command line
Vedran Miletić [Wed, 6 Jul 2016 14:49:31 +0000 (16:49 +0200)]
Print working dir before command line

When running GROMACS via a batch script, it is useful to know which
working dir is being used for relative paths (file names) in the
command line.

Change-Id: Iab6701e09ad3b0386b59c2bdda2c4f908fdc2d0a

7 years agoMerge "Merge branch release-5-1 into release-2016" into release-2016
David van der Spoel [Fri, 8 Jul 2016 14:24:25 +0000 (16:24 +0200)]
Merge "Merge branch release-5-1 into release-2016" into release-2016

7 years agoUpdated g_wham for the new pull setup
Jochen Hub [Thu, 11 Dec 2014 11:19:58 +0000 (12:19 +0100)]
Updated g_wham for the new pull setup

This bring g_wham up to date with the new pull setup where the pull
type and geometry can now be set per coordinate and the pull
coordinate has changed and is more configurable.

Change-Id: I629fee9dfea9715e2bd54685cd1c203c66d05089

7 years agoMerge branch release-5-1 into release-2016
Mark Abraham [Fri, 8 Jul 2016 13:41:00 +0000 (15:41 +0200)]
Merge branch release-5-1 into release-2016

Change-Id: I976ad584d1c8757c6464aae482cb5a4c245beacb

7 years agoIntroduce fatal error for too few frames in gmx dos.
David van der Spoel [Fri, 8 Jul 2016 12:12:27 +0000 (14:12 +0200)]
Introduce fatal error for too few frames in gmx dos.

To prevent gmx dos from crashing with an incomprehensible error
message when there are too few frames, test for this.

Part of #1813

Change-Id: Ie2f23d68cb3d4570944c4ade5ced49873dc98a29

7 years agoSimplify SIMD compiler flag construction
Mark Abraham [Wed, 25 May 2016 13:56:33 +0000 (15:56 +0200)]
Simplify SIMD compiler flag construction

Lots of code duplication for handling both C and C++ is removed. Some
new helper functions handle the language-specific aspects separately
from the main logic. Introduced the notion of preparing the toolchain.
Removed one lot of status messages now that the try_compile status
message is more descriptive that it is checking for flags for SIMD
support.

Moved checking code that caters for ancient clang for AVX_128_FMA to a
common point, eliminating some variables. Moved that point to before
the AVX_128_FMA compiler flag tests, which seems more likely to work
in this case. This unlikely combination is of little significance,
however.

Change-Id: I5377a7951f5414ee52c4960fe63c999f55ff5109

7 years agoAdd detection for ARMv7 cycle counter support
Erik Lindahl [Thu, 7 Jul 2016 11:45:47 +0000 (13:45 +0200)]
Add detection for ARMv7 cycle counter support

ARMv7 requires special kernel settings to allow cycle
counters to be read. This change adds a cmake setting
to enable/disable counters. On all architectures but ARMv7
it is enabled by default, and on ARMv7 we run a small test
program to see if the can be executed successfully. When
cross-compiling to ARMv7 counters will be disabled, but
either choice can be overridden by setting a value for
GMX_CYCLECOUNTERS in cmake.

Fixes #1933.

Change-Id: I1e217d7a09f84a6bcf4eb5bf4a656d430465c915

7 years agoWork around compiler issue with random test
Erik Lindahl [Thu, 7 Jul 2016 23:05:17 +0000 (01:05 +0200)]
Work around compiler issue with random test

gcc-4.8.4 running on 32-bit Linux fails a few
tests for random distributions. This seems
to be caused by the compiler doing something
strange (that can lead to differences in the lsb)
when we do not use the result as floating-point
values, but rather do exact binary comparisions.
This is valid C++, and bad behaviour of the
compiler (IMHO), but technically it is not required
to produce bitwise identical results at high
optimization. However, by using floating-point
tests with zero ULP tolerance the problem
appears to go away.

Fixes #1986.

Change-Id: I252f37b46605424c02435af0fbf7a4f81b493eb8

7 years agoAdd PDF metadata to the manual
Szilárd Páll [Fri, 1 Apr 2016 21:46:46 +0000 (23:46 +0200)]
Add PDF metadata to the manual

Not only nice, but should also help search engines.
Also make sure that the PDF is UTF8 (and is tagged as unicode too).

Replaced in the bib a Unicode minus sign (U+2212) that was causing
trouble with the standard hyphen-minus.

Change-Id: I4708084282cad24b62369101e6155d99dc236981

7 years agoUser guide clarifications
Szilárd Páll [Tue, 5 Jul 2016 18:10:13 +0000 (20:10 +0200)]
User guide clarifications

Clarified OpenCL and CUDA as well as pinning in the glossary.

Change-Id: Ib3b74805812e8c02545819873e077f9d7ec9bab4

7 years agoReduce hwloc & cpuid test requirements
Erik Lindahl [Mon, 4 Jul 2016 22:45:45 +0000 (00:45 +0200)]
Reduce hwloc & cpuid test requirements

On some non-x86 linux platforms hwloc does not report
caches, which means it will fail our strict test
requirements of full topology support. There is no
problem whatsoever with this, so we reduce the
test to only require basic support from hwloc - this
is still better than anything we can get ourselves.
Similarly for CPUID, it is not an error for an
architecture to not provide any of the specific flags
we have defined, so avoid marking it as such.

Fixes #1987.

Change-Id: I0a065296bc647b7f7f5d3cb178e88df80fac81a7

7 years agoMove consistency check for number of threads
Mark Abraham [Mon, 4 Jul 2016 13:42:40 +0000 (15:42 +0200)]
Move consistency check for number of threads

Recent refactoring meant that the count of threads known to OpenMP was
only used to provide a consistency check in the fallback case of
sysconf detection.

Note that no version of the HardwareTopology code ever used
information from OpenMP as an input.

Parameters for implementing warnings currently remain in
HardwareTopology::detect(), so that the sysconf case can continue to
handle cases where we think we know how to advise the user. This
will go away in master branch with the new logging module.

Change-Id: Iaf383abc420d2f04b6514e8856c9f1414cbba55c

7 years agoChange handling for missing releng docs
Teemu Murtola [Wed, 6 Jul 2016 18:27:39 +0000 (21:27 +0300)]
Change handling for missing releng docs

Use a placeholder document from the source tree instead of generating it
on the fly in case RELENG_PATH is not set.

Also fix other warnings that got generated with RELENG_PATH not set.

Fixes #2000

Change-Id: I80b075a39eeff36e64b78cd58b09bc5bdde6ffad

7 years agoAdd user guide info on CUDA application clocks
Szilárd Páll [Tue, 5 Jul 2016 18:19:09 +0000 (20:19 +0200)]
Add user guide info on CUDA application clocks

The new paragraph explains what application clocks are, how are/can be
used as well as the specifics of the mdrun behavior.

Change-Id: Ibfd1d058d9162002ca0c1b148fc44bad29cc3180

7 years agoFix build if libcuda is found but nvcc is not
Mark Abraham [Mon, 4 Jul 2016 23:28:01 +0000 (23:28 +0000)]
Fix build if libcuda is found but nvcc is not

We require nvcc to be found by find_package, so this commit makes that
explicit. Otherwise the code doesn't understand CUDA_MAJOR_VERSION,
nor why we are setting cache variables that have no value to advanced.

Change-Id: Id7ebde308d268bf225f4b1220bc2b20c0e3e6da1

7 years agoRelax pull PBC check
Berk Hess [Tue, 21 Jun 2016 08:44:59 +0000 (10:44 +0200)]
Relax pull PBC check

The check in the pull code for COM distances close to half the box
was to strict for directional pulling. Now dimensions orthogonal
to the pull vector are no longer checked. The check was actually
not strict enough for directional pulling along x or y in triclinic
units cells, but that is a corner case.
Furthermore, the direction-periodic hint is now only printed with
geometry direction.

Added tests for the maximum pull distance calcuation.

Fixes #1962.

Change-Id: I8e389ba3f0490ca67586fd10bdc9d71d9957ab45

7 years agoDocument GMX_GPU_APPLICATION_CLOCKS
Szilárd Páll [Tue, 5 Jul 2016 16:56:46 +0000 (18:56 +0200)]
Document GMX_GPU_APPLICATION_CLOCKS

Added description for the use of the GMX_GPU_APPLICATION_CLOCKS
environment variable.

Change-Id: Id275b5a607d5b4dc23f88c71cc1eebfb5418fb50

7 years agoAdd checks for too much memory in g_nmeig
Berk Hess [Tue, 5 Jul 2016 13:29:55 +0000 (15:29 +0200)]
Add checks for too much memory in g_nmeig

g_nmeig could request storage for eigenvector output and matrices
for more than INT_MAX elements, but nearly all loop variables are int.
Now a fatal error is produced in this case. This also avoids the
confusing error message when too much memory is requeste; snew
will get the correct size, but gmx_fatal prints it as %d.
Removed double allocation of eigenvectors.
Added support for -first > 1 with sparse matrices.

Change-Id: If425457afb532a5116146cd69c3ff712f43d541d

7 years agoFixes for Power7 big-endian
Mark Abraham [Mon, 27 Jun 2016 23:37:22 +0000 (23:37 +0000)]
Fixes for Power7 big-endian

Now compiles and passes all tests in both double and single precision
with gcc 4.9.3, 5.4.0 and 6.1.0 for big-endian VSX.

The change for the code in incrStoreU and decrStoreU addresses an
apparent regression in 6.1.0, where the compiler thinks the type
returned by vec_extract is a pointer-to-float, but my attempts a
reduced test case haven't reproduced the issue.

Added some test cases that might hit more endianness cases in future.

We have not been able to test this on little-endian Power8; there is
a risk the gcc-specific permutations could be endian-sensitive. We'll
test this when we have hardware access, or if somebody runs the tests
for us.

Fixes #1997.
Refs #1988.

Change-Id: Iede0eac22504b22973f1a40d2b0180f10a34b7ed

7 years agoDisable NVIDIA JIT cache with OpenCL
Szilárd Páll [Mon, 27 Jun 2016 18:20:28 +0000 (20:20 +0200)]
Disable NVIDIA JIT cache with OpenCL

The NVIDIA JIT caching is known to be broken with OpenCL compilation in
the case when the kernel source changes but the path does not change
(e.g. kernels get overwritten). Therefore we disable the JIT caching on
NVIDIA.

Fixes #1938

Change-Id: I68749ea695a891ab8f14f07fc830ce632299b0c8

7 years agoAdd grompp check for pull group
Berk Hess [Fri, 1 Jul 2016 12:16:22 +0000 (14:16 +0200)]
Add grompp check for pull group

Added a check in grompp for valid pull groups in a pull coordinate.
Using a pull group out of range would cause invalid memory access
in grompp.

Change-Id: Icfca671cd551b618eafa67329f75efc5a7f7d945

7 years agoFix use of _POSIX_THREAD*
Mark Abraham [Wed, 1 Jun 2016 08:48:07 +0000 (10:48 +0200)]
Fix use of _POSIX_THREAD*

This fixes a couple of aspects of behaviour. Formerly, if
_POSIX_THREADS was defined and equal to zero, we might have used
clock_gettime and got some kind of error (compiling/linking/runtime
behaviour). Similarly, if _POSIX_THREADS was undefined, C99 defines
such preprocessor symbols as zero, so we again used clock_gettime
inappropriately.

Now we avoid compiler warnings if the symbol is undefined, and when it
is defined we use clock_gettime only when _POSIX_THREADS_ has a value
such that it is supposed to work.

Adapted this an the BG/Q fix also for
gmx_gettime_per_thread(). Expanded the documentation of why the code
is the way it is. Noted future TODO to consider std::chrono.

Fixes #1980

Change-Id: Ib3e40903e2344354074c5328d40e8467f264b51f

7 years agoMerge branch release-5-1 into release-2016
Mark Abraham [Wed, 29 Jun 2016 13:30:40 +0000 (15:30 +0200)]
Merge branch release-5-1 into release-2016

The changes to checks in release-5-1 to check_nthreads_hw_avail() are
all incorporated into detectLogicalProcessorCount().

Change-Id: Ifbee24dc40630988a14026b9f45cfaf6e92390ba

7 years agoRefactor sysconf checking
Mark Abraham [Wed, 29 Jun 2016 13:11:40 +0000 (15:11 +0200)]
Refactor sysconf checking

The introduction of layered checking for hardware topology left
checking based on sysconf and OpenMP applying in cases where it is
unclear whether the conclusions are valid, and surely difficult to
test reliably.

Instead, those checks should apply only to sysconf-based detection
(which is the final fallback case). Those are refactored here with a
view to code changes that will merge shortly from release-5-1.

Removed a one-line output to the debug stream.

Change-Id: Ide56fa8d6817608fba9f29a05da10034ae543b75

7 years agoWork around glibc 2.23 with CUDA
Mark Abraham [Mon, 27 Jun 2016 17:18:12 +0000 (19:18 +0200)]
Work around glibc 2.23 with CUDA

Fixes #1982

Change-Id: I24671fcbdfdf1fb8bcc178edaeb801e849959266

7 years agoProperly reset CUDA application clocks
Berk Hess [Fri, 17 Jun 2016 13:56:36 +0000 (15:56 +0200)]
Properly reset CUDA application clocks

We now store the application clock values we read when starting mdrun
and reset to these values, but only when clocks have not been changed
(by another process) in the meantime.

Fixes #1846.

Change-Id: I722d7153202e8f4c6a5330948dcbef06bb6acf28

7 years agoUpdate to include a gcc 6.1 configuration
Mark Abraham [Thu, 23 Jun 2016 12:15:16 +0000 (14:15 +0200)]
Update to include a gcc 6.1 configuration

Change-Id: I806b335f84624f143d91fc9249d29ab08ca6a05a

7 years agoFix SIMD configuration management
Mark Abraham [Wed, 25 May 2016 06:40:10 +0000 (08:40 +0200)]
Fix SIMD configuration management

Subsequent runs of cmake gave inconsistent diagnostic messages because
SUGGEST_BINUTILS_UPDATE was not set on subsequent runs because we were
caching the result of logic, as well as caching the results of
compilation tests. This made life confusing, e.g. when compiling with
gcc on MacOS with clang assembler not available.

Instead, we now re-run the fast logic (quietly, if this is a
subsequent run).

Improved the handling of ${VARIABLE}, because there was no need to use
FORCE because the semantics of an unset variable in CMake just work.
There was also no need for such variables to be put into the cache,
and we were using one more variable than we needed to use. This meant
it was no longer worth implementing the redundant hints about perhaps
updating the binutils package, nor suppressing the redundant special
status-line output.

Noted some TODOs for future simplification. Changed the use of SIMD to
SOURCE, since this utility code doesn't have to relate to SIMD flags.

Change-Id: Id9605ccff0903c55e2621ddd8af10c8da523bebe

7 years agoRemoved unnecessary inter-simulation signalling
Mark Abraham [Tue, 25 Nov 2014 20:23:37 +0000 (21:23 +0100)]
Removed unnecessary inter-simulation signalling

Generally, multi-simulation runs do not need to couple the simulations
(discussion at #692). Individual algorithms implemented with
multi-simulations might need to do so, but should take care of their
own details, and now do. Scaling should improve in the cases where
simulations are now decoupled.

It is unclear what the expected behaviour of a multi-simulation should
be if the user supplies any of the possible non-uniform distributions
of init_step and nsteps, sourced from any of .mdp, .cpt or command
line. Instead, we report on the non-uniformity and proceed. It's
always possible that the user knows what they are doing. In
particular, now that multi-simulations are no longer explicitly
coupled, any heterogeneity in the execution environment will lead to
checkpoints and -maxh acting at different time steps, unless a
user-selected algorithm requires that the simulations stay coordinated
(e.g. REMD or ensemble restraints).

In the implementation of signalling, we have stopped checking gs for
NULL as a proxy for whether we should be doing signalling at that
communication phase. Replaced with a helper object in which explicit
flags are set. Added unit tests of that functionality.

Improved documentation of check_nstglobalcomm. mdrun now reports the
number of steps between intra-simulation communication to the
log file.

Noted minor TODOs for future cleanup.

Added some trivial test cases for termination by maxh in normal-MD,
multi-sim and REMD cases. Refactored multi-sim tests to make this
possible without duplication. This is complicated by the way filenames
get changed by mdrun -multi by the former par_fn, so cleaned up the
way that is handled so it can work and be re-used better. Introduced
mdrun integration-test object library to make that build system work a
little better. Made some minor improvements to Doxygen setup for
integration tests.

Fixes #860, #692, #1857, #1942.

Change-Id: I5f7b98f331db801b058ae2b196d79716b5912b09

7 years agoUse sysconf(_SC_NPROCESSORS_ONLN)
Berk Hess [Wed, 15 Jun 2016 21:38:47 +0000 (23:38 +0200)]
Use sysconf(_SC_NPROCESSORS_ONLN)

If we're not on ARM and sysconf(_SC_NPROCESSORS_ONLN) doesn't match
sysconf(_SC_NPROCESSORS_CONF), we should use the former, as that is
what the correct count on x86 with hyperthreading disabled in the kernel.

Added some comments on assumptions and future possible problems.

Fixes #1991.

Change-Id: Id851b8acfbd6b9a2837e8c0e4340b2267a35a20a

7 years agoMerge branch release-5-1 into release-2016
Mark Abraham [Mon, 27 Jun 2016 14:08:42 +0000 (16:08 +0200)]
Merge branch release-5-1 into release-2016

Omitted the patch that removed support for mdrun -multi -maxh, since
support for that will be reinstated very shortly.

Change-Id: I10e71dddc5c4fb8f32425da7390b64d64e4b16dd

7 years agoMade gmx dos work again.
David van der Spoel [Mon, 27 Jun 2016 12:47:24 +0000 (14:47 +0200)]
Made gmx dos work again.

Due to an error in the index handling gmx dos always stopped with a fatal
error.

Fixes #1996

Change-Id: Iba7685c1e1b86acc92427902a2187eb4e6c9f260