Clarify force buffer setup code in do_force
authorSzilárd Páll <pall.szilard@gmail.com>
Tue, 12 Feb 2019 17:38:43 +0000 (18:38 +0100)
committerMagnus Lundborg <magnus.lundborg@scilifelab.se>
Fri, 1 Mar 2019 10:07:33 +0000 (11:07 +0100)
commit5ada23572c0f75371e752a9a14bdb037ea1226a1
treebc622c0e0f5dc1f8ae47948bef2802f6c29f2283
parent9192505f464857f8ec3706e98250a43774b77197
Clarify force buffer setup code in do_force

Refactored code and made conditionals non-nested to improve
the ease of understanding when is a common or separate buffer used for
the forces when direct virial contribution is computed.

Also add subcounter for force buffer clearing which also helps annotate
code that should be conditional on whether any of these buffers are used
to accumulate or only to copy into (e.g. with everything offloaded to a
GPU).

Refs #2802

Change-Id: I3fa5a3e4e4adf5cfe0eb417f0c1c3d0ed4a96769
src/gromacs/mdlib/sim_util.cpp
src/gromacs/timing/wallcycle.cpp
src/gromacs/timing/wallcycle.h