Skip to content
This repository was archived by the owner on Nov 24, 2018. It is now read-only.

Conversation

@btracey
Copy link
Member

@btracey btracey commented Sep 5, 2015

No description provided.

@btracey
Copy link
Member Author

btracey commented Sep 5, 2015

The cgo for Dlange seems to be fine, but Dlantr with cgo seems to be giving nonsense answers. Do you see where the error may be @kortschak ?

cgo/lapack.go Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/lapcak/lapack/ and below.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops. Done.

@kortschak
Copy link
Member

The cgo code that should reproduce this is:

#include <stdio.h>
#include <lapacke.h>

int row_major = 101;

int main() {
    int norm='I', uplo='L', diag='U', m=3, n=5, lda=5;
    double a[15]= {
        1.2904273494935299, -0.09363912952772585, 0.2666718270372507, -1.529106629898684, -0.2552732603463197,
        0.18532547931159815, -0.9524750588974129, 0.7076464220040795, -0.8807825536566501, 1.1120190482489702,
        -1.6488099453520273, 0.8141133091087833, 1.0845230792403764, 0.4997975031933075, 0.004918788535355434
    };

    double res = LAPACKE_dlantr(row_major, norm, uplo, diag, m, n, a, lda);
    printf("dlantr res=%f\n", res);
}

It does not fail. The errors I see with cgo are either "free(): invalid next size (fast)" or "double free or corruption (out)". So presumably the C code is freeing something that does not belong to it. I'm looking further.

@kortschak
Copy link
Member

If I remove the 2 frees in the LAPACKE_dlantr path (work and a_t) we stop this failure (instead failing during the dlange call - if I remove these, the panic goes away, but the tests fail).

The failure is the same for go1.4.2, so it's not the new GC.

This is obviously insane; the allocations are made by C and then freed by C. If DLANTR is told to RETURN immediately, the panic goes away, so this looks like an unpleasant interaction between Go, C and fortran.

@kortschak
Copy link
Member

This change to OpenBLAS is the minimal change necessary and sufficient to stop the panic - it still fails due to bad answers:

diff --git a/lapack-netlib/SRC/dlantr.f b/lapack-netlib/SRC/dlantr.f
index 6088e8c..97393ec 100644
--- a/lapack-netlib/SRC/dlantr.f
+++ b/lapack-netlib/SRC/dlantr.f
@@ -281,7 +281,7 @@
             END IF
          ELSE
             IF( LSAME( DIAG, 'U' ) ) THEN
-               DO 210 I = 1, N
+               DO 210 I = 1, M
                   WORK( I ) = ONE
   210          CONTINUE
                DO 220 I = N + 1, M

This matches the documentation for WORK which says it should be >= M (via LWORK).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be m?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Naively, no. This is the row vs. column major thing. In column major, one computes the MaxRowSum looping over the columns and incrementing, so len(work) = m. In row major, one computes the column sums with incrementing, so len(work) = n. Maybe this is a problem with the RowMajor implementation.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're getting the right answers for at least one case where OpenBLAS disagrees and work is required (the one that was small enough for me to check), so I don't think this is a problem, I just wanted to check.

@kortschak
Copy link
Member

I'm confident that we are correct and either or both of OpenBLAS and NETLIB are wrong.

@btracey
Copy link
Member Author

btracey commented Sep 6, 2015

What's the link for the file of your code change? In the netlib reference code it only goes to m
http://www.netlib.org/lapack/explore-html/d0/dc4/dlantr_8f_source.html

@kortschak
Copy link
Member

@btracey
Copy link
Member Author

btracey commented Sep 6, 2015

Do you have a good reproducer to report to OpenBLAS? In the meantime, should I log the failure instead of using t.Errorf? I assume that's better than disabling the cgo test.

@btracey
Copy link
Member Author

btracey commented Sep 6, 2015

By which I mean, would you like to report your reproducer to OpenBLAS?

@kortschak
Copy link
Member

The reproducer for C doesn't fail. I think just point to this. The error on my machine is a double free, so we have already lost by the time we call; the test needs to be disabled for cgo.

