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
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
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
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
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
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
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
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
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
Berk Hess [Fri, 24 Mar 2017 13:33:00 +0000 (14:33 +0100)]
Add CPU reference and SIMD pruning kernels
Change-Id: I416946adf67b8261b74093874b348270016585f1
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
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
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
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
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
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
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
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
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
Vedran Miletić [Tue, 13 Jun 2017 16:38:51 +0000 (18:38 +0200)]
Migrate some of the terminology pages
Change-Id: I2671535659cc0e62aa44cd5056e3924180b6abba
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
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
Mark Abraham [Tue, 15 Aug 2017 13:26:34 +0000 (15:26 +0200)]
Merge branch release-5-1 into release-2016
Change-Id: Ib769849746a3e55f3e7ae4067f0b6f549e66bd2c
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
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
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
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
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
Roland Schulz [Fri, 14 Jul 2017 20:44:41 +0000 (13:44 -0700)]
Use table Ewald for Skylake
Change-Id: I433acabb9269594465259d94eb01d34c313996dc
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
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
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
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
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
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
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
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
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
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
Berk Hess [Wed, 26 Jul 2017 10:09:12 +0000 (12:09 +0200)]
Add check for nr of orientation restraints
Change-Id: I78be294cd1c73db1cdd296e636dfc2806fa90c75
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)
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)
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
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
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
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
Berk Hess [Wed, 26 Jul 2017 10:09:12 +0000 (12:09 +0200)]
Add check for nr of orientation restraints
Change-Id: I78be294cd1c73db1cdd296e636dfc2806fa90c75
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Roland Schulz [Sat, 8 Jul 2017 00:40:48 +0000 (17:40 -0700)]
PME-gather: make variables local and const
Change-Id: Ic03622cf06418ffe2b667cb7ad96ccbfb44695ee
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
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
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
Mark Abraham [Fri, 30 Jun 2017 23:12:58 +0000 (01:12 +0200)]
Refactor error handling in init_gpu
Change-Id: I7fe1d196ed3696d359443553407862b08c089c4c
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
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
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
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
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
Mark Abraham [Thu, 22 Jun 2017 17:19:24 +0000 (19:19 +0200)]
Cleaned up GPU emulation logic
It was unclear how GPU emulation was intended to work. I assume that
it should trigger construction of a GPU pairlist and the use of the
matching plain C kernel, but otherwise function like mdrun -nb cpu.
A new fatal error for an inappropriate combination is introduced.
gmx_select_rank_gpu_ids() now cannot be run if emulation is active,
because it does not make sense to run it.
Change-Id: I1ff687afa26a9daee437f72441c856b4963d2272
Aleksei Iupinov [Fri, 30 Jun 2017 17:03:15 +0000 (19:03 +0200)]
Remove outdated cmake nvcc logic
Change-Id: Id51f680a9237bc6fcbb7a9b7441a5fc158be1d47
M. Eric Irrgang [Thu, 29 Jun 2017 22:25:36 +0000 (18:25 -0400)]
Mark unmodified input parameter as const.
Change-Id: I9d84ae7d4635a5132b3d1c9ff2d17ed5b344ff0d
Teemu Murtola [Fri, 30 Jun 2017 06:08:45 +0000 (09:08 +0300)]
Fix boolean serialization
Serialize the value instead of address of the value...
Also, write out more information for key-value tree
serialization/deserialization tests in case they fail, which would have
helped seeing the problem in Jenkins.
Change-Id: I427b80f38522e1b9792a8c49aa46ed2e85ff2ff7
Teemu Murtola [Mon, 27 Mar 2017 19:11:59 +0000 (22:11 +0300)]
Extend key-value tree comparison and tests
Cover comparison support for key-value trees for all basic option types
with tests, and implement support for missing types.
With this, all the basic option types should now be supported through
the whole chain of t_inputrec handling.
Change-Id: Id8f821e2bb7485eecea0922872d86bddcc69ef6f
M. Eric Irrgang [Thu, 29 Jun 2017 22:16:00 +0000 (18:16 -0400)]
Mark unmodified input parameter const
Change-Id: I01a6b180d8d4684e7888a9c5d753e6012df83779
Teemu Murtola [Sun, 25 Jun 2017 14:24:01 +0000 (17:24 +0300)]
Generalize IForceProvider
- Remove knowledge of individual modules from t_forcerec, and hide the
number of modules, and whether they contribute to a virial or not,
behind a generic interface.
- Improve hard-to-understand initialization of separate f_novirsum,
resolving some TODOs.
- Add some parameters that probably make sense for other modules beyond
the electric field one.
This also makes the requirement for all modules to have the same
parameters for the calculateForces() call explicit.
Change-Id: I4952515c4b707ba458fd267565fd000532ec281e
Teemu Murtola [Mon, 27 Mar 2017 15:32:38 +0000 (18:32 +0300)]
Extend key-value tree serialization and tests
Cover serialization support for key-value tree with basic option types
with tests, and implement missing support for bool values.
Change-Id: I630387393fce1435f64f9115870552067182145b
Mark Abraham [Thu, 22 Jun 2017 17:17:57 +0000 (19:17 +0200)]
Cleaned up high-level boolean variable naming
Variables like bSIMD and bGPU were rather unclear about what
they actually meant.
Modernized to remove b prefixes and to use C++ bool type. Clarified
that some variables related to the use of a physical, rather than
emulated, GPU.
No changes to logic, just renaming.
Change-Id: I2bce7e1d554d3910fbbe685bae0d6a32bf50ac91
Mark Abraham [Wed, 28 Jun 2017 10:44:24 +0000 (12:44 +0200)]
Fix specification for gcc-6
We decided to refer to modern gcc versions in a way that makes clear
that we're aiming to test a suitable release from that major version,
not any particular one.
Refs #2161
Change-Id: Idd985d7e4e45b58aeb9bd4f711622a91017a18a4
Mark Abraham [Wed, 28 Jun 2017 10:42:15 +0000 (12:42 +0200)]
Merge branch release-2016
Change-Id: Idb888bea9e78a9979468ff0c2bc2c02443e02026
Roland Schulz [Wed, 28 Jun 2017 00:30:46 +0000 (02:30 +0200)]
Merge "Merge branch release-2016"
Roland Schulz [Tue, 27 Jun 2017 18:36:16 +0000 (11:36 -0700)]
Fix ICC workaround for C++11 feature check
- Fix that move constructor check was disabled for non-ICC
- Disable check for all supported ICC versions
Change-Id: I295ffb9190d6c02540e709fafd9330a581afd1de
Teemu Murtola [Tue, 23 May 2017 18:06:45 +0000 (21:06 +0300)]
Do not use conf-man.py for non-manpage doc builds
Avoid importing conf-man.py for Sphinx invocations that do not build man
pages. Since it only specifies man page build rules, it is not
necessary, and some of the targets do not have dependencies that would
ensure that it is present.
Fixes #2184.
Change-Id: I3fe9cb03667c9a4e1d4bb9e02b65544e8250be31
Roland Schulz [Tue, 27 Jun 2017 22:46:13 +0000 (15:46 -0700)]
Merge branch release-2016
Conflicts:
admin/builds/pre-submit-matrix.txt
Checked that intent of test configs is implemented appropriately in
new context. The cuda-8 config newly introduced in release-2016
is already covered in this branch, so we don't need to have that
new configuration here.
src/gromacs/gpu_utils/gpu_utils.cu
src/gromacs/simd/impl_ibm_qpx/impl_ibm_qpx_simd4_double.h
src/gromacs/domdec/domdec.cpp
Trivial
Change-Id: I9b06bb476f5b62c9652c0e5186340ed11b0c31cc
Mark Abraham [Wed, 21 Jun 2017 12:37:09 +0000 (14:37 +0200)]
Minor improvements to test configs
No functional changes - this just improves the way we specify and
document intent.
Unless there's interaction effects being tested, only one
configuration should document that it is intended to test e.g. "thread
MPI with CUDA".
Made that specific for one such config, and removed the documentation
from a second config, even though it incidentally tests such code
(because it is currently the default).
Added a config that specifically tests thread-MPI (which it was
coincidentally already doing).
Clarified that the test config that covers the SIMD implementation of
search for pair lists to use on the GPU - which SIMD implementation of
the search is tested is merely coincidental, rather than a specific
choice.
Change-Id: Id1889753623f7808cd1bb2fb060ee2b2852dfd94