[petsc-users] Modeling a Network with DMPlex?

Matthew Knepley knepley at gmail.com
Mon Feb 17 10:06:02 CST 2014


On Mon, Feb 17, 2014 at 9:31 AM, Florian Meier <florian.meier at koalo.de>wrote:

> Thanks!
>
> On 02/17/2014 03:39 PM, Matthew Knepley wrote:
> > On Mon, Feb 17, 2014 at 8:05 AM, Florian Meier <florian.meier at koalo.de
> > <mailto:florian.meier at koalo.de>> wrote:
> >
> >     Thank you very much for your review.
> >
> >     On 02/17/2014 02:50 AM, Abhyankar, Shrirang G. wrote:
> >     > Hi Florian,
> >     >   I was able to run your example with a small change (used
> PetscMalloc
> >     > instead of PetscMalloc1).
> >
> >     That is strange. When I use PetscMalloc, it says "Memory
> corruption!".
> >
> >
> > Run under valgrind. There is a bug in the code.
>
> I didn't notice that the input parameters to PetscMalloc are
> different... Now it is ok.
>
> >     > However, the solution on more than 1 processor
> >     > is different presumably because of some work "TODO" for the ghost
> >     vertices.
> >
> >     I do not really understand these ghost vertices. I thought it would
> be
> >     ok to just skip those when I iterate over the vertices, but not when
> I
> >     iterate over the edges, but apparently that is not the case.
> >
> >
> > Here is how the parallelism works. We partition the edges into disjoint
> > sets, one for
> > each process. Vertices shared by edges on different processes are
> > duplicated, with
> > the "ghost" vertex sitting on all processes that do not own the vertex.
>
> So the x values for the ghost vertices are always synchronized
> automatically?
>

The synchronization happens during DMGlobalToLocal() which takes the
(unique)
global values and copies them to the (duplicated) local values.
DMGlobalToLocal()
is called automatically when use register your residual routine as is done
in the
examples. I am guessing you have done this in your example.

   Matt

-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140217/f87834d2/attachment.html>


More information about the petsc-users mailing list