I just blatted the whole of NETLIB LAPACK on top of OpenBLAS and it still fails - the change in the link you provided is not in the 3.5.0 tarball, nor is it in the svn - looking now, it's not in the link above either (look at L284).

I think this is an issue against NETLIB.

@btracey
Copy link
Member Author

btracey commented Sep 6, 2015

Disabled the test

@btracey
Copy link
Member Author

btracey commented Sep 6, 2015

@xianyi we're seeing a bunch of cases where the results from Dlantr do not match the results for the equivalent matrix in Dlange. We're also seeing some possible memory corruption issues. Do you know what the issue is?

@btracey
Copy link
Member Author

btracey commented Sep 6, 2015

PTAL @kortschak

@kortschak
Copy link
Member

Yay! I don't know what I did, but the code above (edited now) does cause a memory corruption failure:

$ cat dlantr-fail.c 
#include <stdio.h>
#include <lapacke.h>

int row_major = 101;

int main() {
    int norm='I', uplo='L', diag='U', m=3, n=5, lda=5;
    double a[15]= {
        1.2904273494935299, -0.09363912952772585, 0.2666718270372507, -1.529106629898684, -0.2552732603463197,
        0.18532547931159815, -0.9524750588974129, 0.7076464220040795, -0.8807825536566501, 1.1120190482489702,
        -1.6488099453520273, 0.8141133091087833, 1.0845230792403764, 0.4997975031933075, 0.004918788535355434
    };

    double res = LAPACKE_dlantr(row_major, norm, uplo, diag, m, n, a, lda);
    printf("dlantr res=%f\n", res);
}
$ gcc dlantr-fail.c -o dlantr -L/usr/local -lopenblas
$ ./dlantr 
*** Error in `./dlantr': double free or corruption (out): 0x00000000024252b0 ***
Aborted (core dumped)
~/Development/OpenBLAS [develop*]$ git rev-parse HEAD
40a3fed6b80523edc21449cee763bc5528a96cb2

Filing with OpenBLAS.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use got and want here - when debugging and the world is uncertain, it makes life easier.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@kortschak
Copy link
Member

I've tried the change at the OpenBLAS issue and when the tests are reinstated we get failures like this (added output):

dlantr.go:78: Norm mismatch. Norm = I, Diag = false, Uplo = false, m = 10, n = 5, lda = 11, Want 406, got 505.
dlantr.go:79: 
    ⎡  0    0    0    0    0    0    0    0    0    0    0⎤
    ⎢ 11   12    0    0    0    0    0    0    0    0    0⎥
    ⎢ 22   23   24    0    0    0    0    0    0    0    0⎥
    ⎢ 33   34   35   36    0    0    0    0    0    0    0⎥
    ⎢ 44   45   46   47   48    0    0    0    0    0    0⎥
    ⎢ 55   56   57   58   59    0    0    0    0    0    0⎥
    ⎢ 66   67   68   69   70    0    0    0    0    0    0⎥
    ⎢ 77   78   79   80   81    0    0    0    0    0    0⎥
    ⎢ 88   89   90   91   92    0    0    0    0    0    0⎥
    ⎣ 99  100  101  102  103    0    0    0    0    0    0⎦
dlantr.go:78: Norm mismatch. Norm = I, Diag = true, Uplo = false, m = 10, n = 5, lda = 5, Want 87, got 235.
dlantr.go:79: 
    ⎡ 1   0   0   0   0⎤
    ⎢ 5   1   0   0   0⎥
    ⎢10  11   1   0   0⎥
    ⎢15  16  17   1   0⎥
    ⎢20  21  22  23   1⎥
    ⎢25  26  27  28  29⎥
    ⎢30  31  32  33  34⎥
    ⎢35  36  37  38  39⎥
    ⎢40  41  42  43  44⎥
    ⎣45  46  47  48  49⎦
dlantr.go:78: Norm mismatch. Norm = I, Diag = true, Uplo = false, m = 10, n = 5, lda = 11, Want 183, got 505.
dlantr.go:79: 
    ⎡  1    0    0    0    0    0    0    0    0    0    0⎤
    ⎢ 11    1    0    0    0    0    0    0    0    0    0⎥
    ⎢ 22   23    1    0    0    0    0    0    0    0    0⎥
    ⎢ 33   34   35    1    0    0    0    0    0    0    0⎥
    ⎢ 44   45   46   47    1    0    0    0    0    0    0⎥
    ⎢ 55   56   57   58   59    0    0    0    0    0    0⎥
    ⎢ 66   67   68   69   70    0    0    0    0    0    0⎥
    ⎢ 77   78   79   80   81    0    0    0    0    0    0⎥
    ⎢ 88   89   90   91   92    0    0    0    0    0    0⎥
    ⎣ 99  100  101  102  103    0    0    0    0    0    0⎦

Want is wrong.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Split the parameters onto a new line. Also, change Norm = %s -> ...=%c and drop the string conversion, make Diag->unitdiag and Uplo->upper.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@btracey
Copy link
Member Author

btracey commented Sep 6, 2015

That's really weird. For the last case I get the same answer as you do. However, if you change the order of computation (of got and want), the want answer changes (though still wrong). Even weirder is that when I change DlangeTest to contain effectively the same matrix (though the zeros are populated), the answer is correctly computed to be 505.

@kortschak
Copy link
Member

Yes, I'm not very happy with the situation right now - there is too much uncertainty in a wide variety of parameters to be able to know what is going on.

@btracey
Copy link
Member Author

btracey commented Sep 6, 2015

Well, on the bright side, I don't think mat64 should have to call this directly. It will instead call Dtrcon (etc.) directly which are hopefully working in cgo.

@kortschak
Copy link
Member

Are you confident (via hand crafted cases) that Dlange and Dlantr in native are OK?

@btracey
Copy link
Member Author

btracey commented Sep 7, 2015

Dlantr is compared with Dlange. Over many cases (I ran with trials = 10,000) Dlantr = Dlange. Thus, I think if Dlange is right, Dlantr is right. The Dlange answer is compared with an alternate coding of the same value, and it matches. Additionally, I have a version of Dgecon implemented and tested. Dgecon uses Dlange, and in a few hand-coded trials the answer is the same.

@kortschak
Copy link
Member

OK.

@btracey
Copy link
Member Author

btracey commented Sep 7, 2015

Also, the plan is to test Dgecon against cgo using a fuzzer given the difficulty of testing some of the other subroutines. That should find any errors.

@kortschak
Copy link
Member

I'll have a look at the code proper later today.

@kortschak
Copy link
Member

Here are current failing cases (I have a fix for the LAPACKE_dlantr issue I think) and they appear to be due to Dlange:

calculating Dlange second:

--- FAIL: TestDlantr (0.00s)
    dlantr.go:79: Norm mismatch. norm = M, unitdiag = false, upper = true, m = 3, n = 5, lda = 5, Want 100, got 14.
    dlantr.go:80: 
        ⎡ 0   1   2   3   4⎤
        ⎢ 0   6   7   8   9⎥
        ⎣ 0   0  12  13  14⎦
    dlantr.go:79: Norm mismatch. norm = M, unitdiag = false, upper = true, m = 5, n = 10, lda = 11, Want 48, got 53.
    dlantr.go:80: 
        ⎡ 0   1   2   3   4   5   6   7   8   9⎤
        ⎢ 0  12  13  14  15  16  17  18  19  20⎥
        ⎢ 0   0  24  25  26  27  28  29  30  31⎥
        ⎢ 0   0   0  36  37  38  39  40  41  42⎥
        ⎣ 0   0   0   0  48  49  50  51  52  53⎦
    dlantr.go:79: Norm mismatch. norm = M, unitdiag = true, upper = true, m = 3, n = 5, lda = 5, Want 100, got 14.
    dlantr.go:80: 
        ⎡ 1   1   2   3   4⎤
        ⎢ 0   1   7   8   9⎥
        ⎣ 0   0   1  13  14⎦
    dlantr.go:79: Norm mismatch. norm = M, unitdiag = true, upper = true, m = 5, n = 10, lda = 11, Want 37, got 53.
    dlantr.go:80: 
        ⎡ 1   1   2   3   4   5   6   7   8   9⎤
        ⎢ 0   1  13  14  15  16  17  18  19  20⎥
        ⎢ 0   0   1  25  26  27  28  29  30  31⎥
        ⎢ 0   0   0   1  37  38  39  40  41  42⎥
        ⎣ 0   0   0   0   1  49  50  51  52  53⎦
    dlantr.go:79: Norm mismatch. norm = O, unitdiag = false, upper = true, m = 3, n = 5, lda = 5, Want 105, got 27.
    dlantr.go:80: 
        ⎡ 0   1   2   3   4⎤
        ⎢ 0   6   7   8   9⎥
        ⎣ 0   0  12  13  14⎦
    dlantr.go:79: Norm mismatch. norm = O, unitdiag = false, upper = true, m = 5, n = 10, lda = 11, Want 130, got 155.
    dlantr.go:80: 
        ⎡ 0   1   2   3   4   5   6   7   8   9⎤
        ⎢ 0  12  13  14  15  16  17  18  19  20⎥
        ⎢ 0   0  24  25  26  27  28  29  30  31⎥
        ⎢ 0   0   0  36  37  38  39  40  41  42⎥
        ⎣ 0   0   0   0  48  49  50  51  52  53⎦
    dlantr.go:79: Norm mismatch. norm = O, unitdiag = true, upper = true, m = 3, n = 5, lda = 5, Want 100, got 27.
    dlantr.go:80: 
        ⎡ 1   1   2   3   4⎤
        ⎢ 0   1   7   8   9⎥
        ⎣ 0   0   1  13  14⎦
    dlantr.go:79: Norm mismatch. norm = O, unitdiag = true, upper = true, m = 5, n = 10, lda = 11, Want 83, got 155.
    dlantr.go:80: 
        ⎡ 1   1   2   3   4   5   6   7   8   9⎤
        ⎢ 0   1  13  14  15  16  17  18  19  20⎥
        ⎢ 0   0   1  25  26  27  28  29  30  31⎥
        ⎢ 0   0   0   1  37  38  39  40  41  42⎥
        ⎣ 0   0   0   0   1  49  50  51  52  53⎦
    dlantr.go:79: Norm mismatch. norm = I, unitdiag = false, upper = true, m = 3, n = 5, lda = 5, Want 127, got 39.
    dlantr.go:80: 
        ⎡ 0   1   2   3   4⎤
        ⎢ 0   6   7   8   9⎥
        ⎣ 0   0  12  13  14⎦
    dlantr.go:79: Norm mismatch. norm = I, unitdiag = false, upper = true, m = 5, n = 10, lda = 11, Want 110, got 303.
    dlantr.go:80: 
        ⎡ 0   1   2   3   4   5   6   7   8   9⎤
        ⎢ 0  12  13  14  15  16  17  18  19  20⎥
        ⎢ 0   0  24  25  26  27  28  29  30  31⎥
        ⎢ 0   0   0  36  37  38  39  40  41  42⎥
        ⎣ 0   0   0   0  48  49  50  51  52  53⎦
    dlantr.go:79: Norm mismatch. norm = I, unitdiag = true, upper = true, m = 3, n = 5, lda = 5, Want 105, got 28.
    dlantr.go:80: 
        ⎡ 1   1   2   3   4⎤
        ⎢ 0   1   7   8   9⎥
        ⎣ 0   0   1  13  14⎦
    dlantr.go:79: Norm mismatch. norm = I, unitdiag = true, upper = true, m = 5, n = 10, lda = 11, Want 79, got 256.
    dlantr.go:80: 
        ⎡ 1   1   2   3   4   5   6   7   8   9⎤
        ⎢ 0   1  13  14  15  16  17  18  19  20⎥
        ⎢ 0   0   1  25  26  27  28  29  30  31⎥
        ⎢ 0   0   0   1  37  38  39  40  41  42⎥
        ⎣ 0   0   0   0   1  49  50  51  52  53⎦
    dlantr.go:79: Norm mismatch. norm = F, unitdiag = false, upper = true, m = 3, n = 5, lda = 5, Want 118.95797577295943, got 27.730849247724095.
    dlantr.go:80: 
        ⎡ 0   1   2   3   4⎤
        ⎢ 0   6   7   8   9⎥
        ⎣ 0   0  12  13  14⎦
    dlantr.go:79: Norm mismatch. norm = F, unitdiag = false, upper = true, m = 5, n = 10, lda = 11, Want 96.98453484963467, got 186.37328134687118.
    dlantr.go:80: 
        ⎡ 0   1   2   3   4   5   6   7   8   9⎤
        ⎢ 0  12  13  14  15  16  17  18  19  20⎥
        ⎢ 0   0  24  25  26  27  28  29  30  31⎥
        ⎢ 0   0   0  36  37  38  39  40  41  42⎥
        ⎣ 0   0   0   0  48  49  50  51  52  53⎦
    dlantr.go:79: Norm mismatch. norm = F, unitdiag = true, upper = true, m = 3, n = 5, lda = 5, Want 115.75404960518661, got 24.331050121192877.
    dlantr.go:80: 
        ⎡ 1   1   2   3   4⎤
        ⎢ 0   1   7   8   9⎥
        ⎣ 0   0   1  13  14⎦
    dlantr.go:79: Norm mismatch. norm = F, unitdiag = true, upper = true, m = 5, n = 10, lda = 11, Want 64.7533782902483, got 174.41330224498358.
    dlantr.go:80: 
        ⎡ 1   1   2   3   4   5   6   7   8   9⎤
        ⎢ 0   1  13  14  15  16  17  18  19  20⎥
        ⎢ 0   0   1  25  26  27  28  29  30  31⎥
        ⎢ 0   0   0   1  37  38  39  40  41  42⎥
        ⎣ 0   0   0   0   1  49  50  51  52  53⎦

and now calculating Dlange first:

--- FAIL: TestDlantr (0.00s)
    dlantr.go:79: Norm mismatch. norm = I, unitdiag = false, upper = true, m = 5, n = 10, lda = 11, Want 252, got 303.
    dlantr.go:80: 
        ⎡ 0   1   2   3   4   5   6   7   8   9⎤
        ⎢ 0  12  13  14  15  16  17  18  19  20⎥
        ⎢ 0   0  24  25  26  27  28  29  30  31⎥
        ⎢ 0   0   0  36  37  38  39  40  41  42⎥
        ⎣ 0   0   0   0  48  49  50  51  52  53⎦
    dlantr.go:79: Norm mismatch. norm = I, unitdiag = true, upper = true, m = 5, n = 10, lda = 11, Want 229, got 256.
    dlantr.go:80: 
        ⎡ 1   1   2   3   4   5   6   7   8   9⎤
        ⎢ 0   1  13  14  15  16  17  18  19  20⎥
        ⎢ 0   0   1  25  26  27  28  29  30  31⎥
        ⎢ 0   0   0   1  37  38  39  40  41  42⎥
        ⎣ 0   0   0   0   1  49  50  51  52  53⎦

Independently allocating a zeroed work for each call gives the second case.

LAPACK_dlange is wrong, and in a way that depends on work, but not entirely.

I'll let you file this one with NETLIB, @btracey.

@btracey
Copy link
Member Author

btracey commented Sep 7, 2015

@btracey
Copy link
Member Author

btracey commented Sep 7, 2015

The Go Dlange results seem accurate?

@kortschak
Copy link
Member

It never spits out any bad things according to your tests which seem OK to me. I'll make a comparison against cgo.

OK. Where they disagree, native is correct.

Correction, they agree entirely (the previous was with the LAPACKE_dlantr fixes and some changes in LAPACKE_dlange that I was playing with - the dlantr changes don't alter this). Now I'm even more confused.

@btracey
Copy link
Member Author

btracey commented Sep 7, 2015

Excellent!

@kortschak
Copy link
Member

Mmmm. Ish. I'm glad our things are good.

For people coming to look, the diff I made to LAPACKE to get dlantr to work is:

diff --git a/lapack-netlib/lapacke/src/lapacke_dlantr.c b/lapack-netlib/lapacke/src/lapacke_dlantr.c
index 522122c..2cde1eb 100644
--- a/lapack-netlib/lapacke/src/lapacke_dlantr.c
+++ b/lapack-netlib/lapacke/src/lapacke_dlantr.c
@@ -53,7 +53,7 @@ double LAPACKE_dlantr( int matrix_order, char norm, char uplo, char diag,
     /* Allocate memory for working array(s) */
     if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
         LAPACKE_lsame( norm, '0' ) ) {
-        work = (double*)LAPACKE_malloc( sizeof(double) * MAX(1,m) );
+        work = (double*)LAPACKE_malloc( sizeof(double) * MAX(1,MAX(m,n)) );
         if( work == NULL ) {
             info = LAPACK_WORK_MEMORY_ERROR;
             goto exit_level_0;
diff --git a/lapack-netlib/lapacke/src/lapacke_dlantr_work.c b/lapack-netlib/lapacke/src/lapacke_dlantr_work.c
index 0a937bd..169f85e 100644
--- a/lapack-netlib/lapacke/src/lapacke_dlantr_work.c
+++ b/lapack-netlib/lapacke/src/lapacke_dlantr_work.c
@@ -46,7 +46,7 @@ double LAPACKE_dlantr_work( int matrix_order, char norm, char uplo,
             info = info - 1;
         }
     } else if( matrix_order == LAPACK_ROW_MAJOR ) {
-        lapack_int lda_t = MAX(1,n);
+        lapack_int lda_t = MAX(1,m);
         double* a_t = NULL;
         /* Check leading dimension(s) */
         if( lda < n ) {
@@ -55,13 +55,13 @@ double LAPACKE_dlantr_work( int matrix_order, char norm, char uplo,
             return info;
         }
         /* Allocate memory for temporary array(s) */
-        a_t = (double*)LAPACKE_malloc( sizeof(double) * lda_t * MAX(1,n) );
+        a_t = (double*)LAPACKE_malloc( sizeof(double) * lda_t * MAX(1,MAX(m,n)) );
         if( a_t == NULL ) {
             info = LAPACK_TRANSPOSE_MEMORY_ERROR;
             goto exit_level_0;
         }
         /* Transpose input matrices */
-        LAPACKE_dtr_trans( matrix_order, uplo, diag, n, a, lda, a_t, lda_t );
+        LAPACKE_dtr_trans( matrix_order, uplo, diag, m, a, lda, a_t, lda_t );
         /* Call LAPACK function and adjust info */
         res = LAPACK_dlantr( &norm, &uplo, &diag, &m, &n, a_t, &lda_t, work );
         info = 0;  /* LAPACK call is ok! */

This accords with some of the code in LAPACKE_dlange (lda_t = MAX(1,m) for example), but I can't get dlange to function correctly by mimicking what I've done here.

It seems that the malloc size should not need to be lda_t * MAX(1,m,n), MAX(1,n) should be enough, but it do; memory corruption otherwise.

@kortschak
Copy link
Member

If the call to LAPACKE_dtr_trans is made with MAX(m,n) instead of m or n. Success.

@kortschak
Copy link
Member

Demonstration of success: https://github.com/gonum/lapack/tree/lapacke-dlantr-fixed

Interestingly the cgo tests can take much longer than the native tests (sometime failing to finish within the time-out).

@btracey
Copy link
Member Author

btracey commented Sep 8, 2015

Does it look good?

@kortschak
Copy link
Member

Sorry, caught up in $JOB. Meetings until this afternoon.

@btracey
Copy link
Member Author

btracey commented Sep 8, 2015

Mo $$ mo problems
On Sep 7, 2015 8:00 PM, "Dan Kortschak" notifications@github.com wrote:

Sorry, caught up in $JOB. Meetings until this afternoon.


Reply to this email directly or view it on GitHub
#39 (comment).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to have this before the other switch on norm? It seems you can roll a whole heap of logic into one switch if not. I guess the only problem is you want to do these checks before the min(m, n) == 0 test.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason is to make the comparison with cgo easier. The panic checks should be the same in both, and this way the code "preamble" can be the same.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.

@kortschak
Copy link
Member

LGTM with minor comments and trepidation because of the weirdness relating to col->row major translation of the fortran. The tests passing and all the stuff I looked at during the LAPACKE_dlantr debugging also helps with confidence.

btracey added a commit that referenced this pull request Sep 8, 2015
@btracey btracey merged commit 7ea69c9 into master Sep 8, 2015
@btracey btracey deleted the adddlantr branch September 8, 2015 15:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants