alexxy/gromacs.git
5 years agoremove most debug flags from gmxpreprocess
Joe Jordan [Thu, 19 Jul 2018 11:53:22 +0000 (13:53 +0200)]
remove most debug flags from gmxpreprocess

To make pdb2gmx more readable as part of #2566 I
removed the debug info. I went ahead and removed
most debug info from other gmxpreprocess tools as
well.

Change-Id: I88919d1f166d7f44508b4fcfae156ffa051b4d70

5 years agoRemove hardcoded warp_size == 32 assumption from PME GPU
Aleksei Iupinov [Mon, 21 May 2018 08:40:08 +0000 (10:40 +0200)]
Remove hardcoded warp_size == 32 assumption from PME GPU

The PME OpenCL host code now queries the warp_size aka max
execution width from the device. The CUDA/unit test handling
of constants/defines is adjusted. With this, only the PME
device-side code should be relying on warp_size define
(which will be passed to the compiler in the OpenCL
implementation).

Change-Id: Ic2d1512e04d36861590b13e02b5bd7a87240f9e2

5 years agoDisable FPEs at end of runner
Roland Schulz [Thu, 19 Jul 2018 16:34:27 +0000 (09:34 -0700)]
Disable FPEs at end of runner

In mdrun unit tests the exceptions enabled for one test were
still active in the next. This caused issues with group
kernel which is known to throw FPEs.

Related #2404

Change-Id: Ie347a29f25ed16836a3164b61c9fca87ca66fc44

5 years agoChange manual section on restarts w/o checkpoint
Paul Bauer [Fri, 20 Jul 2018 13:01:09 +0000 (15:01 +0200)]
Change manual section on restarts w/o checkpoint

As pointed out by Eric, the section on restarting simulations without
a checkpoint file has been wrong/misleading as the feature mentioned
there is no longer available. Changed the section to point this out.

Fixes #2559

Change-Id: I9e14e707e08b9fbcb18a868a80f333b065c34393

5 years agoApply local atom sets in pull code
Berk Hess [Wed, 25 Apr 2018 07:58:21 +0000 (09:58 +0200)]
Apply local atom sets in pull code

Reduces the dependency of the domain decomposition code on the pull
code.

The local cylinder group now contains all local atom of the group,
no longer only the atoms within the cylinder radius.

Converted pull_group_work_t to C++ since LocalAtomSet requires this.

Change-Id: Ia022f8cea9970dc973d8869a4ca96644a266003b

5 years agoUpdate clang static analyzer to version 6
Mark Abraham [Tue, 20 Mar 2018 22:10:32 +0000 (23:10 +0100)]
Update clang static analyzer to version 6

Corrected the comment about how prepare to run such a job.

Fixed check_cons. With econqVeloc, different quantities get passed
into x, and nullptr into v, so the diagnostic output was always wrong
if the run found issues while doing velocity constraining.

Simplified the implementation of SIMD setZero() proxy object.

Added lots of const and some assertions for DD communication code.

Also fixed some complaints from MSVC about bool

Change-Id: Idb741480544189b68db78be57167e3f4ce577bd7

5 years agochange gmx_bool to bool in gmxpreprocess
Joe Jordan [Thu, 12 Jul 2018 13:46:07 +0000 (15:46 +0200)]
change gmx_bool to bool in gmxpreprocess

This change only replaces gmx_bool with bool in files
the gmxpreprocess dir. This is only refactoring.

Change-Id: If98d69cb11f7560e036b8bb52d1d069dac624bb0

5 years agoLocal atom set handling during simulations.
Christian Blau [Thu, 21 Jul 2016 11:45:30 +0000 (13:45 +0200)]
Local atom set handling during simulations.

Initializes and updates local atom sets in the do_md loop.

An instance of local atom sets manager is set up in do_md. Domain
decomposition triggers update to local atom indices.

Change-Id: I361ce33220c423cbce2e6af617dbc5164291ce0a

5 years agoFix Windows+Intel
Roland Schulz [Mon, 16 Jul 2018 19:33:08 +0000 (12:33 -0700)]
Fix Windows+Intel

Introduced by 95466e9d55b23

Change-Id: I275ab4e0ceb04ec03dc5d48067842540aa509621

5 years agoAdd LocalAtomSet for handling atom indices.
Christian Blau [Thu, 7 Jul 2016 14:11:32 +0000 (16:11 +0200)]
Add LocalAtomSet for handling atom indices.

Moves reading and updating indices for a set of atoms to a single place.
Pulling, IMD, rotation enforcement, essential dynamics etc. all use
their own methods triggered in domain
decompostion to handle atom indices in parallel simulations.
This class works towards removing the exposed hooks to all these modules
in domain decomposition.

Part of casting groupcoord routines to c++.

External potentials will use LocalAtomSet to access atom subsets to make
handling of atom indices not the task of individual
external potentials, but of an parallel-Atom API instead.

Related to #1972.

Change-Id: I69460963927249c7d713e76f166e6c87122c68de

5 years agoUpdated infrastructure for comparing mdrun output in Google Tests
Mark Abraham [Thu, 29 Mar 2018 07:36:22 +0000 (09:36 +0200)]
Updated infrastructure for comparing mdrun output in Google Tests

Made some GoogleMock matchers so its easy to check containers of reals
and rvecs.

Implemented better infrastructure for reading and comparing energies
and trajectories. In particular, the functionality for reading frames
and comparing them is now separated.

Added a new templated helper function for comparing either
energies or trajectories between pairs of frames that should match.

Removed use of std::pair, which didn't really help anything.

Reordered names of files in CMakeLists.txt, per intention to have
things alphabetical.

Added unordered_map to the set of C++ headers that the checker
understands, now that we use it.

Change-Id: If8d0bf076c07e7326473e613a83b46a6794f8505

