On Feb 17, 8:59 am, Johan Oudinet <johan.oudi...@gmail.com> wrote:
> Hi,

Hi Johan,

> When I using the following simple script to get a square dxd
> inversible matrix (T) from a dxr matrix (T0), I got a memory overflow:
> #######################
> T=T0;rt=r;d=A.ncols();i=0
> while rt != d:
>         while rt == rank(T.augment(matrix(d,1,{(i,0):1}))):
>                 i+=1
>         T=T.augment(matrix(d,1,{(i,0):1}))
>         rt+=1
> #######################
>
> Since the matrix A is a dxd - with d equals to 1183 - that easily fits
> into the memory (4GB), it seems strange to me that this script needs
> more and more memory until reach a memory overflow. Maybe there is a
> memory leak in the function rank or augment? Or, more likely, I did
> something wrong when writing this script (since I'm a beginner in both
> Sage and Python)?
>
> The entire script (with the 1183x1183 matrix) is available 
> here:http://www.lri.fr/~oudinet/pub/script.sage

What Sage release are you running? It sounds very much like this could
be a memory leak.

The matrix is sparse and pre Sage 3.3 rank was computed using pari
which tends to blow up since it uses *a lot* of memory. We now switch
back to computing the rank of such a matrix by using the much faster
dense representation, but John Palmieri as the author of that code
should fill you in on the details there.

> I'd appreciate any help.

I am running the computation right now on a box with 128 GB, so we
will see how far I get :) Right now we are in the 30th iteration of

while rt != d:
        while rt == rank(T.augment(matrix(d,1,{(i,0):1}))):
                i+=1
        T=T.augment(matrix(d,1,{(i,0):1}))
        rt+=1

and we are already consuming about 2.5GB RAM. There are some known
problem with LA in Sage that are leaky, but I suspect those are
reference count issues in Cython. Cython 0.11 out soon should help
there with the new reference count nanny.

> Regards,

Cheers,

Michael
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to