alexxy/gromacs.git
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

7 years agoFix vsite bug with MPI+OpenMP
Berk Hess [Wed, 1 Jun 2016 09:36:41 +0000 (11:36 +0200)]
Fix vsite bug with MPI+OpenMP

The recent commit b7e4f30d caused non-local virtual sites not be
treated when using OpenMP. This means their coordinates lagged one
step behind and their forces are not spread to the atoms, leading
to small errors in the forces. Note that non-local virtual sites are
only used when local virtual sites use them as a constructing atom;
the most common case is a C/N in a CH3/NH3 group with vsite H's.
Also added a check on the vsite count for debug builds.

Fixes #1981.

Change-Id: Ibe13b75b8ae9841937ad4abc007dba5ad78a30cd

7 years agoFix Verlet buffer calculation with nstlist=1
Berk Hess [Thu, 23 Jun 2016 15:41:00 +0000 (17:41 +0200)]
Fix Verlet buffer calculation with nstlist=1

Under rare circumstances the Verlet buffer calculation code was
called with nstlist=1, which caused a division by zero. The division
by zero is now avoided.
Furthermore, grompp now also determines and prints the Verlet buffer
sizes with nstlist=1, which provider the user information and adds
consistency checks.

Fixes #1993.

Change-Id: I6777f9c18dfcdaee0e4fe3e4609704fb48b5c138

7 years agoMore accurate GPU list splitting
Berk Hess [Tue, 5 Apr 2016 21:23:25 +0000 (23:23 +0200)]
More accurate GPU list splitting

Instead of splitting the GPU lists (to generate more work units)
based on a maximum cut-off, we now generate lists as close to
the target list size as possible. This is more accurate and has
the advantage that we don't use assumptions on the j-group sizes.

Change-Id: I3942a1f42e3d9a2163897030762652ed309d8cf1

7 years agoAllow use of external lmfit package
Mark Abraham [Tue, 7 Jun 2016 17:07:56 +0000 (19:07 +0200)]
Allow use of external lmfit package

For packaging GROMACS for software distributions, we need to permit
maintainers to use external system libraries, rather than the versions
we bundle for convenience for general GROMACS users.

This patch implements the CMake option GMX_EXTERNAL_LMFIT. It
implements FindLmfit.cmake, which relies heavily on pkg-config, which
is supported by lmfit and widely available in the intended use case
(ie distribution maintainers), but can be worked around if lmfit is
available and pkg-config is not and somehow an external lmfit is
needed.

lmfit management now needs to happen at a higher point in the GROMACS
build system, so I have refactored the source code files that use
lmfit functionality. The former gmx_lmcurve.cpp in src/external was in
fact GROMACS code that calls the lmmin routine from lmfit and declares
a suitable callback, so it should never have been in
src/external. Moved it (and its header) to
src/gromacs/correlationfunctions.

Reverted the introduction of gmx_ prefixes in an earlier commit - that
approach permits a third party to link to their own lmfit without
symbol clashes, but doesn't resolve the distribution problem. If both
clients of lmfit can use the same external version, then the problem
is solved, and if each need a different version then there are various
further options. Updated the README accordingly, and noted various
other differences from stock lmfit 6.1.

Added file-level Doxygen for some files. Added mention to install
guide.

The implementation is quiet upon repeat cmake runs, and makes only
advanced or internal cache variables.

Fixes #1957

Change-Id: Ib05eee796c6cf13ea90d456cb9b54b166bfda717

7 years agoPrevent use of mdrun -maxh -multi
Mark Abraham [Thu, 23 Jun 2016 12:53:55 +0000 (14:53 +0200)]
Prevent use of mdrun -maxh -multi

A proper fix can probably be made in release-2016, and if so, the
content of this commit should not be merged forward.

Refs #1942

Change-Id: Ie7e6c0ca25fba09ad1794cacbe116b03e95ff0f9

7 years agoUpdated OpenCLTODOList.txt
Berk Hess [Tue, 21 Jun 2016 09:18:25 +0000 (11:18 +0200)]
Updated OpenCLTODOList.txt

Change-Id: I704a5e40b0aa2382fb35e9fb09f99580cd75a020

7 years agoFix configuration-time cpuinfo code
Mark Abraham [Thu, 9 Jun 2016 01:49:32 +0000 (03:49 +0200)]
Fix configuration-time cpuinfo code

Was broken by merge 7139bb20, and left incomplete in 4ce2aa504d
because of the existing duplication of cpuinfo code.

Change-Id: I72c3c12e7b523f03420d251d87271e5e7f87f71b

7 years agoRemoved spurious r_ij in force for Morse potential in manual.
David van der Spoel [Tue, 21 Jun 2016 13:25:41 +0000 (15:25 +0200)]
Removed spurious r_ij in force for Morse potential in manual.

The code was correct though.

Change-Id: Ia3459569de08b3bf1eb79206ff13092a555c27cb

7 years agoMerge branch release-5-1 into release-2016
Mark Abraham [Wed, 22 Jun 2016 08:22:48 +0000 (10:22 +0200)]
Merge branch release-5-1 into release-2016

Change-Id: I175bb4c5d313a33c0c95446f85b1af2128ce301c

7 years agoAdd nbnxn pair-list rebalancing
Berk Hess [Sat, 14 May 2016 15:09:04 +0000 (17:09 +0200)]
Add nbnxn pair-list rebalancing

The nbnxn CPU pair-lists, and the non-bonded tasks can be unbalanced
over threads, especially for small systems. This change implements
pair-list rebalancing that result in near perfect load-balancing.
This increases the search cost by 3%, but this is outweighed by the
more balanced non-bonded kernel times.

Change-Id: I64e7395127faf193cabe48146e554c696bf76a51