5 years agoWarn for type mismatch for gmx printf like functions 1/3
Roland Schulz [Fri, 13 Jul 2018 04:22:12 +0000 (21:22 -0700)]
Warn for type mismatch for gmx printf like functions 1/3

Automatic fixes with clang fix-it

Related #2570

Change-Id: Id565d2705c673d1e45318bb8bf1091c165a724de

5 years agoReplacement for pdb2gmx tests
Mark Abraham [Fri, 6 Jul 2018 16:41:07 +0000 (18:41 +0200)]
Replacement for pdb2gmx tests

This test directly asserts upon the .top and .gro files that are
written out, using fragments of the
regressiontests/complex/aminoacids/conf.gro because these cover all
basic amino acid types. It also adds testing for hydrogen vsites for
amber and charmm.

We now omit doing an energy minimization after the string checks,
which was always a doubtful way to test pdb2gmx. These tests are still
too slow to run with other pre- and post-submit testing, so a new
CTest category has been made for them, and that category is excluded
from Jenkins builds by default. Developers will still run these by
default with "make check" or "ctest" but that should be fast enough on
a workstation. Later we can probably refactor them to use in-memory
buffers and be fast enough to put with the other tests.

Modified pdb2gmx to avoid writing fractional charges for every atom in
the [atoms] output, which isn't very useful for users and makes
writing tests more difficult.

Fixed unstable sorting of dihedrals whose parameters are strings that
identify macros.

Added new capability for refdata tests to filter out lines that vary
at run time by supplying a regex that matches the lines to skip.
That's not ideal, but useful for now. Better would be to refactor
tools so that e.g. header output can go to a different stream, but
first we should have basic tests in place.

Added tests for Regex. Fixed minor bug in c++ stdlib regex
implementation of Regex. Noted the remaining reason why we have
Regex supported by two different implementations.

Minor updates to use compat::make_unique

Extended functionality of CommandLine for convenient use.

Refs #1587, #2566

Change-Id: I6a4aeb1a4c460621ca89a0dc6177567fa09d9200

5 years agoEnable debug FP exceptions without TPI, not with TPI
Roland Schulz [Wed, 4 Jul 2018 21:50:53 +0000 (14:50 -0700)]
Enable debug FP exceptions without TPI, not with TPI

This is a second attempt at debugging FP exceptions. It reverts the
revert ab4d87ef1b255504d23b619e57d2e98374ba2b3e.

Remove work-around in tpitest.

Fixes #2404

Change-Id: Ib2f8b2e68eef31eeeaefc4c69cee5edf76e7508c

5 years agoMSVC: enable code analysis
Roland Schulz [Fri, 13 Jul 2018 22:51:36 +0000 (15:51 -0700)]
MSVC: enable code analysis

Change-Id: Iff67fd7640e9a4498525a72bb178b98335e43469

5 years agoFix clang-tidy cmake messages
Roland Schulz [Thu, 12 Jul 2018 22:49:00 +0000 (15:49 -0700)]
Fix clang-tidy cmake messages

Fixes #2571

Change-Id: Ibae0b68e30fdcdc5f57cb6ff7c5b78a44df3fb01

5 years agoFix attribute usage
Roland Schulz [Thu, 12 Jul 2018 02:08:25 +0000 (19:08 -0700)]
Fix attribute usage

Undo ddc2297bba8 changes to cmake/gmxCFlags.cmake. [[fallthrough]]
has been removed. So this isn't needed anymore.

Remove gmx_noreturn and always use [[noreturn]].

Change-Id: I74d87c17ccc4cca445f9133c8f05ed877cf43d8a

5 years agoTemporary disable armhpc-18.2
Roland Schulz [Thu, 12 Jul 2018 02:13:34 +0000 (19:13 -0700)]
Temporary disable armhpc-18.2

Required to fix post-submit matrix
bs_overdrive_1000 is offline and no ETA

Change-Id: I201fd0514160cdfb7326760c708fb68db57fb49d

5 years agoRequire ICC 17.0.1
Roland Schulz [Tue, 3 Jul 2018 23:42:18 +0000 (16:42 -0700)]
Require ICC 17.0.1

Also fix minor post-submit issue

Change-Id: Ia97cc66ea12a920f0b4002f309bd0b039bb7a9d2

5 years agoBump minimum MSVC version to 2017
Mark Abraham [Mon, 9 Jul 2018 09:40:49 +0000 (11:40 +0200)]
Bump minimum MSVC version to 2017

On this platform, we should generally support only the latest version
of the various tools. It is not widely used by GROMACS users, and
fairly easy for them to install a new or upgraded version, so we
should generally prefer that GROMACS developers are less
inconvenienced in Jenkins by ongoing issues in the quality and
completeness of the implementation of MSVC.

MSVC support for attributes requires compilation in C++17 mode.
That's probably related to the way C++17 requires that unknown
attributes do not cause compilation to fail.

Change-Id: Icca6f537374fd88888a86152388f574ef14912ed

5 years agoclang: undefined-reinterpret-cast, comma, extra-semi
Roland Schulz [Fri, 6 Jul 2018 03:46:17 +0000 (20:46 -0700)]
clang: undefined-reinterpret-cast, comma, extra-semi

Change-Id: I8581f68ea62f34818c856e9ff2809f087e352dec

5 years agoFix custom build types with cmake 3.11
Roland Schulz [Thu, 5 Jul 2018 23:42:23 +0000 (16:42 -0700)]
Fix custom build types with cmake 3.11

Since cmake 3.11 setting CMAKE_CXX_FLAGS_{CMAKE_BUILD_TYPE}
without FORCE doesn't work anymore.

Change-Id: Ic97a8dcca11b4d5950b827259de562c97fea2a6c

5 years agoClang warnings
Roland Schulz [Tue, 10 Jul 2018 02:51:24 +0000 (19:51 -0700)]
Clang warnings

