[petsc-dev] developer hint
Barry Smith
bsmith at mcs.anl.gov
Sun Nov 13 16:44:49 CST 2011
On Nov 13, 2011, at 4:42 PM, Jed Brown wrote:
> On Sun, Nov 13, 2011 at 16:29, Barry Smith <bsmith at mcs.anl.gov> wrote:
> I have PETSC_OPTIONS set in my .bashrc file to -malloc -malloc_debug -malloc_dump by default.
>
> This means when I introduce memory leaks I find them immediately. Like someone just introduced in src/dm/examples/test/ex30.c but did not detect because they did not have these options set.
>
> This is my fault. In DMDestroy(), there is somewhat strange logic to count the number of circular references in the "gotten" vectors.
>
> DMSliced clones new Vecs off of it's own private Vec, which has yet another circular reference. Should we just artificially decrement the reference count on the DM, and then re-reference it in DMDestroy_Sliced before destroying slice->globalvector? I wonder if there is a more elegant way to handle these circular references.
Why do it anyway different than DMDA? Better consistent and not a great way then 10 different inconsistent and slightly different and better and worse ways.
More information about the petsc-dev
mailing list