7 years agoRemove OpenMP overhead at high parallelization
Berk Hess [Mon, 16 May 2016 20:33:27 +0000 (22:33 +0200)]
Remove OpenMP overhead at high parallelization

Commit 6d98622d introduced OpenMP parallelization for for loops
clearing rvecs of increasing rvecs. For small numbers of atoms per
MPI rank this can increase the cost of the loop by up to a factor 10.
This change disables OpenMP parallelization at low atom count.

Change-Id: I0006526568bb387f91e0a373f7ef203b3809f2e7

7 years agoCorrect GPU pair estimate for list splitting
Berk Hess [Wed, 24 Feb 2016 22:00:03 +0000 (23:00 +0100)]
Correct GPU pair estimate for list splitting

The heuristic estimate for the number of cluster pairs is now too
high by 0-1% instead of 10%. This results is a few percent fewer
pair lists, but still slightly more than requested.

Change-Id: I2e8305a2152913f161a5f47643e8cd7510e81fec

7 years agoAdjust and document C++11 compiler tests
Mark Abraham [Thu, 9 Jun 2016 11:42:21 +0000 (13:42 +0200)]
Adjust and document C++11 compiler tests

icc 16.0.0 didn't cope with the previous form, because it wants to use
a base-class copy constructor to implement the return. Disabled the
new move-constructor test for early patch releases of icc 16, but left
it active in the cases where it (is expected to) pass.

Change-Id: Iff3d52c7bc4180a33c495b7c73bb1328bb18764a

7 years agoPrevent writing to unallocated memory in mk_specbonds
Vedran Miletić [Tue, 21 Jun 2016 13:53:42 +0000 (15:53 +0200)]
Prevent writing to unallocated memory in mk_specbonds

Stop creating new specbonds after at most nspec bonds have been created
to prevent writing to unallocated memory.

Change-Id: I53f9d20059915e7fba8767b92d92fa751e9165e3

7 years agoFix bug with fbposres+MPI+OpenMP
Berk Hess [Fri, 10 Jun 2016 09:58:10 +0000 (11:58 +0200)]
Fix bug with fbposres+MPI+OpenMP

The flat-bottom reference coodinates got mixed up when running with
MPI + OpenMP.

Fixes #1969.

Change-Id: Idcac7ae03e1f7018bc7b65de37a3d63abe8ebefc

7 years agoUpdate pre-submit matrix contents
Mark Abraham [Thu, 9 Jun 2016 12:07:15 +0000 (14:07 +0200)]
Update pre-submit matrix contents

Converted a config so that we have one that uses neither MPI. Also
needed an incidental fix for the  build script to make that work.

Refs #1693

Change-Id: Ieebc939f6c9cf1d3a84681ce212e61059053cf55

7 years agoRemove warnings on checkpoint mismatch
Berk Hess [Thu, 16 Jun 2016 10:32:41 +0000 (12:32 +0200)]
Remove warnings on checkpoint mismatch

mdrun now only warns for mismatch in minor version, build or
number of ranks used when reproducibility is requested.
Also added a separate message for not matching precision.

Fixes #1992.

Change-Id: Ia20e6beff86484f0b70148c155cdb53fed012136

7 years agoImprove docs for linking stdlibc++ needed by icc
Mark Abraham [Fri, 10 Jun 2016 09:48:28 +0000 (11:48 +0200)]
Improve docs for linking stdlibc++ needed by icc

Change-Id: Ibbce9588c090c142ea8b62111818d2788b52a37b

7 years agoRemove std::thread::hardware_concurrency()
Berk Hess [Wed, 15 Jun 2016 21:23:27 +0000 (23:23 +0200)]
Remove std::thread::hardware_concurrency()

We should not use std::thread::hardware_concurrency() fo determining
the logical processor count, since it only provides a hint.
Note that we still have 3 different sources for this count left.

Change-Id: Id536e517419bb33294693d91b6f010d0d5342352

7 years agoReport the filename and the line number on failure
Vedran Miletić [Wed, 15 Jun 2016 14:15:40 +0000 (16:15 +0200)]
Report the filename and the line number on failure

Extend the call to gmx_fatal in fget_lines() to report the filename and
the line number where the read failed.

Change-Id: Ib5ee06c06111cb61be616a5a4d01339da56a5685

7 years agoMerge branch release-5-1 into release-2016
Mark Abraham [Fri, 17 Jun 2016 10:30:52 +0000 (12:30 +0200)]
Merge branch release-5-1 into release-2016

Change-Id: I02dae90bd8dfa2279081bc8547ae447b68b30a76

7 years agoFix multi-sim + DD + simple distance restraints
Mark Abraham [Sun, 12 Jun 2016 14:47:37 +0000 (16:47 +0200)]
Fix multi-sim + DD + simple distance restraints

The check should not look for the existence of a multi-sim, because
the user must also set GMX_DISRE_ENSEMBLE_SIZE in order to get
ensemble restraints.

Fixes #1989

Change-Id: Id8c9aeefb17583a6ef9ef5caf46232bc384f2ecd

7 years agoFix OpenCL error with empty domains
Berk Hess [Tue, 14 Jun 2016 12:36:16 +0000 (14:36 +0200)]
Fix OpenCL error with empty domains

We now don't call the force clearing when there are zero elements
to clear, as can happen with an empty domain with DD.
Also simplified the clearing thread count calculation.

Fixes #1990.

Change-Id: Idc3e42140ac73714475af0918febbf4cac8e43f7

7 years agoFix CUDA build with multiple compilation units
Szilárd Páll [Thu, 9 Jun 2016 01:32:52 +0000 (03:32 +0200)]
Fix CUDA build with multiple compilation units

An unnecessary include slipped in with the 7139bb20 merge which caused
the (non-default) multiple compilation unit builds to fail. This change
removes the offending include.

Change-Id: I5671df3b64e880f2bed02366ad3a7302647c64dc