-Wno-switch-enum
-Wno-shadow-field-in-constructor
-Wno-unreachable-code-break
-Wno-missing-variable-declarations
-Wno-float-conversion
-Wno-shorten-64-to-32

Change-Id: I6b4ed48535b39d0e8a00b2f8f1ef57512be27641

5 years agoSplit TopologyInformation into its own header
Mark Abraham [Wed, 20 Jun 2018 07:38:40 +0000 (09:38 +0200)]
Split TopologyInformation into its own header

This will help provide a useful upgrade path for tools to get away
from t_topology, and eventually into the new framework.

Introduced a builder function to fill TopologyInformation from a tpr
file, which will be needed shortly for porting old tools.

Refs #1862

Change-Id: If2594cdcd3f9817ff83e7fb73208cdb5c497bb1a

5 years agoAdd infrastructure for tools cleanup
Mark Abraham [Fri, 29 Jun 2018 10:31:01 +0000 (12:31 +0200)]
Add infrastructure for tools cleanup

Copy and move construction and assignment are useful to have in RVec,
plus tests. These make sense to have in a simple value type, and the
default implementations are appropriate.

Note that plans to replace t_topology reading in legacy analysis tools
in favour of the approach currently in the new analysis suite will
mean we need to use more RVec and less rvec in those legacy
tools. This change prepares for that.

Fixed a comment.

Refs #1862

Change-Id: I7d0b9bbad9dc61299f6b85a3597082c4867c0202

5 years agoClang warnings: unreachable
Roland Schulz [Tue, 10 Jul 2018 02:11:08 +0000 (19:11 -0700)]
Clang warnings: unreachable

Fixing:
-Wno-unreachable-code
-Wno-unreachable-code-return

Also disabling:
-Wno-missing-field-initializers (set by gmxCFlags)
-Wno-sign-conversion (was warning free)

Change-Id: I2c46ffbf08048b17f065647b4d3a84addbfaff4c

5 years agoClarify the implementation of selection -ofpdb output
Mark Abraham [Tue, 26 Jun 2018 12:57:33 +0000 (14:57 +0200)]
Clarify the implementation of selection -ofpdb output

This prepares for future clean up to remove t_topology. That the
information in the t_pdbinfo is intended to be associated with the
t_atoms is now a bit clearer.

Refs #1862

Change-Id: I07a9796debe25f5023c229b29f0802f9e3c77065

5 years agoUse fewer gcc-4.8 configurations
Mark Abraham [Tue, 3 Jul 2018 22:41:47 +0000 (00:41 +0200)]
Use fewer gcc-4.8 configurations

This will let us explore having fewer builds where all warnings are
enabled

Change-Id: I44728c16d951397a09896adce4ec5222ede0da65

5 years agoFix warnings in internal xdr code
Mark Abraham [Fri, 6 Jul 2018 12:58:04 +0000 (14:58 +0200)]
Fix warnings in internal xdr code

This isn't tested much in Jenkins.

Change-Id: If54f93a9790532b86d3433511c976e4456f30c7b

5 years agoMerge "Merge release-2018 into master"
Mark Abraham [Fri, 6 Jul 2018 13:32:27 +0000 (15:32 +0200)]
Merge "Merge release-2018 into master"

5 years agoFix AVX_512_KNL
Roland Schulz [Wed, 4 Jul 2018 18:53:20 +0000 (11:53 -0700)]
Fix AVX_512_KNL

Was broken by b4e3932e: "AVX512: copysign"

Change-Id: I617bc323a1035433251dc827e044484e3f3d3db5

5 years agoFix compiler warnings in OCL
Roland Schulz [Thu, 5 Jul 2018 00:33:16 +0000 (17:33 -0700)]
Fix compiler warnings in OCL

Change-Id: I4d5d0fac37a09bd1e74db946db54c17526414a24

5 years agoMerge release-2018 into master
Roland Schulz [Wed, 4 Jul 2018 19:11:14 +0000 (12:11 -0700)]
Merge release-2018 into master

Changes to fix errors:
gmx_editconf.cpp: clang-tidy fix-it
mdlib/constr.cpp: -> to .

Trivial conflicts:
cmake/gmxVersionInfo.cmake
docs/CMakeLists.txt
src/external/build-fftw/CMakeLists.txt
src/gromacs/awh/read-params.cpp
src/gromacs/commandline/cmdlineprogramcontext.cpp
src/gromacs/gpu_utils/ocl_compiler.cpp

Change-Id: I1776d8c9a766e46f7212cb0ca3bb3ecb0f312fa5

5 years agoEnable more warnings for Clang 6
Roland Schulz [Sun, 1 Jul 2018 21:24:36 +0000 (14:24 -0700)]
Enable more warnings for Clang 6

Many useful clang warnings are not enabled with -Wall -Wextra.
Enable all with -Weverything and document which are disabled
for what reason. Only do this for the most recent released
version to avoid having false postives from multiple
versions.

Fix the 9 of the least common issued warnings:
class-varargs range-loop-analysis
unused-template implicit-fallthrough non-virtual-dtor
zero-as-null-pointer-constant
header-hygiene unused-member-function missing-noreturn

Change-Id: I70df6553aa715cbd99963dd66d4b4bbd55ffc64d

5 years agoFix ManageLmfit
Roland Schulz [Sat, 30 Jun 2018 09:21:23 +0000 (02:21 -0700)]
Fix ManageLmfit

HAVE_LMFIT was set as cache variable without force. This caused it not
to be set properly after changing GMX_USE_LMFIT. Setting it with force
would make it useless to be in the cache. Thus caching is removed.

Change-Id: I7ed093c638c12a3cfb4982ee1a240645e234ba48

5 years agoFix post-submit issues
Roland Schulz [Tue, 3 Jul 2018 16:51:07 +0000 (09:51 -0700)]
Fix post-submit issues

