alexxy/gromacs.git
6 years agoEnable missing declarations warning
Roland Schulz [Fri, 25 Aug 2017 01:26:34 +0000 (18:26 -0700)]
Enable missing declarations warning

Change-Id: I055e12554e40fea43d37590ea3989d0a8fbe732d

6 years agoFix typo and tweak env var docs
Szilárd Páll [Mon, 28 Aug 2017 15:26:38 +0000 (17:26 +0200)]
Fix typo and tweak env var docs

Change-Id: I78005b3fb4923ea4f81229640327d47e6c182303

6 years agoAllow passing optional width argument into CUDA shuffle intrinsics
Aleksei Iupinov [Fri, 25 Aug 2017 14:16:19 +0000 (16:16 +0200)]
Allow passing optional width argument into CUDA shuffle intrinsics

Change-Id: I207d8a7f94bf317e34ae4ff8cdb963fc96890260

6 years agoMake pull potential registration thread-safe
Berk Hess [Tue, 8 Aug 2017 11:41:16 +0000 (13:41 +0200)]
Make pull potential registration thread-safe

Note that registration is currently not used and with a single
potential provider (such as AWH) there would be no issues.
This is for general thread safety.

Change-Id: I2e9be073655bfbe83cdc93a0f74b26e0b2e39dca

6 years agoSet default GMX_OPENMP_MAX_THREADS to 64
Berk Hess [Mon, 28 Aug 2017 15:28:18 +0000 (17:28 +0200)]
Set default GMX_OPENMP_MAX_THREADS to 64

As there are many new CPU with more than 32 hardware threads and
GROMACS scales quite well to more than 32 threads,
GMX_OPENMP_MAX_THREADS is increased from 32 to 64 threads.
The performance impact of this is that bitmasks are by default
64-bit instead of 32-but integers, which on 64-bit systems should
only have a (negligible) effect on cache pressure.

Change-Id: I73d1c79e86f30f7fc69e1f49e1195271435e77b6

6 years agoAvoid division by zero is pruning part calculation
Szilárd Páll [Mon, 28 Aug 2017 12:31:25 +0000 (14:31 +0200)]
Avoid division by zero is pruning part calculation

Added assert on manually set pruning interval.

Change-Id: I438f98a0a42335d8f79bf7604b53b51943e7db8c

6 years agoAdjust PME LJ solver test input coefficient
Aleksei Iupinov [Thu, 24 Aug 2017 15:56:25 +0000 (17:56 +0200)]
Adjust PME LJ solver test input coefficient

The previous value caused one of the unit tests to fail predictably
on ARM_NEON SIMD. Coefficient was so low that it caused a specific
grid value to hover at the GMX_FLOAT_MIN threshold, which is used
to allow using same test reference data for single/double precision.

Ref #2234

Change-Id: Ia1aa51ead263e82487585abb167c4d080fd813ac

6 years agoEnable unused function warning
Roland Schulz [Thu, 24 Aug 2017 20:56:21 +0000 (13:56 -0700)]
Enable unused function warning

Change-Id: Id00efec9fd2e4edbae328cc291435c202b327492

6 years agoImproved SIMD test data to use all bits
Erik Lindahl [Thu, 25 May 2017 18:01:57 +0000 (20:01 +0200)]
Improved SIMD test data to use all bits

The SIMD test data now uses all available bits in the
current precision floating-point numbers, to catch errors
where we lose precision or have mistakes in single/double
conversions (e.g. return values). Since some operations now
depend on the least significant bit, a few tests have been
relaxed to allow a tolerance rather than require exact
binary matching.

The new tests caught a precision loss in a reduction
function for the SIMD-mimicking scalar functions, but this
has never been used apart from testing, and should be harmless.

Fixes #2163.

Change-Id: I6d8f19d2aafeee8f42a2034c6100fcb10f6d2e81

6 years agoAvoid bonded forces loops/timers on inputs with no bondeds
Berk Hess [Tue, 8 Aug 2017 13:19:09 +0000 (15:19 +0200)]
Avoid bonded forces loops/timers on inputs with no bondeds

This excludes near-zero "Bonded F" and "Listed buffer ops." subcounters
on such inputs.
Moved the bonded loop and thread parallelization to a separate function.
Also made the lambda input array const.

Change-Id: I862fc601e8adcf6d0b1eb7bd88390b0ea073e4fb

6 years agoStopped checkpoint influencing parallelism setup
Mark Abraham [Mon, 21 Aug 2017 16:11:05 +0000 (18:11 +0200)]
Stopped checkpoint influencing parallelism setup

There's no strong reason to prefer that by default the parallelism
setup is the same as it was for the run in the checkpoint. If the next
run has the same number of ranks, then either we should follow the
user's instructions for the second run, or apply the defaults. This
permits us to fix bugs in the default settings for patch releases, and
have it work. It also prepares for future auto-tuning when we hope to
be able to adapt to the run-time environment, which will become
increasingly volatile, between and within runs. And of course it
simplifies the setup code slightly.

Change-Id: I41d65132f0855cd57a0a572d4579045bf10f295e

6 years agoRun GPU detection even for mdrun -nb cpu
Mark Abraham [Mon, 21 Aug 2017 13:27:33 +0000 (15:27 +0200)]
Run GPU detection even for mdrun -nb cpu

The complexity of managing and documenting the setup-time optimization
of whether we do GPU detection in this case is not worth the small
advantage in the case where the user compiled a GPU binary and
required the use of CPUs.

Removed some comments that were either duplicates of the code or
likely to rot.

Change-Id: Ib9c234b55026981090fd064950e361eba21d198e

6 years agoFixed thread-MPI with non-default -npme
Mark Abraham [Tue, 22 Aug 2017 15:09:50 +0000 (17:09 +0200)]
Fixed thread-MPI with non-default -npme

Thread-MPI currently defaults to zero PME-only ranks, but should
support non-default specifications.

Enforced that e.g. mdrun -ntmpi 0 -npme 1 -gpu_id 0 is not
supported, because we don't have the ability to decide how
to distribute threads to the different kinds of ranks.

Change-Id: I5f175fc087c10d4268e6d8226ba1628e99d376fc

6 years agoFix missing declaration of GMX_UNUSED_VALUE
Mark Abraham [Tue, 22 Aug 2017 14:06:03 +0000 (16:06 +0200)]
Fix missing declaration of GMX_UNUSED_VALUE

Probably recent merge from release-2016 plus addition of pruning code,
perhaps following cleanup in master branch created a situation where a
source file included cuda_arch_utils.cuh without this transitive
include.

Change-Id: I7bdfe35f9655beceec8aafc030d6cf8fac4c71b2

6 years agoSeparate PME spread and gather wallcycle counters
Aleksei Iupinov [Mon, 21 Aug 2017 13:45:03 +0000 (15:45 +0200)]
Separate PME spread and gather wallcycle counters

Change-Id: If9d1bcac8b07d0ea09ac57c254e1ca30fbe78d31

6 years agoEnable dynamic pair list pruning
Berk Hess [Fri, 24 Mar 2017 13:39:16 +0000 (14:39 +0100)]
Enable dynamic pair list pruning

