<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body>
<p>hi Jed,</p>
<p>It looked to me like a call to h5f_flush() is all that is
required.</p>
<p>Some people said there would be a performance hit (maybe ~ 10%
slower), which would be the trade-off for increased reliability.
So if this were made available via PetscViewerFlush(), I'd
probably make it optional in my code so the user could decide for
themselves if it was worth it for them.</p>
<p>Do you think flushing would be a better option than
closing/opening the file between writes?</p>
<p>Regards, Adrian<br>
</p>
<div class="moz-cite-prefix">On 10/8/21 9:36 AM, Jed Brown wrote:<br>
</div>
<blockquote type="cite" cite="mid:8735pcd12k.fsf@jedbrown.org">
Adrian Croucher <a class="moz-txt-link-rfc2396E" href="mailto:a.croucher@auckland.ac.nz"><a.croucher@auckland.ac.nz></a> writes:<br>
<br>
> hi,<br>
><br>
> One of the users of my PETSc-based code has reported that
HDF5 output <br>
> files can be corrupted and unusable if e.g. the run is
killed. I've just <br>
> done a bit of reading about this and it appears to be a known
issue with <br>
> HDF5.<br>
><br>
> Some people suggest flushing the HDF5 file periodically to
help prevent <br>
> data loss. I had a look at PetscViewerFlush() but it doesn't
seem to be <br>
> implemented for the HDF5 viewer- is that correct?<br>
<br>
Correct, but I think we can and should implement it. In your
research just now, were there subtleties beyond this call?<br>
<br>
<a href="https://portal.hdfgroup.org/display/HDF5/H5F_FLUSH" moz-do-not-send="true">https://portal.hdfgroup.org/display/HDF5/H5F_FLUSH</a><br>
</blockquote>
<pre class="moz-signature" cols="72">--
Dr Adrian Croucher
Senior Research Fellow
Department of Engineering Science
University of Auckland, New Zealand
email: <a class="moz-txt-link-abbreviated" href="mailto:a.croucher@auckland.ac.nz">a.croucher@auckland.ac.nz</a>
tel: +64 (0)9 923 4611</pre>
</body>
</html>