diff options
author | Roland Haas <roland.haas@physics.gatech.edu> | 2012-09-14 09:53:38 -0700 |
---|---|---|
committer | Roland Haas <roland.haas@physics.gatech.edu> | 2012-10-29 08:53:43 -0700 |
commit | 9804d208450ac83b499793430e73f88632f6bb15 (patch) | |
tree | d8147cd2c6933ea663de93f7aeca702a6434344f /Carpet/CarpetIOHDF5 | |
parent | f0434388c93f9bdd9030c7bdc7323d4f7a9c4d43 (diff) |
CarpetIOHDF5: fix check for missing datasets when called in FileReader mode
only check datasets whose variables were actually requested to be read
Diffstat (limited to 'Carpet/CarpetIOHDF5')
-rw-r--r-- | Carpet/CarpetIOHDF5/src/Input.cc | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/Carpet/CarpetIOHDF5/src/Input.cc b/Carpet/CarpetIOHDF5/src/Input.cc index efd5f3199..637bb7032 100644 --- a/Carpet/CarpetIOHDF5/src/Input.cc +++ b/Carpet/CarpetIOHDF5/src/Input.cc @@ -522,7 +522,18 @@ int Recover (cGH* cctkGH, const char *basefilename, int called_from) } } + // in filereader mode, mark all variables that are not requested as being + // read completely, mark all timelevels > 0 as being read completely const ioGH* ioUtilGH = (const ioGH*) CCTK_GHExtension (cctkGH, "IO"); + if (not in_recovery and ioUtilGH->do_inVars) { + for (unsigned int vindex = 0; vindex < read_completely.size(); vindex++) { + const int timestep = ioUtilGH->do_inVars[vindex]; + for (unsigned int tl = 0 ; tl < read_completely[vindex].size() ; ++tl) { + read_completely[vindex][tl] = tl > 0 or not timestep; + } + } + } + CarpetIOHDF5GH* myGH = (CarpetIOHDF5GH*) CCTK_GHExtension (cctkGH, CCTK_THORNSTRING); // allocate list of recovery filenames @@ -724,15 +735,6 @@ int Recover (cGH* cctkGH, const char *basefilename, int called_from) } for (unsigned int tl = 0; tl < read_completely[vindex].size(); tl++) { - if (called_from == FILEREADER_DATA and not - (ioUtilGH->do_inVars and ioUtilGH->do_inVars[vindex])) { - continue; - } - if (called_from == FILEREADER_DATA and tl > 0) { - // file reader reads only timelevel 0 - continue; - } - if (not read_completely[vindex][tl]) { // check if the variable has been read partially size_t size = 0; @@ -798,8 +800,10 @@ int Recover (cGH* cctkGH, const char *basefilename, int called_from) for (size_t vindex = 0; vindex < read_completely.size(); vindex++) { if (CCTK_GroupTypeFromVarI (vindex) == CCTK_GF or reflevel == 0) { for (size_t tl = 0; tl < read_completely[vindex].size(); tl++) { - if (called_from != FILEREADER_DATA or - (ioUtilGH->do_inVars and ioUtilGH->do_inVars[vindex])) + // Do not synchronize variables that the user request not to be + // read (only possible in FILEREADER mode) + if (not (called_from == FILEREADER_DATA and + (ioUtilGH->do_inVars and not ioUtilGH->do_inVars[vindex]))) { if (read_completely[vindex][tl]) { int const gindex = CCTK_GroupIndexFromVarI (vindex); |