Pass the GPU streams to StatePropagatorDataGpu constructor
authorArtem Zhmurov <zhmurov@gmail.com>
Fri, 27 Sep 2019 20:29:30 +0000 (22:29 +0200)
committerArtem Zhmurov <zhmurov@gmail.com>
Mon, 7 Oct 2019 16:51:29 +0000 (18:51 +0200)
commit77857c59611ace933fb049f6e43bc9e7e50b1c1c
treef6442279cb3de0d1e920e50d4f45c781b20912de
parent77ac5aae23cb1d6a133e64f2e8fd80ad9d9294e5
Pass the GPU streams to StatePropagatorDataGpu constructor

Now the StatePropagatorDataGpu has a local copy of all GPU streams and
manages the update stream. This will allow to select the specific stream
for a specific copy event in the follow-ups. The update stream is now
created in the constructor of the StatePropagatorDataGPU object, which
is a temporary solution until there is a separate device stream manager
(#3115).

Notes:

 - The current implementation where StatePropagatorDataGpu is also used
   on PME-only ranks, where many of the streams do not exist, without
   any restriction on the methods which would require these streams is a
   weakness of the design that will be dealt with in follow-up
 - The OpenCL builds unconditionally use PME stream/context, since for
   these this object is only used when the initial coordinates are copied.
 - The update stream is created in the constructor, whereas the rest of
   the streams is passed as arguments. This asymmentry will be removed
   with introduction of the centralized management of context/streams.

Refs. #2816.

Change-Id: Ia9b1cabd1d3d4942dba8465c716bf644037581e7
15 files changed:
src/gromacs/ewald/pme_only.cpp
src/gromacs/ewald/tests/pmegathertest.cpp
src/gromacs/ewald/tests/pmesplinespreadtest.cpp
src/gromacs/ewald/tests/pmetestcommon.cpp
src/gromacs/ewald/tests/pmetestcommon.h
src/gromacs/mdlib/update_constrain_cuda.h
src/gromacs/mdlib/update_constrain_cuda_impl.cpp
src/gromacs/mdlib/update_constrain_cuda_impl.cu
src/gromacs/mdlib/update_constrain_cuda_impl.h
src/gromacs/mdrun/md.cpp
src/gromacs/mdrun/runner.cpp
src/gromacs/mdtypes/state_propagator_data_gpu.h
src/gromacs/mdtypes/state_propagator_data_gpu_impl.cpp
src/gromacs/mdtypes/state_propagator_data_gpu_impl.h
src/gromacs/mdtypes/state_propagator_data_gpu_impl_gpu.cpp