domdec/domdec.cpp + mdtypes/state.*:
Fix signed/unsigned issues

gmxana/gmx_trjcat.cpp:
GCC 4.8 false postive maybe-uninitialized warning

utility/gmxassert.h:
Fix that usage of _MSC_VER

Change-Id: I87250505899e8d62a468069fe349159645c6c55f

5 years agoFix clang CUDA build
Mark Abraham [Sun, 24 Jun 2018 15:50:06 +0000 (17:50 +0200)]
Fix clang CUDA build

Not sure what the real problem is, but this cmake code can't
crash when LIBGROMACS_SOURCES happens to be empty.

Change-Id: I27c6c3c5e0a061482b456bd3c04908e918d6de9f

5 years agoChange ArrayRef::size_type to signed
Roland Schulz [Sun, 1 Jul 2018 05:55:17 +0000 (22:55 -0700)]
Change ArrayRef::size_type to signed

Follows gsl:span and std::span design, and Google and
Core guidelines.

Related #2010

Change-Id: Ia7b977d0d1a14b5a81f7a6390a9dc4fc24bfa1ce

5 years agoConvert gmx_hash_t to C++
Berk Hess [Thu, 28 Jun 2018 12:48:07 +0000 (14:48 +0200)]
Convert gmx_hash_t to C++

Change-Id: Id8cfb2907eb40a9ede6b744c875d01fb34cb993f

5 years agoclang-tidy: misc-misplaced-widening-cast
Roland Schulz [Sun, 1 Jul 2018 05:03:16 +0000 (22:03 -0700)]
clang-tidy: misc-misplaced-widening-cast

Adds gmx::index to be used as type for index calculations and
comparisons.

given:
int a,b;
size_t c;
static_cast<size_t>(a+b) < c

clang-tidy warns because the static_cast does two things:
- it widens the sum from 32 bit to 64 bit
- it sign casts from signed to unsigned

If the widening is actually required (because while a and b
fit into 32 bit the sum is bigger), then this gives the
wrong result. Thus the terms should be widened prior to summing.
But this gives the wrong result if either of them is negative,
unless the terms are first widened to signed 64 bit and the sum
is then sign converted.

Additionally sign converting the signed to unsigned is unsafe
because it gives the wrong result if it negative. Converting
the unsigned is safe for 64 bit up to 2^63 which is safe to assume
won't be reached.

For all cases clang-tidy complained about (widening after sum), the
sign conversion is changed from signed->unsigned to unsigned->
signed. Introduced gmx::index to have a type for this purpose.

None of the potential bug highlighted by clang-tidy are fixed by
this change. Instead it assumes that in all cases here the intention
was just the signed conversion and no widening prior to summing
is required.

Related #2010

Change-Id: I9251196bf6ed744317868ce9bfc34876e5cfd43b

5 years agoclang-tidy: misc-misplaced-const
Roland Schulz [Sat, 30 Jun 2018 20:11:16 +0000 (13:11 -0700)]
clang-tidy: misc-misplaced-const

Manual fixes

Change-Id: If4174e56c6974c0188af2f1da496f9aa719b23a3

5 years agoclang-tidy: more misc+readability
Roland Schulz [Sat, 30 Jun 2018 20:01:04 +0000 (13:01 -0700)]
clang-tidy: more misc+readability

Auto fixes:
misc-macro-parentheses
readability-named-parameter

Enabled with few violations disabled by configuration:
misc-throw-by-value-catch-by-reference
readability-function-size

Set clang-tidy checks as list to allow comments.

Refactored the operator <<< used by GMX_THROW to take the exception by
value and return a copy, which is easier for tools to see is a proper
throw-by-value (of a temporary).  Performance on the throwing path is
not important, but is anyway not affected because the inlining of the
operator allows the compiler to elide multiple copies. This also
avoids casting away the constness.

Change-Id: I85c3e3c8a494119ef906c0492680c0d0b177a38d

5 years agoLocalize variables in dd_redistribute_cg()
Berk Hess [Mon, 2 Jul 2018 14:25:25 +0000 (16:25 +0200)]
Localize variables in dd_redistribute_cg()

Change-Id: Ie3cc99917e73bca7786e5ac39423826839c95441

5 years agoConvert DD DLB cell size handling to C++
Berk Hess [Fri, 29 Jun 2018 12:45:46 +0000 (14:45 +0200)]
Convert DD DLB cell size handling to C++

Convert structs of arrays to an array of structs.
Clarify variable names.
This change is only refactoring.

Change-Id: I215d1b47b7d1429db390a79ba52d3918c0e2ad37

5 years agoRemove some pieces from forcerec.h
Mark Abraham [Tue, 19 Jun 2018 11:47:40 +0000 (13:47 +0200)]
Remove some pieces from forcerec.h

This makes it less of a global compilation dependency. Some new
includes required because contents were no longer available via
transitive inclusion. Used more forward declarations to avoid
such transitive inclusion.

Removed some C++ guards too now that some more pieces are no longer
compiled by most/all of the group scheme kernels.

Change-Id: I56a1bb290da639500dbc8c8baa04c1f32758713c

5 years agoFix recent bug with 2D/3D DLB
Berk Hess [Fri, 29 Jun 2018 23:26:06 +0000 (01:26 +0200)]
Fix recent bug with 2D/3D DLB

Recent commit 6399cf0a broke DD in 2D and 3D with DLB.

Change-Id: Idbd1e3e7cd327bddc54e1ab6d5d184c553e80f6e

5 years agoEnable clang-tidy NullDereference
Roland Schulz [Sun, 20 May 2018 02:56:46 +0000 (19:56 -0700)]
Enable clang-tidy NullDereference

Change-Id: Ifaa59cd72723e61a989f1bf68ad014e90f8ff693

5 years agoclang-tidy: readability-non-const-parameter (2/2)
Roland Schulz [Sun, 20 May 2018 20:28:38 +0000 (13:28 -0700)]
clang-tidy: readability-non-const-parameter (2/2)

