[petsc-dev] What's the point of D(A/M)GetGlobalVector?

Dmitry Karpeev karpeev at mcs.anl.gov
Fri Aug 27 09:45:36 CDT 2010


I think DAGetXXX etc should really be thought of as constructors,
that under the hood manage a pool to amortize the construction time.
Perhaps more precisely, DA acts as a factory.
It would be natural to rename them DACreateXXX, except that
then XXXDestroy is the wrong thing to do (unless the destructor
is overloaded in the corresponding object).

Dmitry.


On Fri, Aug 27, 2010 at 8:24 AM, Jed Brown <jed at 59a2.org> wrote:
> On Fri, 27 Aug 2010 16:13:14 +0300, Aron Ahmadia <aron.ahmadia at kaust.edu.sa> wrote:
>> Not to mention the various Get routines that are actually used to create
>> things, such as DAGetMatrix.
>
> I think that should have been named DACreateMatrix().  Other XGetY() are
> just accessors which create a managed object if needed.  When there is a
> Get/Restore pair, it implies that the access to that managed resource
> has some sort of exclusivity.  I think
> {Get,Restore}{Local,Global}Vector() are actually the only functions with
> that naming scheme that really manage a pool.
>
> Jed
>



More information about the petsc-dev mailing list