[Trilinos-Users] Fwd: possible IFPACK memory leak

Daniel Wheeler daniel.wheeler2 at gmail.com
Fri Jun 4 13:56:14 MDT 2010


Hi, I seem to have run across a memory leak in IFPACK (or the python
wrapping code for IFPACK) when used from PyTrilinos. I could also be
misusing the interface, I'm just not sure. Anyway the attached python
script is fairly simple and seems to leak a lot of memory. I've
attached the do_configure script as it explains how trilinos was
built. Below is the pertinent Valgrind output that points the finger
at Ifpack::Create as a place where memory as "definitely" being lost.
The complete Valgrind output was too large to attach.

   at 0x402377E: operator new(unsigned) (vg_replace_malloc.c:224)
   ==12400==    by 0x681CBE4: Ifpack::Create(Ifpack::EPrecType,
Epetra_RowMatrix*, int) (Ifpack.cpp:197)
   ==12400==    by 0x681D3A6: Ifpack::Create(std::string,
Epetra_RowMatrix*, int) (Ifpack.cpp:241)
   ==12400==    by 0x7FECA4F: _wrap_Factory_Create__SWIG_1
(IFPACKPYTHON_wrap.cpp:4446)
   ==12400==    by 0x7FED1FD: _wrap_Factory_Create (IFPACKPYTHON_wrap.cpp:4529)

Cheers



--
Daniel Wheeler



-- 
Daniel Wheeler
-------------- next part --------------
from PyTrilinos import IFPACK
from PyTrilinos import Epetra
import numpy

N = 1000
size = 3 * N

comm = Epetra.PyComm()
MAP = Epetra.Map(-1, numpy.arange(N), 0, comm)

matrix = Epetra.CrsMatrix(Epetra.Copy, MAP, -1)
i = numpy.random.random_integers(0, N - 1, size=size)
j = numpy.random.random_integers(0, N - 1, size=size)
v = numpy.random.random(size)
matrix.InsertGlobalValues(i, j, v)
matrix.FillComplete()
matrix.OptimizeStorage()
factory = IFPACK.Factory()

for i in range(100):
    prec = factory.Create("IC", matrix)
    prec.Initialize()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: do_configure
Type: application/octet-stream
Size: 483 bytes
Desc: not available
Url : https://software.sandia.gov/pipermail/trilinos-users/attachments/20100604/8f8899bc/attachment.obj 


More information about the Trilinos-Users mailing list