[SciPy-User] scipy+lapack array copy
Paul Anton Letnes
Mon Mar 8 11:47:51 CST 2010
I have a numerical project where I link a fortran module to python using f2py. The fortran module basically sets up the left hand side coefficient matrix of a linear equation system. The right hand side is small, so I set that up in python. So far, everything works great.
Now, when I call scipy-lapack, I am using:
from scipy.linalg.lapack import flapack as lapack
lu, piv, x, info = lapack.zgesv(A, b)
A is created in the fortran part of the program. b is created from numpy.zeros(). Both report as F_CONTIGUOUS by printing A.flags and b.flags.
The problem is that I'd like A to be large (>1GB), but the lapack wrapper (or lapack itself?) copies the array, doubling the memory use. Aside from being unnecessary, this also reduces the practical problem size I can solve by a factor 2, which of course is very annoying.
How can I get around this problem?
More information about the SciPy-User