This change activates the dynamic pruning scheme and the pruning
only kernels added in previous commits.
A heuristic estimate is used to select value for nstlist and
nstlistPrune that should result in performance that is reasonably
close to optimal. The nstlist increase code has been moved from
runner.cpp to nbnxn_tuning.cpp. The KNL check in that code has been
replaced by a check for Xeon Phi.
A paragraph has been added to the manual to describe the dynamic
and rolling list pruning scheme. A reference with all the details
will be added once the paper has been published.

Change-Id: Ic625858a07083916c8aa3e07f7497488dcfaee9e

6 years agoMerge branch release-2016
Mark Abraham [Mon, 21 Aug 2017 23:51:09 +0000 (01:51 +0200)]
Merge branch release-2016

Made matching change for ARM NEON SIMD to newly refactored SIMD code

Trivial resolutions of adjacent changes in CUDA kernel code.

Adjacent resolutions for changes for dynamic pruning and disabling
of PME tuning for the group scheme need checking.

Change-Id: I024878fa50ba815960d00ad6e811af181323b4db

6 years agoSimple union-find structure
Teemu Murtola [Sat, 19 Aug 2017 18:59:05 +0000 (21:59 +0300)]
Simple union-find structure

Implement a simple data structure that, given a list of items
(represented by integer indices), keeps track of a partitioning of these
items into disjoint sets.  Operations to merge two such sets (given two
member items) and to query the "index" of a set are amortized constant
time.  This is a well-known "Union-Find" data structure.

Change-Id: I0bd907755d709776eac416332a4a1bcd139f135f

6 years agoMoved increase_nstlist() to nbnxn_tuning.h
Mark Abraham [Wed, 12 Jul 2017 12:03:55 +0000 (14:03 +0200)]
Moved increase_nstlist() to nbnxn_tuning.h

No functionality changes, merely code movement. This prepares for a
child commit that changes how increase_nstlist() works.

Change-Id: Ide8ed1774d0ba13957698645cee6397cbc39d231

6 years agoPME solving tests
Aleksei Iupinov [Thu, 5 Jan 2017 13:49:47 +0000 (14:49 +0100)]
PME solving tests

Unit tests for PME solving on CPU. Test 2 grid sizes, 2 input grids,
normal and triclinic boxes, normal and LJ PME, 2 values of Ewald coefficients
and electrostatic parameter epsilon_r, with and without energy/virial compute.
Transformed grid (and possibly energy and virial gathered from the grid)
are tested as outputs.

Change-Id: I74c85b9d21e3ad30c8ad6c27c544690466ab3673

6 years agoFix compilation issues with ARM SIMD
Mark Abraham [Thu, 13 Jul 2017 11:23:52 +0000 (11:23 +0000)]
Fix compilation issues with ARM SIMD

ARM_NEON has never supported double precision SIMD, so disabled it
with GROMACS double-precision build.

The maskzR* functions used the wrong argument order in the debug-mode
pre-masking (and sometimes in a typo-ed syntax).

In the shift operators, the clang-based compilers (including the
armclang v6 compiler series) seem to check that the required immediate
integer argument is given before inlining the call to the operator
function. The inlining seems to permit gcc to recognize that the
callers always use an immediate. In theory, the new code might
generate code that runs a trifle slower, but we don't use it at the
moment and the cost might be negligible if other effects dominate
performance.

Change-Id: I61dd4d906f7d5b77bc4e851cfaaaff059e5a67fe

6 years agoAdd OpenCL pruning kernels and launch/timing logic
Szilárd Páll [Wed, 29 Mar 2017 01:26:11 +0000 (03:26 +0200)]
Add OpenCL pruning kernels and launch/timing logic

The kernels have been tested for correction on NVIDIA >=CC 3.5 and AMD
GCN devices. Tuning for AMD has been done on the old fglrx stack which
has limitations on the intra-workgroup parallelism, so choice of the
j4 concurrency parameter should be revisited at some later stage (using
the latest AMDGPU-PRO and hopefully ROCm).

A number of possible improvements have been also identified and noted as
comments in nbnxn_ocl.cpp.

Change-Id: I7129ec247706d33317df1256846943ee8b0d540c

6 years agoImprove awkward handling of GMX_CUDA_TARGET* help
Szilárd Páll [Wed, 19 Jul 2017 11:31:58 +0000 (13:31 +0200)]
Improve awkward handling of GMX_CUDA_TARGET* help

The previous hack has the sole purpose of making the cache variable
appear and be documented only if set manually by the user. The better
way to do this is to simply use set_property().

Change-Id: I9ba24167302ca1bb9021231697e50ecf056ea15a

6 years agoImprove the "files not present" error message
Vedran Miletić [Mon, 14 Aug 2017 15:33:31 +0000 (17:33 +0200)]
Improve the "files not present" error message

It's possible to use -deffnm in restarts even if it wasn't used in
the initial simulation. This can lead to absurd situations such as:

Expected output files not present or named differently:
  pullx.xvg
  pullf.xvg

where pullx.xvg and pullf.xvg are present and named exactly as listed,
but GROMACS expects them to be named as -deffnm requested.

The improved error message suggest to the user to check for that
possibility.

Refs #942 (partial workaround)

Change-Id: I983a7a2be791a634b877b0cbadb34e56a1ee2f82

6 years agoAdd CUDA pruning kernels and launch/timing logic
Szilárd Páll [Tue, 28 Mar 2017 22:56:32 +0000 (00:56 +0200)]
Add CUDA pruning kernels and launch/timing logic

The CUDA prune kernels have been tuned and tested on CC 2.x-6.x
architectures. The tunable j4 concurrency parameter was chosen
identical for both kernel flavors irrespective the input size which
carries some tradeoffs (documented in the code). With auto-tuning,
such static choices could be revised.

Scheduling currently launches GPU prune kernels between steps, after the
force clearing. This has some drawbacks and more sophisticated
scheduling schemes might be beneficial in the future; these have been
documented along the declaration of nbnxn_gpu_launch_kernel_pruneonly();

Change-Id: Ia310ecafd7400efb33468d2486782c367a5a026a

6 years agoAdd CPU reference and SIMD pruning kernels
Berk Hess [Fri, 24 Mar 2017 13:33:00 +0000 (14:33 +0100)]
Add CPU reference and SIMD pruning kernels

Change-Id: I416946adf67b8261b74093874b348270016585f1

6 years agoMerge "Merge branch release-5-1 into release-2016" into release-2016
Aleksei Iupinov [Thu, 17 Aug 2017 10:23:49 +0000 (12:23 +0200)]
Merge "Merge branch release-5-1 into release-2016" into release-2016

6 years agoReplace consistency checking with assertion
Mark Abraham [Tue, 8 Aug 2017 01:14:10 +0000 (03:14 +0200)]
Replace consistency checking with assertion

The checks intended for checking that the automatic choice of number
of thread-MPI ranks have never worked, because we over-write the
user's choice of hw_opt->nthreads_tmpi. Fixed that by handling those
sub-cases properly by requiring that the number of GPU IDs supplied
matches the number of ranks chosen in all the cases, and asserting on
that.