7 years agoHandle constraint errors with EM
Berk Hess [Fri, 10 Jun 2016 19:57:51 +0000 (21:57 +0200)]
Handle constraint errors with EM

All energy minimizers could fail with random errors when constraining
produced NaN coordinates.
Steepest descents now rejects steps with a constraint error.
All other minimizer produce a fatal error with the suggestion to use
steepest descents first.

Fixes #1955.

Change-Id: Ie2f7ad4039634d3c5f2597171ec47d6a145c5fcb

7 years agoFind python for docs build quietly
Mark Abraham [Fri, 10 Jun 2016 07:03:18 +0000 (09:03 +0200)]
Find python for docs build quietly

Machines that don't have a suitable python don't need
to emit that message upon every run of cmake.

Change-Id: I09025c4a55539ba8c16d0dca486fa5b46a739ba6

7 years agoDisable static libcudart on OS X
Erik Lindahl [Thu, 26 May 2016 22:34:51 +0000 (00:34 +0200)]
Disable static libcudart on OS X

Recent versions of CMake enable a static version of
libcudart by default, but this breaks builds at least
on the most recent version (10.11) of OS X, so we
disable it on this platform.

Change-Id: I2cc9c3dc600c1c72a461c482888f38d33a33eb7a

7 years agoMerge branch release-5-1 into release-2016
Mark Abraham [Tue, 7 Jun 2016 23:14:01 +0000 (01:14 +0200)]
Merge branch release-5-1 into release-2016

Conflicts:
CMakeLists.txt

Adjacent unrelated changes, trivial resolution

cmake/gmxDetectSimd.cmake

Two unrelated fixes, managing the new GMX_STDLIB_LIBRARIES better, and
working around the fact that we can't use try_run with noisy
compilers. The new context invalidates the suggestion to use try_run
once we require CMake 2.8.11.

cmake/gmxSetBuildInformation.cmake

As above.

src/gromacs/commandline/filenm.h

Adjacent changes caused by introducing Doxygen

src/gromacs/fileio/filetypes.cpp

As above

src/gromacs/legacyheaders/force.h

Change to function signature to pass const char *fn.

src/gromacs/mdlib/forcerec.cpp

Minor clashes from reorganized include files.

TODO make_bonded_tables was refactored in release-5-1 to need
t_filenm, which reintroduces a dependency on
commandline/filenm.h. Decide what to do about this.

src/gromacs/mdlib/mdatoms.cpp

git was confused about the frozen-atom fix because of the indenting
change, but the merge is straightforward in terms of code logic.

src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda.cu

New Doxygen in release-2016 clashed with introducing support for CUDA
6.0/6.1.

src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh

As above

src/gromacs/tables/forcetable.cpp

Change to function signature to pass const char *fn.

src/programs/mdrun/tests/CMakeLists.txt

Adjacent new files introduceed in both branches

Change-Id: Iaaffacc186aa5ff67c83522d2c07b05afeec75b2

7 years agoRe-add support for linking against external TinyXML-2
Mark Abraham [Thu, 12 May 2016 15:39:18 +0000 (17:39 +0200)]
Re-add support for linking against external TinyXML-2

I always intended this support, to permit convenient packaging of
GROMACS by distributions, but it got lost from gerrit while rebasing
from patch set 4 to 5 of I6153136.

Fixes #1956

Change-Id: Ie76dc9e8c6116814439d813d5a9555c5bfb7bfc5

7 years agoUpdates to documentation
Mark Abraham [Wed, 30 Mar 2016 21:53:34 +0000 (23:53 +0200)]
Updates to documentation

Moved TNG management code into its own file, and called from a normal
place, so that the minimum requiried TNG version can be automatically
documented.

Change-Id: I4223a6339d635311cbe013e21c757e4065580271

7 years agoAdded manual section about embedding proteins to membranes.
Semen Yesylevskyy [Fri, 1 Apr 2016 13:42:30 +0000 (16:42 +0300)]
Added manual section about embedding proteins to membranes.

Very short paragraph referencing needed papers and linking to user guide for details.

Fixes #1932

Change-Id: I0511576f06be35f1727a22c0d1e5f6552f1ae06d

7 years agoFix data race in hwinfo with thread-MPI
Berk Hess [Fri, 3 Jun 2016 09:04:34 +0000 (11:04 +0200)]
Fix data race in hwinfo with thread-MPI

Fixes #1983.

Change-Id: Ic44d2c1e595796132127364900d4d995379b3175

7 years agoAdd support for CUDA CC 6.0/6.1
Szilárd Páll [Tue, 31 May 2016 12:47:30 +0000 (14:47 +0200)]
Add support for CUDA CC 6.0/6.1

This change adds build-system and kernel generator support for the
Pascal architectures announced so far (GP100: 6.0, GP104: 6.1) and
supported by the CUDA 8.0 compiler.

By default we now generate binary as well as PTX code for both sm_60 and
sm_61 and given the considerable differences between the two, we also
generate PTX for both virtual arch. For now we don't add CC 6.2 (GP102)
compilation support as know nothing about it.

On the kernel generation side, given the increased register file, for
CC 6.0 the "wider" 128 threads/block kernels are enabled, on 6.1 and
later the 64 threads/block remains.

Some macros that were incorrectly left behind by the adbada4 fix had to
be eliminated from the CUDA host code because these caused double
definitions.

Change-Id: I7f465651125fe135255ce5c84db644c62caeea6b

8 years agoCheck number of items read in mdp statements
Erik Lindahl [Sun, 22 May 2016 21:29:24 +0000 (23:29 +0200)]
Check number of items read in mdp statements

Added checks for the number of items read in all
sscanf() statements processing data from the mdp
file.

Fixes #1945.

Change-Id: Iecb5e3c7018570fb3a299624ac936c26d03294eb

