[petsc-dev] Remove calls to XXXReset() in XXXDestroy()

Lisandro Dalcin dalcinl at gmail.com
Thu May 12 15:47:05 CDT 2011


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? 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(). Cyclic references do not play well in our refcounted
model, and we cannot implement a garbage collector that works in
parallel :-(

-- 
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