isce-framework / fringe

Fine Resolution InSAR With Generalized Eigenvectors (FRInGE)
Apache License 2.0
80 stars 42 forks source link

Illegal value errors with openblas #66

Open rtburns-jpl opened 2 years ago

rtburns-jpl commented 2 years ago

Continued from https://github.com/isce-framework/fringe/pull/65#issuecomment-1040778200:

Compiling with openblas gives me invalid results for unit tests.

To reproduce, check out https://github.com/rtburns-jpl/fringe/tree/openblas-repro and run nix-build (requires Nix to be installed).

1/1 Test #1: eigen_test .......................***Exception: SegFault  0.12 sec
Testing known 3 x 3
3 -2 4
-2 8 2
4 2 3
Eigen values:
-1.81507
7
8.81507
Eigen vectors:
-0.679457 0.707107 0.1958
-0.276904 -5.55112e-16 -0.960898
0.679457 0.707107 -0.1958
Input array:
(3,0) (-2,0) (4,0)
(-2,0) (8,0) (2,0)
(4,0) (2,0) (3,0)
Order = 3
 ** On entry to ZHEEVR parameter number 10 had an illegal value
Largest eigen value: 5.55824e-321
(0,0)
(0,0)
(0,0)
Order  3
 ** On entry to ZHEEVR parameter number  6 had an illegal value
Smallest eigen value: 2.27772e-317
(0,0)
(0,0)
(0,0)
Matrix inverse:
(2.55556,0) (1,0) (-2.44444,0)
(1,-0) (0.5,0) (-1,0)
(-2.44444,-0) (-1,-0) (2.55556,-0)

0% tests passed, 1 tests failed out of 1
piyushrpt commented 2 years ago

The zheevr and zpotrf both complain about the first integer argument and I suspect this means 32-bit vs 64-bit? Possibly, this - https://numpy.org/devdocs/user/building.html#bit-blas-and-lapack

rtburns-jpl commented 2 years ago

It's possible, I think openblas supports 64-bit indexing but reference blas must use 32-bit indices. Also, searching the error messages on github brings up some recent openblas/lapack issues regarding NaN/Inf values, not sure if that is related.