alexxy/gromacs.git
5 years ago3/3 of old-style casting
Roland Schulz [Fri, 6 Jul 2018 02:05:20 +0000 (19:05 -0700)]
3/3 of old-style casting

Also remove GMX_CXX11_COMPILATION and gmx_qsort

Change-Id: I3cfec7dfdb47da89d3849ff7e9cc15f0550194a9

5 years agoAdd _real user defined literal
Roland Schulz [Mon, 6 Aug 2018 06:34:40 +0000 (23:34 -0700)]
Add _real user defined literal

Change-Id: Ia656d894db2f663a3b8cfc1f6897f20d97759edc

5 years agoEnable clang-tidy for headers
Roland Schulz [Mon, 30 Jul 2018 22:46:57 +0000 (15:46 -0700)]
Enable clang-tidy for headers

Change-Id: Id5acfb264ac57c09cc1a7d8ab512eb7c6bfc40f1

5 years agoAvoid using global variables in programs
Roland Schulz [Fri, 12 Jan 2018 08:46:35 +0000 (00:46 -0800)]
Avoid using global variables in programs

Using global variables defined in libgromacs and
used from outside causes issues if only lazy
binding is available.

Change-Id: Id1e960d7c638476d3f7ace339a327040f516f6fc

5 years agoAdded physical validation document to the dev manual.
Kevin Boyd [Thu, 9 Aug 2018 00:33:14 +0000 (20:33 -0400)]
Added physical validation document to the dev manual.

physical_validation.rst had been written but not added to the
document generation

Unwrapped a few lines that were causing warnings

Change-Id: I99ade0d25ae3897f01a6ac57d4369c2a4e36f61b

5 years agoRemove Debug Helpers from Essential Dynamics code.
Christian Blau [Thu, 9 Aug 2018 08:40:51 +0000 (10:40 +0200)]
Remove Debug Helpers from Essential Dynamics code.

dump_edi_positions, dump_edi_eigenvecs, and dump_edi rely on the data
layout of the essential dynamics code and leave a large foot-print of
changes when refactoring the code.

All information dumped is reasonably accessible with a modern debugger,
also on

Part of #2590

Change-Id: Icbd60a3347014df365aa17d47bcbbb18c2566a83

5 years agoLocal atom sets in rotational pulling.
Christian Blau [Mon, 6 Aug 2018 21:00:32 +0000 (23:00 +0200)]
Local atom sets in rotational pulling.

Uncouples domain decomposition from rotational pulling by the use of
local atom set.

Change-Id: Ide8de70033a4e8d8f4e8c7eb66a554e0d3316654

5 years ago2/3 of old-style casting
Roland Schulz [Mon, 2 Jul 2018 18:29:58 +0000 (11:29 -0700)]
2/3 of old-style casting

Manual changes.

Change-Id: I5a9d1ab65498f70539dd1f28bb538781dd1021f8

5 years agoEnable ccache compiler wrapper when available.
M. Eric Irrgang [Mon, 30 Jul 2018 10:46:38 +0000 (13:46 +0300)]
Enable ccache compiler wrapper when available.

Let CMake use ccache compiler wrapper via `..._LAUNCHER`.

For gcc and compatible compilers, the cost of rebuilding can be greatly
reduced when switching back and forth between branches. If ccache is not
installed or is not given a known-compatible compiler to wrap, this
change has no effect.

Potential side effects should already be familiar to ccache users:

* In some cases, a cache configured to grow too large may lose its benefit.
* If the cache is corrupted, it may need to be removed to restore utility.

We are not using any of the more aggressive caching options, so there
should be no risk of false positives in compile cache hits.

Resolves #2592

Change-Id: Ia04d7388a3e8367d31cc5728dfc4b245ea7ef774

5 years agoEssential dynamics functions use const-ref for input t_edpar.
Christian Blau [Wed, 8 Aug 2018 12:31:48 +0000 (14:31 +0200)]
Essential dynamics functions use const-ref for input t_edpar.

Made function calls to t_edpar carrying input parameters use const &, so
that we can later use a const parameter storage class.

Added documentation and trivial modernisation to functions and moved
them into anonymous namespace.

Part of #2590

Change-Id: I1910f45c3695ce6b1c234f67bd3ecaa279541e26

