when using the file reader, mark variables not requested fro reading as fully read

Create issue
Issue #1102 closed
Roland Haas created an issue

right now this causes many level 2 warnings about looking in another file for this variable. The run eventually succeeds since CarpetIOHDF5 silently continues if it is unable to read anything at all for a given variable (ie. it only aborts if a variable is read only partially but not if it is not read a all since it is missing from the fileset).

The attached patch marks these variables as being fully read the same way the ignored variables are handled and adds some further checks if the reader is called from the FilerReader rather than from recovery.

The do_inVars logic (explained in the source) is to possibly read a variable if either do_inVars == NULL (corresponds to "all" variables) or do_inVars[vindex] != 0 (which can be positive or negative). As it is right now I think the later checks that end in "continue" are now superfluous.


Comments (6)

  1. Erik Schnetter
    • removed comment

    The patch marks all past timelevels as "read completely". I believe there is a per-variable option to read past timelevel, and e.g. the event horizon finder may depend on this. Can you check this?

    Yes, the two check that end in "continue" should be superfluous; I would avoid them to simplify the logic.

    I don't understand the last hunk (line 802 in the original). If called_from != FILEREADER_DATA, then do_inVars is now always ignored? Why?

  2. Roland Haas reporter
    • removed comment

    Apparently I never actually posted my explanation to comment:2. Oh well. This is what I wanted to say:

    I'll gladly remove the continue check since it just clutters the code.

    As for the last hunk. This is an odd piece of code. My understanding was that the idea is to synchronize all variables that were read. When recovering from a checkpoint, then all variables are attempted to read so all might need synchronization (this is the != FILEREADER_DATA case). If on the other hand the file reader was used, then a variable is either to be read if either all variables are to be read (in which case ioUtilGH->do_inVars is NULL) or if do_inVars[vindex] is not zero (it can be positive or negative but for the file-reader should really be negative or one). This last logic is explained in line 623 of the code. So it seems as if the piece of code in line 802 is required to avoid sync'ing grid functions that were excluded from being read (and whose read_completely entry was set to true at the beginning of the read process). A more readable test might be:

    if (not (called_from == FILEREADER_DATA and
             (ioUtilGH->do_inVars and not ioUtilGH->do_inVars[vindex])) )
      if (read_completely(...
  3. Erik Schnetter
    • changed status to open
    • removed comment

    Could you leave out the "continue" statements, and augment the if condition with a comment similar to the text you wrote above?


  4. Log in to comment