[petsc-dev] Remove calls to XXXReset() in XXXDestroy()
Barry Smith
bsmith at mcs.anl.gov
Thu May 12 15:55:01 CDT 2011
On May 12, 2011, at 3:47 PM, Lisandro Dalcin wrote:
> I would like to remove the calls to XXXReset() in XXXDestroy(),
> probably refactoring the code to reuse a XXXReset_Private(). My
> intention is to have the two things separated, object destruction is a
> bit delicate and requires some care in handling Python subtypes. I
> really prefer subtype implementors not to rely on ops->reset() being
> called before ops->destroy(). Any oposition?
Yes. You don't provide an explanation about why you want to do this, besides "object destruction is delicate". Please formulate a complete explanation why this change would be needed and what the alternatives are. Just because it makes your life a little easier without context why the change is needed isn't a reason to change it.
> In some previous cleanup
> commits I took care of preparing the code to make this change, so I
> expect this one to be easy.
>
> BTW, I think we should review the way we handle referrence counting
> regarding DM's and the global&local vector cache. I had to spend some
> time to figure out that dm->ops->get[global/local]vector() should
> forcibly compose the DM in the vector, if not, bad things occur at
> DMDestroy().
Did you need to change something recently with this? It was working fine so I'd like to know what was changed and why.
> Cyclic references do not play well in our refcounted
> model, and we cannot implement a garbage collector that works in
> parallel :-(
yes, we all understand this.
>
> --
> Lisandro Dalcin
> ---------------
> CIMEC (INTEC/CONICET-UNL)
> Predio CONICET-Santa Fe
> Colectora RN 168 Km 472, Paraje El Pozo
> 3000 Santa Fe, Argentina
> Tel: +54-342-4511594 (ext 1011)
> Tel/Fax: +54-342-4511169
More information about the petsc-dev
mailing list