Skip to content

Add KVT serializers for char and unsigned char

Giacomo Fiorin requested to merge gf-add-byte-serializers into main

While integrating and testing the Colvars-GROMACS MDModules interface by @HubLot (draft MR: !3671 (merged)) an issue arose with embedding the contents of the formatted Colvars state file as a string in the GROMACS checkpoint file. Specifically, the string gets truncated at 4096 bytes.

To support this, two specializations of SerializationTraits<> were added for char and unsigned char respectively. This is done to allow the serialization of long strings such as the Colvars formatted state file. Other arrangements may be more optimal for looping over the array contents: this choice was taken to minimize changes.

For review purposes, please note that serializing a long string of formatted data is not the long term use case intended here by this MR. Formatted data is only used as an intermediate step to test the upcoming unformatted/binary checkpointing feature in Colvars.

Edited by Giacomo Fiorin

Merge request reports