Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a new constructor for all Krylov solvers #947

Merged
merged 11 commits into from
Jan 17, 2025

Conversation

amontoison
Copy link
Member

@amontoison amontoison commented Jan 14, 2025

close #948

Needed for CliMA/Oceananigans.jl#4041.
A more generic constructor for our KrylovSolvers is required to support custom vector types.
I was aware of this limitation, but addressing it requires significant work, as a new workspace constructor must be implemented manually for each Krylov solver.

To resolve the issue, I created a new constructor that takes a single argument (a KrylovConstructor or a BlockKrylovConstructor).
The KrylovConstructor encapsulates (custom) vectors on which we can apply similar to create the necessary workspace.

Since some Krylov solvers, such as least-squares and least-norm solvers, require vectors of varying lengths that cannot be determined / created solely from the right-hand side vector b, only the in-place version of the Krylov method can be used in such cases.
The corresponding KrylovSolver is created with a KrylovConstructor.

cc @michel2323

@amontoison amontoison marked this pull request as ready for review January 15, 2025 01:50
Copy link

codecov bot commented Jan 15, 2025

Codecov Report

Attention: Patch coverage is 99.24528% with 6 lines in your changes missing coverage. Please review.

Project coverage is 93.19%. Comparing base (9536ef7) to head (9baae40).
Report is 30 commits behind head on main.

Files with missing lines Patch % Lines
src/block_gmres.jl 0.00% 3 Missing ⚠️
src/block_krylov_solvers.jl 0.00% 2 Missing ⚠️
src/krylov_utils.jl 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #947      +/-   ##
==========================================
- Coverage   94.68%   93.19%   -1.49%     
==========================================
  Files          45       46       +1     
  Lines        8027     9181    +1154     
==========================================
+ Hits         7600     8556     +956     
- Misses        427      625     +198     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@amontoison amontoison merged commit a2ccdaf into JuliaSmoothOptimizers:main Jan 17, 2025
31 of 35 checks passed
@amontoison amontoison deleted the oceananigans branch January 17, 2025 19:00
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.

Test CGLS with shifts on rectangular systems
1 participant