Automatic fix-it

Change-Id: I574696fc8595855438802af81112e04b3312b8c2

5 years agoRemoved smalloc.h from many DD files
Berk Hess [Thu, 28 Jun 2018 20:40:41 +0000 (22:40 +0200)]
Removed smalloc.h from many DD files

Many files in the domdec module included smalloc.h unnecessarily.
Replaced use of two pointers by std::vector in domdec_setup.cpp.

Change-Id: Ib2644330113660fedd53af9e6f87454224ec6fc5

5 years agoclang-tidy: misc-string-compare+perf-value-param
Roland Schulz [Tue, 26 Jun 2018 05:58:20 +0000 (22:58 -0700)]
clang-tidy: misc-string-compare+perf-value-param

misc-suspicious-string-compare
performance-unnecessary-value-param

Change-Id: Ia9b038206e21ca324cd314385c9a6ca4509473d3

5 years agoclang-tidy: readability-non-const-parameter (1/2)
Roland Schulz [Sun, 20 May 2018 20:25:02 +0000 (13:25 -0700)]
clang-tidy: readability-non-const-parameter (1/2)

Manual part of readability-non-const-parameter.
Auto fix-it works outside of:
 - function pointers
 - passing pointer to constructor for storage
 - non-const usage inside #if

Those are fixed/ignored here. Auto patch is next.

Change-Id: I996367d9710a764db53f84e6601935afb7415544

5 years agoConvert gmx_domdec_constraints_t to C++
Berk Hess [Thu, 28 Jun 2018 10:30:35 +0000 (12:30 +0200)]
Convert gmx_domdec_constraints_t to C++

All buffers are now std::vector.
TODO: Get rid of the plain pointer for ga2la.

Change-Id: Ie70c8b0439cdcd4d5897d7aed2c7ff241e856a63

5 years agoConvert gmx_domdec_specat_comm_t to C++
Berk Hess [Thu, 28 Jun 2018 07:12:12 +0000 (09:12 +0200)]
Convert gmx_domdec_specat_comm_t to C++

All buffers in gmx_domdec_specat_comm_t now use std::vector.
Moved the requested atom index buffers into the vsite and
constraint data structures.

Change-Id: I46fac1bac3679126e578cd1a6f677e716cf23796

5 years agoInitialize DD DLB variable
Berk Hess [Fri, 29 Jun 2018 12:01:34 +0000 (14:01 +0200)]
Initialize DD DLB variable

Recent commit haveTurnedOffDlb caused dd->comm->haveTurnedOffDlb
to be used unitialized.

Change-Id: I5fc412a4ae03654d95b3ce950795ad01d37805c8

5 years agoNew quote from a referee
Berk Hess [Fri, 29 Jun 2018 08:52:59 +0000 (10:52 +0200)]
New quote from a referee

Change-Id: I527fede219fd6890b7d5a543e968d9213c3f40e2

5 years agoclang-tidy: misc-suspicious-missing-comma
Roland Schulz [Tue, 26 Jun 2018 07:21:08 +0000 (00:21 -0700)]
clang-tidy: misc-suspicious-missing-comma

Fixes bug in src/gromacs/fileio/checkpoint.cpp
Manual changes (check has to auto-fix)

Change-Id: I0d9d26c115a240133e680c4cb3433780a3b398e3

5 years agoclang-tidy: add modernize nullptr & emplace
Roland Schulz [Mon, 14 May 2018 09:14:51 +0000 (02:14 -0700)]
clang-tidy: add modernize nullptr & emplace

Move selection/scanner.cpp and parser.cpp into
libgromacs_generated to exclude it from clang-tidy.

All files had been automatically fixed previously.
Changes are new occurrences of old pattern.

Change-Id: I46df2622b555af83e03cc79077d3510168ffc6d4

5 years agoNew quote from ISC2018
Mark Abraham [Wed, 27 Jun 2018 17:44:25 +0000 (19:44 +0200)]
New quote from ISC2018

Change-Id: I931d05b9f0470c39e8acf1ab1c1dd9b15cf7fb4b

5 years agoclang-tidy: readibility redundant
Roland Schulz [Tue, 26 Jun 2018 06:10:06 +0000 (23:10 -0700)]
clang-tidy: readibility redundant

readability-redundant-control-flow (return at end of void fn)
readability-static-definition-in-anonymous-namespace
readability-redundant-member-init

All three remove redundant information.

Manual changes in:
src/gromacs/utility/alignedallocator.cpp (no auto fix)
src/gromacs/utility/futil.cpp (incorrect auto fix)

Change-Id: I807815f2e985f6ff612cdc96f6585ff524da4e54

5 years agoclang-tidy: misleading-indentation+noexcept-move
Roland Schulz [Tue, 26 Jun 2018 07:18:36 +0000 (00:18 -0700)]
clang-tidy: misleading-indentation+noexcept-move

manual fixes (check without auto fix) for
readability-misleading-indentation
performance-noexcept-move-constructor

Change-Id: I5c004c623b03a4a9e907ba0b340a3a721f511dd3

5 years agoclang-tidy: Enable bugprone-integer-division
Roland Schulz [Sun, 20 May 2018 07:18:26 +0000 (00:18 -0700)]
clang-tidy: Enable bugprone-integer-division

- Using int{} constructor syntax for intentional
int division with truncation in fp context.
- Adds new exactDiv which does integer division
and asserts that division is without remainder.
- Converts remaining divsion to fp division.

Also make GMX_ASSERT work in constexpr fn.
Convert over_alloc_* from macro to function.

Change-Id: Ieaeedd4558865a9dd541d24cf246f5c5733e87a1

5 years agoAdd clang-tidy to pre-submit
Roland Schulz [Sat, 23 Jun 2018 21:34:30 +0000 (14:34 -0700)]
Add clang-tidy to pre-submit

