Incorrectly documented workspace in ZGESDD

Open discussion regarding features, bugs, issues, vendors, etc.

Incorrectly documented workspace in ZGESDD

Postby zibi14 » Mon Mar 15, 2010 9:12 pm

In ZGESDD it is documented that the workspace size required by RWORK is 5*min(M,N)*min(M,N) + 7*min(M,N), if JOBZ is not 'N'. But looking at the code at line 1745:

Code: Select all
               CALL ZLARCM( M, N, RWORK( IRVT ), M, VT, LDVT, A, LDA,
     $                      RWORK( NRWORK ) )

we see that this is incorrect because RWORK in ZLARCM requires workspace of size 2*M*N and the larger dimension is not put in the formula. Since NRWORK = 2*N*N+N (assuming that N <= M) we get that the required workspace for RWORK is at least 2*N*(M+N) + N which is larger than 5*N*N+7*N for sufficiently large M.

I found out that something was wrong in this subroutine when I consistently was getting segmentation error working with the documented size of RWORK.

Zbigniew
zibi14
 
Posts: 9
Joined: Tue Jan 30, 2007 6:57 pm
Location: College Station, Texas

Re: Incorrectly documented workspace in ZGESDD

Postby admin » Thu Mar 18, 2010 1:15 pm

Indeed, this is a known bug, and it is currently fix but not yet released.
See http://www.netlib.org/lapack/Errata/
[quote](*) bug0021 :: in DGESDD, workspace query gives a value smaller than the minimal value given in the header to run the routine[quote]
Thank you for the report
Julie
admin
Site Admin
 
Posts: 501
Joined: Wed Dec 08, 2004 7:07 pm

Re: Incorrectly documented workspace in ZGESDD

Postby zibi14 » Thu Mar 18, 2010 2:01 pm

But I wrote about ZGESDD not DGESDD. I read the message about DGESDD but it does not seem to be the same problem although I agree that it is similar.

Zbigniew
zibi14
 
Posts: 9
Joined: Tue Jan 30, 2007 6:57 pm
Location: College Station, Texas

Re: Incorrectly documented workspace in ZGESDD

Postby zibi14 » Thu Mar 18, 2010 2:16 pm

Maybe I should have been more specific. The incorrect workspace in ZGESDD is for RWORK, not WORK (as is in DGESDD). But I agree that the proposed corrected formula may work in this case. By the way, I used the following formula in this case for ZGESDD:
Code: Select all
min(M,N) * max(5*min(M,N)+7, 2*max(M,N)+2*min(M,N)+1)

and it seems to be OK (this is, I do not get any segmentation faults).

Zbigniew
zibi14
 
Posts: 9
Joined: Tue Jan 30, 2007 6:57 pm
Location: College Station, Texas

Re: Incorrectly documented workspace in ZGESDD

Postby admin » Thu Mar 18, 2010 2:26 pm

The workspace is a headache in that routine...
I am going to commit your change as it seems like a wise change, and it makes sense also to me.
Thank you
Julie
admin
Site Admin
 
Posts: 501
Joined: Wed Dec 08, 2004 7:07 pm

Re: Incorrectly documented workspace in ZGESDD

Postby admin » Thu Mar 18, 2010 2:37 pm

The correction has been included as revision 729. It will be release in 3.2.2.
The Errata has been updated as well see http://www.netlib.org/lapack/Errata/, bug 0046
Thank you very much for the bug report
Julie
admin
Site Admin
 
Posts: 501
Joined: Wed Dec 08, 2004 7:07 pm


Return to User Discussion

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests