Fix index mapping issue with LINCS on GPU
commit6e2b1f18a2085c48530fd72e95435de103d196be
authorArtem Zhmurov <zhmurov@gmail.com>
Thu, 21 Nov 2019 16:33:57 +0000 (21 17:33 +0100)
committerPaul Bauer <paul.bauer.q@gmail.com>
Mon, 25 Nov 2019 10:44:06 +0000 (25 11:44 +0100)
tree7bac9cbb061611d04454f9ae806f6b8410d2c519
parented91f1f7032b1411d33c254165d4cf6836ef318f
Fix index mapping issue with LINCS on GPU

In some cases (e.g. when DD is used), coupled constraints blocks
can have constraint indices that are interleaved with other blocks.
This was not taken into account when setting up the LINCS GPU data
structures. This patch fixes that by ensuring that all coupled
constraints are added to the mapping array one after the other.
Add note in decideWhetherToUseGpuForUpdate() that we need to add
a check for this when update auto will choose gpu in some cases.

Also renamed spaceNeeded by numCoupledConstraints to avoid confusion.

Fixes #3211.

Change-Id: Ib402c5cc9fc20116496034cdc11be921586bbd15
src/gromacs/mdlib/lincs_cuda.cu
src/gromacs/taskassignment/decidegpuusage.cpp