Date: Tue, 21 Jul 2009 09:28:36 -0600 From: Michael Chuvelev To: "lapack@cs.utk.edu" Cc: Greg Henry, Alexander Kobotov Subject: [Lapack] Bug in LAPACK 3.2 dlarfb.f and likes Hello, I've found a bug in dlarfb.f recently, it can be revealed by dorgql blocked algorithm, for instance. I suspect the ordinal tests don't catch it because too high crosspoint is set in ilaenv.f NX=128. To catch the bug: 1) set less crosspoint in line 462 of ilaenv.f, for instance, NX=0 2) compile the testcase attached, 3) use the input data attached You will have non-orthogonal vectors on the output. dlarfb.f has been changed to reduce the number of reflectors needed to be applied, but it turns out sometimes we miss the last reflector to be applied. The newly introduced function iladlr detects last non-zero row, but in dlarfb we don't pay attention to the fact that the elementary reflectors v v v v v v v v v 1 v v 1 v 1 could be kept along with a zero diagonal: v v v v v v v v v 0 v v 0 v 0 which in fact reduce the number of reflectors to be applied, that is we miss the last one. I find the following logic appropriate in this case: substituting line 260 in dlarfb.f > LASTV = MAX( K, ILADLR( M, K, V, LDV ) ) by the line < LASTV = MAX( K, ILADLC( M, K, V, LDV ) )+M-K The original LASTV initialization is wrong. Best regards, Michael. ==================================================================================================== Date: Tue, 21 Jul 2009 14:51:14 -0600 Subject: Re: [Lapack] Bug in LAPACK 3.2 dlarfb.f and likes Hello Michael, Thanks a lot for the bug report. We have reproduced all your sayings: your test code flags an error for NX from 0, 1, 2, up to N more or less, your fix to DLARFB fixes the problem. We observe this for lapack-3.2.1 and for our lapack in svn. We need a little a bit of time to get through the code and understand the fix. One thing that bothers us is that DCKKQR did not catch the problem. (Note: we do text for various NB and NX in our test suite through setting the value with XLAENV and then using a fake ILAENV). So, all this to say, that we will come back to your shortly on this one. Best wishes, Julie and Julien ==================================================================================================== Date: Wed, 22 Jul 2009 03:32:44 -0600 Subject: Re: [Lapack] Bug in LAPACK 3.2 dlarfb.f and likes Julie, I see the problem here that we'd like to check the number of first zero rows in matrix V if DIRECT='B', STOREV='C', rather than last to reduce computations, but there's no special auxiliary routine for that. Best regards, Michael. ====================================================================================================