Even if we would fix the over-writing issue, all of the former
consistency checks amount to an assertion that the previous code has
chosen a number of GPU tasks on each node (in gpu_opt.dev_use) that
matches the number of PP ranks on that node, which can be done in many
fewer lines of code.

Note that the checking did not have a SIMD-related behaviour, and
since the way domains communicate is SIMD-agnostic, it's unclear that
such a check would be useful.

Change-Id: Iea85bb4c297c5ce60c8e25d95a87fe9d9bce6686

6 years agoAdd dynamic pair-list pruning framework
Berk Hess [Fri, 24 Mar 2017 13:22:21 +0000 (14:22 +0100)]
Add dynamic pair-list pruning framework

The change add the logistic for setting up dynamic pruning of the
nbnxn pair-lists. Dynamic pruning allows for an increase in nstlist
and rlist while computing fewer pair interactions in the non-bonded
kernel. This comes at the cost of running an extra pruning kernel
every few steps and added communication due to larger buffers.

The kernels, documentation and heuristic for choosing nstlist
will be added in separate changes.

Change-Id: Id8040b95f812df60f117279267bf551ff4ac8d79

6 years agoClean up nbnxn cluster pair addition code
Berk Hess [Wed, 9 Aug 2017 11:54:27 +0000 (13:54 +0200)]
Clean up nbnxn cluster pair addition code

Partial clean up of the nbnxn CPU makeClusterList functions.
Clarified variable names and added more documentation.
No functional changes, except for the removal of setting the start
of the column range the diagonal element, which lead to more checks
but did not affect the resulting cell range.
This is prepration for a bug fix.

Change-Id: Ib0a32087d205a23ebef85394d226f084ba515c24

6 years agoParse user-supplied GPU task assignment only when needed
Mark Abraham [Tue, 8 Aug 2017 00:39:34 +0000 (02:39 +0200)]
Parse user-supplied GPU task assignment only when needed

Now there is never both a gpuTaskAssignment and a
userGpuTaskAssignment present, which could have been misused or
misunderstood.

Also fixed somewhat related outdataed naming and documentation
for gmx_count_gpu_dev_unique().

Change-Id: I09d27857b6a91a49735850655bdf26af4bd88445

6 years agoRemove duplicate GPU non-usage hint
Mark Abraham [Tue, 8 Aug 2017 00:15:54 +0000 (02:15 +0200)]
Remove duplicate GPU non-usage hint

5bef33832c removed the behaviour where mdrun would hint to the user
that compatible GPUs were found, even though the simulation would not
use them (for various possible reasons). That was unintended and
wrong, however, that report was already duplicated for both rerun with
energy groups, and the group scheme, by logic called earlier from
runner(). So we can just remove this hint.

Minor cleanup to the way local variables are created and used.

Change-Id: I7a5f61c3384dba5eec9f049169f3c32f3d00f4f8

6 years agoMoved logging functionality into GPU usage report
Mark Abraham [Tue, 15 Aug 2017 20:37:26 +0000 (22:37 +0200)]
Moved logging functionality into GPU usage report

This moves the logic about whether a GPU usage report is written into
one place.

Noted TODO to resolve bug created by the formerly split logic.

Change-Id: Ieef7853994b4a84a2e45a06598fe852e8f7ac6f9

6 years agoAdd OpenMP for orientation restraints
Berk Hess [Tue, 8 Aug 2017 13:52:47 +0000 (15:52 +0200)]
Add OpenMP for orientation restraints

Recent commit 0be497b7 disabled OpenMP for orientation restraints.
Now the restraint indexing issue with OpenMP is resolved by copying
the type numbering solution from the distance restraint code.

Change-Id: Id3af147c940b84afd542a26736235ece94101c7a

6 years agoUse graph with orientation restraints
Berk Hess [Tue, 8 Aug 2017 13:35:58 +0000 (15:35 +0200)]
Use graph with orientation restraints

With the Verlet cut-off scheme by default molecules are not made whole.
Now they are made whole when orientation restraints are used.
Added checks and assertions for correct PBC treatment with orientation
restraints.

Fixes #2228.

Change-Id: Ib33294cb9b0b0d131b0c385c001b7cb73c006ba9

6 years agoMigrate some of the terminology pages
Vedran Miletić [Tue, 13 Jun 2017 16:38:51 +0000 (18:38 +0200)]
Migrate some of the terminology pages

Change-Id: I2671535659cc0e62aa44cd5056e3924180b6abba

6 years agoMigrate the documentation of the run-time errors
Vedran Miletić [Tue, 13 Jun 2017 16:38:31 +0000 (18:38 +0200)]
Migrate the documentation of the run-time errors

From the wiki, cleaned up and updated with new tool names.

Change-Id: Ia21e227b660d84b1b3f72f1f6e30cf29e5de9a23

6 years agoWorked around missing OpenMP implementation in orires.
David van der Spoel [Wed, 2 Aug 2017 07:15:50 +0000 (09:15 +0200)]
Worked around missing OpenMP implementation in orires.

The orientation restraint code is not aware of OpenMP threads
and uses some global information. By only running it on the
master node results are now independent of number of threads
used.

Fixes #2223

Change-Id: Ie86f4bd4e645fa71a58114950f6a297b5788e022

6 years agoMerge branch release-5-1 into release-2016
Mark Abraham [Tue, 15 Aug 2017 13:26:34 +0000 (15:26 +0200)]
Merge branch release-5-1 into release-2016

Change-Id: Ib769849746a3e55f3e7ae4067f0b6f549e66bd2c

6 years agoCUDA 9/Volta support for the nonbonded module
Jiri Kraus [Wed, 19 Jul 2017 15:51:45 +0000 (08:51 -0700)]
CUDA 9/Volta support for the nonbonded module

The Volta architecture introduces independent thread scheduling. This
new architectural feature breaks implicit warp synchronous programming
and requires new intrinsics for warp wide operations like shfl.

This change implements the necessary sync point for the Volta
architecture and replaces the deprecated warp-intrinsics with their
_sycn version.

Note that the current implementation is conservative and aims for Volta
compatibility only and the implementation is likely not optimal (for
details see nbnxn_cuda_kernel.cuh).

Change-Id: I38dd572992cf14ce5a7158d0bbc3086b54f18676

6 years agoFix value of Ewald shift
Mark Abraham [Thu, 20 Jul 2017 07:16:37 +0000 (09:16 +0200)]
Fix value of Ewald shift

In all the short-ranged kernel flavours, sh_ewald is subtracted from
rinv, which have inconsistent dimensions. Fortunately, rcutoff is
often close to 1, and the inconsistent shifts often cancel in
practice, and energy differences computed on neighbour lists of the
same size will have the error cancel. The difference doesn't even
show up in the regressiontests, but would if we had a unit test
of a single interaction.

Fixes #2215

Change-Id: Ia2ea57f3bd9d521879783b207353d9d6f4ccb4a8

6 years agoRemove loop over all atoms in init_mdatoms
Berk Hess [Sat, 12 Aug 2017 20:54:26 +0000 (22:54 +0200)]
Remove loop over all atoms in init_mdatoms

We should avoid non-parallel loops over all atoms in the system.

Change-Id: I7052f7f203e7d191377ab939e26f9dcd713a9998

6 years agoClarify data flow in GPU task assignment
Mark Abraham [Fri, 4 Aug 2017 16:09:17 +0000 (18:09 +0200)]
Clarify data flow in GPU task assignment

Previously, hw_opt.gpu_opt->dev_use could be filled with data at two
widely separated points, which was harder to understand and maintain
than this alternative.

The possible user-supplied task assignment is now copied into the
vector for task assignment that is later used by mdrunner to configure
the modules that do the work. The automated assignment fills the same
data structure, but the semantics are improved by using a vector, and
copying the user assignment is now trivial.

userGpuTaskAssignment is now part of hw_opt like other user options,
and stored in a string. Eventually the ordinary-data type hw_opt will
be used in a const-like manner, so this changes helps with that.
gmx_hw_opt_t now cannot be allocated with snew, but there is no longer
any reason to consider doing so.

Together, these eliminate gmx_gpu_opt_t because it is now merely a
vector (for now).

The parsing of the string from mdrun -gpu_id is simplified now that
its result is stored in a vector (and tests added). This aspect is
likely to get more complicated when a user assignment might look
different, e.g. "01:2,3:45" if/when we have two ranks each doing a two
PP and one PME task on different GPUs. Moved the parsing code from
detecthardware.cpp to hardwareassign.cpp, where it makes a bit more
sense.

Related trivial cleanup in gmx tune_pme, that uses the same parsing
machinery for GPU IIs, so that it can manage suitably.

Removed getCompatibleGpus() from header file, since its usage is now
local to hardwareassign.cpp. Similary, anyGpuIdIsRepeated() is no
longer used.

Change-Id: I1071281d3348c9cce05e7ac39a24775611ccc0dd

6 years agoCorrected the PDF manual to reflect that all tools are called gmx <tool>
Carsten Kutzner [Thu, 10 Aug 2017 09:44:49 +0000 (11:44 +0200)]
Corrected the PDF manual to reflect that all tools are called gmx <tool>

There were still a few occurrences of the old-style g_tool naming,
this patch removes. Deliberately left g_membed as is, because there
was never a gmx membed but instead it got incorporated into mdrun.

Change-Id: I42d9d07f749be7358ed90dc7701249a1e696334b

6 years agoUse table Ewald for Skylake
Roland Schulz [Fri, 14 Jul 2017 20:44:41 +0000 (13:44 -0700)]
Use table Ewald for Skylake

Change-Id: I433acabb9269594465259d94eb01d34c313996dc

6 years agoFix include dependency for getenv
Mark Abraham [Mon, 7 Aug 2017 15:06:32 +0000 (17:06 +0200)]
Fix include dependency for getenv

Formally, this is required for calling getenv to work, but somehow
Jenkins passes it and my macports clang doesn't. That's presumably
related to some transitive include of stdlib.h, but in any case we
should do this robustly.

Change-Id: I27ac743112e03feb14c49e14ead04302b084cf58

6 years agoSimplified handling of GPU device IDs
Mark Abraham [Sun, 6 Aug 2017 12:33:54 +0000 (14:33 +0200)]
Simplified handling of GPU device IDs

Removed gmx_gpu_device_id lookup function, whose indirect lookup of
the device ID was more complicated than we need. We already require
the user to select GPUs based on the IDs as understood by CUDA, so for
simplicity, and without loss of generality, we can do that everywhere
in the code.

Removed a previously unused function for querying the name of an
OpenCL device.

Change-Id: I6557dd51f6b23591d4fd2b6383deb6abf58a0b92

6 years agoSimplify resource-division efficiency check
Mark Abraham [Fri, 4 Aug 2017 14:11:16 +0000 (16:11 +0200)]
Simplify resource-division efficiency check

The code only needs a boolean result of whether any rank is using a
GPU, not a sum of GPUs used or GPU tasks present, or whatever.

It also doesn't need to be coupled to the implementation of
gmx_hw_opt_t.

One assertion was redundant with an earlier check.

Change-Id: I0adae7a9b6c612fe4b4b8e974b71c59a593a64a4

6 years agoSplit printhardware from detecthardware
Mark Abraham [Fri, 4 Aug 2017 13:43:18 +0000 (15:43 +0200)]
Split printhardware from detecthardware

These have little in common, so should be separate for better
readability and maintainability. Resolves an existing TODO.

Changed a HOSTNAMELEN to STRLEN, just in case hostnames are long.

Noted a new TODO to use MPI_Get_processor_name in printing the
detected hardware.

No other code changes, just movement and include minimization.

Change-Id: Ifd48695964bd7340e957fb55bcb2f66c89e75d1b

6 years agoDecouple task assignment from task execution
Mark Abraham [Fri, 4 Aug 2017 11:52:33 +0000 (13:52 +0200)]
Decouple task assignment from task execution

Code that needs to run on a GPU does not also need to know about the
code and data structures that underpin task assignment.  The outcome
of task assignment is the information about which GPU to use, and it
is simple and effective to give just that result to the code that
needs it.

Simplifies t_forcerec.

Added more const correctness for gmx_device_info_t pointers.

Change-Id: I094c19e08be73af998bd287e43d5c2b6e5969a60

6 years agoRemoved unused host-side allocation code
Mark Abraham [Sun, 6 Aug 2017 10:17:13 +0000 (12:17 +0200)]
Removed unused host-side allocation code

Even though the code is not called ever, compiling with gcc 6 and CUDA
9.0 triggers our static assertion preventing the inadvertent use of
smalloc on a C++ type with a constructor.

Fixes #2227

Change-Id: I2cb66e3f9e90cd809467f2c9b42c07b97e2b19ca

6 years agoStop using hwinfo_g for reporting code
Mark Abraham [Thu, 3 Aug 2017 16:41:53 +0000 (18:41 +0200)]
Stop using hwinfo_g for reporting code

These are passed an actual handle, and should use it, since
they are not participating in the lifetime behaviours.

Change-Id: Iaa4407622a01d0599034c5aea3628a38ffd5a97a

6 years agoRemoved unused include statements
Mark Abraham [Thu, 3 Aug 2017 15:37:31 +0000 (17:37 +0200)]
Removed unused include statements

After recent cleanup, these can be decoupled

Change-Id: I2071e1a4eb67faff591b941167b80e4445ded7e2

6 years agoFix orientation restraint reference
Berk Hess [Thu, 27 Jul 2017 20:09:30 +0000 (22:09 +0200)]
Fix orientation restraint reference

The resetting of the COM of the molecule with orientation restraints
for fitting to the reference structure was done with the COM of the
reference structure instead of the instantaneous structure. This does
not affect the restraining (unless ensemble averaging is used), only
the printed orientation tensor.

Fixes #2219.

Change-Id: I4984ee7f64780a5c3850feb4bfe4a624afd5cec7

