diff options
-rw-r--r-- | Carpet/CarpetIOHDF5/param.ccl | 6 | ||||
-rw-r--r-- | Carpet/CarpetIOHDF5/src/Input.cc | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/Carpet/CarpetIOHDF5/param.ccl b/Carpet/CarpetIOHDF5/param.ccl index b8dc67158..a133a754f 100644 --- a/Carpet/CarpetIOHDF5/param.ccl +++ b/Carpet/CarpetIOHDF5/param.ccl @@ -99,6 +99,12 @@ BOOLEAN one_file_per_group "Write one file per group instead of per variable" ST { } "no" +BOOLEAN open_one_input_file_at_a_time "Open only one HDF5 file at a time when reading data from multiple chunked checkpoint/data files" STEERABLE = ALWAYS +{ + "no" :: "Open all input files first, then import data (most efficient)" + "yes" :: "Process input files one after another (reduces memory requirements)" +} "no" + INT compression_level "Compression level to use for writing HDF5 data" STEERABLE = ALWAYS { 0:9 :: "Higher numbers compress better, a value of zero disables compression" diff --git a/Carpet/CarpetIOHDF5/src/Input.cc b/Carpet/CarpetIOHDF5/src/Input.cc index 7e046b914..8d3ebda71 100644 --- a/Carpet/CarpetIOHDF5/src/Input.cc +++ b/Carpet/CarpetIOHDF5/src/Input.cc @@ -486,6 +486,12 @@ int Recover (cGH* cctkGH, const char *basefilename, int called_from) if (all_done) { break; } + + // keep the file open if not requested otherwise by the user + if (open_one_input_file_at_a_time) { + HDF5_ERROR (H5Fclose (file.file)); + file.file = -1; + } } // check that all variables have been read completely on this mglevel/reflevel |