Passing through meta data from initial conditions
Adrian suggested it would be useful to be able to pass meta data from the initial conditions through to the snapshot files without requiring everyone to agree on what that meta data should look like. Here's an idea of how we could do that in Swift.
If we can a least assume that the meta data is in one or more HDF5 groups and separate from the particle arrays then we could:
- Specify a list of meta data group names in the input parameter file
- On reading the ICs we create a HDF5 file in memory with the core driver and H5Ocopy() any of the named groups which exist in the ICs to the new file
- Use H5Fget_file_image() to turn the in-memory file into a byte array which we can store in swift and in the restart files
- On writing a snapshot, we open the byte array as a HDF5 file (using H5Pset_file_image()) and H5Ocopy() the contents to the snapshot
That should let us carry along arbitrary HDF5 groups without knowing anything about the contents.