CUDA version of LINCS constraints.
authorArtem Zhmurov <zhmurov@gmail.com>
Wed, 20 Feb 2019 14:30:29 +0000 (15:30 +0100)
committerArtem Zhmurov <zhmurov@gmail.com>
Sun, 28 Apr 2019 15:29:14 +0000 (17:29 +0200)
commit0a1aae785a6f746adbaae672736462f2ff1cf948
treec5891d6fee25a15fa36ee5be352e734a3aa9ab26
parent990f4992062489776a0044ae9d7768d09c14d754
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
src/gromacs/mdlib/CMakeLists.txt
src/gromacs/mdlib/constr.cpp
src/gromacs/mdlib/lincs_cuda.h [new file with mode: 0644]
src/gromacs/mdlib/lincs_cuda_impl.cpp [new file with mode: 0644]
src/gromacs/mdlib/lincs_cuda_impl.cu [new file with mode: 0644]
src/gromacs/mdlib/lincs_cuda_impl.h [new file with mode: 0644]
src/gromacs/mdlib/tests/constr.cpp