ESIO provides several methods that greatly simplify writing a sequence of metadata-rich restart files.
Each restart file might contain a simulation snapshot at a particular time along with enough information to track how the data was generated and to allow data post-processing.
A complete, C-based MPI program using ESIO to write a (trivial) sequence of restart files might look like:
This sample prepares a copy of loop-invariant data in the file "template.h5". Often this would include the program version, scenario parameters, and grid information. Then, when the code needs to write a new restart file during the simulation loop, a new uncommitted restart file called "uncommitted.h5" is cloned from "template.h5" using esio_file_clone(). After the program has successfully written all the necessary data to the restart file, the restart file is committed using esio_file_close_restart().
The documentation for the esio_file_close_restart() method contains several important details. The same functionality is also available in Fortran via the methods esio::esio_file_clone() and esio::esio_file_close_restart().
Using such an approach provides several benefits:
ESIO also provides a standalone, non-HDF5 utility named esio_restart
which can be used to test ESIO's restart file management capabilities. See esio_rename –help
for more details.