Lukasz Kaczmarczyk <[email protected]> writes: > Hello, > > Just to confirm. More destructions than creations after use MatAXPY it > is known bug in petsc? Could you confirm that you have the same > problem, or it is something unique to my implementation.
Thanks for the report. I have fixed the problem in 'next' and will merge it into 'maint' in a day or two. commit 03c4025afd7bfddd354430f069f83de621f6646b (jed/fix-mat-header-replace-log) Author: Jed Brown <[email protected]> Date: Sat Nov 9 00:03:28 2013 -0700 MatHeaderReplace: fix duplicate call to PetscLogObjectDestroy PetscLogObjectDestroy includes tallying of creations and destructions, but MatHeaderReplace already calls PetscHeaderDestroy_Private, which calls PetscLogObjectDestroy itself. This led to tallies with more destructions than creations for operations when calling functions that use MatHeaderReplace (like MatAXPY and MatAYPX). Reported-by: Lukasz Kaczmarczyk <[email protected]> diff --git a/src/mat/utils/gcreate.c b/src/mat/utils/gcreate.c index b00fcaa..cbe1f72 100644 --- a/src/mat/utils/gcreate.c +++ b/src/mat/utils/gcreate.c @@ -363,7 +363,6 @@ PETSC_EXTERN PetscErrorCode MatHeaderReplace(Mat A,Mat C) ((PetscObject)A)->refct = refct; - ierr = PetscLogObjectDestroy((PetscObject)C);CHKERRQ(ierr); ierr = PetscFree(C);CHKERRQ(ierr); PetscFunctionReturn(0); }
pgplIAPIyW7bY.pgp
Description: PGP signature
