[petsc-dev] GASM

Dmitry Karpeev karpeev at mcs.anl.gov
Fri Mar 30 09:31:01 CDT 2012


Mark,
It looks like you should destroy ASMLocalIDsArr[level] before zeroing it
out: GASM increfs it internally,
and when you set this IS to 0, you leak the reference you acquired when
creating it in PetscCDGetASMBlocks().

Dmitry.


On Fri, Mar 30, 2012 at 9:04 AM, Mark F. Adams <mark.adams at columbia.edu>wrote:

> Thanks, it seems to work but I have a memory leak.  I use:
>
>           ierr = PCGASMSetLocalSubdomains( subpc, sz, is, PETSC_NULL );
> CHKERRQ(ierr);
>           ierr = PetscFree( is ); CHKERRQ(ierr);
>
> and it looks like the ISs are not getting destroyed in GASM.
>
> Mark
>
> On Mar 29, 2012, at 9:35 PM, Dmitry Karpeev wrote:
>
> Now it should work the way you intended.
> Let me know if it doesn't, though.
>
> Dmitry.
>
> On Thu, Mar 29, 2012 at 7:49 PM, Mark F. Adams <mark.adams at columbia.edu>wrote:
>
>>
>> On Mar 29, 2012, at 11:38 AM, Dmitry Karpeev wrote:
>>
>>
>>
>> On Thu, Mar 29, 2012 at 10:13 AM, Jed Brown <jedbrown at mcs.anl.gov> wrote:
>>
>>> On Thu, Mar 29, 2012 at 08:28, Dmitry Karpeev <karpeev at mcs.anl.gov>wrote:
>>>
>>>> Back to the original problem: how shall we prevent a shared pc from
>>>> being gutted by an unprotected PCReset() cascading from a KSPDestroy() on
>>>> one of the containing ksps?  I can factor out
>>>> KSPReset_Private()/PCReset_Private() as indicated before, unless there are
>>>> objections.
>>>>
>>>
>>>  What do you think of my suggestion of masking ksp->pc when KSPDestroy
>>> calls KSPReset? Then KSPReset does not call PCReset if ksp->pc does not
>>> exist.
>>>
>> I guess that works too, but I thought your suggestion applied to userland
>> code right before calling KSPDestroy(&ksp)?
>> I suppose that will fix Mark's problem.  Maybe that's the right approach:
>> he got himself into this mess by reusing a pc
>> in the inner ksp, he should know how to extricate himself :-)
>>
>>
>> BTW, this is not a matter of being lazy, I need an eigen estimate of the
>> smoothers preconditioned operator.  In the past I created a new PC from the
>> command line database (ugly), but this GASM smoother can not be
>> reconstructed from the database (it uses the AMG aggregates).  I could do a
>> deep copy of the smoother but that would require two setups of the GASM PC,
>> which would be ugly.
>>
>> Mark
>>
>>
>> Dmitry.
>>
>>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20120330/05a89315/attachment.html>


More information about the petsc-dev mailing list