6 years agoFixed bug in gmx disres indexing arrays.
David van der Spoel [Tue, 1 Aug 2017 16:09:16 +0000 (18:09 +0200)]
Fixed bug in gmx disres indexing arrays.

The call to routines in listed-forces/disre.cpp returns values
in a different manner than previously. This meant that gmx disre
would crash since it expected a value to be non-zero.

Change-Id: Ib7008a9655f7e4a8b56ab1319bab9b2104273721

6 years agoAdd check for nr of orientation restraints
Berk Hess [Wed, 26 Jul 2017 10:09:12 +0000 (12:09 +0200)]
Add check for nr of orientation restraints

Change-Id: I78be294cd1c73db1cdd296e636dfc2806fa90c75

6 years agoFix bugs with orientation restraints
Berk Hess [Tue, 25 Jul 2017 17:26:13 +0000 (19:26 +0200)]
Fix bugs with orientation restraints

The orientation restraint initialization got moved to before the
initialization of the domain decomposition, which made the check
for domain decomposition fail.
Also fixed orientation restraints not working with the whole system
as fitting group.

Change-Id: If5b4659fa90c5d8e9106d260b530b47c735acb0e
(cherry picked from commit fea8651dd1a71dccc7d407ef1a59f5440db3a9e6)

6 years agoAdded missing .mdp file documentation for the enforced rotation module
Carsten Kutzner [Thu, 6 Jul 2017 14:05:44 +0000 (16:05 +0200)]
Added missing .mdp file documentation for the enforced rotation module

Change-Id: I08398b0a53ef6154a6ac8005890e21f529659dd0
(cherry picked from commit 77fd72b9dc0af1432fb6ff8391f3842f699340d7)

6 years agoClean up matrix inversion
Berk Hess [Wed, 26 Jul 2017 21:09:36 +0000 (23:09 +0200)]
Clean up matrix inversion

This change is mainly a conversion of the orientation restraints
matrix storage from an array of pointers to a real [5][5] struct.
This requires a small change to the jacobi code which also affects
gmx_traj (in a positive way).

Change-Id: I8a960b659e8da847d1e505844535bd6fbc984814

6 years agoFix orientation restraint reference
Berk Hess [Thu, 27 Jul 2017 20:09:30 +0000 (22:09 +0200)]
Fix orientation restraint reference

The resetting of the COM of the molecule with orientation restraints
for fitting to the reference structure was done with the COM of the
reference structure instead of the instantaneous structure. This does
not affect the restraining (unless ensemble averaging is used), only
the printed orientation tensor.

Fixes #2219.

Change-Id: I4984ee7f64780a5c3850feb4bfe4a624afd5cec7

6 years agoWorked around missing OpenMP implementation in orires.
David van der Spoel [Wed, 2 Aug 2017 07:15:50 +0000 (09:15 +0200)]
Worked around missing OpenMP implementation in orires.

The orientation restraint code is not aware of OpenMP threads
and uses some global information. By only running it on the
master node results are now independent of number of threads
used.

Fixes #2223

Change-Id: Ie86f4bd4e645fa71a58114950f6a297b5788e022

6 years agoMake loop variables in orires.cpp local
Berk Hess [Wed, 26 Jul 2017 08:12:22 +0000 (10:12 +0200)]
Make loop variables in orires.cpp local

Also moved and renamed some variable declarations.

Change-Id: I804a1addde81950576ce4a49006ff00ea29db3ab

6 years agoAdd check for nr of orientation restraints
Berk Hess [Wed, 26 Jul 2017 10:09:12 +0000 (12:09 +0200)]
Add check for nr of orientation restraints

Change-Id: I78be294cd1c73db1cdd296e636dfc2806fa90c75

6 years agoIntroduced Mdrunner high-level class
Mark Abraham [Tue, 11 Jul 2017 13:46:15 +0000 (15:46 +0200)]
Introduced Mdrunner high-level class

This class does not yet conform to style, e.g. for naming of member
variables, because the immediate objective is to support refactoring
of setup code to permit evolution of seams that could be used either
from an API caller, or a test driver. Appending a lot of underscores
would cause a lot of useless work rebasing other patches that touch
this code, and would make this patch rather larger. A good future
refactoring for this setup code would be to move most of the member
variables to be set up by modules that implement the hypothetical
ICommandLineOption interface.

Further, keeping the names the same in this patch means that we can
check with -Wshadow that there are no symbols that share the same name
in a nested scope (which is an error I made when developing this
patch).

Ported the command-line filename argument storage to std::array, so
that default copy assignment (etc.) works correctly. The storage for
the C-style memory pointed at by the individual t_filenm data is still
duplicated by the same call to dup_tfn().

Now that hw_opt is a member variable, several of the uses that modify
it need to take its address, and several of the const uses of it can
take a const reference, per style. This will make it easier to see
those places where we modify a data structure that ought to contain
only the things that the user selected.

Noted some TODOs for future improvements

Change-Id: I15c308e54ee34541818854cac029998f9e5520ff

6 years agoAdded unit-test for orientation restraints output.
David van der Spoel [Thu, 27 Jul 2017 07:16:51 +0000 (09:16 +0200)]
Added unit-test for orientation restraints output.

In order to allow splitting of the gmx energy functionality
into an NMR and an energy part additional tests are needed.
The regression test tests the content of the edr file but
not the extraction to xvg files, which is what this test
contributes.

The test is complicated by intricate differences between single-
and double precision files, which was cleaned up.

Had to add memory cleanups in multiple locations as well, e.g.
for cleaning cmap data structures. Never touch untouched code.
Change-Id: I0a6ee05f38bd198c9a3c37f7f837a28ce77b74e0

6 years agoProvide STL make_unique template function.
M. Eric Irrgang [Sat, 17 Jun 2017 23:34:03 +0000 (19:34 -0400)]
Provide STL make_unique template function.

make_unique is not available in the ISO standard library spec
corresponding to C++11, but the implementation from the
standards document is small and benign.

src/gromacs/compat/make_unique.h provides this implementation
in the gmx::compat namespace.

Change-Id: I275c33ad6c821e8a8006531dc650b3be6df0a6e5

6 years agoEnhance cmake and releng handling of GMX_USE_RDTSCP
Mark Abraham [Sun, 2 Jul 2017 23:22:17 +0000 (01:22 +0200)]
Enhance cmake and releng handling of GMX_USE_RDTSCP

It is possible for a physical or virtual CPU to support avx and not
rdtscp, or the other way around, so the previous workaround was always
a bit hacky.

This change refactors the implementation to preserve the existing
behaviour of both explicitly setting GMX_USE_RDTSCP to be ON or OFF,
and the default behaviour of relying on the rdtscp detection, unless
we should make a guess associated with an explicit user choice of SIMD
level.

It adds GMX_USE_RDTSCP=DETECT, which is now useful in Jenkins, where a
hypervisor does expose AVX instructions and not RDTSCP, so the above
fallback is not very effective for (e.g.) matrix configurations where
we specify the SIMD level. Various jobs now use either OFF or DETECT
according to the intent of the job. This will be useful in migrating
verification jobs between hosts without having hidden
incompatibilities.

