<div dir="ltr">It sounds like you opened the file for writing.<div><br></div><div> Matt</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 18, 2019 at 9:08 PM Yuyun Yang via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div lang="EN-US">
<div class="gmail-m_2756243618327281762WordSection1">
<p class="MsoNormal">Hello,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I am writing a very simple function just to read in a single value from an input file (which also just contains one single scalar value). Using PetscBinaryRead(fd, &value, 1, PETSC_SCALAR) gives me the following error. Could you help me
figure out why?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------<u></u><u></u></p>
<p class="MsoNormal">[0]PETSC ERROR: Read from file failed<u></u><u></u></p>
<p class="MsoNormal">[0]PETSC ERROR: Read past end of file<u></u><u></u></p>
<p class="MsoNormal">[0]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" target="_blank">http://www.mcs.anl.gov/petsc/documentation/faq.html</a> for trouble shooting.<u></u><u></u></p>
<p class="MsoNormal">[0]PETSC ERROR: Petsc Release Version 3.10.3, unknown<u></u><u></u></p>
<p class="MsoNormal">[0]PETSC ERROR: ./output on a arch-linux2-c-debug named <a href="http://DESKTOP-02K82L1.stanford.edu" target="_blank">DESKTOP-02K82L1.stanford.edu</a> by yyy910805 Mon Feb 18 17:58:30 2019<u></u><u></u></p>
<p class="MsoNormal">[0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ --with-shared-libraries=1 --download-hdf5 --download-metis --download-parmetis --download-hypre --download-superlu --download-mumps --download-scalapack --download-mpich --download-mpich-configure-arguments="--enable-error-messages=all
--enable-g"<u></u><u></u></p>
<p class="MsoNormal">[0]PETSC ERROR: #1 PetscBinaryRead() line 276 in /home/yyy910805/petsc/src/sys/fileio/sysio.c<u></u><u></u></p>
<p class="MsoNormal">0.000000<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thanks a lot!<u></u><u></u></p>
<p class="MsoNormal">Yuyun<u></u><u></u></p>
</div>
</div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div>