Write TPR body as opaque XDR data in big-endian format
authorErik Lindahl <erik@kth.se>
Sun, 29 Dec 2019 13:43:35 +0000 (14:43 +0100)
committerPaul Bauer <paul.bauer.q@gmail.com>
Sun, 29 Dec 2019 20:37:03 +0000 (21:37 +0100)
commitc4ebf37503f4d64f945645c0f5c8c296f0c1c7bb
tree23c92b59f8d15db19d302473a36079daf55ba4c0
parentd30f2cb6d8ef17d2bfffdfff5f2a79ef1e605fe3
Write TPR body as opaque XDR data in big-endian format

This implements support for opaque data in our serializers,
as well as a few missing XDR support opaque routines,
including support for data objects larger than 2GB.

By using this for the new serialization of the TPR body
we avoid the unintended 4x growth of the file size, and
avoid introducing extra endian swapping or padding.

We also adjust the endian so the InMemorySerializer
swaps to big endian (i.e., swap if host is little endian)
such that the body of the TPR file is compatible with
the header that is already written as big-endian by
the XDR routines.

Fixes #3276.

Change-Id: I99011dffe190155e671bd656127c2a33459923e2
src/gromacs/fileio/gmxfio_xdr.cpp
src/gromacs/fileio/gmxfio_xdr.h
src/gromacs/fileio/mrcdensitymap.cpp
src/gromacs/fileio/tpxio.cpp
src/gromacs/utility/inmemoryserializer.cpp
src/gromacs/utility/inmemoryserializer.h
src/gromacs/utility/iserializer.h
src/gromacs/utility/tests/inmemoryserializer.cpp
src/gromacs/utility/tests/keyvaluetreeserializer.cpp