Repository navigation
Conversation
The LWORK description was copied from xGESVDX and asks for less than the routines check for, so a caller who passes the documented minimum gets INFO = -19. State the minimum the code enforces: for the real routines 8*MIN(M,N)**2 + 43*MIN(M,N) on paths 1 and 1t and MAX(7*MIN(M,N)**2 + 42*MIN(M,N), 5*MIN(M,N)**2 + 27*MIN(M,N) + MAX(M,N)) on the others; for the complex routines MIN(M,N)*(MIN(M,N)+5) and 3*MIN(M,N) + MAX(M,N). Each needs only 1 when MIN(M,N) = 0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The four passes of the "minimal and adequate workspace" loop all
passed LWORK, so every matrix was tested four times with the same
input. The complex testers computed a workspace size from the ZGESVD
formula but never used it, and the real ones printed LSWORK without
setting it ("Symbol LSWORK referenced but never set" from nagfor).
ACSimon33
force-pushed
the
drvmr3-workspace-sizes
branch
from
October 22, 2026 08:16
58600b3 to
2d8786e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The
?drvmr3testers added in Reference-LAPACK#1361 run each matrix through a loop of four passes, commented "for minimal and adequate (for blocking) workspace". Every pass calledxGESVDMR3with the fullLWORK, though, so each matrix was tested four times with the same input, and smaller workspaces were never tested. The complex testers computed a workspace size from the ZGESVD formula but never passed it. The real testers printedLSWORKin their error message without ever setting it, which nagfor reports as "Symbol LSWORK referenced but never set".Additionally, the
LWORKdescription inxGESVDMR3was copied fromxGESVDXand asks for less than the routines check for, so a caller who passes the documented minimum getsINFO = -19:SGESVDMR3,DGESVDMR3MIN(M,N)*(MIN(M,N)+4)/8*MIN(M,N)**2 + 43*MIN(M,N)2*MIN(M,N)+MAX(M,N)/MAX(7*MIN(M,N)**2 + 42*MIN(M,N), 5*MIN(M,N)**2 + 27*MIN(M,N) + MAX(M,N))CGESVDMR3,ZGESVDMR3MIN(M,N)*(MIN(M,N)+4)/MIN(M,N)*(MIN(M,N)+5)2*MIN(M,N)+MAX(M,N)/3*MIN(M,N)+MAX(M,N)All four routines need only 1 when
MIN(M,N) = 0.Changes:
SRC/[sdcz]gesvdmr3.f: document the workspace the code enforces, as in the table. The code itself is unchanged.TESTING/EIG/[sdcz]drvmr3.f: compute the documented minimum for eachMandN. As in the routine,ILAENV( 6, 'xGESVD', ... )decides between path 1 and path 2. Over the four passes, stepLSWORKfrom that minimum up toLWORK, the same way?drvbddoes for the other SVD drivers. PassLSWORKto everyxGESVDMR3call.