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
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
Roland Schulz [Sun, 20 May 2018 02:56:46 +0000 (19:56 -0700)]
Enable clang-tidy NullDereference
Change-Id: Ifaa59cd72723e61a989f1bf68ad014e90f8ff693
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
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
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
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
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
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
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
Berk Hess [Fri, 29 Jun 2018 08:52:59 +0000 (10:52 +0200)]
New quote from a referee
Change-Id: I527fede219fd6890b7d5a543e968d9213c3f40e2
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
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
Mark Abraham [Wed, 27 Jun 2018 17:44:25 +0000 (19:44 +0200)]
New quote from ISC2018
Change-Id: I931d05b9f0470c39e8acf1ab1c1dd9b15cf7fb4b
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
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
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
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
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
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.
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
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
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
Roland Schulz [Mon, 25 Jun 2018 07:34:55 +0000 (00:34 -0700)]
clang-tidy: performance-type-promotion-in-math-fn
Change-Id: I7cca74e0c280c564f7a71cc1a68a5402172eefd1
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
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
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
Berk Hess [Thu, 31 May 2018 07:50:06 +0000 (09:50 +0200)]
Add consistency check to DDAtomRanges
Change-Id: Iee153a6268258f32fc1724376188fae35187f345
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
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
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
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
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
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
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
Roland Schulz [Sun, 24 Jun 2018 02:15:31 +0000 (19:15 -0700)]
Allow GMX_OCL_DEBUG for any vendor
Change-Id: Iefcce1a2881a5c979c2114a159799c08c779974e
Roland Schulz [Sun, 20 May 2018 07:16:52 +0000 (00:16 -0700)]
clang-tidy: Enable most bugprone checks
Change-Id: I63f3cdd76e1d4a5141cca62b8ed03e36251a68b4
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
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
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
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
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
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
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
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
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
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
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
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
Mark Abraham [Wed, 21 Mar 2018 10:35:35 +0000 (11:35 +0100)]
Prepare for GROMACS 2019 release notes
Since we want to add to these as part of the relevant commits, we need
some stub files and content now.
Change-Id: Ie318cb77a42be04e34cefe2585415faba9a53d5d
David van der Spoel [Tue, 20 Mar 2018 07:52:10 +0000 (08:52 +0100)]
Let gmx nmeig print thermochemistry.
The quasiharmonic entropy analysis computes vibrational entropy.
Here we add translational and rotational terms in order to compare
directly to experimental data. In addition the heat capacity and
vibrational internal energy are computed in the same manner.
The vibrational internal energy is printed as well.
A frequency scaling factor as is customary in quantum chemistry
code is available as well.
Change-Id: Ib9a76ecfc2f2cc27c90f3f9b58a924036a912e1f
Paul Bauer [Fri, 25 May 2018 16:44:43 +0000 (18:44 +0200)]
Change use of t_inpfile to std::vector
Refactored code to use std::vector for t_inpfile instead of pointers.
This is meant to be the basis for a change in mdp file writing from gmx
dump that requires the t_inpfile structure to use the already available
functions to write the file instead of having a custom one.
Rebased on change that changes the use of macros to functions for
reading the information into the structure.
Changed t_inpfile to a struct with constructor and destructor, as well as
replacing the custom sort function with std::sort.
Change-Id: I0c5c646b183d232c638db869f98457af82e0be18
Paul Bauer [Mon, 28 May 2018 11:24:26 +0000 (13:24 +0200)]
Remove macros in input file reading
Removed macros used when parsing input files with the actual functions.
Added functions that wrap the comment string printing. Removed unused
variables that resulted from the change.
Change-Id: I1fd09df87095d199caf817b36fdf9e8819f049e3
Aleksei Iupinov [Fri, 18 May 2018 14:16:37 +0000 (16:16 +0200)]
Compile most of PME GPU host code with OpenCL
Change-Id: Ifca008ac44e345cc6ab87a3b7bd6d5694385a082
Berk Hess [Thu, 17 May 2018 11:24:39 +0000 (13:24 +0200)]
Clean up make_at2con
Added an enum to control the flexible constraint treatment.
Removed start (was always zero), simplified indexing and added
documentation.
Change-Id: I08494dd553e85f8ff4aa39303899639583fdc7ac
Mark Abraham [Fri, 27 Apr 2018 13:18:13 +0000 (15:18 +0200)]
Move IMD initialization and fuse DD setup
init_IMD does not use the local state, and only the global state
positions on master rank, so we can move it before the local state
initialization.
This permits us to fuse some DD setup stages
Removed inaccurate comment about DD partioning.
Refs #1793
Change-Id: I00f98c22f5a17a1b9ae1114b513cfa3ea3798334
Kevin Boyd [Thu, 24 May 2018 02:44:28 +0000 (22:44 -0400)]
Added to PME on GPU information in mdrun performance
Added -pme to glossary
Moved and modified a previous mdrun with GPU example to follow
a more logical progression - first introduce the simpler use cases
of gputasks and show examples, then at the end show how to avoid a
graphics-dedicated GPU
Added more GPU task assignment examples
Change-Id: I63304a511d5d98d85fdbb1cea497627a80a14418
Mark Abraham [Sun, 3 Jun 2018 22:54:58 +0000 (00:54 +0200)]
Make proper BoxDeformation class
Fixes several long-standing implementation issues. Also now
throws if the integrator is non-dynamical.
Change-Id: I8ca08252b467d1e03addadf4d92ce88243b37197
Berk Hess [Mon, 21 May 2018 20:42:49 +0000 (22:42 +0200)]
Make nbnxn_grid_t counts and sizes arrays
This enables templating on the dimension.
Also put the cell index storing and atom counting together in
a separate function, since these need to be consistent.
Change-Id: I9931ff258a90a6ea5af788b7ec3e56d32859e47b
Mark Abraham [Sun, 4 Mar 2018 16:25:49 +0000 (17:25 +0100)]
Separate flexible constraint counting
Functions should do one thing, particularly when the thing is only
needed some of the time and complicates returning multiple things.
Minimized scope of some variables, avoiding risky re-use of variables
with the same name.
Refs #2423
Change-Id: I1860447b4780e76c20a53964a2a946512689b872
Mark Abraham [Fri, 2 Mar 2018 08:58:19 +0000 (09:58 +0100)]
Make Constraints a proper class
Converted the opaque C struct to a pimpl-ed C++ class.
Numerous callers of constraint routines now don't have to pass
parameters that are embedded within the class at setup time,
e.g. for logging, communication, per-atom information,
performance counters.
Some of those parameters have been converted to use const references
per style, which requires various callers and callees to be modified
accordingly. In particular, the mtop utility functions that take const
pointers have been deprecated, and some temporary wrapper functions
used so that we can defer the update of code completely unrelated to
constraints until another time. Similarly, t_commrec is retained as a
pointer, since it also makes sense to change globally.
Made ConstraintVariable an enum class. This generates some compiler
warnings to force us to cover potential bug cases with fatal errors.
Used more complete names for some of the enum members.
Introduced a factory function to continue the design that constr is
nullptr when we're not using constraints.
Added some const correctness where it now became necessary.
Refs #2423
Change-Id: I7a3833489b675f30863ca37c0359cd3e950b5494
Mark Abraham [Sun, 3 Jun 2018 21:49:54 +0000 (23:49 +0200)]
Update Awh initialization and lifetime management
inputrec no longer stores the main module, just the user-specified
parameters
RAII and make_unique is used for resource management.
The new factory function provides a good place to run cross-module
checks and checkpoint handling preparation.
Change-Id: I63218e201f965b838106fc8918a3f9fabdba88cb
Mark Abraham [Sun, 3 Jun 2018 21:03:19 +0000 (23:03 +0200)]
Remove redundant shell-code fatal errors
These errors are duplicated in init_shell_flexcon()
Change-Id: I6cd2581fb3f68f4478aed33566041c7c17b9912c
Szilárd Páll [Thu, 31 May 2018 16:26:21 +0000 (18:26 +0200)]
Fix timing of clFFT kernels
Also add some missing docs.
Fixes #2536
Change-Id: If5d9a3d6309e88f8ff4aed2ec58387e290755bb5
Magnus Lundborg [Tue, 29 May 2018 15:19:12 +0000 (17:19 +0200)]
Write lambdas and box to TNG at correct intervals
Lambdas and box sizes are supposed to be written at the lowest common
denominator of the interval of all outputs to the TNG file(s). Before
this commit it was only written when other output was also written.
Fixes #2507
Change-Id: If9c7b063deccbc3a94b5c5df4b59e06ffdbeac56
Kevin Boyd [Fri, 25 May 2018 01:37:27 +0000 (21:37 -0400)]
Cosmetic fixes to mdp documentation
Mostly grammar/tense/linking
Added specific mentions of .trr and .xtc file extensions in output control
Properly formatted superscripts, removed unneccessary escape characters in units
Change-Id: Ia359ffae1c54075d2fcc36c7b7b81acef779f608
Aleksei Iupinov [Tue, 29 May 2018 10:39:59 +0000 (12:39 +0200)]
Merge pme.cu into pme-gpu-internal.cpp
All the code is moved as is, only the includes change.
Change-Id: I96590c411718b3bff912b08ac9ee09bd681a6b64
Aleksei Iupinov [Thu, 17 May 2018 15:12:16 +0000 (17:12 +0200)]
PME OpenCL 3D FFT transform is implemented, using clFFT
This is not yet used but already compiled.
Refs #2536
Change-Id: I49d47ce1ca2bfe75759e757259371289a18a584c
Aleksei Iupinov [Fri, 18 May 2018 10:34:32 +0000 (12:34 +0200)]
Move pme-timings.cu to pme-gpu-timings.cpp
This prepares PME GPU timer code to be compiled with OpenCL.
Change-Id: I90228a57f534844d2a41547937662fc37bfec8d5
Aleksei Iupinov [Wed, 23 May 2018 16:44:53 +0000 (18:44 +0200)]
Prefer linking to system clFFT rather than bundled one
Wrote a new find_package module that works in more modern
ways. Updated install guide.
Currently there is no support for checking the clFFT version, which is
unlikely to matter until they make the 2.14 release.
Fixes #2500
Change-Id: If43ee95d3066823f2c57a49a23fd6dd027dbcc94
Aleksei Iupinov [Thu, 17 May 2018 16:40:13 +0000 (18:40 +0200)]
Move the PmeGpuSpecific structure into pme-gpu-types-host-impl.h
This host structure contains trait-dependent types,
but should also be visible to OpenCL.
Change-Id: I068e537687b78488d66c927a355a115e4581885b
Aleksei Iupinov [Mon, 7 May 2018 15:33:25 +0000 (17:33 +0200)]
Added the bundled clFFT into OpenCL builds
Used an object library, since we have no need of a real library, to
have or to install, whether shared or static. Checked for the
availability of dynamic loading, and made it available portably to
libgromacs.
Clfft initialization class is added and used in mdrunner to
initialize/tear down clFFT library resources in a thread-safe
manner, and only on ranks that require such setup. Noted TODOs
for future work.
Noted a useful style for explicit listing of source files.
Refs #2500
Refs #2515
Refs #2535
Change-Id: I62d7d66f65e147bde17929ccc30abad36e2373c6
Aleksei Iupinov [Mon, 16 Apr 2018 15:54:07 +0000 (17:54 +0200)]
Add GpuEventSynchronizer class
This class encapsulates the host synchronisation on a single GPU
event (currently used for PME mixed mode).
In the future it can also be extended for inter-queue GPU sync.
Change-Id: I8ea0cb615c041d64ebb0580b5f54bdaa26a6aeea
Aleksei Iupinov [Thu, 17 May 2018 12:28:39 +0000 (14:28 +0200)]
Gather the PME GPU constants/macros in a single header
Those will be translated to defines by the OpenCL kernel compiler.
Refs #2453, #2528
Change-Id: I03062c908db6dad9bbc8c62accdc4707b03ff527
Aleksei Iupinov [Thu, 3 May 2018 14:20:50 +0000 (16:20 +0200)]
Make PME GPU structures use DeviceBuffer
A couple related function calls in PME are changed to match.
allocateDeviceBuffer() is now correctly called with the GPU
context handle instead of a stream handle (this was not causing
errors since context is only a stub in CUDA implementation).
pme-gpu-internal.cpp is now compiled with CUDA compiler
(to handle gputraits.cuh included through devicebuffer.h),
paving the way for using unified CUDA/OpenCL host code.
Change-Id: I3621bd93e4b2cc7c02161323f532ca62b48763ab
Roland Schulz [Mon, 21 May 2018 02:44:10 +0000 (19:44 -0700)]
Fix MSAN build-type and error
FLAGS setting was missing FORCE and wasn't working. Slightly
improve the flags. Fix one detected error. One error in TNG
remaining.
Change-Id: I4863d9c7315fdc6b714cbbf2294e58e3d6ce45ed
Szilárd Páll [Sat, 26 May 2018 13:03:16 +0000 (15:03 +0200)]
Switch to CUDA 9.2 + gcc 7
Latest gcc with CUDA combination is updated as the recent CUDA 9.2 now
supports gcc 7.
Also removed the outdated reasoning for the gcc-6 config on bs-mac.
Change-Id: I4935efd895502675dee1789904dba2d472bcc97a
Aleksei Iupinov [Thu, 26 Apr 2018 13:15:24 +0000 (15:15 +0200)]
Support persistent device context-derived data in PME tests
PME OpenCL will need to not recompile kernels for running each
unit test. With this in mind, a persistent PmeGpuProgram class
is tasked with GPU kernel setup, and passed around, using a typedef.
The purpose of the class is to hold the PME program data that should
only be set up once and live forever for the given device context.
PmeGpuProgramImpl structure is now tasked with managing
function pointers to the CUDA kernels' instances, and will later
be tasked with compiling OpenCL kernels.
Refs #2453, #2522
Change-Id: I85a01bfc92ec3a108825414b14e2be3731433c9a
Mark Abraham [Fri, 25 May 2018 01:07:41 +0000 (03:07 +0200)]
Clean up force.h and its use
Reduced use of transitive inclusion of headers, along with unnecessary
inclusion of force.h, and broke it up into its parts.
Change-Id: Ic75795e98e010bd2d36093cdce28d101343a5645
Mark Abraham [Tue, 22 May 2018 19:42:35 +0000 (21:42 +0200)]
Remove bDomDec from t_forcerec
Whether DD is in use should be conveyed in a consistent manner, which
for now is best done with cr.
Change-Id: I1e9e9763b5beee2ad1540c404f57c91597abc919
Berk Hess [Wed, 23 May 2018 15:27:09 +0000 (17:27 +0200)]
Fix grompp bug with blocks of same molecules
Merging consecutive molecule blocks with the same molecule types
caused a segv.
Fixes #2517
Change-Id: I14759527383f06cb0021368c9e6312aa00ccba41
Mark Abraham [Fri, 27 Apr 2018 16:58:48 +0000 (18:58 +0200)]
Move responsibility for bonded threading decomposition
This is an aspect of force calculation, not of the topology needed for
that force calculation.
Removed use of assert no longer needed now that the responsiblity has
been moved.
Also updated some use of struct keyword.
Refs #2492
Change-Id: If9d356dc9c4de49b84f23e9c432baa84a8335731
Mark Abraham [Thu, 24 May 2018 13:26:59 +0000 (15:26 +0200)]
Relocate GPU initialization for PME
We need to have set up the GPU we intend to use before we would want
to e.g. compile kernels for it. We will shortly want to do this
for OpenCL support for PME.
Change-Id: Iaf22ecba8fb3ad7583b57958742abb018d1e8a0d
Berk Hess [Thu, 24 May 2018 11:13:58 +0000 (13:13 +0200)]
Simplify idef_fe in calc_listed_lambda
Instead of (mis)using the bonded threading range indexing to index
only the perturbed interaction in calc_listed_lambda(), now idef_fe
only contains the perturbed interactions.
This allows to assert on consistency of the threading and the topology
in calc_one_bond()
Change-Id: I8eae27b626bf41ea3a3e75fa55295c12cde3b4f2
Mark Abraham [Wed, 23 May 2018 13:21:43 +0000 (15:21 +0200)]
Reform Ewald-module cmake handling
The globbing approach is convenient when all the files get the same
treatment, but sometimes inconvenient when you forget to run cmake
when adding or deleting files. Subtracting one glob from another makes
it rather hard to know what is going on, particularly with multiple
changes in flight.
Specifying the files makes it easier to see what is going on when
there are multiple different configurations that need different files,
as we are shortly likely to have as OpenCL support for PME is
integrated. This is similar to the approach now used in gpu_utils.
Change-Id: I11a62cab6fb87ed895615486a7071d420a62ea6e
Berk Hess [Tue, 22 May 2018 18:58:59 +0000 (20:58 +0200)]
Change nbs in nbv to std::unique
Change-Id: Ife3d5904553a8245aaf7e99e0912aa6d6c7ad03f
Berk Hess [Mon, 14 May 2018 13:55:36 +0000 (15:55 +0200)]
Convert gmx_domdec_master_t to C++
Renamed to AtomDistribution, now in its own files.
This change is only refactoring.
Change-Id: I0a71efc559c107b3dce0939bd65d21f2bfee0ae7
Mark Abraham [Wed, 16 May 2018 19:28:42 +0000 (21:28 +0200)]
Clean up PME testing
Resolves a TODO to simplify things by building hardware contexts that
are already aware of the code path they can test.
Also stops doing unecessary copying of TestHardwareContext objects.
Setting up the hardware contexts for PME testing duplicated the
knowledge that a CUDA build is required in order for testing PME on
GPUs to be relevant. So this patch separates the checking for whether
the build can support PME on a GPU from whether the user's input is
able to run on a GPU. Extracted a common function from related
code. Used less preprocessing. Noted an additional TODO to start using
the context these messages provide.
Change-Id: Ic2dda686168f69ab6ea845f841f774a84ddd9d0d
Roland Schulz [Thu, 17 May 2018 00:08:30 +0000 (17:08 -0700)]
Rename GMX_OCL_CLUSTER_SIZE to GMX_OCL_NB_CLUSTER_SIZE
Refs #2454
Change-Id: I077447845a92bfa70808b63529d924732b5bd76d
Berk Hess [Wed, 16 May 2018 11:41:27 +0000 (13:41 +0200)]
Split off collect.cpp from domdec.cpp
Change-Id: I6bb8ed282d4d8edd1d2ec22e52f5fb34013f2fb8
Berk Hess [Tue, 22 May 2018 12:31:12 +0000 (14:31 +0200)]
Convert nbnxn_search to C++
Also converted nbnxn_search_work to C++
Change-Id: Ic46bf26f8b6cf4d9afee48b715f0b80a4de55691
Kevin Boyd [Wed, 23 May 2018 00:39:26 +0000 (20:39 -0400)]
Removed "XXX non-matching atom names" Martini statement.
The current statement is that atom renaming in grompp is part of the
accepted workflow, and so the above error can be ignored. Not sure how
long ago this was the case, but I'm fairly certain it isn't now.
Change-Id: Ie4f00bf49d0108c36b5f47b59942b455bba8cd28
Berk Hess [Fri, 18 May 2018 05:52:32 +0000 (07:52 +0200)]
Change nbnxn grid reallocation
The nbnxn grid memory reallocation now happens right before access
and with the exact amount needed instead of overallocating.
Change-Id: Iacc7c4de736765709fe841dd9b1aef9d3d77f7c9
Berk Hess [Thu, 17 May 2018 22:07:44 +0000 (00:07 +0200)]
Use std::vector in nbnxn_search_t
Change-Id: Ia2babb4443e1330fb950e1ba62763f89f100418c
Berk Hess [Thu, 17 May 2018 20:55:40 +0000 (22:55 +0200)]
Use std::vector in nbnxn_grid_t
Change-Id: I0a5c04f9504243f1dfe462ca7374feffbbed8ee3
Kevin Boyd [Mon, 21 May 2018 01:25:28 +0000 (21:25 -0400)]
Cosmetic documentation changes
Fixed some broken links
Spelling errors/tense errors/grammar
Change-Id: Ie83e36a46cda2f686098e4e88f0acf13faf2e5cd
Kevin Boyd [Sat, 19 May 2018 20:09:02 +0000 (16:09 -0400)]
Minor fixes to mdrun performance documentation
In "Examples for mdrun on one node," third example description, the respective number
of thread-mpi ranks and OpenMP threads per rank were reversed.
In "Examples for mdrun on one node," 6th example. For 12 logical cores, the pinoffsets
should be 0 and 6, respectively (I think)
A few command line examples of running mdrun with more than 1 node used gmx rather
than gmx_mpi
Several spelling/grammar/tense error/linking issues addressed.
Change-Id: I014bc52d55cda1cbd05843cb8e960c2a2d7cbb47
Berk Hess [Thu, 17 May 2018 16:12:19 +0000 (18:12 +0200)]
Clean up in nbnxn_grid.cpp
Made variable names more descriptive and added more const.
Change-Id: I3092656511e4e2cf30059f334e6ede14d6d617be
Aleksei Iupinov [Mon, 19 Feb 2018 18:25:34 +0000 (19:25 +0100)]
prepareGpuKernelArguments() and launchGpuKernel() are added
Template functions are added for preparing/packing GPU kernel
arguments and launching GPU kernels. This allows to hide
CUDA/OpenCL boilerplate. launchGpuKernel() throws InternalError
on failure. GPU kernels scheduling details are unified into
a KernelLaunchConfig struct. The new functions are applied
in NB as well as PME (facilitating PME OpenCL porting).
Change-Id: I90205cf1cda93c377a342b7f1c46a8caf239ba65
Berk Hess [Mon, 7 May 2018 15:35:15 +0000 (17:35 +0200)]
Split off domdec distribution and cellsizes
Move domain decomposition distribution and cell size related functions
to separate files.
This change is only code motion, apart from changing some macros to
constexpr or inline functions and adding some const qualifiers.
Change-Id: Ib943944b090958921428f69ecaf9e53f7e2ab224