Also use clang 6 and cmake 3.11.4

Change-Id: I40aed48b12c17d485a965dfd254547cd8a817c84

5 years agoRename atomGroups in gmx_domdec_t to atomGrouping
Berk Hess [Wed, 27 Jun 2018 14:50:23 +0000 (16:50 +0200)]
Rename atomGroups in gmx_domdec_t to atomGrouping

This is to avoid a name conflict with the atom group indices
(which index into atomGrouping).

Change-Id: Ieebb47e86ff6d84a79ff58cbb68f42b109e4658b

5 years agoClean up dd_move_cellx()
Berk Hess [Wed, 27 Jun 2018 11:35:47 +0000 (13:35 +0200)]
Clean up dd_move_cellx()

Change-Id: Iaad99796610a3fea9d6c1b8c1224f3faf867e64f
Note: only used with the group cut-off scheme.

5 years agoConvert gmx_domdec_sort_t to C++
Berk Hess [Tue, 26 Jun 2018 09:49:00 +0000 (11:49 +0200)]
Convert gmx_domdec_sort_t to C++

All pointers have been replaced by std::vector.
Elements are now appended with push_back() where there is little
effect on performance; otherwise resize() and direct elemnt access
is used and a note is added to the documentation.

Change-Id: Id1e1662c629b0e90c5cfeead69a0945d3069af97

5 years agoChange BlockRanges to class RangePartitioning
Berk Hess [Thu, 14 Jun 2018 10:18:49 +0000 (12:18 +0200)]
Change BlockRanges to class RangePartitioning

Now RangePartitioning is a proper class, apart from the temporary
method that allows direct access to the (private) index.
Range based for loops are now used where possible.
Also simplified some use of this in DD distribute.

Change-Id: Ic7b1895024a74a79a4838253545329bd4c8f27c0

5 years agoclang-tidy: 4 readability checks
Roland Schulz [Mon, 25 Jun 2018 08:05:13 +0000 (01:05 -0700)]
clang-tidy: 4 readability checks

readability-redundant-smartptr-get
readability-redundant-string-cstr
readability-simplify-boolean-expr
readability-container-size-empty

Change in src/gromacs/utility/exceptions.cpp manual.

Change-Id: I25580faa80f2d5b81a1e754ae7486e954b490dc8

5 years agoclang-tidy: performance-type-promotion-in-math-fn
Roland Schulz [Mon, 25 Jun 2018 07:34:55 +0000 (00:34 -0700)]
clang-tidy: performance-type-promotion-in-math-fn

Change-Id: I7cca74e0c280c564f7a71cc1a68a5402172eefd1

5 years agoClang-tidy: enable further tests
Roland Schulz [Sun, 20 May 2018 08:22:36 +0000 (01:22 -0700)]
Clang-tidy: enable further tests

Those out of misc, performance, readiability, mpi with managable
number of required fixes.

Remaining checks:
      4 readability-redundant-smartptr-get
      4 readability-redundant-string-cstr
      4 readability-simplify-boolean-expr
      5 misc-misplaced-widening-cast
      5 readability-named-parameter
      6 performance-noexcept-move-constructor
      8 readability-misleading-indentation
     10 readability-container-size-empty
     13 misc-suspicious-string-compare
     13 readability-redundant-control-flow
     17 performance-unnecessary-value-param
     17 readability-static-definition-in-anonymous-namespace
     18 misc-suspicious-missing-comma
     20 readability-redundant-member-init
     40 misc-misplaced-const
     75 performance-type-promotion-in-math-fn
     88 misc-incorrect-roundings
    105 misc-macro-parentheses
    151 readability-function-size
    201 readability-else-after-return
    202 readability-inconsistent-declaration-parameter-name
    316 misc-throw-by-value-catch-by-reference
    383 readability-non-const-parameter
  10284 readability-implicit-bool-conversion

Change-Id: I5b35ce33e723349fa583f527fec55bbf29a57508

5 years agoFix bug with 2D/3D triclinic DD
Berk Hess [Wed, 27 Jun 2018 12:14:42 +0000 (14:14 +0200)]
Fix bug with 2D/3D triclinic DD

Recent commit 68ec0470 introduced a bug with detecting triclinic
dimensions during communication setup for 2D and 3D decomposition.

Change-Id: I345fd5f4387d3dc81b96ce14af185c02194b7087

5 years agoBase vacuum DD on atom coordinates
Berk Hess [Wed, 13 Jun 2018 15:19:59 +0000 (17:19 +0200)]
Base vacuum DD on atom coordinates

The domain decomposition partitioning for vacuum system was based
on the distribution of centers of geometry of charge groups.
But there is no reason not to use the atom positions, which results
in a better distribution and simpler code.
Also replaced several rvec pointers by arrayrefs.

Change-Id: I49b9b97f5f7beed838f9cf10382e17f7bde69906

5 years agoAdd consistency check to DDAtomRanges
Berk Hess [Thu, 31 May 2018 07:50:06 +0000 (09:50 +0200)]
Add consistency check to DDAtomRanges

Change-Id: Iee153a6268258f32fc1724376188fae35187f345

5 years agoPartial conversion of gmx_domdec_comm_t to C++
Berk Hess [Thu, 31 May 2018 09:12:48 +0000 (11:12 +0200)]
Partial conversion of gmx_domdec_comm_t to C++

Replaced generic communication buffers by proper classes.
Raplaced some other buffer by std::vector.
Now gmx_domdec_comm_t is allocated with new.

Also removed the halo pulse print to stderr.

Change-Id: I2e0be6cc6776026dcd5d64d042175e8473d8258a

5 years agoTemplate and overload dd_sendrecv functions
Berk Hess [Wed, 27 Jun 2018 08:20:09 +0000 (10:20 +0200)]
Template and overload dd_sendrecv functions

