On Thu, Apr 30, 2009 at 5:38 AM, Jed Brown <span dir="ltr"><<a href="mailto:jed@59a2.org">jed@59a2.org</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I'm bringing this up after a confusing debugging session.<br>
<br>
After VecGhostGetLocalForm/VecGhostRestoreLocalForm, the state is not<br>
increased.  This is not a problem as long as the user calls<br>
VecGhostUpdateBegin/End which will increase the state, but that is not<br>
always required.  However, the state *must* be increased after changing<br>
the local form.  In my case, the cached norm was being used erroneously<br>
after function evaluation.<br>
<br>
Since the local and global forms refer to the same memory, I think their<br>
states would ideally be synchronized.  Doing this robustly when the user<br>
is messing with the global form and local form at the same time is a<br>
problem because the local form does not have a reference to the global<br>
form, but I think we can at least eliminate one class of bugs by<br>
synchronizing the states using MAX in VecGhostGetLocalForm and<br>
VecGhostRestoreLocalForm.<br>
<br>
Do you see a better way, or should I just go ahead with this?</blockquote><div><br>We should just treat LocalForm as GetArray, and increase the state on<br>RestoreLocalForm. I will do it.<br><br>   Matt<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<font color="#888888"><br>
Jed<br></font></blockquote></div>-- <br>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<br>