[petsc-dev] Memory corruption on 'master' (barry/improve-memory-logging)

Jed Brown jedbrown at mcs.anl.gov
Tue Aug 20 15:02:52 CDT 2013


Jed Brown <jedbrown at mcs.anl.gov> writes:

>   [The reference there to an issue should be to #43, not #33.
>    https://bitbucket.org/petsc/petsc/issue/44/parent-object-keeps-linked-list-of]

#44, rather.

> Can we revert this parent traversal on 'master' for now?

I.e.,

diff --git i/src/sys/logging/plog.c w/src/sys/logging/plog.c
index 907b38d..f7f3fd1 100644
--- i/src/sys/logging/plog.c
+++ w/src/sys/logging/plog.c
@@ -15,13 +15,7 @@
 
 PetscErrorCode PetscLogObjectParent(PetscObject p,PetscObject c)
 {
-  PetscObject pp = p;
   if (!c || !p) return 0;
-  while (!c->parent && pp) {
-    /* if not credited elsewhere credit all childs memory to all new ancestors */
-    pp->memchildren += c->mem + c->memchildren;
-    pp               = pp->parent;
-  }
   c->parent   = p;
   c->parentid = p->id;
   return 0;
@@ -30,12 +24,6 @@ PetscErrorCode PetscLogObjectParent(PetscObject p,PetscObject c)
 PetscErrorCode PetscLogObjectMemory(PetscObject p,PetscLogDouble m)
 {
   p->mem += m;
-  p       =  p->parent;
-  while (p) {
-    /* Create all ancestors with the memory */
-    p->memchildren += m;
-    p               =  p->parent;
-  }
   return 0;
 }
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20130820/38cd7ba5/attachment.sig>


More information about the petsc-dev mailing list