[petsc-users] Destroy ghosted vector that was used to duplicate

John Mousel john.mousel at gmail.com
Wed Jun 19 22:17:40 CDT 2013


That's what I suspected. Thanks for the help. I have my current issue fixed.

John


On Wed, Jun 19, 2013 at 10:13 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:

>
> On Jun 19, 2013, at 8:05 PM, John Mousel <john.mousel at gmail.com> wrote:
>
> > I just figured out that I had a well hidden duplication of a duplication
> of the vector I was trying to resize. Hence the run-up in persistent
> communications. This kind of dependency is somewhat difficult to track
> down. Is there any way to check the vectors dependent on a particular
> scatter?
>
>    Unfortunately not. It would not be terribly difficult to graphically
> display all the objects and their dependencies but we don't have that
> currently.
>
>    Barry
>
> >
> >
> > On Wed, Jun 19, 2013 at 5:59 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:
> >
> >   John,
> >
> >    When a VecCreateGhost() is duplicated the new vector shares the
> VecScatter with the original vector. In your example below vec2 and vec3
> share the VecScatter. Hence the VecScatter has a reference count of 3. When
> you call VecDestroy(vec1) the reference count for that scatter falls to 2.
> Once vec2 and vec3 are destroyed the reference count for the VecScatter
> falls to zero and it is destroyed. Hence no memory (or MPI persistent
> communication resources) should be lost.
> >
> >     Note that even if you do not plan to use the "local vector" part of
> vec2 and vec3 that VecScatter will still be around until you destroy vec2
> and vec3 and any other Vecs obtained by VecDuplicating any of these. If you
> want to eliminate the VecScatter then don't use a VecDuplicate() on the
> ghosted vector instead create a non-ghosted vector.
> >
> >
> >    This is the way it is suppose to be anyways. Are you observing
> something different that could be reproduced in a somewhat reasonably small
> example?
> >
> >    Barry
> >
> > On Jun 19, 2013, at 2:45 PM, John Mousel <john.mousel at gmail.com> wrote:
> >
> > > Looking at the message queue graph in Totalview, it seems that I'm
> running up the number of persistent communications when I try to resize a
> vector by duplicating, copying, destroying, and calling VecCreateGhost.
> > >
> > >
> > > On Wed, Jun 19, 2013 at 2:42 PM, Matthew Knepley <knepley at gmail.com>
> wrote:
> > > On Wed, Jun 19, 2013 at 6:24 PM, John Mousel <john.mousel at gmail.com>
> wrote:
> > > Is it legal to destroy a ghosted vector if it has been used in
> VecDuplicate?
> > >
> > > This is fine.
> > >
> > >    MAtt
> > >
> > > Something like:
> > >
> > > VecCreateGhost(...,vec1)
> > > VecDuplicate(vec1,vec2)
> > > VecDuplicate(vec1,vec3)
> > > VecDestroy(vec1)
> > > VecAXPY(vec2,1.0,vec3)
> > >
> > > Is this legal or are the scatters left hanging in the ether?
> > >
> > >
> > > John
> > >
> > >
> > >
> > > --
> > > 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/20130619/9960651a/attachment-0001.html>


More information about the petsc-users mailing list