Switched usage of HAVE_RDTSCP to be always defined, for better
checking by the compiler for any errors made.

Improved status messages when the setting changes, and why, if it
depends on the detection result.

Change-Id: I932c1764d91ec317475ef71400802e7b8d07c887

6 years agoInform users about the end of run DLB state
Szilárd Páll [Wed, 5 Apr 2017 23:34:10 +0000 (01:34 +0200)]
Inform users about the end of run DLB state

The user will not know whether the run did DLB or not without looking
through the entire log or standard error. Hence, this change adds a note
that tells the user about the state of DLB at the end of the simulation.

The note on the fraction of the step used for load balance calculation
has also been improved.

Change-Id: I7a152a26453c00bb0433b738a69fe08ec9caa760

6 years agoFix bugs with orientation restraints
Berk Hess [Tue, 25 Jul 2017 17:26:13 +0000 (19:26 +0200)]
Fix bugs with orientation restraints

The orientation restraint initialization got moved to before the
initialization of the domain decomposition, which made the check
for domain decomposition fail.
Also fixed orientation restraints not working with the whole system
as fitting group.

Change-Id: If5b4659fa90c5d8e9106d260b530b47c735acb0e

6 years agoSeparated responsibility for consistency checking
Mark Abraham [Tue, 18 Jul 2017 18:39:15 +0000 (20:39 +0200)]
Separated responsibility for consistency checking

Printing reports about GPU usage can and should happen before
checking for consistency. Note change to triggering logic - it should
be printed when GPUs are used, not when compatible GPUs are detected.

Moved the point of call for the notes about user-selected GPU sharing,
and under-use of GPUs to be part of the GPU usage report. This is a
cleaner implementation, makes sense whether or not the intervening
code will issue a warning or error, and removes the temptation to
repeat aspects of the GPU usage report.

Removed verbose catching of exceptions. Only std::bad_alloc can
throw, and it's a lesser evil to use the std:: functionality and catch
at a high level than to uglify the code at the point of call to denote
where exception-safe boundaries exist.

Our error handling on multiple MPI ranks is currently crude, and in
the hope that the MPI runtime will help out, we use a barrier. The
barrier helps to cater to lots of previous code where gmx_fatal()
might be called on any rank in the simulation, so moved it up to the
runner level. Also used the correct communicator (so that PME-only
ranks will also participate in the barrier). Note that
gmx_fatal_collective() exists, but is only suitable for coordinating
the output in the case where all ranks are known to have observed the
same error condition.

Converted some comments to Doxygen.

Change-Id: Ia4cfd69aa6e3b158244ae8da44317adf8257739b

6 years agoRemove unnecessary GPU checking code
Mark Abraham [Sat, 15 Jul 2017 08:20:26 +0000 (10:20 +0200)]
Remove unnecessary GPU checking code

These were introduced when the early OpenCL implementation
had limitations.

This commit resolves the TODO to remove them, now that all
simulation code paths are supported on both GPU code paths.

Change-Id: Ic601d90d8c57e2a471785d196c75bfd5e075cf95

6 years agoCleaned up bUseGpu in runner
Mark Abraham [Tue, 18 Jul 2017 20:35:33 +0000 (22:35 +0200)]
Cleaned up bUseGpu in runner

This variable was rather unclear about what it actually meant, and
various comments were wrong. This had several effects.

It obscured that automated assignment of GPU IDs to PP ranks actually
does take place after thread-MPI thread launch.

Fixing it revealed that we set up nstlist and rlist for the Verlet
scheme unnecessarily early, and this leads to an extra broadcast
(which is not costly, because there are many other broadcast calls
nearby).

Previously, -nb gpu and -nb auto would trigger GPU detection, and the
result of the detection was used to decide whether GPU assignment
might take place. tryUsePhysicalGpu and forceUsePhysicalGPu now play
the latter role, so that it is clear that we have the flexibility to
avoid assigning work to GPUs when that does not make sense (e.g. rerun
with energy groups), even if GPUs are detected. In particular,
tryUsePhysicalGpu needs to default to false when GPU support is not
configured, and when the .tpr is for the group scheme.

Removed strange comment about ignoring manually selected GPUs, which
may have been an historical artefact about doing so on PME-only ranks.

Change-Id: I69f21210a7ee931e5fa2cbe49e0999ad89ba7426

6 years agoRework and rename gmx_select_gpu_ids
Peter Kasson [Thu, 20 Jul 2017 17:02:31 +0000 (13:02 -0400)]
Rework and rename gmx_select_gpu_ids

This change makes clear that this function now produces a validated
mapping of intra-node PP ranks (ie with GPU tasks) to compatible GPUs
on that node. If the user provided GPU IDs, then exit if that mapping
is invalid. Otherwise, produce a valid mapping.

Noted TODOs relating to our lack of feature-complete error-handling
infrastructure.

Change-Id: I63ee0e5fbdce87cdefd458d3024a0de8dca472a5

6 years agoStop duplicate printing of detected GPUs
Mark Abraham [Thu, 13 Jul 2017 16:55:13 +0000 (18:55 +0200)]
Stop duplicate printing of detected GPUs

The detected GPUs and their compatibility status are always printed to
both stderr and log file immediately after detection, as part of the
normal hardware report.

When the user made an invalid selection, we should not print the
information about the detected GPUs again (differently).

When an auto-selection is made, we do not need to print information
about the detected GPUs again.

sprint_gpus is now local to a single source file.

Noted TODO to separate a printing functionality from a checking
routine.

Change-Id: I47ef0da6bdf58d9a61b8577e539effd96c771b8c

6 years agoFix use of GMX_SIMD in own-fftw build
Mark Abraham [Wed, 19 Jul 2017 07:30:31 +0000 (09:30 +0200)]
Fix use of GMX_SIMD in own-fftw build

Recent change separated the variables that contain the user's input
from the resulting action, but this aspect of the behaviour was
missed.

Change-Id: I8881e08ac8deb818f86c0db737beedeea77e4a5b

6 years agoRemoved unnecessary static declarations for command-line parsing
David van der Spoel [Wed, 19 Jul 2017 07:13:17 +0000 (09:13 +0200)]
Removed unnecessary static declarations for command-line parsing

For historical reasons command-line parsing needed static variables
when declaring the t_pargs structures, however modern compilers
do not need this anymore. Simultaneously, repeatedly calling a function
containing static variables may lead to irreproducible results.
The programs fixed here have no unit tests, however grompp and pdb2gmx
are tested in the regression tests, which pass.

Fixed uninitialized variable that turned up when not static anymore.

TODO: fix the same in analysis tools.

Part of #2113.

Change-Id: I1f67cc54362062289264b83078d3317f8e914faf

6 years agoMade post-submit config to test clang+openmp.
Mark Abraham [Thu, 13 Jul 2017 19:25:27 +0000 (21:25 +0200)]
Made post-submit config to test clang+openmp.

Resolves a testing matrix TODO, adds one for
clang+openmp+cuda

Change-Id: Iab628029d6020491f83a7e03f7c5cb7289f8154c

6 years agoFixed test-order dependency in gmxpreprocess tests.
David van der Spoel [Wed, 19 Jul 2017 05:36:31 +0000 (07:36 +0200)]
Fixed test-order dependency in gmxpreprocess tests.

Due to the use of static variable in genconf.cpp and
solvate.cpp, used for initializing command-line args
the result of the tests were dependent on the order of
execution. The reason is that static variables set in one
of the test runs are "inherited" by the next run. A
particular example is a randum number seed, which when 0
is set to a random seed, but just the first time around. This
is obviously not a good idea when aiming for reproducability.

Part of #2113.

Change-Id: I8bd8d36c75dcd20824e7f3db7268512387cd04ca

6 years agoFix non-reproducability of clustsize tests.
David van der Spoel [Wed, 19 Jul 2017 05:10:20 +0000 (07:10 +0200)]
Fix non-reproducability of clustsize tests.

Due to the use of static variables in the old command-line
parsing codes, running the same test repeatedly would "inherit"
settings from the previous test. This is fixed here by
removing the static flags and updating some test results.

Part of #2113

Change-Id: Ie5bdf4aaefb8acfdb07a4ee65652a1c3c8ca84e6

6 years agoImprove CMake implementation for GMX_SIMD
Mark Abraham [Sun, 2 Jul 2017 22:34:11 +0000 (00:34 +0200)]
Improve CMake implementation for GMX_SIMD

It is robust to have cache variables that are user choices (and to
refrain from modifying them), or the result of system
introspection. We should not cache the result of subsequent
fast-running logic.

Introduced the new default for GMX_SIMD, which is AUTO. The value AUTO
triggers the same detection path that used to set the old "default",
producing the same SIMD choice, but leaves the value of GMX_SIMD as
what the user chose, ie "AUTO". That means e.g. ccmake will now show
the user their choice, not the result of the detection. The choice
is written to the status output each time it changes (even to and
from AUTO).

Explicit non-AUTO choices for GMX_SIMD work the same way they used to.

Simplified the implementation surrounding the run of the detection
code. We can just store the feature string if the run was successful,
and not otherwise, and that works also to prevent unecessary re-runs
of the detection.

This will now make it possible for us to implement other logic that
reacts to a SIMD choice differently according to whether it comes from
the user or detection.

The implementation of GMX_USE_RDTSCP now works better, because RDTSCP
is now on if the user chose an AVX-era SIMD level, off if an older
SIMD level was chosen, and suits the build host if the SIMD choice is
also automated to reflect the build host.

Moved a compiler-problem check to the SIMD-management code so that
it can use GMX_SIMD_CHOICE after it is defined.

The FFT-management code now uses GMX_SIMD_ACTIVE, which works because
it runs after the SIMD management, which uses a macro (so shares the
same variable scope as the calling code).

mdrun binary information still reports the actual choice, and not
whether it was based on AUTO.

Verifying that the rest of the code works correctly is complicated by
the way the SIMD module defines GMX_SIMD, and that is used e.g. by the
nbnxn, lincs and bonded code.

Minor fix to docs of gmx_check_if_changed.

Change-Id: I54e140394ea0c452450ebebad5782849e92a5ce2

6 years agoPrune unnecessary cells in analysis nbsearch
Teemu Murtola [Tue, 23 May 2017 05:19:14 +0000 (08:19 +0300)]
Prune unnecessary cells in analysis nbsearch

When doing a grid-based neighborhood search, do not compare pairs in
grid cells that are completely outside the cutoff.  This excludes up to
40% of the search volume (if the grid cells are much smaller than the
cutoff), but more realistically the speedup is of the order of 10-20%.

Change-Id: Ie8965b001cc20f739432ecdce9011b686c76236a

6 years agoConverted some const pointers into const references, per style
Mark Abraham [Thu, 13 Jul 2017 14:23:20 +0000 (16:23 +0200)]
Converted some const pointers into const references, per style

There's more we could do here (later), but this caught my eye while
cleaning other things up.

Change-Id: I55509985172ce7c53cc4f3a9afbb903fd6adfc36

6 years agoEliminated pick_nbnxn_resources
Mark Abraham [Fri, 30 Jun 2017 23:49:05 +0000 (01:49 +0200)]
Eliminated pick_nbnxn_resources

The data about which GPUs on a node will be used by the PP tasks on it
is stored when the dev_use array is filled, either by user selection
or the automated per-rank round-robin assignment in
gmx_select_rank_gpu_ids. It is filled so that the PP intra-node rank
IDs will index into it, so aspects of the task assignment can be seen
as already complete. The code in pick_nbnxn_resources makes the final
action of indexing with the intra-node rank ID, then handles the
initialization of the selected GPUs.

Note that nothing meaningful has happened since the the call to
gmx_select_rank_gpu_ids. mdrun has done some checks, called
init_forcerec (which then set up a lot of unrelated things), and then
called init_nb_verlet. The actual task assignment (selecting the GPU
for this task) is where it always was (ie implicitly somewhere between
filling the dev_use array, and the act of actually indexing into it),
and future design options are still as open as they ever were.

Change-Id: Iac908bb74dbec20edaecf6fbfcd18b87179e7aba

6 years agoFix hwloc detection
Teemu Murtola [Mon, 17 Jul 2017 13:47:33 +0000 (15:47 +0200)]
Fix hwloc detection

In some cases, including the release workflow build in Jenkins, this
could fail because it uses a CMake macro without including the file
where it got defined.

Change-Id: I83646e0b489c8930a5b6d7fdb2584cb760282fdb

6 years agoImplemented grompp -po for options-style mdp handling
Mark Abraham [Mon, 2 Jan 2017 09:50:23 +0000 (09:50 +0000)]
Implemented grompp -po for options-style mdp handling

Previously options that were handled via a key-value tree (currently
only electric field options) were not written to the .mdp output.
Restoring this functionality will permit more widespread use of the
key-value tree handling during the transition period.

Restored mdp file comments for electric-field options, but the method
for writing them is hacky. This is probably good enough for
functionality that will disappear when we shift to key-value input.

Change-Id: I488b37ff72f70a6e145338fd9d57daa1c9e4de7e

6 years agoClean up cmake build host detection
Mark Abraham [Mon, 3 Jul 2017 19:59:49 +0000 (21:59 +0200)]
Clean up cmake build host detection

This resolves some existing TODOs to de-duplicate code,
while making it more robust to re-execution and proper
use of the cache.

Change-Id: Ie9c0618778b6da2aace37baa182785604c8f4afe

6 years agoClean up gmx_mdrun()
Mark Abraham [Tue, 11 Jul 2017 13:34:54 +0000 (15:34 +0200)]
Clean up gmx_mdrun()

NFILE is inconsistent with usage in the rest of mdrun, changed to
nfile.

Removed outdated comment.

Changed several variable names to *_choices, because in two cases the
actual selection gets passed to runner() as a pointer to the updated
first element of the choices (which is organized by
parse_common_args()). It's easier to understand that the variables
have different roles in the two places if they have different names.

Renamed nstlist and nsteps to the same with the _cmdline suffix that
is used in mdrunner().