8 years agoWrite OpenCL build log prior to checking build status
Vedran Miletić [Thu, 2 Jun 2016 14:31:48 +0000 (16:31 +0200)]
Write OpenCL build log prior to checking build status

If building an OpenCL kernel fails, we still want to let the user know
why the build process failed. Therefore the code has to write the build
log prior to throwing a build failure exception.

Change-Id: I2a8881895379da9ce4b13cf34788357347f1050c

8 years agoHandle partially frozen and constrained atoms
Berk Hess [Thu, 2 Jun 2016 12:21:41 +0000 (14:21 +0200)]
Handle partially frozen and constrained atoms

Atoms frozen along some, but not all dimensions would still be moved
along all dimensions by constraints. Now such dimensions are frozen.
Note that the initial configuration might not obey the constraints,
which leads to conflicting demands of freezing and constraining.
Partially frozen atoms in the initial configuration will still be
constrained along all dimensions (but will be frozen during the run).

Fixes #1960.

Change-Id: Ic4d43a2840fabc084aec4237abf6a589eaa72f37

8 years agoFix compatibility with older CMake
Mark Abraham [Thu, 26 May 2016 12:08:37 +0000 (14:08 +0200)]
Fix compatibility with older CMake

LINK_LIBRARIES is introduced in 2.8.11. We don't test anywhere that
CMake hardware detection works.

Change-Id: Icb5812c3971219085b8e91634e4cd08451041118

8 years agoMake more CMake variables advanced
Mark Abraham [Wed, 1 Jun 2016 11:38:28 +0000 (13:38 +0200)]
Make more CMake variables advanced

This keeps the ccmake display down to things users are reasonably
likely to want to change.

Fixes #1764

Change-Id: Ia78387bb32f5d6c7f6b82e453b155fdf657a044a

8 years agoIgnore stderr when detecting SIMD and build info
Mark Abraham [Mon, 30 May 2016 20:02:57 +0000 (22:02 +0200)]
Ignore stderr when detecting SIMD and build info

Cray and some other stupid compilers echo extra stuff to stderr when
compiling a normal source file. Unfortunately, the standard CMake
try_run cannot ignore stderr.

Refactored some try_run calls to try_compile + try_run. This
incidentally makes build-host detection run faster because the same
binary is not compiled multiple times. The results of the detections
are now set up so that an initial default value is constructed,
replaced if the compilation and run both succeed, before finally being
cached.

Noted some TODOs for future cleanup of the duplication in such code.

Fixes #1881.

Change-Id: Icb770872f853cff3ef60426d9980f463341eb1cf

8 years agoAdd env. var. to enable OpenCL caching
Szilárd Páll [Mon, 30 May 2016 19:51:10 +0000 (21:51 +0200)]
Add env. var. to enable OpenCL caching

OpenCL binary caching is disabled by default (due to concurrency and
versions not being safely handled), but during development, being
able to avoid the kernel compilation overhead can speed up testing and
benchmarking tremendously. This change adds an environment variable
that can be used to manually trigger binary caching.

Change-Id: I5879acf040216ad75dbb54e7ecec001aae8af8a5

8 years agoFix OpenCL binary cache file name generation
Szilárd Páll [Mon, 30 May 2016 15:52:18 +0000 (17:52 +0200)]
Fix OpenCL binary cache file name generation

The binary cache names was generated from the full path prefixed
with a constant string which is a not a valid filename.

Also added assertion on the file pointer passed to fclose.

Change-Id: I838cf9a2e19385afaf26b80a15be2b74973d3a4c

8 years agoFix ICC 16u3 build
Roland Schulz [Tue, 31 May 2016 17:39:07 +0000 (11:39 -0600)]
Fix ICC 16u3 build

The C++11 check was triggering a bug in a corner case (empty
defaulted move constructor), which wasn't present in the actual
code.

Change-Id: I650580497fe2ad9b67777d2f8a216cdb2c14bf12

8 years agoEnsure IMD include dependencies work
Patrick Welche [Tue, 31 May 2016 11:34:19 +0000 (12:34 +0100)]
Ensure IMD include dependencies work

Makes sure select() and the necessary struct types are declared.

Fixes #1978

Change-Id: I3f7e545c95f26b5cf0398ed14e6206c08ba9735d

8 years agoImprove make_ndx help text
Teemu Murtola [Tue, 31 May 2016 19:24:38 +0000 (22:24 +0300)]
Improve make_ndx help text

Clarify the use of boolean operators.  The old help text could
incorrectly hint that AND, OR, and NOT would work as keywords.
Add a reference to gmx select that in most cases can serve as a
replacement.

Fixes #1976.

Change-Id: I0284c849c398e5b09569453d7d0f19b9639a6d0c

8 years agoFix reference to vmdio.c to be vmdio.cpp
Mark Abraham [Tue, 31 May 2016 13:00:17 +0000 (15:00 +0200)]
Fix reference to vmdio.c to be vmdio.cpp

Fixes #1979

Change-Id: I441ad6ace31325a6804f6031f32a1ca4600766e5

8 years agoSecond 2016 beta release
Mark Abraham [Mon, 30 May 2016 07:29:13 +0000 (09:29 +0200)]
Second 2016 beta release

Change-Id: I6350da03d04580da4b1bd11dc66fa79dbef9a47e

8 years agoReposition nbnxn filler particles
Berk Hess [Fri, 27 May 2016 12:13:40 +0000 (14:13 +0200)]
Reposition nbnxn filler particles

As particles are now allowed to overlap in the nbnxn kernels,
the ugly, complicated scheme to create different coordinates for
the filler particles in nbnxn cells can be removed.

Change-Id: Ic25c3b4bc82065b2b6b25f721d34eda3e6c23c0e

8 years agoAvoid numerical overflow with overlapping atoms
Berk Hess [Wed, 25 May 2016 13:19:02 +0000 (15:19 +0200)]
Avoid numerical overflow with overlapping atoms