All dd_sendrecv functions were identical, except for the data types.
Now there is a single template function that is called by all other
functions.
Also added overload versions using gmx::ArrayRef, not used yet.

Noted the deprecated status of the non-ArrayRef template functions.

Change-Id: Ibfbb8aa35340d5fed8120c62be5c164c84076657

5 years agoCorrect DD zone size loop bound
Berk Hess [Wed, 27 Jun 2018 08:01:23 +0000 (10:01 +0200)]
Correct DD zone size loop bound

The loop that set the size of the non-home zones in set_zones_size()
looped beyond the value of zone_end passed to the function.
When called for updating for the home zone (zone_end=1), the range
of values the maximum was taken over contained outdated values.
Because the data is initialized by snew, the result was correct
at the first call. At subsequent calls the zones would have the size
set to maximum of the old and new size instead of only the new one.
This only caused zones to be slightly larger, which did not affect
correctness and only had a minor effect on performance.

Change-Id: I3372022a08b865ed863449606ca2344d199a4fc8

5 years agoMove vectype_ops.clh into gpu_utils
Aleksei Iupinov [Fri, 25 May 2018 13:46:06 +0000 (15:46 +0200)]
Move vectype_ops.clh into gpu_utils

OpenCL compilation now uses gpu_utils as an include directory in source.
All the OpenCL sources are still installed into one directory.

Change-Id: Ib8f4b441867b685d774202319a7d54fd085d1a9b

5 years agoMove the PME GPU kernel launch functions into pme-gpu-internal.cpp
Aleksei Iupinov [Fri, 18 May 2018 17:45:27 +0000 (19:45 +0200)]
Move the PME GPU kernel launch functions into pme-gpu-internal.cpp

Change-Id: Iafd464a94aa12eb9c9743e3c3fae307208f2a3dd

5 years agoTest both internal and external clFFT build in Jenkins
Mark Abraham [Mon, 28 May 2018 21:46:56 +0000 (23:46 +0200)]
Test both internal and external clFFT build in Jenkins

Chose to test external linking of clFFT in pre-submit because that
compiles several minutes faster. Chose to test internal linking in
post-submit because rapid throughput is less important there.

The clfft label is used to understand that external linking of clFFT
is required for this configuration, much like the fftw, fftpack and
mkl labels, however there is no need to explicitly tie the clfft label
to the gpu or opencl ones.

Refs #2500

Change-Id: I455f7f7713310153f2fdbf5197bb32660332649c

5 years agoFix unused variable warnings
Mark Abraham [Sun, 24 Jun 2018 15:54:36 +0000 (17:54 +0200)]
Fix unused variable warnings

The default switch case could otherwise warn that plan was used
uninitialized, etc.

Change-Id: If0b4bd8e09280f1192f2aae511a07e4e078e1553

5 years agoAllow GMX_OCL_DEBUG for any vendor
Roland Schulz [Sun, 24 Jun 2018 02:15:31 +0000 (19:15 -0700)]
Allow GMX_OCL_DEBUG for any vendor

Change-Id: Iefcce1a2881a5c979c2114a159799c08c779974e

5 years agoclang-tidy: Enable most bugprone checks
Roland Schulz [Sun, 20 May 2018 07:16:52 +0000 (00:16 -0700)]
clang-tidy: Enable most bugprone checks

Change-Id: I63f3cdd76e1d4a5141cca62b8ed03e36251a68b4

5 years agoAllow to enable clang-tidy with GMX_CLANG_TIDY
Roland Schulz [Mon, 14 May 2018 05:39:20 +0000 (22:39 -0700)]
Allow to enable clang-tidy with GMX_CLANG_TIDY

Fix all warnings with clang-tidy 6 without OpenMP.
OpenMP+clang-tidy has issue: #37442

Change-Id: I2380f63ba1d7541cf230fb99d53e42f7f515986a

5 years agoUpdate energy and trajectory frame types
Mark Abraham [Thu, 29 Mar 2018 07:04:02 +0000 (09:04 +0200)]
Update energy and trajectory frame types

Introduced new classes that may eventually replace t_enxframe and
t_trxframe. Currently only used in tests that compare mdrun results.

Consolidated energy.h with the new energyframe.h

Change-Id: Ia49ece9ff99d8604112f8e3e0807fc9bede5fe8d

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

Change-Id: I0c33fcbdfcc0010b5a13cbbc5503c6a95df751dc

5 years agoVersion 2018.2
Mark Abraham [Wed, 13 Jun 2018 00:30:34 +0000 (02:30 +0200)]
Version 2018.2

Updated release notes for some commits that were missing them.

Change-Id: Id9eca559faa981fb762699a34336b6b3d0f58399

5 years agoChanged documentation on common errors during minimization
Kevin Boyd [Wed, 23 May 2018 02:01:44 +0000 (22:01 -0400)]
Changed documentation on common errors during minimization

Fixed title of non-converged minimization in common errors to reflect actual error

Added section on non-finite forces to match the new minimization error message added in
changeset I7428fe4e54304b6cd2a9843445fb3c3d2ab7bc9b

Change-Id: I61e8b7e5493b3ca925e92bdb54a62769901ec7e5

5 years agoMinimization now detects infinite forces
Berk Hess [Wed, 23 May 2018 08:09:35 +0000 (10:09 +0200)]
Minimization now detects infinite forces

With non-finite forces, energy minimization now prints a non-converged
message mentioning non-finite forces instead of the machine precision
message.

Change-Id: I7428fe4e54304b6cd2a9843445fb3c3d2ab7bc9b

5 years agoEnsure PME with OpenCL does not attempt to pin
Aleksei Iupinov [Fri, 18 May 2018 16:33:04 +0000 (18:33 +0200)]
Ensure PME with OpenCL does not attempt to pin

