[Scipy-tickets] [SciPy] #1225: Test errors in scipy.sparse when using MSVC/MKL build

SciPy Trac scipy-tickets@scipy....
Fri Jul 9 16:12:35 CDT 2010


#1225: Test errors in scipy.sparse when using MSVC/MKL build
--------------------------+-------------------------------------------------
 Reporter:  cjgohlke      |       Owner:  wnbell
     Type:  defect        |      Status:  new   
 Priority:  normal        |   Milestone:  0.8.0 
Component:  scipy.sparse  |     Version:  0.7.0 
 Keywords:                |  
--------------------------+-------------------------------------------------
 This is related to the discussion at http://mail.scipy.org/pipermail
 /scipy-user/2010-July/025961.html

 Using numpy 1.4.1 and scipy 0.8rc1 built with msvc9, ifort 11.1.065, and
 MKL 10.2.5.1, on Python 2.6.5 for Windows I get the following scipy.sparse
 test errors and failures:

 {{{
 Running unit tests for scipy.sparse
 NumPy version 1.4.1
 NumPy is installed in X:\Python26-x64\lib\site-packages\numpy
 SciPy version 0.8.0rc1
 SciPy is installed in X:\Python26-x64\lib\site-packages\scipy
 Python version 2.6.5 (r265:79063, Apr 26 2010, 17:05:32) [MSC v.1500 64
 bit (AMD
 64)]
 nose version 0.11.3
 SSSSSSSSSSS.FE.EE.EE......K.........E.E.........................................
 ................................................................................
 ..K...............................................................K.............
 ................................................................................
 ............................................................KK..................
 ......................................................
 ======================================================================
 ERROR: test_linsolve.TestSplu.test_lu_refcount
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "X:\Python26-x64\lib\site-packages\nose\case.py", line 186, in
 runTest
     self.test(*self.arg)
   File "X:\Python26-x64\lib\site-
 packages\scipy\sparse\linalg\dsolve\tests\test_
 linsolve.py", line 122, in test_lu_refcount
     lu = splu(a_)
   File "X:\Python26-x64\lib\site-
 packages\scipy\sparse\linalg\dsolve\linsolve.py
 ", line 173, in splu
     ilu=False, options=_options)
 RuntimeError: Factor is exactly singular

 ======================================================================
 ERROR: test_linsolve.TestSplu.test_spilu_smoketest
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "X:\Python26-x64\lib\site-packages\nose\case.py", line 186, in
 runTest
     self.test(*self.arg)
   File "X:\Python26-x64\lib\site-
 packages\scipy\sparse\linalg\dsolve\tests\test_
 linsolve.py", line 60, in test_spilu_smoketest
     lu = spilu(self.A, drop_tol=1e-2, fill_factor=5)
   File "X:\Python26-x64\lib\site-
 packages\scipy\sparse\linalg\dsolve\linsolve.py
 ", line 245, in spilu
     ilu=True, options=_options)
 RuntimeError: Factor is exactly singular

 ======================================================================
 ERROR: test_linsolve.TestSplu.test_splu_basic
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "X:\Python26-x64\lib\site-packages\nose\case.py", line 186, in
 runTest
     self.test(*self.arg)
   File "X:\Python26-x64\lib\site-
 packages\scipy\sparse\linalg\dsolve\tests\test_
 linsolve.py", line 87, in test_splu_basic
     lu = splu(a_)
   File "X:\Python26-x64\lib\site-
 packages\scipy\sparse\linalg\dsolve\linsolve.py
 ", line 173, in splu
     ilu=False, options=_options)
 RuntimeError: Factor is exactly singular

 ======================================================================
 ERROR: test_linsolve.TestSplu.test_splu_perm
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "X:\Python26-x64\lib\site-packages\nose\case.py", line 186, in
 runTest
     self.test(*self.arg)
   File "X:\Python26-x64\lib\site-
 packages\scipy\sparse\linalg\dsolve\tests\test_
 linsolve.py", line 100, in test_splu_perm
     lu = splu(a_)
   File "X:\Python26-x64\lib\site-
 packages\scipy\sparse\linalg\dsolve\linsolve.py
 ", line 173, in splu
     ilu=False, options=_options)
 RuntimeError: Factor is exactly singular

 ======================================================================
 ERROR: test_linsolve.TestSplu.test_splu_smoketest
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "X:\Python26-x64\lib\site-packages\nose\case.py", line 186, in
 runTest
     self.test(*self.arg)
   File "X:\Python26-x64\lib\site-
 packages\scipy\sparse\linalg\dsolve\tests\test_
 linsolve.py", line 53, in test_splu_smoketest
     lu = splu(self.A)
   File "X:\Python26-x64\lib\site-
 packages\scipy\sparse\linalg\dsolve\linsolve.py
 ", line 173, in splu
     ilu=False, options=_options)
 RuntimeError: Factor is exactly singular

 ======================================================================
 ERROR: Check that QMR works with left and right preconditioners
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "X:\Python26-x64\lib\site-
 packages\scipy\sparse\linalg\isolve\tests\test_
 iterative.py", line 161, in test_leftright_precond
     L_solver = splu(L)
   File "X:\Python26-x64\lib\site-
 packages\scipy\sparse\linalg\dsolve\linsolve.py
 ", line 173, in splu
     ilu=False, options=_options)
 RuntimeError: Factor is exactly singular

 ======================================================================
 ERROR: test_preconditioner (test_lgmres.TestLGMRES)
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "X:\Python26-x64\lib\site-
 packages\scipy\sparse\linalg\isolve\tests\test_
 lgmres.py", line 38, in test_preconditioner
     pc = splu(Am.tocsc())
   File "X:\Python26-x64\lib\site-
 packages\scipy\sparse\linalg\dsolve\linsolve.py
 ", line 173, in splu
     ilu=False, options=_options)
 RuntimeError: Factor is exactly singular

 ======================================================================
 FAIL: test_twodiags (test_linsolve.TestLinsolve)
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "X:\Python26-x64\lib\site-
 packages\scipy\sparse\linalg\dsolve\tests\test_
 linsolve.py", line 39, in test_twodiags
     assert( norm(b - Asp*x) < 10 * cond_A * eps )
 AssertionError

 ----------------------------------------------------------------------
 Ran 454 tests in 6.358s

 FAILED (KNOWNFAIL=5, SKIP=11, errors=7, failures=1)
 }}}


 The sparse.linalg.spsolve function returns wrong results as demonstrated
 by this script:

 {{{
 # spsolve_test.py

 import numpy as np
 import scipy as sp
 import scipy.sparse.linalg

 Adense = np.matrix([[ 0.,  1.,  1.],
         [ 1.,  0.,  1.],
         [ 0.,  0.,  1.]])
 As =  sp.sparse.csc_matrix(Adense)
 x = np.random.randn(3)
 b = As.matvec(x)

 print x
 print sp.sparse.linalg.spsolve(As, b)
 }}}

 {{{
 In [7]: run -i spsolve_test.py
 [ 0.08507826  1.04401349 -1.56609783]
 [-0.52208434 -1.48101957 -1.56609783]
 }}}


 When linking the _superlu extension with CBLAS (from the SuperLU 4.0
 source distribution) instead of MKL, sparse.linalg.spsolve works and the
 RuntimeErrors disappear but other errors and failures appear:

 {{{
 In [2]: run -i spsolve_test.py
 [ 1.96143212  0.74679121  0.34017413]
 [ 1.96143212  0.74679121  0.34017413]
 }}}

 {{{
 Running unit tests for scipy.sparse
 NumPy version 1.4.1
 NumPy is installed in X:\Python26-x64\lib\site-packages\numpy
 SciPy version 0.8.0rc1
 SciPy is installed in X:\Python26-x64\lib\site-packages\scipy
 Python version 2.6.5 (r265:79063, Apr 26 2010, 17:05:32) [MSC v.1500 64
 bit (AMD
 64)]
 nose version 0.11.3
 SSSSSSSSSSS.E..F..........K.........F...........................................
 ................................................................................
 ..K...............................................................K.............
 ................................................................................
 ............................................................KK..................
 ......................................................
 ======================================================================
 ERROR: test_twodiags (test_linsolve.TestLinsolve)
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "X:\Python26-x64\lib\site-
 packages\scipy\sparse\linalg\dsolve\tests\test_
 linsolve.py", line 39, in test_twodiags
     assert( norm(b - Asp*x) < 10 * cond_A * eps )
   File "X:\Python26-x64\lib\site-packages\scipy\linalg\misc.py", line 9,
 in norm

     return np.linalg.norm(np.asarray_chkfinite(a), ord=ord)
   File "X:\Python26-x64\lib\site-packages\numpy\lib\function_base.py",
 line 586,
  in asarray_chkfinite
     raise ValueError, "array must not contain infs or NaNs"
 ValueError: array must not contain infs or NaNs

 ======================================================================
 FAIL: test_linsolve.TestSplu.test_spilu_smoketest
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "X:\Python26-x64\lib\site-packages\nose\case.py", line 186, in
 runTest
     self.test(*self.arg)
   File "X:\Python26-x64\lib\site-
 packages\scipy\sparse\linalg\dsolve\tests\test_
 linsolve.py", line 62, in test_spilu_smoketest
     assert abs(x - r).max() < 1e-2
 AssertionError

 ======================================================================
 FAIL: Check that QMR works with left and right preconditioners
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "X:\Python26-x64\lib\site-
 packages\scipy\sparse\linalg\isolve\tests\test_
 iterative.py", line 178, in test_leftright_precond
     assert_equal(info,0)
   File "X:\Python26-x64\lib\site-packages\numpy\testing\utils.py", line
 309, in
 assert_equal
     raise AssertionError(msg)
 AssertionError:
 Items are not equal:
  ACTUAL: 1
  DESIRED: 0

 ----------------------------------------------------------------------
 Ran 454 tests in 6.723s

 FAILED (KNOWNFAIL=5, SKIP=11, errors=1, failures=2)
 }}}

 The errors and failures are the same on 32 and 64 bit Python.

-- 
Ticket URL: <http://projects.scipy.org/scipy/ticket/1225>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list