-
Notifications
You must be signed in to change notification settings - Fork 11
Add the Dxxcon routines to lapack64. #47
Conversation
are used to check the condition number of a matrix before attempting a linear solve
|
I've seen the dlantr failure on my machine at home too, but sporadically. For perpetuity: |
|
LGTM |
|
Interesting. I have never seen that failure. Is there a way to tell cgo problems from lapack problems? Go is throwing the error, but, for example, would Xerbla give a go throw like this? It's in allocStack which makes me think it's a Go problem, but I don't know enough to have an educated guess. |
Add the Dxxcon routines to lapack64.
|
I would say it's lapacke. |
|
It's reliably reproduced with |
|
Nice find! Reproduced on my computer as well. |
|
I think I've figured it out, but would you take a look. I think that LAPACKE_dtr_nancheck fails when m < n because m is not passed and the caller assumes that a triangle is not trapezoid even though LAPACKE_dlantr may take such a matrix. Then stack corruption and bang! later when that is uncovered. Does this look right to you? |
|
I've confirmed that this fixes the real case, but I don't think it is the proper fix. diff --git a/lapack-netlib/lapacke/src/lapacke_dlantr.c b/lapack-netlib/lapacke/
index 2cde1eb..9d44972 100644
--- a/lapack-netlib/lapacke/src/lapacke_dlantr.c
+++ b/lapack-netlib/lapacke/src/lapacke_dlantr.c
@@ -46,7 +46,7 @@ double LAPACKE_dlantr( int matrix_order, char norm, char uplo,
}
#ifndef LAPACK_DISABLE_NAN_CHECK
/* Optionally check input matrices for NaNs */
- if( LAPACKE_dtr_nancheck( matrix_order, uplo, diag, n, a, lda ) ) {
+ if( LAPACKE_dtr_nancheck( matrix_order, uplo, diag, MIN(m,n), a, lda ) ) {
return -7;
}
#endifThe issue now is that dlantr does work on an m by n triangular and the NaN check is only over the triangular component, so the is the possibility of a NaN in the rectangle outside that. What do you think? |
|
I agree with your analysis. LAPACKE_dtr_nancheck should be modified to look at trapezoidal matrices or there should be a dtrap which does. |
|
I checked a couple of other functions that have failed on Travis, and I didn't see a similar bug arising. |
|
Those were the suggestions I made in the OpenBLAS issue. Making a change to LAPACKE_dtr_nancheck has a lot of flow on effects, so a specific dtrap would be better in my opinion.
|
The condition number routines are used to check the condition number of a matrix before attempting a linear solve.