The verlet kernels did not allow overlapping atoms, even if they were
not interacting (in contrast to the group kernels). Fixed by clamping
the interaction distance so it can not become smaller than ~6e-4
in single and ~1e-18 in double, and when this number is later
multiplied by zero parameters it will not influence forces. The
clamping should never affect normal interactions; we would previously
crash for distances that were this small.
On Haswell, RF and PME kernels get 3% and 1% slower, respectively.
On CUDA, RF and PME kernels get 1% and 2% faster, respectively.

Fixes #1958.

Change-Id: I83b88f0e9ca34dc151a8b907f334a95a1a4301cc

8 years agoAdd check for finite energies
Berk Hess [Thu, 26 May 2016 10:01:26 +0000 (12:01 +0200)]
Add check for finite energies

Added a check for finite total potential energy. This check is nearly
free and can catch issues with incorrectly set up systems before users
get a confusing constraint or PME error. Note that this check is only
performed at steps where energies are calculated, so it will often
not catch an exploding system.

Change-Id: If33245a96cecae78c9077a825cb22335c853a810

8 years agoAdd grompp check for unbound atoms
Berk Hess [Sat, 28 May 2016 07:22:37 +0000 (09:22 +0200)]
Add grompp check for unbound atoms

grompp now print a note for atoms that are not connected by
a potential or constraint to any other atom in the same moleculetype,
since this often means the user made a mistake.

Refs #1958.

Change-Id: Iabb00563c76a9f7954f84d89d1c67d438f2c31ff

8 years agoSimplified and updated OpenCL compilation
Mark Abraham [Fri, 5 Feb 2016 23:01:18 +0000 (23:01 +0000)]
Simplified and updated OpenCL compilation

Moved into gmx and new ocl namespace, updated variable naming, updated
string handling, treated many more error conditions, also with
exceptions, used more RAII, used more of the standard GROMACS
utility infrastructure.

Removed some string databases functions that existed merely to be
looked up once.

Changed to write OpenCL build log to file pointer provided by the
caller, if needed, rather than a separate file. This currently uses
stderr, so can't yet work well with multiple ranks, but neither did
the old approach. We need a proper MPI-aware logging module, first.

Separated the caching functionality into its own source file. Changed
the naming of binary cache to reflect the name of the kernel source
file whose binary is being cached. Noted further requirements if we
would re-activate caching at some point, but since it is still
de-activated, this is not worth further effort now.

Removed the requirement that we must be able to read source code, if
instead a binary cache is available.

Required that compileProgram compile kernels for the vendor of the
target device. This was always the behaviour, but there is no reason
to be able to select alternative things there.

Simplified the passing of preprocessor defines required by the caller
of compileProgram to the JIT compilation.

Removed use of GMX_OCL_FORCE_CPU in log file coordination, as CPU
OpenCL devices are not supported.

Refs #1720

Change-Id: I25e78526f55715c779819e96d6bf6b52ad9394c6

8 years agoFix build with clang 3.1+3.2
Roland Schulz [Thu, 26 May 2016 17:47:59 +0000 (10:47 -0700)]
Fix build with clang 3.1+3.2

Change-Id: I8bffaa081d4cf52662e46fcd6c58667b4528fa04

8 years agoDetect the usage of hwtop XML caching
Erik Lindahl [Sun, 22 May 2016 16:40:43 +0000 (18:40 +0200)]
Detect the usage of hwtop XML caching

The environment variable HWLOC_XMLFILE can be used
to speed up hwloc detection e.g. on Xeon Phi. Documented
in the user guide, and made sure we detect when such
caching was used to avoid strange future bug reports.

Fixes #1946.

Change-Id: Id99385fb7cc1e2692fb9b06fa187424058aaa213

8 years agoFix reading of bonded tables
Mark Abraham [Thu, 3 Mar 2016 15:04:16 +0000 (16:04 +0100)]
Fix reading of bonded tables

The old approach specified only a filename prefix, and init_forcerec
would expect to be able to append _b0 to generate the filename for the
zeroth bonded table, etc. This failed a check in early command-line
parsing when no file that matched just the prefix could be found.
Pairs are unaffected because there's only one table. Short-ranged
energy-group tables are not affected because they require that the
file with default name exists.

Command-line parsing now requires -tableb to name all tabulated bonded
interaction table files explicitly, and does the normal check that
they exist. init_forcerec will find any name in that list that matches
the required pattern. The concept of a default filename prefix for
tabulated bonded interactions no longer applies, but the old
'table_b0.xvg' naming still works. Added some comments and Doxygen to
explain what the old code was doing. Amended the user documentation
suitably.

One could add further checks e.g. that there are no table filenames
provided that are unused by the topology, but it is likely the need
for such checks will go away when the topology will name the files
directly.

Add some integration tests to show the functionality no longer
produces an error. Infrastructure to actually verify energies and
forces is waiting for review in Gerrit.

Expanded some string- and filename-handling infrastructure to meet
the new needs.

Improved the robustness of the check that the derivative column is
approximately the negative of the numerical derivative of the value
column.

Fixes #1913

Change-Id: If0a7cd69a40eb95fbda20eaaf4c3002782772f0e

8 years agoNew quote
Mark Abraham [Thu, 26 May 2016 11:53:14 +0000 (13:53 +0200)]
New quote

Change-Id: I1f36460618cd9fd919e5f3117934bfd3d939e76f

8 years agoFix bug in v-rescale thermostat & replica exchange
Berk Hess [Mon, 23 May 2016 12:42:49 +0000 (14:42 +0200)]
Fix bug in v-rescale thermostat & replica exchange

Commit 2d0247f6 made the random normally distributed number for the
v-rescale thermostat constant for a run only depending on ld-seed,
and moved a reset for replica exchange inside the multi-exchange
branch.

