DSYEVR returns non-orthogonal vectors?

Open discussion regarding features, bugs, issues, vendors, etc.

DSYEVR returns non-orthogonal vectors?

Postby pav » Thu Apr 22, 2010 1:34 pm

Hi,

(Forwarding http://projects.scipy.org/scipy/ticket/1159 )

For some matrices DSYEVR, when told to compute a small number of eigenvalues, returns non-orthogonal eigenvectors. Perhaps it possible for the algorithm to detect this and return with an error?

This applies at least when using the automatically chosen ABSTOL. However, at least for the example below, I wasn't able to find a suitable ABSTOL for which it would work.

Maybe, this might have to do with the fact that for the example problem below, the first eigenvalue is multiply degenerate, and the numerical second eigenvalue is eps-close to the first one.

The following test program illustrates this: http://projects.scipy.org/scipy/raw-att ... 9/test.f90
with the test data http://projects.scipy.org/scipy/raw-att ... 1159/L.txt

On Lapack 3.2.1 + reference BLAS, I get:

Code: Select all
$ gfortran -o test test.f90 -llapack -lblas
$ ./test < L.txt
 orth error (           2  eigs): -0.96599125529927221      HUGE ERROR
 orth error (           3  eigs): -0.96599125529927232      HUGE ERROR
 orth error (           4  eigs): -0.96599125529927221      HUGE ERROR
 orth error (           5  eigs): -2.52928802610462387E-017
 orth error (           6  eigs): -1.47893223140021721E-016
 orth error (           7  eigs): -1.18177613284446356E-016
 orth error (           8  eigs):   0.0000000000000000     
 orth error (           9  eigs): -2.84549495443531079E-016
 orth error (          10  eigs): -2.93456682158620488E-016
pav
 
Posts: 6
Joined: Tue Sep 16, 2008 2:58 pm

Re: DSYEVR returns non-orthogonal vectors?

Postby admin » Thu Apr 22, 2010 1:37 pm

Dear Pauli,
I just ran your test and it works fine on my machine.
I tried LAPACK 3.2.1, 3.1.1 and our current repository version with different BLAS (ref BLAS, veclib and ATLAS).
gfortran -o test test.f90 ~/Documents/Boulot/lapack-dev/lapack/tags/lapack-3.2.1/lapack_LINUX.a ~/Documents/Boulot/lapack-dev/lapack/tags/lapack-3.2.1/blas_LINUX.a
./test < L.txt
orth error ( 2 eigs): -2.67037960893108216E-032
orth error ( 3 eigs): 4.46452343408814271E-033
orth error ( 4 eigs): -2.67037960893108216E-032
orth error ( 5 eigs): 2.73435787900844218E-016
orth error ( 6 eigs): 1.45283091113057594E-017
orth error ( 7 eigs): -7.06450011644714449E-033
orth error ( 8 eigs): 0.0000000000000000
orth error ( 9 eigs): 3.53775168882020097E-016
orth error ( 10 eigs): -9.49761103097301884E-017

So I suspect a compilation issue, or something like this.
Could you tell me which configuration you are using? (machine, compiler, make.inc, etc..)

Regards,
Julie
admin
Site Admin
 
Posts: 499
Joined: Wed Dec 08, 2004 7:07 pm

Re: DSYEVR returns non-orthogonal vectors?

Postby pav » Thu Apr 22, 2010 4:16 pm

The issue occurred with Lapack+BLAS libraries shipped by Debian (libatlas3gf-base 3.6.0-22 + liblapack3gf 3.1.1-1), and also on those by Ubuntu (libblas3gf 1.2-2build1 + 3.2.1-2). Both are gfortran-built.

I also downloaded LAPACK 3.2.1 (http://netlib.org/lapack/lapack.tgz) and BLAS (http://netlib.org/blas/blas.tgz) built it using the default make.inc's as-is (except changing BLAS's to use gfortran). This means "-g" for LAPACK and "-O3" for BLAS.

On the Ubuntu machine (32-bit linux intel atom), I have
Code: Select all
$ gfortran --version
GNU Fortran (Ubuntu 4.4.3-4ubuntu5) 4.4.3
$ gfortran -o test test.f90 lapack-3.2.1/lapack_LINUX.a lapack-3.2.1/blas_LINUX.a
$ ./test < L.txt
 orth error (           2  eigs):  0.98018274937637251      HUGE ERROR
 orth error (           3  eigs):  0.98018274937637251      HUGE ERROR
 orth error (           4  eigs):  0.98018274937637251      HUGE ERROR
 orth error (           5  eigs):  1.25314924656247904E-016
 orth error (           6  eigs):  2.17735748322348682E-016

The same also with BLAS compiled with "-g" instead of "-O3". Moreover, the same occurs also with everything built with
Code: Select all
$ gfortran-4.3 --version
GNU Fortran (Ubuntu 4.3.4-10ubuntu1) 4.3.4


On the Debian machine (64-bit intel xeon), I get from the same procedure
Code: Select all
$ gfortran --version
GNU Fortran (Debian 4.3.2-1.1) 4.3.2
$ gfortran -o test test.f90 lapack-3.2.1/lapack_LINUX.a lapack-3.2.1/blas_LINUX.a
$ ./test < L.txt
 orth error (           2  eigs): -2.67037960893108216E-032
 orth error (           3  eigs):  4.46452343408814271E-033
 orth error (           4  eigs): -2.67037960893108216E-032
 orth error (           5  eigs):  2.73435787900844218E-016
 orth error (           6  eigs):  1.45283091113057594E-017
 orth error (           7  eigs): -7.06450011644714449E-033

So no error there, and adding "-O2" or "-O3" to LAPACK compilation doesn't seem to break anything.
Moreover,
Code: Select all
$ gfortran -o test test.f90 lapack-3.2.1/lapack_LINUX.a -lblas-3
22:59 pauli@phys:~/tmp$ ./test < L.txt
 orth error (           2  eigs): -1.80363506134932581E-032
 orth error (           3  eigs):  0.99999999999998068      HUGE ERROR
 orth error (           4  eigs):  0.99999999999998068      HUGE ERROR
 orth error (           5  eigs):   0.0000000000000000     
 orth error (           6  eigs):   0.0000000000000000     
 orth error (           7  eigs):   0.0000000000000000     
 orth error (           8  eigs): -3.13768108717304983E-016
 orth error (           9  eigs): -4.51028103753969845E-017
 orth error (          10  eigs):  1.40946282423115576E-016
$ gfortran -o test test.f90 lapack-3.2.1/lapack_LINUX.a BLAS/blas_LINUX.a
$ ./test < L.txt
 orth error (           2  eigs): -2.67037960893108216E-032
 orth error (           3  eigs):  4.46452343408814271E-033
 orth error (           4  eigs): -2.67037960893108216E-032
 orth error (           5  eigs):  2.73435787900844218E-016
$ gfortran -o test test.f90 -llapack-3 BLAS/blas_LINUX.a
$ ./test < L.txt
 orth error (           2  eigs):  9.82816896344506035E-019
 orth error (           3  eigs):  9.82816896344506035E-019
 orth error (           4  eigs):  9.82816896344506035E-019
 orth error (           5  eigs):  1.24132789084528224E-017

So it seems like the Debian-supplied BLAS is somehow faulty, at least in this case.

A third machine (Debian Lenny, Athlon 64-bit), shows similar behavior as the above 64-bit machine.

So, there seem to be problems with 32-bit self-compiled and all distributor-supplied packages. So it looks very much like a compiler-related problem, unless there's some bitness issues...
pav
 
Posts: 6
Joined: Tue Sep 16, 2008 2:58 pm

Re: DSYEVR returns non-orthogonal vectors?

Postby admin » Thu Apr 22, 2010 5:06 pm

Pav,
Yes I confirm, I managed to reproduce the problem on my 32 bits machine with 4.1.2 and the reference BLAS
I am going to take a closer look.
Julie
admin
Site Admin
 
Posts: 499
Joined: Wed Dec 08, 2004 7:07 pm


Return to User Discussion

Who is online

Users browsing this forum: Exabot [Bot] and 4 guests

cron