Change-Id: Id99fa26b7ab38cd67de8f259c612179ad7f1e992

6 years agoCleaned up mdrunner_start_threads
Mark Abraham [Sun, 9 Jul 2017 06:24:17 +0000 (08:24 +0200)]
Cleaned up mdrunner_start_threads

Threw an exception rather than return a nullptr to trigger a
fatal error.

Removed unnecessary variables. Parameters passed by value are copied,
so there is no need to make that explicit just because the return
value will be stored in the same variable that was just the source of
a parameter.

Noted TODOs for removing some allocation and leaks if we progress to
the point where mdrun filename arguments can be proved to be used only
in a const-safe read-only manner.

Updated and converted comments to Doxygen

Change-Id: I638c757d2d0aa5175dfe3769b499993eb613ea26

6 years agoMore updates to testing matrix
Mark Abraham [Mon, 15 May 2017 15:17:36 +0000 (17:17 +0200)]
More updates to testing matrix

Covered newest cmake, while ensuring that we test the new
and old FindCUDA modules.

Added new configuration to target gcc-7.

Moved x11 responsibility to a non-GPU configuration.

Moved a simd responsbility off the tsan configuration, which has
a TODO to get moved off the GPU build slave. Updated it to gcc-7
which should be useful.

Consolidated three jobs that built on bs_nix-amd into two.

Fixed minor issues with possible sprintf over-run or snprintf
truncation, and possible use of uninitialized pointers.

Fixed release matrix use of gcc-[567] versions. The release-2016
branch usess older compiler versions.

Change-Id: Iafd6a440fd763ef6c645bb094579e0ec6875621b

6 years agoFix formatting of gmx msd Description
Vedran Miletić [Tue, 4 Jul 2017 14:49:11 +0000 (16:49 +0200)]
Fix formatting of gmx msd Description

When [tt] isn't followed by a space or a punctation symbol, Sphinx will
generate wrong HTML output (preformated text ending tag will not be
where it should be). The formulation provided here is also slightly
more readable.

Change-Id: I328921b0e724e8f997fd07615e84cc8d87e7153f

6 years agoPME-gather: make variables local and const
Roland Schulz [Sat, 8 Jul 2017 00:40:48 +0000 (17:40 -0700)]
PME-gather: make variables local and const

Change-Id: Ic03622cf06418ffe2b667cb7ad96ccbfb44695ee

6 years agoSupport scoped key-value tree transform rules
Teemu Murtola [Sun, 9 Jul 2017 06:28:26 +0000 (09:28 +0300)]
Support scoped key-value tree transform rules

Resolve several TODOs about having the knowledge of the "applied-forces"
option section scattered in different places.  It is now possible to
create a "scoped" key-value tree transform rule interface such that all
rules created through it target a specific subtree in the target tree.

This makes it possible to have initMdpOptions() and initMdpTransform()
operate on the same tree in electricfield.cpp, and have the higher-level
structure only declared in mdmodules.cpp.  Remove the dependency on
MDModules from electric field tests, since it can now use these two
methods without knowing anything about the presence of the higher-level
"applied-forces" section.

Change-Id: I8107b10af3c9c602f40297a2279e3b0449e27e8d

6 years agoAdded missing .mdp file documentation for the enforced rotation module
Carsten Kutzner [Thu, 6 Jul 2017 14:05:44 +0000 (16:05 +0200)]
Added missing .mdp file documentation for the enforced rotation module

Change-Id: I08398b0a53ef6154a6ac8005890e21f529659dd0

6 years agoRestructure the load balancing timing
Berk Hess [Tue, 4 Oct 2016 09:29:51 +0000 (11:29 +0200)]
Restructure the load balancing timing

The load balancing region is now set by a (variable) start and end
point. This is much simpler than the tedious addition of timings of
many small regions during the force communication over multiple files.
The disadvantage of the current implementation is that one needs to
place a call to ddReopenBalanceRegionCpu() after every communication
call that can occur in the balancing region.
This change should avoid instabilities in DLB due to e.g. more time
being measured, but also available, when using GPUs and ranks with
less load starting earlier due to the constrains finishing earlier.

Change-Id: Idf73c3367adc269def533dfabf27df2ba4f6834f

6 years agoRefactor error handling in init_gpu
Mark Abraham [Fri, 30 Jun 2017 23:12:58 +0000 (01:12 +0200)]
Refactor error handling in init_gpu

Change-Id: I7fe1d196ed3696d359443553407862b08c089c4c

6 years agoSimplify gmx_gpu_opt_t
Mark Abraham [Wed, 5 Jul 2017 10:59:35 +0000 (12:59 +0200)]
Simplify gmx_gpu_opt_t

This temporary data about compatibility can be recomputed simply at
need.

Change-Id: I70352d75a39f4f777823638c462ea108829e46be

6 years agoDetect unknown mdp options in gmx dump/check
Teemu Murtola [Thu, 29 Jun 2017 15:08:34 +0000 (18:08 +0300)]
Detect unknown mdp options in gmx dump/check

Make gmx dump and gmx check fail gracefully if an input tpr file has
options that are not known to the current code, instead of silently
ignoring them.  gmx dump -orgir can still write out such files.

mdrun is using a different path (at least for now) that failed also
previously.

Change-Id: Ib61b03bb44c1510b03543f6e558caca5d44cb84d

6 years agoUnify nbnxn kernel dispatchers
Berk Hess [Thu, 20 Apr 2017 19:04:11 +0000 (21:04 +0200)]
Unify nbnxn kernel dispatchers

Reduced code duplication by merging the three nbnxn kernel dispatch
functions for C reference, simd_4xn and simd_2xnn into a single
dispatcher. This also removes the implementation details from
sim_util.cpp.

More reorganization could be done, but is not included here to
minimize the size of this change.

The original goal of this change was to conditionally compile all
files in the simd_4xn and simd_2xnn directory, but currently we
do not have the conditions available at configure time.

Change-Id: I41f7ae96d267a12cf6024866b59bb0cda7e1cd2f

6 years agoClean up pick_nbnxn_resources
Mark Abraham [Fri, 30 Jun 2017 21:16:22 +0000 (23:16 +0200)]
Clean up pick_nbnxn_resources

GMX_NO_NONBONDED should not trigger GPU emulation, it should disable
nonbonded calculations. Removed that logic, and amended the
documentation.

Made emulateGpu a field of nonbonded_verlet_t, set by the environment
variable, and used it to trigger the subsequent paths.

This simplifies pick_nbnxn_resources.

Change-Id: I5ce4f69e470fe7e24bb554556211697d25f11b0f

6 years agoRemove gmx_constexpr
Berk Hess [Fri, 30 Jun 2017 20:01:26 +0000 (22:01 +0200)]
Remove gmx_constexpr

gmx_constexpr was introduced because MSVC 2013 does not support
constexpr, but we no longer support version 2013. It was noted
that version 2015 also has issues, but our Jenkins MSVC 2015 setup
only produces a warning for a single line, which is now fixed inline.

Change-Id: I4f9321b5845ad89f3c13af3a0c9fa3c9f00b59d4