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

Minres solver #975

Merged
merged 3 commits into from
Mar 3, 2025
Merged

Minres solver #975

merged 3 commits into from
Mar 3, 2025

Conversation

MarcelKoch
Copy link
Member

@MarcelKoch MarcelKoch commented Feb 22, 2022

This PR will add a Minres solver for symmetric/hermitian indefinite matrices. The implementation is based in the book 'Iterative Methods for Solving Linear Systems' (Ch. 8) by Anne Greenbaum (DOI: https://doi.org/10.1137/1.9781611970937). It uses the common kernel interface to define kernels.

One uncertainty for me is the computation of the residual norm approximation. I'm using the approach from Iterative Methods for Singular Linear Equations and Least-Squares Problems, but somehow this does not define the initial value for the used recursion. The three possible values are beta = sqrt(<r, z>), ||r|| or ||z||. I'm currently using ||z||, since I could also find that used by petsc. I've compared these three in matlab for smaller matrices, and the difference between these does not seem to matter.

Todo:

@MarcelKoch MarcelKoch added is:new-feature A request or implementation of a feature that does not exist yet. type:solver This is related to the solvers 1:ST:ready-for-review This PR is ready for review mod:all This touches all Ginkgo modules. labels Feb 22, 2022
@MarcelKoch MarcelKoch added this to the Ginkgo 1.5.0 milestone Feb 22, 2022
@MarcelKoch MarcelKoch self-assigned this Feb 22, 2022
@ginkgo-bot ginkgo-bot added mod:core This is related to the core module. mod:cuda This is related to the CUDA module. mod:hip This is related to the HIP module. mod:reference This is related to the reference module. reg:benchmarking This is related to benchmarking. reg:build This is related to the build system. reg:testing This is related to testing. labels Feb 22, 2022
@MarcelKoch
Copy link
Member Author

format-rebase!

@ginkgo-bot
Copy link
Member

Error: Rebase failed, see the related Action for details

@MarcelKoch
Copy link
Member Author

format!

@MarcelKoch MarcelKoch force-pushed the minres-solver branch 4 times, most recently from 26a67da to ae95b88 Compare February 23, 2022 08:56
@MarcelKoch MarcelKoch requested a review from a team February 23, 2022 08:57
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 1 Security Hotspot
Code Smell B 160 Code Smells

72.8% 72.8% Coverage
13.0% 13.0% Duplication

@codecov
Copy link

codecov bot commented Feb 23, 2022

Codecov Report

Attention: Patch coverage is 93.65672% with 34 lines in your changes missing coverage. Please review.

Project coverage is 89.50%. Comparing base (7404a82) to head (56c758b).
Report is 4 commits behind head on develop.

Files with missing lines Patch % Lines
core/solver/minres.cpp 81.74% 23 Missing ⚠️
common/unified/solver/minres_kernels.cpp 88.37% 5 Missing ⚠️
core/device_hooks/common_kernels.inc.cpp 0.00% 3 Missing ⚠️
reference/solver/minres_kernels.cpp 96.42% 2 Missing ⚠️
reference/test/solver/minres_kernels.cpp 99.37% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #975      +/-   ##
===========================================
+ Coverage    89.23%   89.50%   +0.27%     
===========================================
  Files          818      824       +6     
  Lines        68082    68588     +506     
===========================================
+ Hits         60753    61391     +638     
+ Misses        7329     7197     -132     

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

"A comma-separated list of solvers to run. "
"Supported values are: bicgstab, bicg, cb_gmres_keep, "
"cb_gmres_reduce1, cb_gmres_reduce2, cb_gmres_integer, "
"cb_gmres_ireduce1, cb_gmres_ireduce2, cg, cgs, fcg, minres, gmres, idr, "
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we try to use alphabetical order here, or?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I guess I wasn't paying attention.

@upsj upsj self-requested a review March 17, 2022 11:12
@Slaedr Slaedr self-requested a review March 17, 2022 11:12
@upsj upsj removed this from the Ginkgo 1.5.0 milestone Apr 20, 2022
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 1 Security Hotspot
Code Smell B 154 Code Smells

75.5% 75.5% Coverage
6.2% 6.2% Duplication

@MarcelKoch MarcelKoch added 1:ST:ready-for-review This PR is ready for review and removed 1:ST:WIP This PR is a work in progress. Not ready for review. labels Dec 15, 2023
@MarcelKoch MarcelKoch requested a review from a team December 15, 2023 08:52
@MarcelKoch MarcelKoch force-pushed the minres-solver branch 4 times, most recently from 777448c to 7e34ec9 Compare December 15, 2023 11:03
@MarcelKoch MarcelKoch added this to the Ginkgo 1.9.0 milestone Aug 26, 2024
@MarcelKoch MarcelKoch modified the milestones: Ginkgo 1.9.0, Ginkgo 1.10.0 Dec 9, 2024
@MarcelKoch MarcelKoch requested a review from venkovic February 13, 2025 13:26
Copy link
Member

@thoasm thoasm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to see a mention of the used algorithm in the header description as well (the details can remain in the CPP file).
The rest looks good; my other comments are primarily nits.
Note: This review was done together with @nvenko, so consider our two reviews as one.

Copy link
Contributor

@venkovic venkovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The two used bibliographic references can be added in the minres header file. Also, the namespace should be corrected in the minres_kernels header file, from cg to minres.

Copy link
Member

@thoasm thoasm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@MarcelKoch MarcelKoch force-pushed the minres-solver branch 2 times, most recently from ea61fcd to 8b54622 Compare February 28, 2025 15:10
MarcelKoch and others added 3 commits February 28, 2025 16:14
based on 'Iterative Methods for Solving Linear Systems' (https://doi.org/10.1137/1.9781611970937) and 'Iterative Methods for Singular Linear Equations and Least-Squares Problems' (PhD thesis, Stanford University)

Co-authored-by: Aditya Kashi <[email protected]>
Co-authored-by: Hartwig Anzt <[email protected]>
Signed-off-by: Marcel Koch <[email protected]>
- documentation
- missing tests
- refactor

Co-authored-by: Thomas Grützmacher <[email protected]>
Co-authored-by: nvenko <[email protected]>
Signed-off-by: Marcel Koch <[email protected]>
@MarcelKoch MarcelKoch added 1:ST:ready-to-merge This PR is ready to merge. and removed 1:ST:ready-for-review This PR is ready for review labels Feb 28, 2025
@MarcelKoch MarcelKoch merged commit 858bbea into develop Mar 3, 2025
13 of 14 checks passed
@MarcelKoch MarcelKoch deleted the minres-solver branch March 3, 2025 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1:ST:ready-to-merge This PR is ready to merge. is:new-feature A request or implementation of a feature that does not exist yet. mod:all This touches all Ginkgo modules. mod:core This is related to the core module. mod:cuda This is related to the CUDA module. mod:hip This is related to the HIP module. mod:reference This is related to the reference module. reg:benchmarking This is related to benchmarking. reg:build This is related to the build system. reg:testing This is related to testing. type:solver This is related to the solvers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants