Use much less PaddedRVecVector and more ArrayRef of RVec
authorMark Abraham <mark.j.abraham@gmail.com>
Thu, 9 Nov 2017 00:23:01 +0000 (17:23 -0700)
committerBerk Hess <hess@kth.se>
Tue, 21 Nov 2017 13:19:17 +0000 (14:19 +0100)
commit5268b73d6cd2966426540a0ad61044809fa71711
tree331c250d20fc58794fe4b63d6e1acc5d50ff940a
parent5748121c25f7c5fcd6f465e3ecdf56e0c171c3e5
Use much less PaddedRVecVector and more ArrayRef of RVec

Only code that handles allocations needs to know the concrete type of
the container. In some cases that do need the container type,
templating on the allocator will be needed in future, so that is
arranged here. This prepares for changing the allocator for state->x
so that we can use one that can be configured at run time for
efficient GPU transfers.

Also introduced PaddedArrayRef to use in code that relies on the
padding and/or alignedness attributes of the PaddedRVecVector.  This
keeps partial type safety, although a proper implementation of such a
view should replace the current typedef.

Had to make some associate changes to helper functionality to
use more ArrayRef, rather than rely on the way rvec pointers could
decay to real pointers.

Used some compat::make_unique since that is better style.

Change-Id: I1ed3feb016727665329e919433bece9773b46969
26 files changed:
src/gromacs/domdec/domdec.cpp
src/gromacs/domdec/domdec.h
src/gromacs/fileio/checkpoint.cpp
src/gromacs/gmxana/gmx_trjconv.cpp
src/gromacs/math/paddedvector.h
src/gromacs/mdlib/broadcaststructs.cpp
src/gromacs/mdlib/calcmu.cpp
src/gromacs/mdlib/calcmu.h
src/gromacs/mdlib/force.h
src/gromacs/mdlib/mdoutf.cpp
src/gromacs/mdlib/mdoutf.h
src/gromacs/mdlib/minimize.cpp
src/gromacs/mdlib/shellfc.cpp
src/gromacs/mdlib/sim_util.cpp
src/gromacs/mdlib/sim_util.h
src/gromacs/mdlib/tpi.cpp
src/gromacs/mdlib/trajectory_writing.cpp
src/gromacs/mdlib/trajectory_writing.h
src/gromacs/mdlib/update.cpp
src/gromacs/mdlib/update.h
src/gromacs/mdtypes/state.cpp
src/gromacs/mdtypes/state.h
src/gromacs/pbcutil/pbc.cpp
src/gromacs/pbcutil/pbc.h
src/programs/mdrun/md.cpp
src/programs/view/manager.cpp