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>
Tue, 7 Jan 2020 11:56:56 +0000 (12:56 +0100)
commit3e9cdd24f55e8600ade1c426e2532ed33c947be2
treea9048df1bd35982b7951363c4fff9a213c4566e1
parent343c908495c27277ba46f21b66c26da8fe7e808a
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