<div dir="ltr"><div class="markdown-here-wrapper" style=""><p style="margin:0px 0px 1.2em!important">Hi Barry/Matt, </p>
<p style="margin:0px 0px 1.2em!important">I now have a simpler test (attached with this email) for this bug which does the following : </p>
<ul style="margin:1.2em 0px;padding-left:2em">
<li style="margin:0.5em 0px">Create a vector of size 50, set it to 2 and save to disk. </li>
<li style="margin:0.5em 0px">Create a vector of size 100, set it to 1 and extract the last 50 elements as a subvector.</li>
<li style="margin:0.5em 0px">Load the saved vector from disk into the subvector and restore the subvector. </li>
<li style="margin:0.5em 0px">Test for VecSum, it should be 150. </li>
</ul>
<p style="margin:0px 0px 1.2em!important">With one mpi rank (implying no scatters were used in the creation of the subvector), the above works as expected when using binary IO but if one uses HDF5 for IO, <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">VecSum</code> outputs 100 showing that the subvector didn’t restore correctly. Running the executable in gdb I see that for both cases the <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">VecRestoreSubVector</code> reads the variable <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">VecGetSubVectorSavedStateId</code> as 4 with the boolean variable valid being false. </p>
<p style="margin:0px 0px 1.2em!important">My guess regarding the origin of the error with HDF5-IO is the fact that <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">VecLoad_HDF5</code> uses a <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">VecReplaceArray</code> to load the data and this somehow messes up the assumptions regarding SubVector data pointers upon creation by using <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">VecPlaceArray</code>. </p>
<p style="margin:0px 0px 1.2em!important">As Barry mentioned the check for validity of subvector data is faulty and would need to be fixed and that should be able to transfer the subvector data back to the parent vector regardless of how the subvector is modified. </p>
<p style="margin:0px 0px 1.2em!important">Thank You,<br>Sajid Ali | PhD Candidate<br>Applied Physics<br>Northwestern University<br><a href="http://s-sajid-ali.github.io">s-sajid-ali.github.io</a></p>
<div title="MDH:PGRpdj48ZGl2PkhpIEJhcnJ5L01hdHQsIDxicj48YnI+PC9kaXY+SSBub3cgaGF2ZSBhIHNpbXBs
ZXIgdGVzdCAoYXR0YWNoZWQgd2l0aCB0aGlzIGVtYWlsKSBmb3IgdGhpcyBidWcgd2hpY2ggZG9l
cyB0aGUgZm9sbG93aW5nIDogPGJyPi0gQ3JlYXRlIGEgdmVjdG9yIG9mIHNpemUgNTAsIHNldCBp
dCB0byAyIGFuZCBzYXZlIHRvIGRpc2suIDxicj48L2Rpdj48ZGl2Pi0gQ3JlYXRlIGEgdmVjdG9y
IG9mIHNpemUgMTAwLCBzZXQgaXQgdG8gMSBhbmQgZXh0cmFjdCB0aGUgbGFzdCA1MCBlbGVtZW50
cyBhcyBhIHN1YnZlY3Rvci48YnI+PC9kaXY+PGRpdj4tIExvYWQgdGhlIHNhdmVkIHZlY3RvciBm
cm9tIGRpc2sgaW50byB0aGUgc3VidmVjdG9yIGFuZCByZXN0b3JlIHRoZSBzdWJ2ZWN0b3IuIDxi
cj48L2Rpdj48ZGl2Pi0gVGVzdCBmb3IgVmVjU3VtLCB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