<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><br class=""></div> I don't understand the logic of VecRestoreSubVector() at all. I don't see how it could work.<div class=""><br class=""></div><div class=""><div class=""> } else {</div><div class=""> PETSC_UNUSED PetscObjectState dummystate = 0;</div><div class=""> PetscBool valid;</div><div class=""> ierr = PetscObjectComposedDataGetInt((PetscObject)*Y,VecGetSubVectorSavedStateId,dummystate,valid);CHKERRQ(ierr);</div><div class=""> if (!valid) {</div><div class=""> VecScatter scatter;</div><div class=""><br class=""></div><div class=""> ierr = PetscObjectQuery((PetscObject)*Y,"VecGetSubVector_Scatter",(PetscObject*)&scatter);CHKERRQ(ierr);</div><div class=""> if (scatter) {</div><div class=""> ierr = VecScatterBegin(scatter,*Y,X,INSERT_VALUES,SCATTER_REVERSE);CHKERRQ(ierr);</div><div class=""> ierr = VecScatterEnd(scatter,*Y,X,INSERT_VALUES,SCATTER_REVERSE);CHKERRQ(ierr);</div><div class=""> }</div><div class=""> }</div><div class=""><br class=""></div><div class=""> Seems completely wrong to me. It never compares the saved state of the Y vector with the current vector. Matt is right stepping through with the debugger could should why it is not doing the scatter.</div><div class=""><br class=""></div><div class=""> Barry</div><div class=""><br class=""></div><div><br class=""><blockquote type="cite" class=""><div class="">On Jul 27, 2020, at 7:06 PM, Matthew Knepley <<a href="mailto:knepley@gmail.com" class="">knepley@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div dir="ltr" class="">On Mon, Jul 27, 2020 at 6:09 PM Sajid Ali <<a href="mailto:sajidsyed2021@u.northwestern.edu" class="">sajidsyed2021@u.northwestern.edu</a>> wrote:<br class=""></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr" class=""><div class=""><div class="">Hi PETSc-developers, <br class=""><br class=""></div>When I load data (using VecLoad) into a subvector, the parent vector does not seem to get the data after the subvector is restored. I tried doing a VecSet to verify that the index set (used to select the subvector) is valid and the values set by VecSet are transferred back to the parent vector. Could anyone point out if I'm missing something when I try transferring the data via a VecLoad from a subvector to the parent vector ?<br class=""><br class=""></div>I'm attaching the code for selecting the subvector and loading data along with a test hdf5 file (filled with random values). I expect the output `testload.h5` to be a vector of size 100 with the first 50 being 1 and the rest being the input values. </div></blockquote><div class=""><br class=""></div><div class="">You should be able to see with the debugger why the update does not happen. My guess is that the state is not updated. It should be updated</div><div class="">by VecReplaceArray(), so I do not understand, but you should be able to see it clearly in gdb.</div><div class=""><br class=""></div><div class=""> Thanks,</div><div class=""><br class=""></div><div class=""> Matt</div><div class=""> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr" class=""><div class=""><div class=""><div class=""><div class="">Thank You,<br class=""></div><div class=""><div dir="ltr" class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div style="font-size:12.8px" class="">Sajid Ali | PhD Candidate<br class=""></div><div style="font-size:12.8px" class="">Applied Physics<br class=""></div><div style="font-size:12.8px" class="">Northwestern University</div><div style="font-size:12.8px" class=""><a href="http://s-sajid-ali.github.io/" target="_blank" class="">s-sajid-ali.github.io</a></div></div></div></div></div></div></div></div></div></div></div></div>
</blockquote></div><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div dir="ltr" class="gmail_signature"><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class="">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br class="">-- Norbert Wiener</div><div class=""><br class=""></div><div class=""><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank" class="">https://www.cse.buffalo.edu/~knepley/</a><br class=""></div></div></div></div></div></div></div></div>
</div></blockquote></div><br class=""></div></body></html>