5 years agoSplit essential dynamics eigenvector reading.
Christian Blau [Mon, 6 Aug 2018 06:46:12 +0000 (08:46 +0200)]
Split essential dynamics eigenvector reading.

Split off input parameter reading in all t_eigvec from working memory
allocation for buffers or simulation state variables. Preparation to
splitting t_eigvec and t_edflood data structures in constant input
data, temporary buffers, and data describing the simulation state.

Moved the initialReferencePosition and referenceSlope out of t_eigvec
into t_edflood, because it is only used in flooding and is meaningless
for all other data structures using t_eigvec.

Part of #2590

Change-Id: Id01aeca97489a02a6ed7c7ed2789fd11b978a115

5 years agoMake essential dynamics a C++ type.
Christian Blau [Mon, 6 Aug 2018 15:18:02 +0000 (17:18 +0200)]
Make essential dynamics a C++ type.

Confer also the reform of the rotational pull data, Ic03919f68c, for the
conversion strategy for gmx_edsam.

Part of #2590

Change-Id: Iece42512a8c5222d86ab8545ce2fc12aa1c6ffc7

5 years agoFix part of old-style casting
Roland Schulz [Mon, 2 Jul 2018 04:58:10 +0000 (21:58 -0700)]
Fix part of old-style casting

Part clang-tidy google-readability-casting is able to do.
Manual fixes in:
fileio/vmdio.cpp
gmxlib/nonbonded/nonbonded.cpp
selection/sm_same.cpp
gmxana/gmx_anadock.cpp
gmxana/gmx_cluster.cpp

Change-Id: Iad15ea205ac56b29f8ecaea6556fabedec975736

5 years agoRemove gmx custom fixed int (e.g. gmx_int64_t) types
Roland Schulz [Mon, 16 Jul 2018 16:35:11 +0000 (09:35 -0700)]
Remove gmx custom fixed int (e.g. gmx_int64_t) types

Change-Id: I20b6681f55c06e535524923351c9919ec4c7ffa3

5 years agoAdd some developer help to Developer Guide.
M. Eric Irrgang [Thu, 2 Aug 2018 11:55:38 +0000 (14:55 +0300)]
Add some developer help to Developer Guide.

Import helpful stuff from old web site.

Change-Id: I9ae4e872a8de014e9ddd3afed47067e9f7aac405

5 years agoRemove duplicate entry for Doxygen from dev manual
Paul Bauer [Mon, 6 Aug 2018 07:45:06 +0000 (09:45 +0200)]
Remove duplicate entry for Doxygen from dev manual

The page for doxygen was added twice to the developer manual, as it was
included both in the style guidelines and under development tools.
Removed the entry in the style section, as I think that the information
is better situated in the tools section.

Change-Id: Ie8f802b6981e7fdb53d04002e05563f092bc8047

5 years agoLocal atom sets in compEL / ion swapping code.
Christian Blau [Wed, 14 Mar 2018 12:33:23 +0000 (13:33 +0100)]
Local atom sets in compEL / ion swapping code.

Local atom sets remove depency of domain decomposition on the
computational electrophysiology modules and handle atom index updates
outside of this module.

Additional refactoring, because swap_group has to be a C++ struct now.

Refers to #1972

Change-Id: Ic6ee2a71f5c5c11e161fa26aafbed2764e014daa

5 years agoFix clang-tidy MPI warnings
Roland Schulz [Fri, 3 Aug 2018 22:47:07 +0000 (15:47 -0700)]
Fix clang-tidy MPI warnings

Change-Id: Ib7098b1409c3b11b6464d2b7673a0f58a807ed4f

5 years agoChange gmx_bool from int to bool
Roland Schulz [Mon, 21 May 2018 05:41:57 +0000 (22:41 -0700)]
Change gmx_bool from int to bool

This relies on C bool and C++ bool be of same size.
The language doesn't gurantee that. But we anyhow require
that both compilers use the same ABI and in that case
both types will have the same size.

Change-Id: I50b1b2e5683abfd1a5389ea158db2fda86e752c5

5 years agoDisable FPE for GCC 7.* with optimizations
Roland Schulz [Mon, 6 Aug 2018 02:17:32 +0000 (19:17 -0700)]
Disable FPE for GCC 7.* with optimizations

Only GCC 7 with RelWithAsserts has issues. And debugging
has been unsuccessful.

