Re: [petsc-dev] DMDA_*PERIODIC and DMDA_XYZGHOSTED
patch now added to petsc-dev satish On Thu, 10 Mar 2011, Ethan Coon wrote:
Hmm, I didn't add the dd->idx, so I'm suprised it wasn't free'd already. I also wasn't sure when/if to log the memory, since it seemed to be in there for some stuff and not for others in the previous code.
You should just log it in the DM object, just uncomment the line in the 2D and 3D setup code
Ok, done.
With the copy (your next email) to the IS, shouldn't that changeset leak memory? I think it also needs a PetscFree(idx) then as well...
My two patches are cumulative... Take into account that DMDestroy_DA applies to 1/2/3D, while the setup code is different. The free(idx) at the common destoy() should be enough (provided you use COPY_VALUES for the 1D code)
Ah, I see my confusion... previously the memory had been shared with the da->l2gmap, and so it was destroyed by that. I missed the fact that your second change was in da1. This passes valgrind's memcheck. Thanks for clearing that up, Lisandro.
This patch does the change from DMDAPeriodicType -> DMDABoundaryType and deals with Lisandro's memory fixes.
The one thing I didn't change is the name of the DMDASetPeriodicity() method, which I wasn't sure what to go to.
Ethan
Will get these fixes in,
With both patches applied, petsc4py testsuite pass cleanly (and mem leaks seems to go away). So I'm more or less confident on your (huge) changes + my (tiny) fixes
participants (1)
-
Satish Balay