Fixes #1968.

Change-Id: Iadc38ccadb99c6c1232756fd595843a01e5f3ce8

8 years agoDisable automated FFTW3 builds on Windows
Erik Lindahl [Tue, 17 May 2016 14:57:19 +0000 (15:57 +0100)]
Disable automated FFTW3 builds on Windows

The FFTW distribution does not include configurations to
build it automatically on windows, in particular not through
the ./configure; make; make install triad.

Fixes #1961.

Change-Id: Ifff74a0c80118b70da7ce4f8e26d2f2ee8fdc300

8 years agoAdd reference to TopoTools 1.6
Roland Schulz [Fri, 13 May 2016 18:56:18 +0000 (11:56 -0700)]
Add reference to TopoTools 1.6

Can help with topologies not supported by pdb2gmx.

Change-Id: I1df49f7fe8b9e918a2b8ad4a8a116ad865f2f9a0

8 years agoFix some thread affinity cases
Teemu Murtola [Sun, 15 May 2016 10:15:58 +0000 (13:15 +0300)]
Fix some thread affinity cases

Fix one deadlock found by unit tests in master: this happened with
automatic pinning, if only part of the nodes were full.

Do not produce extra warnings when an earlier check has already failed.
This got broken by last-minute simplification of the conditionals in the
previous change; now it should be both easy to understand, and
correct...

There is one deadlock still theoretically possible: if thread-MPI
reports that setting the affinity is not possible only on a subset of
ranks, the code deadlocks.  This has always been there and might never
happen, so it is not fixed here.

Change-Id: I70ddda31c9510d1c215be4d523453d1b5fc1c15d

8 years agoDon't use abort for fatal errors
Roland Schulz [Wed, 11 May 2016 20:07:49 +0000 (13:07 -0700)]
Don't use abort for fatal errors

Fixes #1866

Change-Id: I44330ef3769c684fbd0c8ffd7e8987d733006a67

8 years agoMerge branch release-5-1 into release-2016
Mark Abraham [Thu, 12 May 2016 22:07:37 +0000 (00:07 +0200)]
Merge branch release-5-1 into release-2016

Change-Id: I4195829e82c50f3d0aa04644a99ae53beb2e24c3

8 years agoGROMACS 2016 beta1 release
Mark Abraham [Tue, 10 May 2016 15:25:07 +0000 (17:25 +0200)]
GROMACS 2016 beta1 release

Change-Id: Ifed8cb0e7ea686ee5f1ade36c6ffe701e60f41f4

8 years agoRemove static function qualifier in OpenCL kernel utils
Vedran Miletić [Wed, 11 May 2016 12:47:32 +0000 (14:47 +0200)]
Remove static function qualifier in OpenCL kernel utils

Static function qualifiers are supported since OpenCL 1.2. When Mesa 3D
Gallium Clover state tracker is used on AMD Radeon GCN cards, it only
provides OpenCL 1.1 support, so static function qualifiers are not
supoorted.

Change-Id: I6d7aceabefeb0ce825b698962830201728bc56d7

8 years agoUse STRLEN for buf
James W. Barnett [Wed, 11 May 2016 20:04:54 +0000 (15:04 -0500)]
Use STRLEN for buf

Change-Id: Idad6bfb340160c96aa979943aee32c3b909940a5

8 years agoFixed large file issue on 32-bit platforms
Erik Lindahl [Tue, 10 May 2016 22:19:49 +0000 (00:19 +0200)]
Fixed large file issue on 32-bit platforms

At some point gcc started to issue a warning
instead of a fatal error for the checking
code; fixed to really generate an error now.

Fixes #1834.

Change-Id: I5827f358b22de516becaac02d81229b82b02297b

8 years agoAdditional Jenkins documentation
Teemu Murtola [Sat, 30 Apr 2016 12:18:19 +0000 (15:18 +0300)]
Additional Jenkins documentation

Some additional content could be added, but now there are at least a few
words on each of the build types.  The overall structure of the
Jenkins-related user-/developer-facing documentation should now be
there, though.  Significant part of the Jenkins-related documentation is
in the releng repo, which is now more clearly referenced from here where
relevant.

Related to #1731.

Change-Id: If71cb725f966ea5acd72585fb3a1aa65e1a269ff

8 years agoBump clang static analyzer to version 3.8
Mark Abraham [Wed, 30 Mar 2016 03:58:26 +0000 (05:58 +0200)]
Bump clang static analyzer to version 3.8

This seems to avoid false positive issues in AWH code with
the old version in clang 3.4.

Changed the way clang-analyzer is matched to a slave - now
the version is part of the analyzer specification.

Addressed a minor false positive, apparently caused by the analyzer
being unable to be sure that posfn won't change its emptiness.

Change-Id: Ia7e571542b361a03d0cba7c061a1a970c24be44f

8 years agoMinor update to sphinx dependency
Mark Abraham [Tue, 10 May 2016 15:40:05 +0000 (17:40 +0200)]
Minor update to sphinx dependency

Jenkins is using a new version of sphinx, and that warns that pngmath
is deprecated. So we replace that with the suggested imgmath.

Change-Id: I40dbc5f04565391535ea7d59aba0d23a3a206805

8 years agoInclude releng documentation to developer guide
Teemu Murtola [Sat, 3 Oct 2015 19:38:32 +0000 (22:38 +0300)]
Include releng documentation to developer guide

Include the rst documentation from releng repository into the developer
guide.  This mainly adds the infrastructure to do this; actual
documentation formatting is not yet very nice...  If releng is not
available, a dummy page is inserted instead.

Split general information about the build tree into a separate file from
gmxVersionInfo.cmake.

Sphinx 1.3 is required to be able to parse Google-style docstrings into
the documentation.

