Joe Jordan [Mon, 22 Feb 2021 19:00:38 +0000 (19:00 +0000)]
Hold unique_ptr to gmx_ewald_tab_t in forcerec
Proper constructor and destructor are added. The field eir, which
was anyway recomputed with every call to do_ewald, is removed from
the struct and made local to do_ewald. Since the type cvec is only
used by eir, it is moved to reside in ewald.cpp.
Joe Jordan [Mon, 22 Feb 2021 17:35:53 +0000 (17:35 +0000)]
Hold unique_ptr for interaction_const in forcerec
Also renamed ic->interactionConst in init_interactionConst.
Mark Abraham [Mon, 22 Feb 2021 12:29:43 +0000 (13:29 +0100)]
Fix code so clang-tidy no longer complains
ejjordan [Sun, 21 Feb 2021 18:47:09 +0000 (19:47 +0100)]
remove InteractionLocality from PairListSet constructor
The InteractionLocality is removed as a member from PairListSet
and is no longer passed to the constructor, but instead to
PairListSets::construct. This will make it easier to remove the
explicit dependence on domdec_zones in nbnxm module.
Artem Zhmurov [Mon, 22 Feb 2021 14:15:16 +0000 (14:15 +0000)]
Unify NB atoms and staging data structures in OpenCL, CUDA and SYCL
Refs #2608
Paul Bauer [Mon, 22 Feb 2021 12:00:03 +0000 (12:00 +0000)]
Remove raw pointer to gmx_reverse_top
Changed the underlying type to an unique_ptr and changed the type to an
impl struct to make this possible. This removes the memory leak found
there.
Berk Hess [Mon, 22 Feb 2021 10:15:48 +0000 (11:15 +0100)]
Reduce use of gmx_domdec_t in domdec_topology.cpp
Paul Bauer [Mon, 22 Feb 2021 10:24:36 +0000 (10:24 +0000)]
Refactor md_enums
The old enum handling caused clang-tidy to complain about the globally
defined symbols for the enum strings, and also violated type safety by
using the enums both as enumerations and integers.
Changed all exposed enum strings and their corresponding char arrays
to classes and enumeration arrays.
Used enumeration array in a few places where it made sense to me.
Was not able to get rid of some instances where the enum to integer
conversion was abused.
Moved enum reading template to header to have it available for reading
all enums.
Artem Zhmurov [Mon, 22 Feb 2021 09:43:43 +0000 (09:43 +0000)]
Add FloatN aliases to OpenCL and use them in NBNXM
These aliases are nessesary to unify OpenCL, CUDA and SYCL
code.
Refs #3312, #2608, #3311
Artem Zhmurov [Sat, 20 Feb 2021 08:12:02 +0000 (11:12 +0300)]
Add FloatN aliases to CUDA and use them in NBNXM
These aliases are nessesary to unify OpenCL, CUDA and SYCL
code.
Refs #3312, #2608, #3311
Andrey Alekseenko [Thu, 18 Feb 2021 10:09:14 +0000 (13:09 +0300)]
Rename our SYCL aliases floatN to FloatN
Main reasons:
- Clearly separate our types (or aliases) from native types. This will
likely make later changes (e.g., in scope of #3312) easier.
- Enable hipSYCL build by avoiding clashes of multiple floatN in the
global namespace.
Refs #3312, #3923
Artem Zhmurov [Sat, 20 Feb 2021 22:48:03 +0000 (22:48 +0000)]
Set temperature scaling groups upon construction of integrator
The temperature scaling parameters do not change, so can be
set upon construction of the integrator object.
Closes #3794
Joe Jordan [Sat, 20 Feb 2021 08:52:44 +0000 (08:52 +0000)]
Remove unsed structs from nblist and use vector in t_nblist
Several unused structs are removed from nblist.h. Some unused members of
t_nblist are removed, and pointers are changed to vectors.
Joe Jordan [Fri, 19 Feb 2021 20:33:04 +0000 (20:33 +0000)]
Revome unused code from nsgrid
In addition to removing several functions that are not used,
some unused parameters from the t_grid struct are removed.
Berk Hess [Fri, 19 Feb 2021 14:44:49 +0000 (14:44 +0000)]
Clean up DD reverse topology options
Added a ReverseTopOptions struct to handle often used options for
functions. Added a constructor for gmx_reverse_top_t.
Replaced two bools by two enum classes for clarity and safety.
Joe Jordan [Fri, 19 Feb 2021 12:00:10 +0000 (12:00 +0000)]
Use const refs in init_nb_verlet
In addition to using more const refs instead of pointers
in some nbnmx setup code, names are made slightly more
verbose.
Andrey Alekseenko [Fri, 19 Feb 2021 09:20:35 +0000 (10:20 +0100)]
Replace sqrt with std::sqrt in mdatoms.cpp
We are including <cmath>, so we should use versions from the std namespace.
ejjordan [Thu, 18 Feb 2021 11:59:01 +0000 (12:59 +0100)]
Pass restraint data structures to bonded functions
This adds explicitly the t_disresdata and t_oriresdata structures to all
bonded force calculation calls, instead of passing them as members of
the t_fcdata structure. This is an unfortunate but necessary step in
order to be able to separate bondedtable_t from the two restraint
data structures. The splitting of t_fcdata into separate table data and
restraint data structures is needed to simplify the initialization of
the forcerec.
Artem Zhmurov [Thu, 18 Feb 2021 16:31:47 +0000 (19:31 +0300)]
Unify and clarify a couple of macro definitions in NBNXM
1. The GMX_NBNXN_PRUNE_KERNEL_J4_CONCURRENCY definition was
essentially duplicated in CUDA and OpenCL. This unify them.
2. The 1/sqrt(PI) macro was defined several times in OpenCL.
Joe Jordan [Fri, 19 Feb 2021 07:01:02 +0000 (07:01 +0000)]
Rename and add doxygen to reaction field params in interaction_const
This will make further changes to interaction_const RF params easier
to review.
Joe Jordan [Thu, 18 Feb 2021 20:48:33 +0000 (20:48 +0000)]
Use unique_ptr for forcerec in runner
Brings forcerec usage in line with most other large data structures there.
Andrey Alekseenko [Thu, 18 Feb 2021 13:01:43 +0000 (16:01 +0300)]
Make the use of GpuEventSynchronizer in SYCL conformant with CUDA/OpenCL
MR !1035 refactored the use of GpuEventSynchronizer in CUDA and OpenCL
to make merging the code paths easier. Here, we update SYCL to the same
standard.
Note, that it introduces additional synchronization between local and
non-local queues. It is present in CUDA and OpenCL, but was implicit in
SYCL. To simplify code, it is added here. If it turns out to be
detrimental to performance, it can be (conditionally) NOPed.
Refs #2608, #3895.
ejjordan [Thu, 18 Feb 2021 17:18:12 +0000 (18:18 +0100)]
Fix includes and forward declarations of domdec in nbnxm headers
ejjordan [Thu, 18 Feb 2021 16:36:56 +0000 (17:36 +0100)]
Use array in gmx_domdec_zones_t
Paul Bauer [Thu, 18 Feb 2021 16:06:08 +0000 (17:06 +0100)]
Fix doxygen in SYCL code
Was left over when merging changes from development branch.
Pascal Merz [Thu, 11 Feb 2021 00:27:01 +0000 (17:27 -0700)]
Implement velocity terms for virtual sites
This change
* introduces velocity terms for virtual site reporting replacing the
displacement hack used prior,
* removes work-arounds used to keep virtual sites frozen during real
atom propagation,
* allows users of the VirtualSiteHandler object to chose whether to
calculate positions only (used for non-output steps), positions
and velocities (used for output-steps except in md-vv), or
velocities only (used for output-steps in md-vv), which mitigates
the fact that calculating the velocities requires a few additional
operations,
* adds tests of the virtual velocity,
* updates the documentation accordingly.
Fixes #3866
Andrey Alekseenko [Thu, 18 Feb 2021 11:51:28 +0000 (11:51 +0000)]
SYCL NBNXM offload support
Associated changes:
- Added function stubs to PME: necessary for compilation.
- Stricter SYCL hardware compatibility checks: limits on subgroup size
and the availability of local memory.
- The kernel implementation and overall logic closely follow the OpenCL
implementation. Divergences are documented locally.
Limitations:
- No fine-grained timings yet.
- Code-duplication with CUDA and OpenCL: see #2608.
- Minor differences in local/nonlocal synchronization: see #3895,
related to #2608.
- Only the OpenCL backend was extensively tested. LevelZero works fine
without MPI but stalls due to a known bug. The fix for DPCPP runtime
is available, but not yet part of any OneAPI release:
https://github.com/intel/llvm/pull/3045.
- The complex/position-restraints regression test fails: see #3846.
- No performance tuning: see #3847.
Performance on rnase-cubic system is similar to OpenCL implementation.
Szilárd Páll [Wed, 17 Feb 2021 18:17:13 +0000 (19:17 +0100)]
Clean up box vector constants in do_force
Andrey Alekseenko [Thu, 18 Feb 2021 08:41:41 +0000 (11:41 +0300)]
Fix clang-8-cuda-10.0 container
MR !1135 (
60deae1fd05334f0ecf2f295cc7f49d59f734bb9) introduced a hack to
work around Clang support for 11.x CUDA versions. This inadvertantly
broke Clang 8 + CUDA 10.0 build.
Apparently, Clang requires
$CUDA_HOME/version.txt file to have version in major.minor.patch format,
and fails to find libraries if it is specified as major.minor only.
Paul Bauer [Thu, 18 Feb 2021 07:10:07 +0000 (07:10 +0000)]
Update CMake requirement to 3.16.3
We will require a more modern CMake beginning with the 2022 version, and
have chosen 3.16.3 as the minimum version, as this is what the Ubuntu
20.04 LTS ships by default.
Refs #3708
Pascal Merz [Wed, 17 Feb 2021 12:27:55 +0000 (12:27 +0000)]
Introduce test checking freeze groups
This currently fails for the partially frozen velocities
of md-vv simulation. Fix is in the follow-up commit.
Refs #3849
Andrey Alekseenko [Wed, 17 Feb 2021 10:44:43 +0000 (10:44 +0000)]
Add -DGMX_SYCL_HIPSYCL cmake option
When supplied, use hipSYCL's CMake module to set up compile options.
Otherwise, use our own code to configure flags for Intel's LLVM-based
SYCL compiler.
Artem Zhmurov [Wed, 17 Feb 2021 10:24:31 +0000 (10:24 +0000)]
Use GpuEventSynchronizer in NBNXM
This unifies the event-based synchronization in CUDA and OpenCL
by using a wrapper with platform-agnostic interfaces for events.
Refs #2608
ejjordan [Wed, 17 Feb 2021 09:13:10 +0000 (10:13 +0100)]
Remove dead function declarations from forcerec
Not only are the removed functions not used, they are not even defined.
ejjordan [Wed, 17 Feb 2021 07:52:18 +0000 (08:52 +0100)]
More const in edsam functions
In addition to increasing const correctness in edsam functions,
some additional minor cleanup is also done.
ejjordan [Tue, 16 Feb 2021 17:01:11 +0000 (18:01 +0100)]
Use const ref to mtop in init_forcerec
Also lower level function, which are currently static, are
refactored to take a const ref to mtop. This will make exposing
those lower level functions safer.
Szilárd Páll [Thu, 11 Feb 2021 10:57:05 +0000 (11:57 +0100)]
Support checking event status in GpuEventSynchronizer
This commit adds an isReady() method that allows checking whether
the event has been triggered (or in SYCL associated barrier task has
completed).
The primary aim is porting the nbnxm module to the unified GPU layer.
Implements part of #2527
Andrey Alekseenko [Tue, 16 Feb 2021 15:13:56 +0000 (15:13 +0000)]
Fix clang-tidy-11 errors in NBNXM module, part 5
Refs #3897
Andrey Alekseenko [Tue, 16 Feb 2021 14:16:02 +0000 (14:16 +0000)]
Add support for Clang-CUDA 11.x and a post-merge CI build
Tested mostly with Clang-11 and CUDA-11.2
While Clang does not officially support CUDA after 10.1, it appears to
work fine with newer versions.
Caveat: Clang fails to properly detect CUDA versions past 10.2
This can be worked around by creating `/usr/local/cuda/version.txt`
file with the single line `CUDA Version X.Y.Z`.
Despite the workaround above, Clang:
- does not recognize sm_86.
- recognizes sm_80, but believes that the installed CUDA version
is too old to support it.
Joe Jordan [Tue, 16 Feb 2021 13:43:14 +0000 (13:43 +0000)]
Use const ref to inputrec in do_force
Inputrec can be const at the level of do_force and below. This
will make subsequent refactorings in, e.g. setup code called
within do_force, easier.
Andrey Alekseenko [Tue, 16 Feb 2021 13:01:05 +0000 (13:01 +0000)]
Add container with LLVM 11, CUDA 11.2.1, hipSYCL
- Introduce the option to add hipSYCL to a CI container.
- - Version is specified by commit SHA, because the latest stable
release (0.9.0) is too old.
- - hipSYCL requires llvm-dev packages for compilation. This bloats the
size of the image, but is much easier to manage than installing CUDA
and ROCm into a temporary container.
- Add workarounds for known Clang limitations when dealing with the latest
versions of CUDA (11.0-11.2.1) and ROCm (3.9-4.0).
- - Is also allows using cuda-clang build with CUDA 11.
- Add a new image to the admin/containers/buildall.sh:
- - Ubuntu 20.04, Clang 11, CUDA 11.2.1, hipSYCL develop.
Pascal Merz [Tue, 16 Feb 2021 08:47:10 +0000 (08:47 +0000)]
Introduce virtual sites test
The virtual site tests contain two parts:
1. A reference implementation. The virtual sites code in mdrun is
difficult to unit-test, since the function calls require data
structures which are not available in our current testing
framework. To circumvent that problem, a reference implementation
is introduced in the tests. The reference implementation can be
unit-tested, and can be compared to end-to-end mdrun output,
which leads to a situation comparable to having unit and end-to-end
tests for the virtual sites implementation. Additionally, the
reference implementation is simplified and kept close to the
analytical formulas, which makes verification by eye easier. The
current unit tests compare the position calculation to the velocity
calculation, ensuring that the latter is indeed the derivative of
the first. Additional unit tests could be addded.
2. End-to-end tests. This ensures that all virtual site types can be
run, and that the trajectory of the virtual site matches the
trajectory of the real sites, using the reference implementation.
These tests check that the mdrun implementation agrees with the
reference implementation, and that real and virtual site reporting
does not get out of sync.
Note that the reference implementation also includes virtual velocities,
which are, however, not used to test simulation output yet. This will
be introduced once the new velocity definitions are implemented in
mdrun.
Refs #3866
Andrey Alekseenko [Mon, 15 Feb 2021 19:31:21 +0000 (22:31 +0300)]
Rework SYCL CMake machinery to be compatible with hipSYCL
Unlike DPCPP, hipSYCL (and ComputeCPP) offer its own CMake package.
This package has a nice `add_sycl_to_target` function to indicate which
source files must be compiled with SYCL and which target must be linked
with appropriate libraries.
Such function is rather trivial for DPCPP, so, in the interest of
homogeneity, we add it here.
Pascal Merz [Sun, 14 Feb 2021 20:19:32 +0000 (13:19 -0700)]
Make the restraint history const during force calculation
The history is updated later, and is read-only within the force
routines. Adds a few const qualifiers to clarify this.
Refs #3430
Paul Bauer [Mon, 15 Feb 2021 09:45:02 +0000 (09:45 +0000)]
Fix clang-tidy-11 for topology module
Part of updates for clang-tidy changes to require variable
initialization.
Sebastian Kehl [Mon, 15 Feb 2021 08:42:56 +0000 (09:42 +0100)]
Expose mk_nbfp and make_ljpme_c6grid.
Expose mk_nbfp and make_ljpme_c6grid from 'mdlib/forcerec.cpp'
in 'mdlib/forcerec.h'.
Thereby rename:
mk_nbfp -> makeNonBondedParameterLists
make_ljpme_c6grid -> makeLJPmeC6GridCorrectionParameters
Paul Bauer [Fri, 12 Feb 2021 09:45:15 +0000 (10:45 +0100)]
Fix release docs build
The change to python handling for the documentation build was not
propagated to the release builds.
Sebastian Kehl [Fri, 12 Feb 2021 19:24:47 +0000 (19:24 +0000)]
Fix leaked memory created in make_ljpme_c6grid.
Andrey Alekseenko [Fri, 12 Feb 2021 15:42:10 +0000 (15:42 +0000)]
Add gmx::isPowerOfTwo function
A follow-up from a discussion in !1080.
Mark Abraham [Fri, 12 Feb 2021 14:24:31 +0000 (15:24 +0100)]
Merge branch release-2021 into master
No content, because that was accidentally squashed into commit
a660b04e8d8756ed9c4d.
Paul Bauer [Fri, 12 Feb 2021 09:48:26 +0000 (10:48 +0100)]
Remove unused function
This was leftover from the tree-reduce algorithm removal.
Mark Abraham [Fri, 12 Feb 2021 13:02:37 +0000 (13:02 +0000)]
Improve CUDA codegen flags
- onnly generate PTX for an early and the latest arch (3.5 and 8.0)
- add binary 8.0 and 8.6 targets
Pascal Merz [Fri, 12 Feb 2021 08:02:58 +0000 (08:02 +0000)]
Move virtual site calculation
The previous implementation would lead to slight inaccuracies when
virtual positions were calculated before shifting positions in
pressure coupling algorithms. This change moves the calculation to the
top of the loop, right before DD and force calculation.
This also removes an unnecessary call to the virtual site construction
in rerun. That call was placed after force calculation and trajectory
writing, so had no influence since coordinates for the next step are
read from file. Since virtual sites are constructed when reading
coordinates from file, the results should have been correct anyway, the
call just had no influence.
This also moves the call to the virtual site construction in MiMiC.
Similar to the rerun case, the current call happened after virtual
sites are used. This call has been moved to right after the coordinates
are received. This is likely to have lead to wrong results when using
MiMiC with virtual sites.
Refs #3866
Joe Jordan [Thu, 11 Feb 2021 18:21:13 +0000 (18:21 +0000)]
Use unique_ptr for tables
Instead of returning a raw pointer, make_tables now returns a unique_ptr.
Andrey Alekseenko [Thu, 11 Feb 2021 13:49:29 +0000 (13:49 +0000)]
Fix clang-tidy-11 errors in NBNXM module, part 3
Refs #3897
Pascal Merz [Thu, 11 Feb 2021 06:23:24 +0000 (23:23 -0700)]
Disable cos acceleration for non leap-frog code paths
The cos acceleration is only applied in leap-frog. grompp and mdrun
would, however, happily accept non-zero cos-accel input, and report
viscosity-related quantities without ever applying the acceleration
for all other integrators.
This change adds a check at grompp time (to avoid new tprs with
non-implemented parameter combinations being created), and at
runner time (to catch older tprs). Should probably be backported
to the supported releases.
Refs #3903
Andrey Alekseenko [Tue, 9 Feb 2021 20:13:01 +0000 (23:13 +0300)]
Safer handling of empty cells in Grid::sortColumnsCpuGeometry
When the number of atoms is low, NBNXM grid can contain empty cells.
Previously, this caused the value of numAtomsCell in
Grid::sortColumnsCpuGeometry to become negative, and we were calling
Grid::fillCell with atomEnd < atomStart.
It did not cause any bugs as far as I observed, but is slightly
dangerous and couterintuitive behavior.
For example, such situation happens in
./bin/mdrunfep-test --gtest_filter=FreeEnergyCalculationsAreEquivalentToReference/FreeEnergyReferenceTest.WithinTolerances/coulandvdwsequential_coul_s
Artem Zhmurov [Thu, 11 Feb 2021 11:19:52 +0000 (11:19 +0000)]
Fix MPI build
In the change that made clang-tidy-11 happy for domdec
(
0af8a86a3c9556b2dc8fbd4c9f2a430c5cd58982) the MPI_Comm
were set to nullptr, although they are not pointers.
M. Eric Irrgang [Mon, 8 Feb 2021 15:55:14 +0000 (18:55 +0300)]
Use GmxManageMPI variables for gmxapi.
For minimal disruption to the release-2021 infrastructure,
let the `gmxapi` CMake target (libgmxapi) use
`${MPI_COMPILE_FLAGS}` and `${MPI_C_LIBRARIES}`
instead of the `MPI::MPI_*` target(s).
Note: This will conflict with the resolution to #3672.
Conflicts arising in a merge from `release-2021` to `master`
should defer to `master`.
Fixes #3896
Pascal Merz [Wed, 10 Feb 2021 21:48:49 +0000 (14:48 -0700)]
Allow specific diagonostic ignore for GCC only
GCC diagonstic pragmas will by default also be read by clang, but clang
and GCC don't always use the same warnings. Example: clang doesn't
understand "-Wunused-but-set-parameter" which GCC uses.
Needed for implementation of #3866.
Paul Bauer [Thu, 11 Feb 2021 09:21:32 +0000 (09:21 +0000)]
Prepare changes to docker images for python packages
Python package handling for things currently added manually to the
system python are moved to the virtual environments instead. This
affects the sphinx and gcovr packages.
Berk Hess [Wed, 10 Feb 2021 10:38:47 +0000 (11:38 +0100)]
Fix gmx_rmpbc_init with InteractionDefinitions
Molecules were not made whole when gmx_rmpbc_init with
InteractionDefinitions. This caused all trajectoryanalysis tools
not to make molecules whole.
Fixes #3900
Paul Bauer [Wed, 10 Feb 2021 07:49:31 +0000 (07:49 +0000)]
Fix llvm build in docker container
We still need to be able to rebuild containers if needed.
Andrey Alekseenko [Tue, 9 Feb 2021 16:03:14 +0000 (19:03 +0300)]
Fix clang-tidy-11 errors in NBNXM module, part 4
Refs #3897
Andrey Alekseenko [Wed, 10 Feb 2021 07:42:07 +0000 (07:42 +0000)]
Fix clang-tidy-11 errors in NBNXM module, part 1
In some cases, extracted problematic pieces into static functions to
simplify the logic.
Pascal Merz [Mon, 30 Nov 2020 23:37:38 +0000 (16:37 -0700)]
Re-fix md-vv Trotter kinetic energy and temperature
!270 reintroduced bug #3832.
Andrey Alekseenko [Tue, 9 Feb 2021 09:32:47 +0000 (09:32 +0000)]
SYCL compilation and code compatibility changes
- Split SYCL device kernels into separate compilation modules
By default (no split), all the kernels are put into a single compilation unit.
With the upcoming 168 flavors of NBNXM kernel, the JIT compilation
adds 6-10 minutes to each launch of _any_ program using _any_ SYCL kernel, because
all existing kernels (even unused ones) are compiled.
With this change, only actually invoked kernels are JIT-compiled (although not
cached), making the overhead much more manageable.
This cost can be moved to the compile-time by using flags like
`-fsycl-targets=spir64_x86_64-unknown-unknown-sycldevice`.
But it will require having the OpenCL runtime installed on the compilation host.
- Expose Intel SYCL extensions in a manner compatible with SYCL2020.
Intel DPCPP compiler has some of the 2020 features in its sycl::ONEAPI
namespace, and some of them have different names. Meanwhile, hipSYCL has
same functions in cl::sycl proper. Here, we create our own sycl_2020
namespace, and put all these functions there.
- Silence warning from icpx
It seems to be a false positive, not emitted by the manually compiled
llvm from Intel's repo.
- Don't check USM in CMake stage
We don't currently use USM, and, for some reason, this code fails to
compile with hipSYCL. Since we only want to check compilation at the
CMake stage, there is little sense in putting complicated code there.
Andrey Alekseenko [Mon, 8 Feb 2021 16:29:55 +0000 (19:29 +0300)]
Fix SYCL clearDeviceBufferAsync<float3>
Per SYCL 1.2.1 and 2020 (provisional), cl::sycl::handler::fill only
works for scalars and SYCL vectors, not custom types, like gmx::RVec. It
actually worked fine on OpenCL CPU and host, but not on OpenCL GPU. So,
a simple wrapper that reinterprets the buffer as array of float's is
added.
Artem Zhmurov [Tue, 9 Feb 2021 12:21:03 +0000 (15:21 +0300)]
Name streams after locality
This renames the deviceStream into localStream to be more verbose
in naming.
Andrey Alekseenko [Tue, 9 Feb 2021 13:13:37 +0000 (13:13 +0000)]
Fix clang-tidy-11 errors in NBNXM module, part 2
In some cases, extracted problematic pieces into static functions to
simplify the logic. Maybe a bit too much here, but, I believe, it improves readability.
Also fixed some grammar.
Refs #3897
Pascal Merz [Tue, 9 Feb 2021 10:06:15 +0000 (10:06 +0000)]
Make temperature and pressure coupling enums enum classes
This makes the plain enums denoting the temperature and pressure
coupling enums enum classes. Most of this change is simple renaming,
changing etcXXX into TemperatureCoupling::XXX, and epcXXX into
PressureCoupling::XXX.
As these are the first of many enums in md_enums.h being refactored
into enum classes, this also introduces some reusable functionality,
including a templated function mapping enums to a string representing
the functionality, and helper functions used when reading inputrec
from file or comparing inputrec instances.
This keeps explicit static_casts from / to int in two places: When
serializing the inputrec, and when transferring the values over
multiple simulations.
Mark Abraham [Tue, 9 Feb 2021 06:08:05 +0000 (07:08 +0100)]
Remove tree-reduce algorithm
This was formerly used only on the now-removed MIC platform. It could
well be useful these days with high core counts on conventional CPU
platforms, but it is likely that something else will prove limiting to
MD step thread scaling before that point. If we ever want it back,
then git will remember it, and we'd probably re-implement it on
different infrastructure anyway.
No need for release notes, as it was not something intended for users
to use.
Renamed the "standard" reduction function now that there is no need to
distinguish it from the tree reduction.
Part of #3982
Fixes #3891
Andrey Alekseenko [Tue, 9 Feb 2021 06:15:36 +0000 (06:15 +0000)]
dispatchTemplatedFunction: dispatch by bool
Add support of boolean template parameters of the subject function in
dispatchTemplatedFunction.
Artem Zhmurov [Tue, 9 Feb 2021 05:33:13 +0000 (08:33 +0300)]
Fix clang-format
2d567afadf39d215950455d46056745474b850c0 was finalized by applying
suggestion in the GitLab GUI, which did not adhere to clang-format
policy.
Paul Bauer [Tue, 9 Feb 2021 05:14:34 +0000 (05:14 +0000)]
Fix range check bug in gmx covar
Range checking was done the wrong way around.
Fixes #3902
Paul Bauer [Mon, 8 Feb 2021 17:40:49 +0000 (17:40 +0000)]
Tag images on the branch as release-2021
This makes sure we can change images for master without affecting the
stable branch.
Refs #3716
Andrey Alekseenko [Fri, 18 Dec 2020 13:39:51 +0000 (13:39 +0000)]
Disable FPE for SYCL builds
Intel Graphics Compiler triggers FPEs inside its JIT. We can more
selectively call gmx_fedisableexcept only iff we are running on
Intel's GPU, but, to me, a more predictable approach seems friendlier.
Also, refactored the two complex PP conditions into a separate function.
It's only called once at program launch, so function call overhead
should not be an issue.
Paul Bauer [Mon, 8 Feb 2021 12:23:12 +0000 (12:23 +0000)]
Fix clang-tidy-11 for trajectoryanalysis
Make sure the module conforms to clang-tidy-11.
Refs #3897
Paul Bauer [Mon, 8 Feb 2021 07:49:04 +0000 (08:49 +0100)]
Removed "math.h" included from clang-tidy
Version 11 seems to include those in the code without need.
Artem Zhmurov [Mon, 8 Feb 2021 06:25:49 +0000 (06:25 +0000)]
Parametrize constraints test over the test systems
Use a pre-define set of constant test systems to prevent repetition of logic
in different tests when latter are instintiated.
Szilárd Páll [Fri, 5 Feb 2021 22:00:07 +0000 (23:00 +0100)]
Fix clang-tidy 11 warning in nbnxm ocl kernels
Andrey Alekseenko [Fri, 5 Feb 2021 16:29:45 +0000 (19:29 +0300)]
Replace custom implementations of GCD with std::gcd
There is a minor implementation difference:
When any of the arguments is 0, old `lgc` functions return 1,
while std::gcd returns max of both arguments.
However, in the two cases changed here, the function is never
called with zeroes.
Mark Abraham [Sat, 6 Feb 2021 09:15:27 +0000 (09:15 +0000)]
Add style code for function static variables
These should be prefixed with `s_` just like class variables, because
the reason is the same: the reader knows immediately the scope and
lifetime.
Mark Abraham [Fri, 5 Feb 2021 14:13:57 +0000 (15:13 +0100)]
Ensure GoogleTest builds properly
Some test targets would not build without this.
Closes #3890
Paul Bauer [Fri, 5 Feb 2021 15:37:11 +0000 (16:37 +0100)]
Clean up domdec again after clang-tidy-11 fixes
Previous fixes have been incomplete and introduced a bug.
Paul Bauer [Fri, 5 Feb 2021 15:58:27 +0000 (15:58 +0000)]
Clang-tidy-11 fixes for utility
Fixes have been missing from previous fixes.
Refs #3897
Cathrine Bergh [Fri, 5 Feb 2021 15:43:14 +0000 (15:43 +0000)]
Updated logos
Paul Bauer [Fri, 5 Feb 2021 13:01:43 +0000 (13:01 +0000)]
Fix clang-tidy-11 for domdec and utility
Part of updates needed to conform to clang-tidy-11. Split into several
commits as it is impossible to have all changes together.
Refs #3897
Joe Jordan [Fri, 5 Feb 2021 12:21:29 +0000 (12:21 +0000)]
Use raw strings instead of format in docker build script
Removes all instances of .format() from strings in docker build
script in favor of the more modern raw strings.
Mark Abraham [Fri, 5 Feb 2021 10:06:20 +0000 (10:06 +0000)]
Remove VMX SIMD
This catered for POWER6 architectures, which are not used in HPC.
Part of #3891
Mark Abraham [Wed, 3 Feb 2021 16:20:56 +0000 (17:20 +0100)]
Define M_PI when it is not defined
This is a standard work-around (e.g. used in GROMACS) for C++ library
implementations that don't provide POSIX capabilities by default
(e.g. Cygwin).
Closes #3890
Mark Abraham [Tue, 2 Feb 2021 09:52:59 +0000 (10:52 +0100)]
Remove support for ARMv7 and NEON
Note that ARMv8 and NEON ASIMD are unaffected.
The implementation of the SIMD library for NEON ASIMD formerly
included content from that for NEON, and sometimes then overrode it
based on preprocessor defines. This has been consolidated manually so
that there is neither duplication nor additional preprocessing needed.
Part of #3891
Paul Bauer [Wed, 3 Feb 2021 15:18:56 +0000 (16:18 +0100)]
Remove no longer needed macro define
The __STDC_LIMIT_MACROS and __STDC_FORMAT_MACROS definitions
should no longer be necessary.
Mark Abraham [Wed, 3 Feb 2021 07:56:08 +0000 (08:56 +0100)]
Fix refactoring issue
The former code had short-circuit logic that is now restored. That
could only be a problem if multiple patches for the same atom had the
same name, which sounds unlikely. So probably the problem was benign.
Added doxygen and suggested future clean-up.
Refs #2833
Artem Zhmurov [Thu, 4 Feb 2021 09:56:25 +0000 (09:56 +0000)]
Make LJ combination rule enum into an enum class
To introduce type-safety, the combination rule for LJ is madde into
enum class. This also fixes:
1. Out-of-order string assignment to enum values
2. Unsafe utilization of the enum for LJ PME combination rule
(the values of this enum coincided so no bug by luck)
Mark Abraham [Thu, 4 Feb 2021 08:26:29 +0000 (09:26 +0100)]
Ensure no UB in writing forces
UBSan observed that on non-master ranks we added an offset to a null
pointer in of->f_global. That pointer was never used, so there was no
bug, but we can improve the code by expressing that more clearly.
Ref #3897
Mark Abraham [Wed, 3 Feb 2021 07:56:08 +0000 (08:56 +0100)]
Fix handling of tip4p in pdb2gmx
The former code wrote an output configuration file with an extra
spurious 'M' particle, as well as the 'MW'.
Added test coverage, which needs the full output configuration to be
checked. Made that configurable so that we have the option to check
the full configuration only when we want to.
Refs #2833
Fixes #3894
Andrey Alekseenko [Wed, 3 Feb 2021 17:15:31 +0000 (17:15 +0000)]
Initialize rollingPruningNumParts in init_plist
Previously, rollingPruningNumParts and rollingPruningPart were not
initialized, which, in the case of an empty domain, caused access
to uninitialized memory. No particular harm was being done, but it
could trigger an assertion in gpu_launch_kernel_pruneonly during
some of the regression tests.
The whole code in the preamble of gpu_launch_kernel_pruneonly is
probably due for refactoring, but since we initialize all other
plist's fields in init_plist, we better initialize these two as well.
Paul Bauer [Wed, 3 Feb 2021 16:40:13 +0000 (16:40 +0000)]
Update llvm docker build
The LLVM project changed their repository organisation, so we have to
adjust our docker build script to take that into account.
Container for llvm 11 tested locally.
Refs #3897
Mark Abraham [Wed, 3 Feb 2021 12:28:19 +0000 (13:28 +0100)]
Fix test of not_null
Inadvertently removed too much code
Refs #3893