<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Feb 17, 2014 at 9:31 AM, Florian Meier <span dir="ltr"><<a href="mailto:florian.meier@koalo.de" target="_blank">florian.meier@koalo.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks!<br>
<br>
On 02/17/2014 03:39 PM, Matthew Knepley wrote:<br>
> On Mon, Feb 17, 2014 at 8:05 AM, Florian Meier <<a href="mailto:florian.meier@koalo.de">florian.meier@koalo.de</a><br>
> <mailto:<a href="mailto:florian.meier@koalo.de">florian.meier@koalo.de</a>>> wrote:<br>
><br>
>     Thank you very much for your review.<br>
><br>
>     On 02/17/2014 02:50 AM, Abhyankar, Shrirang G. wrote:<br>
>     > Hi Florian,<br>
>     >   I was able to run your example with a small change (used PetscMalloc<br>
>     > instead of PetscMalloc1).<br>
><br>
>     That is strange. When I use PetscMalloc, it says "Memory corruption!".<br>
><br>
><br>
> Run under valgrind. There is a bug in the code.<br>
<br>
I didn't notice that the input parameters to PetscMalloc are<br>
different... Now it is ok.<br>
<br>
>     > However, the solution on more than 1 processor<br>
>     > is different presumably because of some work "TODO" for the ghost<br>
>     vertices.<br>
><br>
>     I do not really understand these ghost vertices. I thought it would be<br>
>     ok to just skip those when I iterate over the vertices, but not when I<br>
>     iterate over the edges, but apparently that is not the case.<br>
><br>
><br>
> Here is how the parallelism works. We partition the edges into disjoint<br>
> sets, one for<br>
> each process. Vertices shared by edges on different processes are<br>
> duplicated, with<br>
> the "ghost" vertex sitting on all processes that do not own the vertex.<br>
<br>
So the x values for the ghost vertices are always synchronized<br>
automatically?<br>
</blockquote></div><br>The synchronization happens during DMGlobalToLocal() which takes the (unique)</div><div class="gmail_extra">global values and copies them to the (duplicated) local values. DMGlobalToLocal()</div><div class="gmail_extra">
is called automatically when use register your residual routine as is done in the</div><div class="gmail_extra">examples. I am guessing you have done this in your example.</div><div class="gmail_extra"><br></div><div class="gmail_extra">
   Matt<br clear="all"><div><br></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
</div></div>