sphinx.ext.pngmath is deprecated in Sphinx 1.4.1, so replace
its use with the recommended sphinx.ext.imgmath.

Change-Id: Ic8638ee341533b07af2f5accc48664f84c1d5cb4

8 years agoFix precision loss in tabulated normal distribution
Erik Lindahl [Sun, 8 May 2016 20:49:36 +0000 (22:49 +0200)]
Fix precision loss in tabulated normal distribution

The tabulated normal distribution was generated by
simply integrating a gaussian function, which led to
severe loss-of-precision for double precision tables.
Fixed by implementing proper inverse error functions
in the math module, and using this to fill the table
directly.

Fixes #1930.

Change-Id: I74b72b4a6d36f1eb382c6456501ce5644c92725e

8 years agoFacilitate linking with libcxx
Mark Abraham [Wed, 30 Mar 2016 03:38:46 +0000 (05:38 +0200)]
Facilitate linking with libcxx

Using recent clang static analyzer versions seems to be easier with
libcxx, which we should anyway support for building and testing.

Reworked the testing for C++11 support, since it is sensible to first
test the compiler, and then the standard library. This helps users
diagnose problems. Converted this code to a function (for better
scoping), added some docs, and made the semantics clearer. Added
some explicit testing for other non-library C++11 functionality.

Introduced GMX_STDLIB_CXX_FLAGS, so that all the linked executables
can have their sources compiled with any compiler flag that might be
required. Alternatives like requiring the user to modify
CMAKE_CXX_FLAGS, or adding COMPILE_FLAGS properties to targets didn't
seem great. The latter also triggers clang to issue warnings for
source files that are still C (group kernels and TNG).

Introduced GMX_STDLIB_LIBRARIES, so that linking can proceed
correctly.

For example, the check for C++11 support needs to be passed a library
to link during the try_compile(), and the only reliable way for the
user to do that before this patch was to add the linker flag to
CMAKE_CXX_FLAGS, which then leads to clang warning about the unused
linker flag as it compiles each source file. The GMX_STDLIB_*
mechanisms probably also permit users to build against different
versions of GNU libstdc++, which may be useful on distributions like
CentOS, because CMake has no mechanism at all for this.

Updated the install guide to clarify how to choose a standard library
in the various cases. Updated the guide for using GROMACS as a library,
and the template README.

Fixed issue where the template did not have C++11 compiler flags
propagated properly. The template now builds correctly, via both
Makefile.pkg and cmake, both with normal default libstdc++ and libc++
selected via this mechanism and propagated to the installed build
system for the template.

Fixed issue where SIMD suggestion would produce a garbage suggestion
when the linking failed and OUTPUT_SIMD was left unset.

Refs #1745,#1790

Change-Id: Ieef3b47de5c1a00a203baa1b34ebf70535cf5ff0

8 years agoFlush streams when not writing newline character
Erik Lindahl [Sun, 8 May 2016 11:11:02 +0000 (13:11 +0200)]
Flush streams when not writing newline character

Some of our routines use the carriage return without a newline
to keep writing the status e.g. on stderr.
For some operating systems this seems to lead to the output
being cached in the buffers, so this change adds an explicit
fflush() for these print stamements.

Fixed #1772.

Change-Id: I3ad9c4f0e962d8a0b2f8d2341af69f0e3d01a477

8 years agoOptimized the vsite threading
Berk Hess [Thu, 22 Oct 2015 11:04:42 +0000 (13:04 +0200)]
Optimized the vsite threading

On many threads a significant part of the vsites would end up in
the separate serial task, thereby limiting scaling. Now two weakly
dependent tasks are generated for each thread and one of them uses
a thread-local force buffer, parts of which are reduced by different
threads that are responsible for those parts.
Also the vsite setup now runs multi-threaded.

Change-Id: I5b117ea2d4af7c1c5844748e2a53a64f69415384

8 years agoFix CUDA shmem bug
Berk Hess [Mon, 9 May 2016 12:13:38 +0000 (14:13 +0200)]
Fix CUDA shmem bug

There was a bug in the (nasty) manual CUDA shmem management.
This does not seem to have affected any results.
Also replaced 2 by c_nbnxnGpuClusterpairSplit where appropriate.

Change-Id: I27cf8b02ad78a6d8ef0825d666103f7494c651a2

8 years agoAdd OpenMP for functions limiting scaling
Roland Schulz [Sat, 6 Dec 2014 05:58:13 +0000 (00:58 -0500)]
Add OpenMP for functions limiting scaling

Loops over number of atoms cause significant amount of serial time with
large number of threads.

Change-Id: I5f7b894c92c3a0aabe417914905b813d5fccc739

8 years agoSupport cmap with QMMM
Berk Hess [Mon, 18 Apr 2016 06:58:34 +0000 (08:58 +0200)]
Support cmap with QMMM

QMMM only supported bonded interactions using up to 4 atoms.
Now any number is supported and some hard-coded assumptions have been
removed.

Change-Id: I69b78ad5e7f8520cda792a8c2f212adef0a2c7c8

8 years agoImproved description for GPU/CPU time ratio
Erik Lindahl [Sun, 8 May 2016 10:45:35 +0000 (12:45 +0200)]
Improved description for GPU/CPU time ratio

