Skip to content

?drvmr3 workspace sizes - #1439

Merged
langou merged 2 commits into
masterfrom
drvmr3-workspace-sizes
Oct 23, 2026
Merged

langou merged 2 commits into
masterfrom
drvmr3-workspace-sizes

Conversation

@ACSimon33

Copy link
Copy Markdown
Collaborator

Description

The ?drvmr3 testers added in #1361 run each matrix through a loop of four passes, commented "for minimal and adequate (for blocking) workspace". Every pass called xGESVDMR3 with the full LWORK, 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 printed LSWORK in their error message without ever setting it, which nagfor reports as "Symbol LSWORK referenced but never set".

Additionally, the LWORK description in xGESVDMR3 was copied from xGESVDX and asks for less than the routines check for, so a caller who passes the documented minimum gets INFO = -19:

Routine Paths 1 and 1t, documented / enforced Other paths, documented / enforced
SGESVDMR3, DGESVDMR3 MIN(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, ZGESVDMR3 MIN(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 each M and N. As in the routine, ILAENV( 6, 'xGESVD', ... ) decides between path 1 and path 2. Over the four passes, step LSWORK from that minimum up to LWORK, the same way ?drvbd does for the other SVD drivers. Pass LSWORK to every xGESVDMR3 call.

@codecov

codecov Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.70%. Comparing base (1f523db) to head (58600b3).

⚠️ Current head 58600b3 differs from pull request most recent head 2d8786e

Please upload reports for the commit 2d8786e to get more accurate results.
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1439   +/-   ##
=======================================
  Coverage   69.70%   69.70%           
=======================================
  Files        6200     6200           
  Lines      497033   497065   +32     
  Branches    23426    23426           
=======================================
+ Hits       346455   346486   +31     
  Misses     150155   150155           
- Partials      423      424    +1     
Components Coverage Δ
BLAS 99.73% <ø> (-0.03%) ⬇️
CBLAS 96.98% <ø> (ø)
LAPACK 82.63% <ø> (+<0.01%) ⬆️
LAPACKE 2.15% <ø> (ø)
TMGLIB 55.69% <ø> (ø)
BLAS testing 88.77% <ø> (ø)
CBLAS testing 89.63% <ø> (ø)
LAPACK testing 82.25% <100.00%> (+<0.01%) ⬆️
LAPACKE testing ∅ <ø> (∅)
Files with missing lines Coverage Δ
SRC/cgesvdmr3.f 95.33% <ø> (ø)
SRC/dgesvdmr3.f 95.19% <ø> (ø)
SRC/sgesvdmr3.f 95.19% <ø> (ø)
SRC/zgesvdmr3.f 95.33% <ø> (ø)
TESTING/EIG/cdrvmr3.f 82.25% <100.00%> (+0.36%) ⬆️
TESTING/EIG/ddrvmr3.f 82.01% <100.00%> (+0.91%) ⬆️
TESTING/EIG/sdrvmr3.f 82.01% <100.00%> (+0.91%) ⬆️
TESTING/EIG/zdrvmr3.f 82.25% <100.00%> (+0.36%) ⬆️

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1f523db...2d8786e. Read the comment docs.

ACSimon33 and others added 2 commits October 22, 2026 10:10
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
ACSimon33 force-pushed the drvmr3-workspace-sizes branch from 58600b3 to 2d8786e Compare October 22, 2026 08:16
@langou
langou merged commit 50834f6 into master Oct 23, 2026
47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants