Shot in the dark: Anyone ever use CLAPACK routines?

bruce.labitt at autoliv.com bruce.labitt at autoliv.com
Thu May 20 16:03:01 EDT 2010


gnhlug-discuss-bounces at mail.gnhlug.org wrote on 05/19/2010 02:34:19 PM:
<snip a ton o' stuff>
> 
> Comment on my own post.  Probably nothing is wrong with MY CODE. 
> 
> http://icl.cs.utk.edu/lapack-forum/viewtopic.php?f=2&t=745
> 
> The claim is that zgesvd_ function hangs.  The fix is allegedly to 
modify
> the make.inc file for CLAPACK. 
> 
> The change is adding -ffloat-store to the end of NOOPT.
> "NOOPT = -O0 -I$(TOPDIR)/INCLUDE -fPIC -ffloat-store"
> 
> Hope that fixes it.  I'll find out in 4+ hours!
> 
> -Bruce
> 

Of course it didn't work :(   Sounded too good to be true, and it was!
I did find out that Scipy.linalg.svd used LAPACK not CLAPACK. 

In [4]: source( svd )
In file: /usr/lib/python2.6/dist-packages/scipy/linalg/decomp.py

def svd(a,full_matrices=1,compute_uv=1,overwrite_a=0):

snip
    """
    # A hack until full_matrices == 0 support is fixed here.
    if full_matrices == 0:
        import numpy.linalg
        return numpy.linalg.svd(a, full_matrices=0, compute_uv=compute_uv)
    a1 = asarray_chkfinite(a)
    if len(a1.shape) != 2:
        raise ValueError, 'expected matrix'
    m,n = a1.shape
    overwrite_a = overwrite_a or (_datanotshared(a1,a))
    gesdd, = get_lapack_funcs(('gesdd',),(a1,))
    if gesdd.module_name[:7] == 'flapack':
        lwork = calc_lwork.gesdd(gesdd.prefix,m,n,compute_uv)[1]
        u,s,v,info = gesdd(a1,compute_uv = compute_uv, lwork = lwork,
                      overwrite_a = overwrite_a)
    else: # 'clapack'
        raise NotImplementedError,'calling gesdd from %s' % 
(gesdd.module_name)
    if info>0: raise LinAlgError, "SVD did not converge"
    if info<0: raise ValueError,\
       'illegal value in %-th argument of internal gesdd'%(-info)
    if compute_uv:
        return u,s,v
    else:
        return s

Hmm... I wonder if CLAPACK have been rigorously tested, like (f)LAPACK 
has...  I guess that scipy/numpy did not think so... 
arggggggghhhhhhhhhhhhhhhhhh...

Aaaaaccckk, time to get more familiar with valgrind...  Nuts, I thought 
this was all going to be straight forward...  Give me python any day!

-Bruce




******************************
Neither the footer nor anything else in this E-mail is intended to or constitutes an <br>electronic signature and/or legally binding agreement in the absence of an <br>express statement or Autoliv policy and/or procedure to the contrary.<br>This E-mail and any attachments hereto are Autoliv property and may contain legally <br>privileged, confidential and/or proprietary information.<br>The recipient of this E-mail is prohibited from distributing, copying, forwarding or in any way <br>disseminating any material contained within this E-mail without prior written <br>permission from the author. If you receive this E-mail in error, please <br>immediately notify the author and delete this E-mail.  Autoliv disclaims all <br>responsibility and liability for the consequences of any person who fails to <br>abide by the terms herein. <br>
******************************



More information about the gnhlug-discuss mailing list