Made the output slightly more explicit according to Mark's
suggestion three years ago in a bug report (which wasn't a bug).

Fixes #1291.

Change-Id: I0021afb5b8d964c6cff5bfbff58a5ebef2efdcbb

8 years agoFixes for clang 3.7 on PowerPC
Mark Abraham [Fri, 18 Mar 2016 16:50:32 +0000 (16:50 +0000)]
Fixes for clang 3.7 on PowerPC

We should not test testBits on platforms that don't use it, in
particular, BG/Q.

Our cyclecounter implementation is correct, but clang 3.7 issues
harmless warnings that I do not plan to fix.

Change-Id: Id6b21c3984051ab9ef8598d53746df3b38003aef

8 years agoCorrect and clarify output units for fluct_props
James W. Barnett [Thu, 5 May 2016 15:48:15 +0000 (10:48 -0500)]
Correct and clarify output units for fluct_props

Compressibility and bulk modulus had units reversed in output (values themselves
are correct - just the text units next to them were reversed). Clarify K is in
denominator of heat capacities.

Change-Id: Id68a050b5d547903765526a6fd1c340a9303cb08

8 years agoFix Luzar/Chander literature reference in g_hbond
Erik Lindahl [Sun, 3 Apr 2016 18:11:47 +0000 (20:11 +0200)]
Fix Luzar/Chander literature reference in g_hbond

Fixes #1935.

Change-Id: I5307b2d1962730e703865278b21ec1c8022424d8

8 years agoFix constants, units and conversion factors
Mark Abraham [Mon, 25 Apr 2016 19:55:40 +0000 (21:55 +0200)]
Fix constants, units and conversion factors

Pressure definition was wrong, should be in bar. There's no point in
giving a standard conversion factor to other units that nobody uses.

Giving the "accuracy" of various quantities is useless without
specifying what the value in parentheses means. We make no use of
those accuracy values anywhere in the code. We should cite the source
and leave it up to the user with some potentially more accurate value
to decide if their value, with _its_ error, is close enough to the
value used in GROMACS to be acceptable.

Change-Id: I417873db5ab01aa53ad409988eb738442f2f0305

8 years agoModify lmfit library to avoid clashes with other versions.
David van der Spoel [Wed, 9 Dec 2015 15:52:52 +0000 (16:52 +0100)]
Modify lmfit library to avoid clashes with other versions.

Due to the inclusion of the lmfit package in certain operating
systems clashes could occur when linking different codes. In
order to prevent this the exported symbols from this library
were renamed by prepending the names with gmx_ and the .c files
renamed to .cpp.

Now based on lmfit 6.1.

Change-Id: I67ea602d7fdacc08efd88279b50ca42ebe886a4c

8 years agoUpdate mdrun termination info
Berk Hess [Wed, 16 Mar 2016 14:42:29 +0000 (15:42 +0100)]
Update mdrun termination info

Both the mdrun help and stderr/log messages reported that mdrun
would stop at the next step or next nstlist step, which has not been
correct for some time.

Fixes #1918.

Change-Id: Ia890ffb3ccfdbdbed3d003b149c3cbb55e5c1818

8 years agoSupport for OpenCL CI builds
Teemu Murtola [Mon, 14 Mar 2016 15:09:26 +0000 (17:09 +0200)]
Support for OpenCL CI builds

Add support for OpenCL builds to gromacs.py, and some configurations to
the pre-submit matrix.

Change-Id: I321af28bc8ac20ad4629d40ec68c542ec96ef9c6

8 years agoOpenMP parallelization for pull
Berk Hess [Thu, 14 Apr 2016 10:53:23 +0000 (12:53 +0200)]
OpenMP parallelization for pull

The pull code could take up to a third of the compute time for OpenMP
parallelel simulation with large pull groups.
Now all loops over atoms have an OpenMP parallel version.

Change-Id: I59e65a3e33782828cca58cb843c33afd1502e4b5

8 years agoMerge branch release-5-1
Teemu Murtola [Thu, 5 May 2016 14:47:00 +0000 (17:47 +0300)]
Merge branch release-5-1

No conflicts.

Change-Id: I582e9c267588d446f55788828866cc50781d74dd

8 years agoMake Sphinx build silent for version 1.3+
Teemu Murtola [Thu, 5 May 2016 03:01:49 +0000 (06:01 +0300)]
Make Sphinx build silent for version 1.3+

The handling of the theme has changed, so now the code sets the theme
differently for different versions.  This should allow upgrading Sphinx
on Jenkins in-place (older branches do not use Sphinx).

Also, make the copyright year automatically update based on the day the
documentation is generated to avoid manual maintenance.

Change-Id: I180b4307ba5f3d95d39196661831dc40de1424e1

8 years agoRemove CUDA host compiler consistency checks
Szilárd Páll [Sun, 3 Apr 2016 22:30:06 +0000 (00:30 +0200)]
Remove CUDA host compiler consistency checks

Since CMake 2.8.10 the host compiler is set by CMake which effectively
broke our consistency checks. However, these checks are hard to
maintain, and even though CMake does not do any checks we are better off
without this code.

This commit removed the checks, unconditionally sets the
CUDA_HOST_COMPILER variable for CMake 2.8.9 and earlier - code that
should be removed when CMAke 2.8.10 is required.

Fixes #1248

Change-Id: I6c08b59642dd3b5d18c5fe5ac454f19c75718f6a

8 years agoFix SIMD detection on AMD AVX CPUs w/o fma (master)
Erik Lindahl [Sun, 3 Apr 2016 20:00:11 +0000 (22:00 +0200)]
Fix SIMD detection on AMD AVX CPUs w/o fma (master)

This is essentially the same fix as for release-5.1,
but since the cpu detection code has been rewritten from
scrath this part has been moved to the SIMD module.

Fixes #1906.

Change-Id: Ie25d6013c737279ece902d40d1f54a6e3c5966bb

8 years agoAvoid allocating heap memory for tabulated distribution
Erik Lindahl [Sun, 3 Apr 2016 12:58:19 +0000 (14:58 +0200)]
Avoid allocating heap memory for tabulated distribution

The previous version of the table-generation routine
first allocated memory on the heap and the returned a
reference, which is just complicated, and it probably
led to a small memory leak despite the comment. We
currently return the entire vector by value instead,
since this should be optimized away anyway.

Change-Id: Icf07286e785eeec213ee44d4770df91b71977f19