Related #2404

Change-Id: I0ed3161c12cc8c33af3280f30a97a25c5d38cf1b

5 years agoReform enforced rotation working data
Mark Abraham [Tue, 17 Jul 2018 21:46:31 +0000 (23:46 +0200)]
Reform enforced rotation working data

runner now holds responsibility for this object, not inputrec. We need
this separation as a precursor for various modularization efforts. The
input parameters are now referred to from that object, as a precursor
to forming a proper class and module.

The working data for each rotation group now contains a handle to the
const input data for each rotation group, rather than the other way
around. It also contains its index within the set of rotation
groups. These permit more const correctness, more range-based for
loops, and fewer parameters passed. This will let us evolve a class
to handle each group and/or type of rotation.

A vec field in the inputrec is now called inputVec. Formerly , it
handled both the user input and the normalized form used during the
work of the module, which no longer occurs. The name change makes it
clear that there are no remaining inadvertent uses of the field in the
input data.

The ind_loc field is now a proper deep copy of the ind field, because
they contain different data. This can be superseded by the
LocalAtomSet approach.

Some additional const correctness and reduced scope of iteration
variables.

Change-Id: Ic03919f68cc121eed9ebba58f887f18e5d1d8720

5 years agoclang-tidy: modernize make-unique/shared
Roland Schulz [Tue, 17 Jul 2018 20:27:44 +0000 (13:27 -0700)]
clang-tidy: modernize make-unique/shared

Change-Id: I913646526c767a409b74854c3a8efce5806a2a97

5 years agoSupport hwloc 2.x.x
Kevin Boyd [Sat, 21 Jul 2018 18:56:38 +0000 (14:56 -0400)]
Support hwloc 2.x.x

Created compatibility layer to account for API changes moving
from hwloc 1.x.x to 2.x.x while retaining support for v1.x.x.

Changes supporting hwloc 2.x.x include:
    -reworked descendents lookup in topology tree to account for new
     division of object children into "normal", "memory", and "io" types
    -different memory access location for hwloc objects
    -accessing distances (latencies) between nodes has been reworked
    -different flags for accessing PCI devices
    -changed numa node ancestor search to account for numa nodes no
     longer being a normal part of topology tree

Fixes #2539

Change-Id: I483dda3dd344d8f7c99aa828bcc118a3d2de9dfd

5 years agoSplit essential dynamics reading routine
Christian Blau [Tue, 31 Jul 2018 09:27:10 +0000 (11:27 +0200)]
Split essential dynamics reading routine

Introduce a class that handles the .edi file magic number reading and
versioning.

Split off working memory allocation and file version checking from
parameter reading.

Part of #2590

Change-Id: I22ee0294d464ba3acc2e5c54b3a42d97c90cbb71

5 years agoRemove extraneous gitignore line.
M. Eric Irrgang [Tue, 31 Jul 2018 15:03:58 +0000 (18:03 +0300)]
Remove extraneous gitignore line.

The line for `#*` is a comment, but is not a useful one. It may
have been intended (and may be misread) to indicate temporary
files that start with `#`. Since no one has noticed for years that
it doesn't do that, I propose to remove the line. If someone finds
it appropriate to exclude files starting with a hash, they can add
a `\#*` line. If the line was a comment, then its meaning should
be explained in a separate change (potentially superceding this one).

Change-Id: Ice7f9b9bd11f3ac0360e567a744106a4a8ca1494

5 years agoClean up inputrec structs
Mark Abraham [Tue, 17 Jul 2018 15:47:11 +0000 (17:47 +0200)]
Clean up inputrec structs

Used Doxygen for comments. Less use of typedef struct and better use
of forward declarations at the top of the header file. Expanded some
abbreviations and fixed some spelling and punctuation.

No functionality changes.

Change-Id: I20da07314a131b945d09dcbf25d95a37ef9c03cd

5 years agoMove out OpenCL device utils from vectype ops
Szilárd Páll [Fri, 25 May 2018 15:37:36 +0000 (17:37 +0200)]
Move out OpenCL device utils from vectype ops

The vectype_ops.clh contained misplaced device functions that did not
really implement vector-type operations. These are now moved to a
separate general-purpose device-side OpenCL utils header.

Change-Id: I225260e0fc63fbb144a30f2efecdb8adb7d20100

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