Paul Bauer [Tue, 11 Jun 2019 09:20:28 +0000 (11:20 +0200)]
Split tpr header reading reading from tpr body
Split the low level functions for TPR file header and file body reading
into fully separate parts to allow reading the main part of the file
without having to read the header again.
Also gave the header datastructure a new name in line with naming
conventions and default initialized all fields.
Refs #2971
Change-Id: I110fb80cf19d9d2e59df1576e50c64806f532e00
Berk Hess [Wed, 19 Jun 2019 08:29:55 +0000 (10:29 +0200)]
Removed unused code paths in the NB FE kernel
Code paths that were only used with the group scheme were removed.
Change-Id: I27175abfad5da9948f0626af90d16e7801eaf19d
M. Eric Irrgang [Tue, 2 Apr 2019 16:41:50 +0000 (19:41 +0300)]
Updates to gmxapi docker entry points.
* Read GMXRC in gmxapi docker test environment. Allows `gmx` binary to
be easily discovered by Python wrappers. Supports expected behavior
for gmxapi/ci-... docker containers and ensures that GROMACS
components available during image build are available when running.
* Allow more granular testing. Rename and reorganize entry points for
the docker test containers.
Ref: #2756
Change-Id: I5e781fae4709e4ccb718a8295c3fbe68dd59de44
Paul Bauer [Wed, 12 Jun 2019 09:39:33 +0000 (11:39 +0200)]
Fix gmx dump
The program would fail because the filename for writing the output mdp
file was passed as valid empty string that could not be opened as an
output file.
Now only passes the string when it is not empty.
Added test and fixed possible floating point exception found by the
test.
Change-Id: I8b18fbc0dfc5642399935f32fb0b1999fad44c98
Mark Abraham [Mon, 20 May 2019 08:28:28 +0000 (10:28 +0200)]
Move code handling mdrun -gpu_id to taskassignment module
Also made the error message report all incompatible GPU IDs, not just
the first, and do so by throwing an exception.
Change-Id: I4e1f26a59903077b5ab6cc671486fb059cb78964
Berk Hess [Tue, 18 Jun 2019 08:28:19 +0000 (10:28 +0200)]
Make forcerec const in dispatchNonbondedKernel()
Changed forcrecin Nbnxm::dispatchNonbondedKernel() from a pointer
to a const reference. The GPU emulation kernel now writes the shift
forces to nbnxn_atomdata_t.
Change-Id: I170165529ba447db9b5d1824eea10675ae1bef7d
Christian Blau [Fri, 3 May 2019 10:21:32 +0000 (12:21 +0200)]
Mrc format header to lattice coordinate transform
Extracts a coordinate transformation into lattice coordinates from the mrc density
header, as well as the three dimensional grid extents.
refs #2282
Change-Id: I8c01a370e3010add29b8810e2f3320b9ab428c02
Christian Blau [Wed, 17 Apr 2019 11:43:52 +0000 (13:43 +0200)]
Density similarity measure and gradient
Adding a class that allows evaluating the similarity of three dimensional
densities and their gradient given a comparison method, along with a
concrete implementation of the inner-product as a comparison method.
refs #2282
Change-Id: Id73f237e123bed14241227b84cbf83970a09ff49
Paul Bauer [Mon, 10 Jun 2019 07:54:06 +0000 (09:54 +0200)]
Extend ISerializer functionality
Add datatypes to ISerializer that are needed to read TPR files but were
missing.
Refs #2971
Change-Id: I5d5e7f1f91c533a079cb287b018fa1d579c4f3f9
Artem Zhmurov [Mon, 18 Mar 2019 18:03:59 +0000 (19:03 +0100)]
Combine CUDA Leap-Frog, LINCS and SETTLE. I.
This is the first step in combining constraints and integrator
into "UpdateAndConstraints" module. The initial merge does not
imply any performance optimisation or code clean-up. Hence, this
patch keeps all the temporary infrastructure that was built
around SETTLE, LINCS and Leap-Frog to allow them to function as
a separate units. In the following commits, this infrastructure
will be removed and these three implementations will be more closely
integrated. To enable, set GMX_UPDATE_CONSTRAIN_GPU environment
variable. Note, that environment variables GMX_LINCS_GPU,
GMX_SETTLE_GPU and GMX_INTEGRATE_GPU will no longer work.
Refs #2816, #2888
Change-Id: I8730aad0ecaa0230686fe89d1157b0da2f01f7bc
M. Eric Irrgang [Wed, 12 Jun 2019 10:40:07 +0000 (13:40 +0300)]
Reduce docker image size for gmxapi CI.
Use ``--no-cache-dir`` option to ``pip install``.
Change-Id: I4c1794cc020096c3cee377ff2d79c6c599542bc1
Artem Zhmurov [Thu, 16 May 2019 08:06:06 +0000 (10:06 +0200)]
Bug fix: Constraints tests are not instantiated with CUDA
If the tests initialization macros is called with ValuesIn
function, the container provided should be filled. In the
current version, it is filled in the test SetUp function,
after the macros is processed. As a result, the empty
container is used in instantiation and no test are run.
Only CUDA-enabled builds are affected.
Change-Id: Ia2f38c9908d4b7d4277d282c01781b278eeeead0
Berk Hess [Fri, 7 Jun 2019 07:37:25 +0000 (09:37 +0200)]
Simplify GPU nbnxm x conversion
The GPU nbnxm x conversion change
42b343b9 lead to data being transferred
multiple times and introduced several ugly hacks. This change simplifies
the code and transfers each coordinate only once.
Change-Id: I430496251ae40ee4c604e3920b789b3ae2b297dd
Berk Hess [Mon, 17 Jun 2019 07:54:26 +0000 (09:54 +0200)]
Remove unused nbnxm include files
Change-Id: I04ca522139dfa7f1b809a2db9dd494ed9f0f0b23
Mark Abraham [Wed, 12 Jun 2019 15:39:08 +0000 (17:39 +0200)]
Fix pygments detection for sphinx for docs build
Got broken in
29616660 but somehow wasn't a problem in the docs build
on the dedicated slave for that.
Refs #2615
Change-Id: I407383bd0342decae56e4c60202ffbf190e8bb1b
Mark Abraham [Tue, 21 May 2019 20:59:26 +0000 (22:59 +0200)]
Use RAII approaches for hardware information detection
Eliminated gmx_hardware_info_free. The lifetime of the hardware info
should be from the first time it is needed until the end of the
process, and in particular its ownership should not be related to the
lifetime of any threads implementing mdrun.
The implementation of gmx_detect_hardware now uses a simple mutex and
file static smart pointer to hold the data, lazily create it, and leave
it to process cleanup to call the destructor to free resources. Helper
functions no longer refer to the static smart pointer directly.
Internal data structures of gmx_hw_info_t are now held by smart pointer rather
than needing manual memory cleanup.
Extended not_null to be able to be created from smart pointers, and
tested the new behaviours.
Reduced the header dependencies of detecthardware.cpp, now that it
doesn't do all the string handling of printhardware.cpp
Change-Id: I9d5cd838dc6e214163cf2e3104e0f7aaa356fcf8
Mark Abraham [Sun, 26 May 2019 22:00:46 +0000 (00:00 +0200)]
Clean up multisim, communication, and REMD code
Moved multisim declarations and code to one place.
Moved mpi_in_place_buf_t to its own files in a low-level module, and
made sure we tested a build that needed it. Removed duplicate tng
option declaration while I was there.
Moved a check for REMD to its code, removed another that was redundant
with that for multisim requiring more than one simulation.
Added some t_commrec and gmx_multisim_t cleanup code, but not all
of it can work before some more cleanup takes place.
Change-Id: Ie591f50a2162dce2e83552102f8633c8d49553a7
Erik Lindahl [Sun, 9 Jun 2019 11:51:36 +0000 (13:51 +0200)]
More quotes
Having to prepare slides for a Gromacs workshop is
a great motivation for procrastination in the form
of adding more quotes :-)
Change-Id: Ieed151881f5eecdc552726f8d95541a2ab9b5eb7
Szilárd Páll [Mon, 29 Apr 2019 10:02:32 +0000 (12:02 +0200)]
Template x buffer ops call on whether GPU is used
This allows the code to get optimized to avoid the overhead of merged
CPU and GPU codepaths.
Change-Id: If98c5eff327f5f9ecb81f278ca27b6d139bc19ab
Pascal Merz [Mon, 27 May 2019 04:42:47 +0000 (22:42 -0600)]
Clean up renamed simulator.h file
This change is a follow-up to I9bc31588, in which the Integrator class
was renamed to Simulator, and integrator.{h,cpp} was accordingly
renamed to simulator.{h,cpp}. The former change did, however, miss
the include guard, a typedef, and two mentions of "integrator" in
comments. The current change addresses this.
Change-Id: I14d55eeb35c18f198d4123a7132fbee2366713df
Pascal Merz [Sat, 25 May 2019 06:02:52 +0000 (00:02 -0600)]
Remove dependence of mdoutf_write_to_trajectory_files on global top
mdoutf_write_to_trajectory_files is currently taking the full global
topology object as input, but uses only the number of atoms. Removing
this dependency simplifies some refactoring further down the road,
as the new state element can use this function without needing
access to the global topology.
Change-Id: I3ad39050bfd5d7bb0792f3b158bad0817907e029
Pascal Merz [Sat, 25 May 2019 05:44:47 +0000 (23:44 -0600)]
Rename Integrator class
This renames the `Integrator` class to `Simulator`, which does not
actually represent integrators, but rather types of simulations
(some of which contain an integrator, but not all!).
Refs #2943
Leaves the TODO to rename the corresponding mdp-option, but no
consensus on the new name has been reached yet.
Change-Id: I9bc3158856cd68dfc2ca5f3da793cd1ecbc2ffaf
Artem Zhmurov [Wed, 24 Apr 2019 11:27:42 +0000 (13:27 +0200)]
Clarify which of the main energy terms are printed.
This is an attempt to clarify which of the main
energy terms are printed and which are not printed
from the EnergyOutput.
Change-Id: I8628026817c691add39d0332ddab5e372a2c3e96
Artem Zhmurov [Tue, 16 Apr 2019 14:40:35 +0000 (16:40 +0200)]
Clarify the EnergyOutput III
Making the EnergyOutput into the proper class. The t_mdebin structure
contents was made into the private fields of the object, prepare()
method was transformed into constructor. Legacy printing helper
functions merged into class methods.
Change-Id: Ia97650f8e74c6c08ee9735ba5e973c051b14784c
Artem Zhmurov [Wed, 3 Apr 2019 14:45:16 +0000 (16:45 +0200)]
Clarify the EnergyOutput II
The function that prints energy (and other thermodynamic values)
is now split into three: one that prints current values, one that
prinst averages at the end of the simulation run and one that prints
annealing temperatures. This way it is much clearer what is done at
each call and how many steps can be passed without calling one function
or another.
Change-Id: Ifc481fe3a5243917d0a290f1e3bec616b6ca6073
Mark Abraham [Thu, 23 May 2019 18:07:27 +0000 (20:07 +0200)]
Reorder code before thread-MPI spawns threads
gmx_check_thread_affinity_set was called before thread-MPI threads
were spawned, because originally that was necessary. But the intended
functionality is to provide feedback to users about whether thread
affinity was set by the OpenMP library or something else. Nothing else
uses the thread_affinity value in the meantime. So, it only needs to
be called just before OpenMP is initialized. The reordering makes
clear that some reduction code within this function only needs to run
with real MPI.
check_and_update_hw_opt_1 does modify hw_opt, but none of the relevant
variables were accessed in the preceding code, so the reordering is
safe. It now takes a boolean rather than a handle to t_commrec, which
decreases the code coupling and will shortly be useful. A check for
mdrun -ntmpi -npme has been moved into this routine.
check_and_update_hw_opt_2 only related to the group scheme and can
be removed.
The fatal error for group-scheme .tpr files can safely be moved
later, alongside other code specific to the Verlet scheme.
Reruns can safely clear the velocity vector later.
The log file makes a request to cite GROMACS papers, which is now
implemented in a simple function elsewhere.
Change-Id: I1e5990656c391da81aec215f86b94efc752002d4
Szilárd Páll [Thu, 23 May 2019 17:30:26 +0000 (19:30 +0200)]
Fix mulitple link refs in dev-manual
Change-Id: I4e9c68d392c911fad227667b1d3f29bb54d024f1
Mark Abraham [Wed, 15 May 2019 10:21:30 +0000 (12:21 +0200)]
Teach ArrayRefWithPadding to make a const flavour
Sometimes code that has a non-const view of padded memory needs to be
able to have a const view of that memory, e.g. to pass to a routine
that does not need to be able to modify. Now there is a member
function to do that. Note that the private data means that it is not
easy to construct the const view from the non-const view, because they
are different instantiations of the same template, so formally are
different types. However there is now a convenience overloaded
constructor so that passing a non-const view to a function that takes
a const view will work.
Also fixed the swap member, which fortunately was unused.
Change-Id: I52095fe3b5d5dd24b86698da2a065c0fd1f3fb0b
Mark Abraham [Fri, 10 May 2019 09:17:52 +0000 (11:17 +0200)]
Rewrite starting behavior
Several necessary checks were deferred until the time the checkpoint
was read, which made this feature hard to implement and
understand. Having moved the code, if it will not be possible to
append, we can tell the user immediately.
Fixed a bug where mdrun -append would start from the .tpr
configuration when the checkpoint file was missing.
Opening the logfile in the non-appending cases is now
closely associated with the logic for how the restart
works.
Refs #2804, #2375
Change-Id: I83a846958619e72ddc9a5e9bae49a9b71221ad24
Mark Abraham [Fri, 10 May 2019 09:17:52 +0000 (11:17 +0200)]
Introduce tri-state enums for restarts
Both the user choice for appending and the decision about how to
implement a restart are good to express as a three-way enumeration of
mutually-exclusive possibilities, rather than booleans.
Checkpoint restarts also need to consider whether KE quantities
need to be recomputed, which is now stored in t_ekinstate alongside
the data from which it was computed.
Together, these eliminate the ContinuationOptions struct.
Several booleans in implementation objects were renamed to be
consistent with the StartingBehavior enumeration values, so that the
code is easier to understand.
Moved the call to handleRestart out of updateFromCommandLine now that
it no longer needed to be there.
Used namespaces for handlerestart.cpp
Refs #2804, #2375
Change-Id: I1128b94e947c6ef355a1b137b8978faa227ab1a0
Alan Gray [Tue, 30 Apr 2019 10:18:03 +0000 (03:18 -0700)]
Pin X buffer with DD and use proper abstraction in buffer ops
This patch fixes an issue that the coordinate buffer was not being
pinned with DD, and replaces a raw cudaMemcpy call in the buffer ops
routine with proper abstraction through the copyToDeviceBuffer API.
Follow up to Gerrit change 9169
Implements part of #2934
Change-Id: I64aec66157ceb5eb04bcfd7cfe24b6ea5c18e4ae
Jinke Fan [Tue, 21 May 2019 03:33:17 +0000 (11:33 +0800)]
Add support for Hygon Dhyana processor
This change adds hardware detection and related task assignment
heuristics support for the Hygon Dhyana CPUs.
Chengdu Haiguang IC Design Co., Ltd (Hygon) is a Joint Venture
between AMD and Haiguang Information Technology Co.,Ltd., aims
at providing high performance x86 processor for China server
market. Its first generation processor codename is Dhyana, which
originates from AMD technology and shares most of the architecture
with AMD's family 17h, but with different CPU Vendor ID ("HygonGenuine")
/Family series number (Family 18h).
More details can be found on:
http://lkml.kernel.org/r/
5ce86123a7b9dad925ac583d88d2f921040e859b.
1538583282.git.puwen@hygon.cn
Change-Id: Ic91b032e69dfc13abad3fbfe6ab5e4f0e57fc7c0
Alan Gray [Thu, 9 May 2019 11:14:25 +0000 (04:14 -0700)]
Code quality improvements for CUDA position buffer ops
* improved variable naming
* use of reallocateDeviceBuffer
Follow up to Gerrit change 9169
Implements part of #2934
Change-Id: Ie948f624ae6f7e2df7a2b6c6c734d08d862096e5
Mark Abraham [Thu, 9 May 2019 21:05:55 +0000 (23:05 +0200)]
Move functionality to mdrunutility
This lower-level module needs to acquire more content from mdrun as we
evolve a more levelised design. This change premptively resolves
several cycles that would be introduced by consolidating restarting
handling into mdrunutility/handlerestart.cpp.
Moved multi-sim related bools to its header, rather than commrec.h.
Several functions did not need to be inlined, as they were only
used during set up and tear down.
Made a few routines in even lower-level modules be passed the
boolean parameter computed from cr and ms, rather than being
passed it themselves.
Change-Id: I4a1721eaf7cbe08155110782a6680785091504db
Szilárd Páll [Mon, 11 Feb 2019 17:07:09 +0000 (18:07 +0100)]
Improve X buffer ops kernel
- Added restrict qualifiers
- Simplified code and converted to vector load/store operations.
Change-Id: I76e4b954b4ef045f299a8496b4975497720f4b89
Erik Lindahl [Sat, 11 May 2019 11:33:16 +0000 (13:33 +0200)]
Added more quotes
Lazy Friday evening entertainment.
Change-Id: If26bd56b178510224b4c24b63124fcd413e6ee42
M. Eric Irrgang [Thu, 16 May 2019 14:11:31 +0000 (17:11 +0300)]
Fix typos regarding GMX_PHYSICAL_VALIDATION CMake variable.
Variable was misspelled in CMake messages.
Change-Id: I5cddd249a8d4ee6c32fc89ba01143f068c319af3
Pascal Merz [Thu, 16 Aug 2018 00:29:38 +0000 (18:29 -0600)]
Use Python 3
This updates the Python scripts shipped with GROMACS to use Python 3.5+.
Most changes done are either due to `__cmp__` not being available in py3
(replaced by `functools.total_ordering`), py2-iterators being replaced by
py3-iterators, or print statements being replaced by functions.
Additionaly, some changes in the Cmake files were made to select the
different Python version.
All python scripts having an explicit `#!/usr/bin/env python2` as a first
line were checked and updated. Larger changes were only needed for the
documentation scripts, other scripts did not require any changes. Scripts
not explicitly using shebangs were also checked, but no changes were
needed. The following scripts were not touched:
- all scripts under tests/physicalvalidation/ (already py3 compatible)
- all scripts under python_packaging/
- scripts/make_gromos_rtp.py - this file is not valid py2.7
Refs #2615
Change-Id: I2edbe213bc6401563934ce56f5fd6a39886d3095
Berk Hess [Tue, 14 May 2019 09:21:32 +0000 (11:21 +0200)]
Make all do_force_lowlevel() input const
Change-Id: I6db7dda98c169aed5f253ab48f1ac62bf64a2ea9
Mark Abraham [Thu, 9 May 2019 20:17:14 +0000 (22:17 +0200)]
Update infrastructure needed for restart rewrite
These changes are things that might be generally useful, and are
planned for use in refactoring of handleRestart.
Change-Id: Ic1ac5c2cb7e778808cdc40afbee59d26a6f52792
Artem Zhmurov [Tue, 2 Apr 2019 14:12:47 +0000 (16:12 +0200)]
Clarify the EnergyOutput I
The EnergyOutput::printStepToEnergyFile(...) method is responsible
for printing the current and average thermodynamic quantities as
well as anealing temperatures. The swich between what is printed
is done by passing enum argument to the function. Different
values of this argument lead to diferent, almost non-overlapping
code paths. Hence, it is natural to split the function. The
follow-up patch will make these into separate methods of the
EnergyOutput class, thus eliminating enum argument and making it
more clear what and how often is done.
Change-Id: Ifde9098cdddf85bc663f2943b2ee8778bc72a3ac
Paul Bauer [Thu, 9 May 2019 12:50:23 +0000 (14:50 +0200)]
Fix math formatting in reference manual
Change-Id: I87e4d4103e45562ce5395add18dcca8625a64b62
Artem Zhmurov [Thu, 7 Mar 2019 11:09:37 +0000 (12:09 +0100)]
CUDA version of Leap-Frog integrator with basic tests
Part of the GPU-only loop. Curent version is as a stand-alone module,
with its own coordinate, velocities and forces data management.
To activate, set environment variable GMX_INTEGRATE_GPU.
Limitations:
-- Only basic Leap-Frog is implemented.
-- No temperature control.
-- No pressure control.
Refs #2816, #2887
Change-Id: I439d7f5fd4f69a17ca7aaa412e242ce5e3aa5dbd
Alan Gray [Thu, 24 Jan 2019 15:31:21 +0000 (07:31 -0800)]
Position buffer ops in CUDA
On all but search steps the buffer ops transform can now be done on a
CUDA GPU. If PME runs on the same GPU the already uploaded coordinates
will be used as input.
Activate with GMX_USE_GPU_BUFFER_OPS env variable.
Note:
- waits for X copy on the PME stream to finish, need to implement sync
point between PME and NB streams (in follow-up).
Implements part of #2817
Change-Id: Ib87dabd74a02727898681249691ac9786b8ac65c
Paul Bauer [Tue, 12 Mar 2019 11:06:48 +0000 (12:06 +0100)]
Remove more manual memory management
Changed another virtual site preprocessing type to std::container and
added some documentation for types.
Refs #2833
Change-Id: I24e84bdb18e46f2cff710a1ca2cb0e1d4b80e633
M. Eric Irrgang [Tue, 2 Apr 2019 15:57:39 +0000 (18:57 +0300)]
More Python testing infrastructure for gmxapi.
* Add and improve test fixtures.
* Generate MD input files for tests.
Refs: #2756
Refs: #2896
Change-Id: I15ac8e44844cbf699cfe362e2fa443d07a355b3d
M. Eric Irrgang [Wed, 8 May 2019 12:23:50 +0000 (15:23 +0300)]
Add gmxapi._logging submodule.
To rearrange import statements and module initialization code,
a private _logging module is introduced to initialize the
Python logging module and to provide gmxapi.logger.
Change-Id: Ifc13db35df300d10500d4ced80fc84684bea2c0c
M. Eric Irrgang [Tue, 2 Apr 2019 11:23:45 +0000 (14:23 +0300)]
Update I/O handling in gmxapi.commandline.
Change-Id: Ic0506ac3df91b7a5e234242fb6dfdd0ce4796027
M. Eric Irrgang [Tue, 7 May 2019 20:32:02 +0000 (23:32 +0300)]
Expand gmxapi.operation tools to support the data flow constraints.
Achieves functional requirements 1, 2, and 3 as described
in the documentation submitted under #2893.
Updates some acceptance tests duplicated in a companion change.
Fixes: #2894
Change-Id: I26b1413c83e3ad176f2fd70f93e8b8e1033667ae
M. Eric Irrgang [Wed, 8 May 2019 12:30:58 +0000 (15:30 +0300)]
Fix formatting and typos.
Resolve some typos from earlier rebase.
Rearrange imports, dunders, and white space for better PEP8 compliance.
Change-Id: I14319b7882e17937f92951339a5caf9bc454cf4d
M. Eric Irrgang [Wed, 10 Apr 2019 14:32:00 +0000 (17:32 +0300)]
Support basic command line wrapper in gmxapi
Introduces gmxapi.commandline module and updates gmxapi.operation
to support gmxapi.commandline.cli() operation.
Ref: #2894
Change-Id: I9f6c113f21d3a1ce97184a1e48b8bd4856c5c924
Mark Abraham [Tue, 7 May 2019 13:20:14 +0000 (15:20 +0200)]
Provide hook for forks of GROMACS to describe themselves
This will help everybody understand which version of GROMACS is being
used because a description ends up in the log file.
Change-Id: I2ddd4def5b2a3768174a6b0ccc284cbc118906a1
Mark Abraham [Tue, 7 May 2019 08:08:55 +0000 (10:08 +0200)]
Provide better help for using libc++
This is now the actual cmake option required
Refs #2842
Change-Id: I1ab4676b0e01d65ba8df736b78eeb3c676cdc4ea
Artem Zhmurov [Fri, 3 May 2019 16:31:31 +0000 (18:31 +0200)]
Fixing minor memory issues in MDLib
1. Changed to PaddedVector in SETTLE test
2. Added GPU memory deallocation in CUDA versions of
LINCS and SETTLE.
Change-Id: I3dc8207f8e84f52bfde3f99b144cc44f91f65ee5
Mark Abraham [Thu, 2 May 2019 15:39:52 +0000 (17:39 +0200)]
Improve how mdrun -noappend names output files
Fixes a bug that could lead to names like md.part0001.part0002.log
Change-Id: Ic8f16f7f77e98e1506d7eec2dfc336e808c2d00c
Berk Hess [Tue, 16 Apr 2019 08:54:54 +0000 (10:54 +0200)]
Remove PME exclusion correction
Now the group scheme has been removed, ewald_LRcorrection() no longer
needs to correct for exclusions, which simplifies the code.
Also restructured the conditionals for the PME calls in
do_force_lowlevel().
Change-Id: I518f7929460e7209780b967bd612e4b83c14831d
Mark Abraham [Tue, 30 Apr 2019 15:14:35 +0000 (17:14 +0200)]
More tests for how mdrun -cpi restarts handle files
These tests clarify the behaviour of mdrun -cpi -noappend. It should
append ".partNNNN" to output files, but it is currently possible to
produce output files named like md.part0001.part0002.log
Added some unit tests around the string-handling behaviour that needs
fixing and left TODO comments to show what issues need fixing.
Reduced use of the deprecated mdrun -nsteps option
Refs #2804, #2829
Change-Id: I7e370b835d6fd3512fcaac575d0ff627b33c6e47
Paul Bauer [Thu, 30 Aug 2018 13:28:27 +0000 (15:28 +0200)]
Add outputadapters (2/3)
Add outputadapters based on IOutputAdapter that can be used to set the
box information in the t_trxframe, and toggle the settings for including
forces and velocities into the t_trxframe.
Change-Id: I13c637ab5e6f7e008a971798a5573f8ee1314667
Paul Bauer [Tue, 2 Apr 2019 10:36:58 +0000 (12:36 +0200)]
Replace t_grps with std::vector
Refs #2833
Change-Id: Ia1f156fec4c6c24f4c29a792e384668d835416f0
Berk Hess [Wed, 17 Apr 2019 16:50:38 +0000 (18:50 +0200)]
Convert manage_threading_t and gmx_enerdata_t to C++
Change-Id: I75fd6e0b8f217461f328690d168f61d5b45239cf
Paul Bauer [Thu, 30 Aug 2018 13:23:49 +0000 (15:23 +0200)]
Add outputadapters (1/3)
Add outputadapters based on IOutputAdapter that can be used to set the
number of atoms written to disk and control the addition of the t_atoms
information to the processed t_trxframe.
Change-Id: I0084a1566024f0a56f72eab031f927d342f42b30
M. Eric Irrgang [Fri, 29 Mar 2019 12:23:39 +0000 (15:23 +0300)]
Infrastructure updates for dependent changes.
* Introduce gmxapi.exceptions.ProtocolError.
* Add some pytest configuration and helpers.
* Update some comments.
Refs: #2893
Change-Id: I71030c3b552d568df7263115430631208812b9dc
Artem Zhmurov [Mon, 29 Apr 2019 13:33:34 +0000 (15:33 +0200)]
Use test with parameters for EnergyOutput
Some of the energy terms are printed out only if the specific
combination of thermostat/barostat/integrator is enabled. The
output also considerably different if it is from a rerun. This
commit changes the tests so that several possible combinations
of input parameters are tested.
This commit also fixes a possible bug when having more
acceleration groups than temperature coupling groups would
lead to under-allocation of temporary variable tmp_v.
Change-Id: Icc08e49a428b14ffd62d251662eb96184564b2c4
Paul Bauer [Tue, 9 Oct 2018 12:52:46 +0000 (14:52 +0200)]
Add builder for TrajectoryFileWriter
Adds builder method and storage for requirements on how to build an
object with its outputadapter methods.
Change-Id: I1b52e0cbb0bc39d8d1a78087a0526dcee8f8c289
Berk Hess [Tue, 30 Apr 2019 07:07:24 +0000 (09:07 +0200)]
Change nbnxm FEP pointer to unique_ptr
This fixes an incorrect delete issue in free energy runs.
Change-Id: Ib247c6eaa98807fe3abe2fcefd09d8509d6b8598
Mark Abraham [Tue, 30 Apr 2019 15:03:53 +0000 (17:03 +0200)]
Enhance path search functions
Extracted common implementation functions based on compat::string_view
and simplified the uses of them. Some temporary strings are no longer
created. Added, updated, and corrected Doxygen. Removed comments about
dot and dot-dot special directories, as the code does not do anything
about them. Moved some naming in the direction of C++17
std::filesystem::path.
Added new tests to cover the changes. Used namespaces better in the
test file. Used reference data for the tests.
Eliminated getParentPathAndBasename as redundant.
Change-Id: I11a1a25a257da753ca83f5bdd09d06b11c76cec5
Artem Zhmurov [Wed, 27 Feb 2019 15:38:42 +0000 (16:38 +0100)]
CUDA version of SETTLE algorithm with basic tests
CUDA-based GPU implementation of SETTLE. This is a part of
all-GPU loop. Can work isolated from other parts of the code
since coordinates are copied to (from) device before (after)
SETTLE kernel call. The velocity update as well as virial
evaluations can be enabled.
To enable, set GMX_SETTLE_GPU environment variable.
Limitations:
1. Does not work when domain decomposition is enabled.
2. Projection of the derivative is not implemented.
3. Not fully integrated/unified with the CPU version.
TODOs:
1. Multi-GPU case.
2. Better virial reduction. This is a more general feature,
not only related to constraints.
5. More cleanup in constr.cpp needed.
6. Better unit tests.
Refs #2816, #2886
Change-Id: I218e1bf1f86a2351e189e3c27f950f45c06135a4
Mark Abraham [Wed, 17 Apr 2019 06:35:11 +0000 (08:35 +0200)]
Test the output of "gmx mdrun help"
As we migrate mdrun to use the gmx::Options framework, several chunks
of text and many option descriptions will move to their respective
modules. However users would prefer the output of "gmx mdrun help" to
only change in ways that we as developers expect.
This will also provide a stable path towards e.g. implementing gmx
minimize, gmx tpi, gmx rerun, etc. and having the help text relevant
only to that runner. It may also be useful if in future we structure
mdrun modules to write their help via e.g. "gmx help mdrun pulling".
Change-Id: Iccd07f797004d8ff24eb56ca528a3fe9148b6749
Berk Hess [Thu, 28 Feb 2019 12:40:27 +0000 (13:40 +0100)]
Add con/destructor for t_forcetable
This avoids the need for sfree calls in C++ objects that use this.
Change-Id: I21d6867a9e3c84929ecf472e65ee97b3cf7c4846
Berk Hess [Wed, 27 Feb 2019 08:58:37 +0000 (09:58 +0100)]
Convert DispersionCorrection to a class
This change is only refactoring.
Change-Id: Ic6d90a26b485ab1546706bf8f419d7a297c7c7b5
Artem Zhmurov [Mon, 29 Apr 2019 15:42:48 +0000 (17:42 +0200)]
Fix for the CUDA version of LINCS
This fixes a couple of Jenkins Post-submit failures:
1. Clang warnings in the CUDA portion of code.
2. New CUDA LINCS failure on the host with CUDA, but without
capable GPU.
Also done is minor renaming and typo correction.
Change-Id: I4f1d89d4bf5a6f3f0083186cb67787cdf6536bb9
Artem Zhmurov [Wed, 20 Feb 2019 14:30:29 +0000 (15:30 +0100)]
CUDA version of LINCS constraints.
Implementation of the LINCS constraints for NVIDIA GPUs.
Currently works isolated from the other parts of the code:
coordinates and velocities are copied to and from GPU on
every integration timestep. Part of the GPU-only loop.
Loosely based on change 9162 by Alan Gray. To enable,
set the environmental variable GMX_LINCS_GPU.
Limitations:
1. Works only if the constraints can be split in short
uncoupled groups (currently < 256, designed for H-bonds
constraints).
2. Does not change the matrix inversion order for costraints
triangles.
3. Does not support free energy computations.
4. Assumes no communications between domains (i.e. assumes that
there is no constraints connecting atoms from two different
domains).
5. Number of thread per blocks should be a power of 2 for
reduction of virial to work.
TODOs:
1. Move more data from the global memory to local.
2. Change .at() to []
3. Add sorting by the number of coupled constraints to decrease
warp divergencies.
4. numAtoms should be changeable (for multi-GPU case).
Refs #2816, #2885
Change-Id: I3c975cf898053b7467bcd30459e60ce2c8852be6
Christian Blau [Wed, 17 Apr 2019 13:50:35 +0000 (15:50 +0200)]
mrc density map reading/writing
Add a class that combines header and mrc data handling for float values
to enable reading and writing of mrc files.
refs #2282
Change-Id: Idd84ab2628a52a2fcafb6121ad66f62e88235c74
Christian Blau [Tue, 23 Apr 2019 13:03:52 +0000 (15:03 +0200)]
Three dimensional coordiante transformation.
Introduce class that transforms three dimensional coordiantes via scaling and translation.
Change-Id: Ic433400cf42c33d7eadd4a17020d0486542b8542
Paul Bauer [Tue, 9 Oct 2018 12:35:12 +0000 (14:35 +0200)]
Add C++ coordinate file writing method.
TrajectoryFileWriter also allows the chaining of modules derived from
IOutputAdapter together to perform actions that modify the meta
information contained in a t_trxframe before writing the information to
disk.
IOutputAdapter can be used to communicate what requirements a specific
file writing method has on the meta information contained in t_trxframe,
with modules being able to proclaim those and TrajectoryFileWriter checking
them against the requested file types before accepting the addition of a
module to the processing chain.
The TrajectoryFileWriter object needs a builder method to construct itself that will
be added in a child change.
Change-Id: I1c29701b4ce788918cb6b3a47ca9277898a7bff4
Szilárd Páll [Thu, 25 Apr 2019 12:20:04 +0000 (14:20 +0200)]
Fix clang warning about NULL use
Change-Id: Ia34e401bf04f1743419898fdb60671d3f066992f
Szilárd Páll [Wed, 24 Apr 2019 10:36:02 +0000 (12:36 +0200)]
Avoid using AtomLocality::Count as a valid value
Change-Id: I740eef01e679f085a9f73c60a67377e0122daba4
Christian Blau [Tue, 16 Apr 2019 12:04:13 +0000 (14:04 +0200)]
density fitting forces
Evaluate forces on atoms that increase a measure of the goodness of fit to a reference density.
The density fitting forces are evaluated as the gradient of the goodness of fit of a comparison density is generated from atoms by spreading on a grid via a Gaussian kernel to the reference density.
Applying the chain rule for this gradient yields the density fitting force as the inner product of the derivative of the comparison density to reference density goodness-of-fit function at all density values and the gradient of the spreading kernel used to simulate the density.
This patch assumes that the comparison density to reference density goodness of fit derivative density is given, methods that aid the evaluation of this derivative density are part of a child patch.
refs #2282
Change-Id: I4d93fffbdb41753f9a0a4af921011aca02ade69c
Artem Zhmurov [Fri, 12 Apr 2019 15:49:22 +0000 (17:49 +0200)]
Improvements for energy output test.
EnergyOutput handles outputs to the text log file
as well as to the binary edr file with the number of
the printed energy terms determined by the simulation
setup. This commit adds the tests for the binry output
and increases the number of tested energy terms.
TODO Proper fix for memory leak in energy output.
Change-Id: I670b168a83c0a1883b821a4b317c0df3055183e8
Paul Bauer [Tue, 13 Nov 2018 10:36:33 +0000 (11:36 +0100)]
Add Interface to change coordinate file info
Adds the IOutputAdapter interface to organize coordinate output file
writing, as well as enum flags to communicate requirements between output
modules and output filetypes, as well as the outputadaptercontainer storage
object to keep track of modules derived from the IOutputAdapter
interface.
IOutputAdapter can be used to communicate what requirements are specific
file writing method has on the meta information contained in t_trxframe.
Change-Id: I0011c852eb54bd551230dd8c4971292dd4edc7e5
Mark Abraham [Thu, 25 Apr 2019 08:04:02 +0000 (10:04 +0200)]
Update style guide about class enums
Change-Id: Icf6ddde8ce030bd5ed737152a8c58daad87ff991
Szilárd Páll [Fri, 15 Feb 2019 17:34:52 +0000 (18:34 +0100)]
Fix CUDA fallback shmem gather reduction
Fixed some shmem races and an intra-warp WAR hazard.
Change-Id: Ic02874f147e1c3a0dad1b67a6464ede453f77c47
Mark Abraham [Wed, 17 Apr 2019 09:24:00 +0000 (11:24 +0200)]
Clarify pushing of interaction types
gcc was warning about possibly pushing atomNumber to a vector when its
value was not defined. That was impossible because of the gmx_incons
earlier, but we can express the validity of the code much more clearly
to the reader/compiler.
Fixes CMAP implementation also
Extracted the common code to a function.
Change-Id: I74be61b125e05ff5505162440349fcef4ea50fdb
Mark Abraham [Wed, 17 Apr 2019 12:31:44 +0000 (14:31 +0200)]
Updated clang -Weverything checks to clang-7
This is supposed to be used with the latest tested clang
compiler. That is now clang 7, but the logic is hard-coded to clang 6,
which is why some things only failed in post-submit testing where we
have such a compiler for the clang-cuda build.
Fixed issues only found with clang -Weverything.
Also fixed those found with clang-8, but as we do not yet use that in
Jenkins, they're commented out for now.
Change-Id: I83be1cb770d486cc81a453d4911361f06a056ce3
Christian Blau [Wed, 10 Apr 2019 13:58:46 +0000 (15:58 +0200)]
Three dimensional gauss transform
Added class that adds gaussians functions with specified
amplitudes and coordinates onto a three-dimensional scalar field.
Change-Id: I07ea2cdd219b34afc402975a0b0e8a52eb71acaf
refs: #2282
Christian Blau [Wed, 10 Apr 2019 13:52:48 +0000 (15:52 +0200)]
One dimensional Gaussian function on lattice.
Evaluate a Gaussian of width sigma in one dimension on lattice points with unit spacing.
refs #2282
Change-Id: I57a513f05af44323e7109c4560438dc023793c4c
Berk Hess [Thu, 21 Mar 2019 21:09:30 +0000 (22:09 +0100)]
Remove nbnxm kernel type from pairlist generation
The type of kernel for computing distances between atom clusters pairs
is no longer set directly by the non-bonded interaction kernel type.
A new type is added for this, although the actual choice of cluster
distance kernel type has actually not changed.
Also moved the declaration of PairlistType to pairlistparams.h.
Change-Id: Iaf38ca7804eed75295e6cb0e1176a23d620c6f0c
Berk Hess [Tue, 16 Apr 2019 14:19:01 +0000 (16:19 +0200)]
Remove charge groups from domdec and localtop
Code explicitly handling charge groups has been removed in the domdec
module. Removed the charge groups from gmx_localtop_t.
Changed cginfo in forcerec to std::vector, which propagates into
the nbnxm module.
Parts of the TPI code are now commented out until reimplemented.
Change-Id: I9d3bffe26e34ebbb8e31ef97a9a7f1e0bea92306
Todo: Change naming from charge group to atom.
Todo: Remove duplicate counters for atoms and charge groups.
Szilárd Páll [Mon, 15 Apr 2019 16:24:42 +0000 (18:24 +0200)]
Fix warnings & consolidate declarations
- Unused variables warnings with cuda 10.1
- Early declaration of kernel pointers eliminated
Change-Id: I7c8ca06322a3da9c948cc19d6b0b0f6a53f16beb
Mark Abraham [Fri, 8 Feb 2019 15:55:27 +0000 (16:55 +0100)]
Create gmx::compat::optional
This C++17 std component is an extremely useful vocabulary type that
has a straightforward implementation in C++14. Having it available is
likely to mean we can write simpler, less buggy code in less developer
time. It should be used in cases where the absence of a proper value
has an obvious natural interpretation, e.g. the type of the return
value of a function that parses an integer value from a string, or
searching for a matching element in a range, or optionally naming
a residue type.
Updated developer guide and COPYING file accordingly.
Used compat::optional for some aspects of residue handling. This
simplifies some code, and sometimes avoids needing to make a dummy
residue name string that then needs to be compared with other strings.
Let .clang-tidy file's header management apply to source fields for
test binaries.
Excluded the external code from Doxygen checking. Noted where to go
for documentation in the file Doxygen.
Fixes #2861
Change-Id: Ife34983f234549702902a0ea45dc3592098e377d
Mark Abraham [Sun, 14 Apr 2019 19:45:53 +0000 (21:45 +0200)]
Move pull work struct out of inputrec
Its lifetime is now managed by runner. This will make high-level
organization more comprehensible, and permit more meaningful
const-correctness of t_inputrec.
Change-Id: I66bf765ad7235d84184227325eb52afd58146b72
Mark Abraham [Sat, 13 Apr 2019 14:46:20 +0000 (16:46 +0200)]
Improve swapcoords session lifetime management
This is no longer stored in the inputrec (which is now more
const-correct), and it is also now be cleaned up in one place.
Change-Id: I4d3c3ebb8124849cf7e13334759fda731370c1bc
Paul Bauer [Fri, 5 Apr 2019 08:22:49 +0000 (10:22 +0200)]
Update clang-tidy to check for dangling references
Change-Id: I4a720ee29dddcb0778f88aaa3b1057c61d319036
Berk Hess [Sat, 13 Apr 2019 10:00:06 +0000 (12:00 +0200)]
Fix pdb-related issues
In editconf, if a PDB input was read, chain IDs are known, and should
be written if the output is also PDB. This now works again, after
being broken in commit
8dd3c9ae88004054b3.
This required adding missing tpr support to readConfAndAtoms(), which
also fixes that pdb2gmx, insert-molecules, and solvate could not read
tpr files. Those are the only tools that directly or indirectly called
readConfAndAtoms with a .tpr file.
Fix in master also closes memory leaks.
Refs #2900
Change-Id: I883777be945023a7e69260b22e76df54477828ee
Berk Hess [Wed, 17 Apr 2019 09:35:59 +0000 (11:35 +0200)]
Remove group scheme search code
This also required removing the generic group kernel code.
Removed domdec group scheme sorting code.
Also removed the nbnxm grid size call from the domdec module off it
turned out the results were not used.
Change-Id: I1a49967bbeca33dcd62834e8a244aaf02e80a95e
Berk Hess [Tue, 16 Apr 2019 20:59:03 +0000 (22:59 +0200)]
Simplify vsite PBC handling
Since we no longer support charge groups, removed the (complex)
vsite pbc tracking code.
Also changed the inter charge group vsite counting to inter update
groups counting, so we can avoid PBC calculation with update groups.
Change-Id: Iebaee9a25e761d38c571563fd0814b57e15c7e5f
Prashanth Kanduri [Fri, 29 Mar 2019 16:15:32 +0000 (17:15 +0100)]
Move shellfc code to the mdrun module
This code was previously in mdlib and made use of the force
calculation routines. The introduction of the forceschedules
module (Patch 9363) introduces a cyclic dependency.
Therefore, this clean up is important to ensure that all
users of the Force Schedules are present in a single module.
Related: #2574, #2774
Change-Id: I19563f0f6e7985d198a2497a799c5377b24a1419
Paul Bauer [Fri, 5 Apr 2019 15:41:55 +0000 (17:41 +0200)]
Enable printing of known issues in commandline
Showcase in gmx dump.
Added test for it.
Change-Id: If1e70cc3b1a9c73a9483ba643a979edb2838d6a5
Paul Bauer [Wed, 3 Apr 2019 13:38:44 +0000 (15:38 +0200)]
Create gmx::compat::string_view
This part of the C++-17 std will likely help in cases we want objects to
store views to std::strings instead of performing a copy of them.
Updated COPYING instructions and developer guide.
Excluded the external code from Doxygen checking.
Noted where to go for documentation in the file Doxygen.
Change-Id: Ibc75f32929d385159d27d0b7ba87f2133995e915
Mark Abraham [Wed, 17 Apr 2019 05:06:54 +0000 (07:06 +0200)]
Fix post-submit
Change-Id: I203647ed9ac70c99d188d29223a3a4141d3d4533