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

Adds (S)SOR Preconditioner #1633

Merged
merged 7 commits into from
Oct 30, 2024
Merged

Adds (S)SOR Preconditioner #1633

merged 7 commits into from
Oct 30, 2024

Conversation

MarcelKoch
Copy link
Member

@MarcelKoch MarcelKoch commented Jun 27, 2024

This PR adds the core and reference implementation of a (S)SOR preconditioner. It uses triangular solves to apply the preconditioner. The preconditioner is either a single lower triangular solver, or a lower triangular solve followed by an upper triangular one. Thus the preconditioner is represented as a gko::Combination. The Sor class itself is only a linop factory, similar to the Lu factorization. It can be parameterized by the relaxation_factor (0 < w < 2), symmetric or not (sym version has the two triangular solves), and the solver factories for the upper and lower triangular matrices.

This also adds a Gauss-Seidel preconditioner as a special case of SOR.

Todo:

@MarcelKoch MarcelKoch self-assigned this Jun 27, 2024
@ginkgo-bot ginkgo-bot added reg:build This is related to the build system. reg:testing This is related to testing. mod:core This is related to the core module. mod:cuda This is related to the CUDA module. mod:reference This is related to the reference module. type:preconditioner This is related to the preconditioners mod:hip This is related to the HIP module. type:factorization This is related to the Factorizations labels Jun 27, 2024
@MarcelKoch MarcelKoch mentioned this pull request Jun 27, 2024
Copy link
Member

@yhmtsai yhmtsai left a comment

Choose a reason for hiding this comment

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

LGTM in general.
I am thinking of how to add the test for GaussSeidel in a cheap way or just do not test it, which calls SOR with relaxation 1

core/test/config/preconditioner.cpp Outdated Show resolved Hide resolved
core/test/config/preconditioner.cpp Show resolved Hide resolved
include/ginkgo/core/preconditioner/gauss_seidel.hpp Outdated Show resolved Hide resolved
include/ginkgo/core/preconditioner/gauss_seidel.hpp Outdated Show resolved Hide resolved
include/ginkgo/core/preconditioner/sor.hpp Outdated Show resolved Hide resolved
reference/preconditioner/sor_kernels.cpp Show resolved Hide resolved
core/preconditioner/sor.cpp Outdated Show resolved Hide resolved
reference/test/preconditioner/sor_kernels.cpp Outdated Show resolved Hide resolved
include/ginkgo/core/preconditioner/sor.hpp Show resolved Hide resolved
@MarcelKoch MarcelKoch requested a review from yhmtsai July 11, 2024 07:54
Copy link
Member

@yhmtsai yhmtsai left a comment

Choose a reason for hiding this comment

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

LGTM. The config test from registry is not yet there

@MarcelKoch MarcelKoch requested a review from a team August 13, 2024 13:53
@MarcelKoch MarcelKoch added the 1:ST:ready-for-review This PR is ready for review label Aug 15, 2024
@MarcelKoch MarcelKoch added this to the Ginkgo 1.9.0 milestone Aug 26, 2024
@MarcelKoch MarcelKoch requested review from a team and removed request for a team August 27, 2024 12:03
Copy link
Collaborator

@fritzgoebel fritzgoebel left a comment

Choose a reason for hiding this comment

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

LGTM, only a few small comments / questions.

Note: I did not look at the correctness of the config parsing.

Copy link
Collaborator

@fritzgoebel fritzgoebel left a comment

Choose a reason for hiding this comment

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

LGTM, only a few small comments / questions.

Note: I have not looked at the correctness of the config parsing.

Copy link

codecov bot commented Oct 28, 2024

Codecov Report

Attention: Patch coverage is 97.31183% with 10 lines in your changes missing coverage. Please review.

Project coverage is 90.33%. Comparing base (30c2d86) to head (4b83873).
Report is 9 commits behind head on develop.

Files with missing lines Patch % Lines
common/unified/preconditioner/sor_kernels.cpp 0.00% 4 Missing ⚠️
core/device_hooks/common_kernels.inc.cpp 0.00% 2 Missing ⚠️
include/ginkgo/core/preconditioner/sor.hpp 81.81% 2 Missing ⚠️
...nclude/ginkgo/core/preconditioner/gauss_seidel.hpp 90.00% 1 Missing ⚠️
reference/factorization/factorization_kernels.cpp 90.90% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1633      +/-   ##
===========================================
- Coverage    92.05%   90.33%   -1.73%     
===========================================
  Files          764      776      +12     
  Lines        62678    63228     +550     
===========================================
- Hits         57701    57116     -585     
- Misses        4977     6112    +1135     

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

MarcelKoch and others added 3 commits October 29, 2024 17:51
- documentation
- tests
- don't build upper solver if not symmetric

Co-authored-by: Yu-Hsiang M. Tsai <[email protected]>
Copy link

sonarcloud bot commented Oct 29, 2024

@MarcelKoch MarcelKoch merged commit 53c9fac into develop Oct 30, 2024
11 of 14 checks passed
@MarcelKoch MarcelKoch deleted the sor branch October 30, 2024 07:32
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. 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:build This is related to the build system. reg:testing This is related to testing. type:factorization This is related to the Factorizations type:preconditioner This is related to the preconditioners
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants