[SciPy-User] SciPy-User Digest, Vol 83, Issue 41

Grosspietsch John-AJG001 John.Grosspietsch@motorola....
Wed Jul 21 12:19:20 CDT 2010



"scipy-user-request@scipy.org" <scipy-user-request@scipy.org> wrote:

Send SciPy-User mailing list submissions to
	scipy-user@scipy.org

To subscribe or unsubscribe via the World Wide Web, visit
	http://mail.scipy.org/mailman/listinfo/scipy-user
or, via email, send a message with subject or body 'help' to
	scipy-user-request@scipy.org

You can reach the person managing the list at
	scipy-user-owner@scipy.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of SciPy-User digest..."


Today's Topics:

   1. Re: segfault using _sparse_ svd, eigen,	eigen_symmetric 	with
      svn 0.9.0.dev6598 (Skipper Seabold)


----------------------------------------------------------------------

Message: 1
Date: Wed, 21 Jul 2010 12:27:18 -0400
From: Skipper Seabold <jsseabold@gmail.com>
Subject: Re: [SciPy-User] segfault using _sparse_ svd, eigen,
	eigen_symmetric 	with svn 0.9.0.dev6598
To: SciPy Users List <scipy-user@scipy.org>
Cc: pietro.berkes@googlemail.com
Message-ID:
	<AANLkTikVnxaoDXBTNl-wmHFlZ6Jto-pxqQKe_vKWgoWM@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

On Wed, Jul 21, 2010 at 11:59 AM, Jose Quesada <quesada@gmail.com> wrote:
> Hi,
>
> We are on a coding sprint trying to implement sparse matrix support in
MDP
>
(http://sourceforge.net/apps/mediawiki/mdp-toolkit/index.php?title=MDP_Spr
int_2010).
> The new sparse.linalg is very useful here.
>
> We are getting segfaults using _sparse_ svd, eigen, eigen_symmetric with
svn
> 0.9.0.dev6598. I understand that (1) this is an unreleased version, and
(2)
> these methods may depend on external C and fortran code that could have
not
> being installed well on my machine, so this may be difficult to debug. I
> have added instructions to reproduce the segfault, but please ask for
> anything else that could be needed and I'll try to provide it.
>
> I installed the svn version on a virtualenv using
pip:~/.virtualenvs/sprint$
> pip install svn+http://svn.scipy.org/svn/scipy/trunk/#egg=scipyc
>
> This generates a long log that could contain the explanation, so I
posted it
> here (going as far back as my terminal's scrollback enabled:
> http://pastebin.org/410867
>
> Last, here's an example that reproduces the segfault:
>
> #!/usr/bin/env python
> # -*- coding: utf-8 -*-
>
> #--------------------------
> # simply run an svd on a a sparse matrix, svn 0.9.0.dev6598
> #--------------------------
> import scipy
> from scipy import sparse
> from numpy.random import rand
>
> # create random sparse matrix
> x = scipy.sparse.lil_matrix((1000000, 1000000))
> x[0, :100] = rand(100)
> x[1, 100:200] = x[0, :100]
> x.setdiag(rand(1000))
> x = x.tocsr() # convert it to CSR
> #v, u, w = scipy.sparse.linalg.eigen_symmetric(x) # segmentation fault
>
> # try a simpler matrix
> y = scipy.sparse.lil_matrix((10, 10))
> y.setdiag(range(10))
> y = y.tocsr() # convert it to CSR
> #v, u, w = scipy.sparse.linalg.eigen_symmetric(y) #
>

I have to import the linalg separately, and my docs say that
eigen_symmetric only returns w and v, so I can do

import scipy.sparse.linalg as splinalg
w, v = splinalg.eigen_symmetric(y)

without a segfault.

I'm running the most recent git mirror version of scipy.  Just
installed this morning.  I don't know how to check the git concept of
a revision number yet...

> #./sampleSegFault.py
> #Traceback (most recent call last):
> ??? #File "./sampleSegFault.py", line 13, in <module>
> ??? #x[0, :100] = rand(100)
> ??? #File
>
"/home/quesada/.virtualenvs/sprint/lib/python2.6/site-packages/scipy/spars
e/lil.py",
> line 319, in __setitem__
> ??? #x = lil_matrix(x, copy=False)
> ??? #File
>
"/home/quesada/.virtualenvs/sprint/lib/python2.6/site-packages/scipy/spars
e/lil.py",
> line 98, in __init__
> ??? #A = csr_matrix(A, dtype=dtype).tolil()
> ??? #File
>
"/home/quesada/.virtualenvs/sprint/lib/python2.6/site-packages/scipy/spars
e/compressed.py",
> line 71, in __init__
> ??? #self._set_self( self.__class__(coo_matrix(arg1, dtype=dtype)) )
> ??? #File
>
"/home/quesada/.virtualenvs/sprint/lib/python2.6/site-packages/scipy/spars
e/coo.py",
> line 171, in __init__
> ??? #self.data? = M[self.row,self.col]
> ??? #ValueError: shape mismatch: objects cannot be broadcast to a single
> shape
> ??? #*** glibc detected *** python: double free or corruption (!prev):
> 0x0000000004075ec0 ***
>
>
> # some other linalg methods
> ly,v = scipy.sparse.linalg.eig(y) # segmentation fault
>

I don't have splinalg.eig, but I have splinalg.eigen and it works
without segfault.  Probably a bad install is my guess.  I don't use
pip, but you might want to just try building from source and provide
the full output of the build process.

Skipper


------------------------------

_______________________________________________
SciPy-User mailing list
SciPy-User@scipy.org
http://mail.scipy.org/mailman/listinfo/scipy-user


End of SciPy-User Digest, Vol 83, Issue 41
******************************************



More information about the SciPy-User mailing list