[petsc-dev] memory leaks in BCGSL when using KSPReset()

Lisandro Dalcin dalcinl at gmail.com
Tue Apr 12 08:27:27 CDT 2011


On 12 April 2011 00:50, Satish Balay <balay at mcs.anl.gov> wrote:
> On Tue, 12 Apr 2011, Lisandro Dalcin wrote:
>
>> After adding this test in petsc4py-dev/test/test_ksp.py :
>>
>>     def testResetAndSolve(self):
>>         self.ksp.reset()
>>         self.testSolve()
>>         self.ksp.reset()
>>         self.testSolve()
>>         self.ksp.reset()
>>
>> it seems there is some memory bleeding:
>>
>> [0]Total space allocated 256 bytes
>> [ 0]80 bytes KSPSetUp_BCGSL() line 476 in
>> /home/devel/petsc/dev/src/ksp/ksp/impls/bcgsl/bcgsl.c
>>       [0]  KSPSetUp() line 184 in
>> /home/devel/petsc/dev/src/ksp/ksp/interface/itfunc.c
>>       [0]  KSPSolve() line 332 in
>> /home/devel/petsc/dev/src/ksp/ksp/interface/itfunc.c
>>
>> These are workspace arrays that are re-allocated at every KSPSetup_BCGSL call.
>>
>> Not sure about the proper way to fix this, but I would deallocate the
>> arrays at KSPReset_BCGSL. Can anyone help me with this?
>>

Never mind, I've pushed the fix I proposed above.

>>
>> PS: Will we ever have petsc4py in the nightly builds? Is there
>> something to be done from my side?
>
> Sorry - will check on adding one..
>

I was not complaining. But I think petsc4py do help to catch bugs in core PETSc.

BTW, take a look here:
http://code.google.com/p/petsc4py/source/browse/misc/makefile.dev .
Ideally, you should test many PETSC_ARCH's as possible.

PS: Could you add mpiuni+single+complex to the nighties? I recently
fixed an mpiuni issue for this case.


-- 
Lisandro Dalcin
---------------
CIMEC (INTEC/CONICET-UNL)
Predio CONICET-Santa Fe
Colectora RN 168 Km 472, Paraje El Pozo
3000 Santa Fe, Argentina
Tel: +54-342-4511594 (ext 1011)
Tel/Fax: +54-342-4511169



More information about the petsc-dev mailing list