#909: abort IOUtil_TruncateOutputFiles if called too early -----------------------------------+---------------------------------------- Reporter: rhaas | Owner: Type: defect | Status: new Priority: minor | Milestone: Component: EinsteinToolkit thorn | Version: Keywords: IOUtil | -----------------------------------+---------------------------------------- currently when called before the grid extension for IOUtil has been registered (which is when IOUtils learns if the is a checkpoint recovery run or not), the routine returns -1. However the documentation in the thorn guide states that {{{ Thorn IOUtil provides an aliased function for other I/O thorns to call: CCTK_INT FUNCTION IO_TruncateOutputFiles (CCTK_POINTER_TO_CONST IN cctkGH) This function simply returns 1 or 0 if output files should or should not be truncated. }}} Since there are thorns out there that take this to heart and test for IO_TruncateOutputFiles() being true (ie non-zero) these thorns always overwrite data during a recovery when calling IOUtils too early. This happened to Carpet in ticket #908.
The attached patch makes IOUtil abort instead which seems better than silently returning the wrong (since undocumented) answer. No actual user thorn should be affected.
#909: abort IOUtil_TruncateOutputFiles if called too early ------------------------------------+--------------------------------------- Reporter: rhaas | Owner: Type: defect | Status: review Priority: minor | Milestone: Component: EinsteinToolkit thorn | Version: Resolution: | Keywords: IOUtil ------------------------------------+--------------------------------------- Changes (by rhaas):
* status: new => review
#909: abort IOUtil_TruncateOutputFiles if called too early ------------------------------------+--------------------------------------- Reporter: rhaas | Owner: Type: defect | Status: reviewed_ok Priority: minor | Milestone: Component: EinsteinToolkit thorn | Version: Resolution: | Keywords: IOUtil ------------------------------------+--------------------------------------- Changes (by eschnett):
* status: review => reviewed_ok
Comment:
Okay to apply.
Could you improve the error message? People won't know what "the grid extension" is.
#909: abort IOUtil_TruncateOutputFiles if called too early ------------------------------------+--------------------------------------- Reporter: rhaas | Owner: Type: defect | Status: closed Priority: minor | Milestone: Component: EinsteinToolkit thorn | Version: Resolution: fixed | Keywords: IOUtil ------------------------------------+--------------------------------------- Changes (by rhaas):
* status: reviewed_ok => closed * resolution: => fixed
Comment:
Applied with a more verbose error message as rev 289 of IOUtil.
trac@lists.einsteintoolkit.org