The usual workaround is to give the vectors different prefixes.<br><br><div class="gmail_quote">On Wed, Jul 18, 2012 at 9:10 AM, Hong Zhang <span dir="ltr"><<a href="mailto:hzhang@mcs.anl.gov" target="_blank">hzhang@mcs.anl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You use same datafile 'vec.dat' for writing two different vectors,<div>V3 and V1:</div><div><br></div><div><div>
<span style="white-space:pre-wrap"> </span>ierr = VecView(V1, view_out); </div>
<div><span style="white-space:pre-wrap"> </span>ierr = VecView(V3, view_out); </div><div><br></div><div>// here, vec.dat holds V3</div><div><br></div><div>Then read it in the order</div>
<div><div><span style="white-space:pre-wrap"> </span>ierr = VecLoad(V1, view_in);<span style="white-space:pre-wrap"> </span></div><div>//crash here because reading V3 into V1</div><div>
<br></div><div><span style="white-space:pre-wrap"> </span>ierr = VecLoad(V3, view_in);<span style="white-space:pre-wrap"> </span></div></div><div><br></div><div>Comment out one of vectors, your code works fine.</div><span class="HOEnZb"><font color="#888888">
<div><br></div><div>Hong</div></font></span><div><div class="h5"><div><br></div><div><br></div><div><br></div><br><div class="gmail_quote">On Wed, Jul 18, 2012 at 7:54 AM, Anton Popov <span dir="ltr"><<a href="mailto:popov@uni-mainz.de" target="_blank">popov@uni-mainz.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
Dear petsc team,<br>
<br>
could you please tell me what's wrong with the attached example
file?<br>
I run it on 4 processors with petsc-3.3-p1.<br>
<br>
What could error message "Local size 1000 not compatible with block
size 3!" mean?<br>
<br>
I've another question related to this issue. What is the real
purpose of PetscViewerBinarySkipInfo function?<br>
I see no reason to skip creating "info" file, because the file
produced by the attached example seems to be correct.<br>
<br>
Moreover, similar block size error occurs in our code while reading
file with multiple vectors, irrespective whether "info" file exists
or not.<br>
<br>
Thank you,<br>
<br>
Anton<br>
<br>
</div>
</blockquote></div><br></div></div></div>
</blockquote></div><br>