![]() ![]() ![]() ![]() Next: Example Parameter Files Up: IOUtil Previous: Checkpointing and Recovery in Contents Reading Data from Files into CactusThe very same routines which implement checkpointing/recovery functionality in the IOHDF5 and IOFlexIO thorns are also used to provide file reader capabilities within Cactus. They enable users to read variables, whose contents were written to files in HDF5 or IEEEIO data format, back into Cactus at a later time. This is especially useful if compute-intensive initial data is calculated only once and stored in a file. Such data can then be read back in at startup and immediately used by following evolution runs. The following IOUtil parameters exist to specify what variables should be read from file(s) as initial data:
Thorn IOUtil also provides a filereader API which can be called by any application thorn at any time. It gets passed the equivalent information to the filereader parameters, plus a pointer to the underlying CCTK grid hierarchy. The return code denotes the total number of variables recovered by the filereader. C API: #include "CactusBase/IOUtil/src/ioutil_CheckpointRecovery.h" int IOUtil_RecoverVarsFromDatafiles (cGH *GH, const char *in_files, const char *in_vars); Fortran API: call IOUtil_RecoverVarsFromDatafiles (result, GH, in_files, in_vars) integer result CCTK_POINTER GH character*(*) in_files character*(*) in_vars If data is to be imported from files which were not created by IOHDF5 or IOFlexIO it needs to be converted first into the appropriate HDF5 or IEEEIO file format and the file layout which either one of these thorns uses. This is described in detail in the thorns' documentation, along with a simple C source file which can be used as a template to build your own data converter program.
![]() ![]() ![]() ![]() Next: Example Parameter Files Up: IOUtil Previous: Checkpointing and Recovery in Contents |