Host-only memory pinning was designed with CUDA in mind, while OpenCL
requires managing both host and device memory buffer for efficient
mapping, which is not yet implemented.

This change teaches the PME module to understand what pinning policy
is appropriate to the build configuration, so that the setup of data
structures in various parts of the code can use a pinning policy that
always works.

Refs #2498

Change-Id: I2a294aee460947cd3aad5e23869cead1b99fd610

5 years agoIntroduced DDAtomRanges class
Berk Hess [Wed, 30 May 2018 12:40:39 +0000 (14:40 +0200)]
Introduced DDAtomRanges class

Replaces manually managed atom range data.
A consistency check for range setting order will be added later.

Change-Id: I1cc502ff3a1e596ac676b376b30f46ba485eda17

5 years agoCall Constraints::setConstraints with other setup code
Mark Abraham [Fri, 1 Jun 2018 08:06:32 +0000 (10:06 +0200)]
Call Constraints::setConstraints with other setup code

Refs #2423

Change-Id: Iebee644a133f60778fea9b8030b7b7bf9656ba82

5 years agoRemove LINCS prints to log file
Berk Hess [Wed, 13 Jun 2018 15:30:53 +0000 (17:30 +0200)]
Remove LINCS prints to log file

LINCS printed RMS and max constraint deviations before and after
constraining to the log file. Since this information is not useful
for the user and it is rank-local, is it now printed to debug instead.
Note that these prints appeared after refactoring, since before null
as passed as fplog.

Also removed LINCS warning prints to the log file, since they are
rank local, so only warnings on the master rank would show up.
Now warnings are only issued to stderr.

Change-Id: Ia60446ef0c21105c9687f31329ec6d4d17e8d838

5 years agoFix premature reporting of action when GPUs are not detected
Mark Abraham [Wed, 13 Jun 2018 07:24:45 +0000 (09:24 +0200)]
Fix premature reporting of action when GPUs are not detected

The decision about what to do when GPUs could not be detected is a
responsbility taken at a higher level, so the detection handling code
should just report the facts.

Clarified some of the intended usage in the documentation

Fixes #2374

Change-Id: I63b569e053dd88d66351640019efc758e91bbdff

5 years agoUse initializer lists for Lincs and Task
Mark Abraham [Tue, 6 Mar 2018 20:51:35 +0000 (21:51 +0100)]
Use initializer lists for Lincs and Task

This permits us to have some constructors that work the same way that
snew used to do (ie. calloc), so that future cleanup can use more
vectors, etc.

Also made a destructor of Constraints::Impl so the Lincs object gets
freed.

Refs #2423

Change-Id: Ie4a2001556d04f620a9d5241a9e1da9024cb9ce1

5 years agoUse more containers and views for constraints code
Mark Abraham [Sun, 4 Mar 2018 17:13:12 +0000 (18:13 +0100)]
Use more containers and views for constraints code

Lifetime and usage is clearer if we don't use raw pointers.

Refs #2423

Change-Id: I7d76e30acfd209baf2256efbd3c40290ed38caab

5 years agoPartial conversion of gmx_domdec_t to C++
Berk Hess [Mon, 14 May 2018 13:55:36 +0000 (15:55 +0200)]
Partial conversion of gmx_domdec_t to C++

Most of the simple buffers in gmx_domdec_t now use std::vector.
Changed AtomDistribution to use std::unique_ptr.
Now new is used for gmx_domdec_t with some default zero values.

Renamed charge groups to atom groups for all modified code
in preparation for the introduction of update groups.

Change-Id: Ie54b2e6fc354cd2fbc874023922369261b3cd092

5 years agoUpdate top-level README
Mark Abraham [Wed, 13 Jun 2018 07:09:36 +0000 (09:09 +0200)]
Update top-level README

Included most recent core GROMACS publication

Change-Id: If389c72902831598b7cf0263a7b74e40c8d21f86

5 years agoFixed documentation typo
Mark Abraham [Wed, 13 Jun 2018 07:39:26 +0000 (09:39 +0200)]
Fixed documentation typo

This version is true to the original text.

Refs #2359

Change-Id: I3c2ab7a30109a397999883d5147346f1244a77f0

5 years agoBump lmfit support to version 7
Mark Abraham [Mon, 11 Jun 2018 06:30:19 +0000 (08:30 +0200)]
Bump lmfit support to version 7

The breaking API change means that distributions will not be able to
build GROMACS reliably with support for lmfit of arbitrary versions.
Nor does lmfit provide any support for querying the version.

Updated the FindLmfit and other cmake code to make better use of
modern cmake idioms for managing build targets. lmfit support is now
handled by a tri-state GMX_USE_LMFIT cmake variable, which defaults to
using the bundled version. When building without lmfit support, tools
that call such fitting will now issue a fatal error.

Reorganized aspects of gmx_lmcurve to better encapsulate the
dependency, now that we have to support the absence of lmfit.

Updated install guide and COPYING file.

Refs #2533

Change-Id: I6b14e08be216f803326b0ad9215b8d89bb0962c1

5 years agoAdd AWH continuation consistency checking
Berk Hess [Tue, 20 Mar 2018 13:35:34 +0000 (14:35 +0100)]
Add AWH continuation consistency checking

AWH now checks at checkpoint continuation that the number of
visits/samples matches the update count. This catches unallowed
changes of AWH parameters or the number of walkers.

Change-Id: I3e3325327552f1f6c2f25c61ff8991c06c6fc36a

5 years agoMore fixes to suit gcc 8 for double build
Mark Abraham [Wed, 21 Mar 2018 09:57:26 +0000 (10:57 +0100)]
More fixes to suit gcc 8 for double build

gcc 7 supports the same syntax, but only gcc 8 requires it.

xl code path untested, because we have no access to a working compiler

Fixes #2421

Change-Id: I8f89af4b066be68e07a286a9fa45b8ded3c925f3