Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fails of tests for QR and LQ decompositions #973

Open
dklyuchinskiy opened this issue Jan 10, 2024 · 1 comment
Open

fails of tests for QR and LQ decompositions #973

dklyuchinskiy opened this issue Jan 10, 2024 · 1 comment

Comments

@dklyuchinskiy
Copy link
Contributor

dklyuchinskiy commented Jan 10, 2024

Hello!

I have been running tests for QR and LQ (xlintstd_dtest) and sometimes I have got failures like

M=   10, N=   10, K=    5, NB=   1, NX=    1, type  2, test( 1)= 0.16408E+16
M=   10, N=   10, K=    5, NB=   1, NX=    1, type  2, test( 2)= 0.62678E+15

Usually, I need to change input file to reproduce error.

My investigation shows, that root-cause is PR 900 with replacement GELQS by GELS (in example of LQ). Behavior of the test is changed a bit (see TESTING/LIN/dchklq.f):

Before:
LQT01 is called to factorize matrix by GELQF for every combination of parameters m and n and this factorized matrix is used at any check of test parameter k.

Now:
LQT01 is again called to factorize matrix, but later array AF is cleared to A to call GELS since factorization is now performed inside call of GELS. But, unfortunately, if m = n in call of GELS then factorization is done by GEQRF instead GELQF (check SRC/dgels.f). And this is a main difference. For upper triangular matrix QR factorization doing nothing, which lead to failure of test(1) and test(2) on the next iteration of parameter k, since arrays A and AF are equal.

@angsch please take a look.

Input is attached input qr and lq.txt

@dklyuchinskiy
Copy link
Contributor Author

dklyuchinskiy commented Jan 12, 2024

Stable reproduced, if there is only one parameter NB in input file. That's why there are no fails for general input file.

It seems, root-cause is also clear. Test have 2 cycles

DO 40 IK = 1, NK
DO 30 INB = 1, NNB

If NNB >= 2, then factorized matrix becomes correct again, since factorization is performed by LQT01 (or GELQF) due to IK = 1. But if NNB = 1, then factorization is done by GELS, which calls GEQRF for m = n and test fails for next iterations of IK.

Actually, I still have no idea for proper solution to fix this behavior. Construction of the test is complicated. I believe, that we should somehow avoid call of QR in test for LQ.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant