Skip to content

Allow to use ValueType in template of preconditioner ILU #1828

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

Merged
merged 7 commits into from
May 11, 2025

Conversation

yhmtsai
Copy link
Member

@yhmtsai yhmtsai commented Apr 15, 2025

This PR is the ILU part of #1811 .
As it contains LSolver and USolver, user will need to use <ValueType, ValueType, ...> unfortunately
User can use <ValueType> now.
Also, it brings back the default l_solver in IC, which gives the LowerTrs<value_type, index_type> like original one.

@yhmtsai yhmtsai requested review from upsj and MarcelKoch April 15, 2025 16:32
@yhmtsai yhmtsai self-assigned this Apr 15, 2025
@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:reference This is related to the reference module. type:preconditioner This is related to the preconditioners labels Apr 15, 2025
@yhmtsai yhmtsai force-pushed the ic_ilu_with_linop branch from f70c7b6 to 71e45e6 Compare April 16, 2025 07:08
@yhmtsai yhmtsai force-pushed the ic_ilu_with_linop branch from 2b7c086 to 3bc88de Compare April 24, 2025 15:56
@yhmtsai yhmtsai added the 1:ST:ready-for-review This PR is ready for review label Apr 24, 2025
@yhmtsai yhmtsai force-pushed the ic_ilu_with_linop branch from 3bc88de to e09c3a9 Compare April 24, 2025 16:20
@MarcelKoch MarcelKoch added this to the Ginkgo 1.10.0 milestone May 6, 2025
@yhmtsai yhmtsai force-pushed the ic_ilu_with_linop branch from e09c3a9 to 802d992 Compare May 7, 2025 19:33
Base automatically changed from ic_ilu_with_linop to develop May 8, 2025 08:01
@yhmtsai yhmtsai force-pushed the ilu_with_linop branch 2 times, most recently from 6f55f04 to fa14c74 Compare May 9, 2025 09:42
Copy link
Member

@MarcelKoch MarcelKoch left a comment

Choose a reason for hiding this comment

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

LGTM, I only have some minor refactoring and documentation changes.

@yhmtsai yhmtsai requested a review from MarcelKoch May 9, 2025 13:16
Comment on lines +409 to +412
// If comp contains both factors: We only check the dimension from
// the second factor. However, we still use the l_solver^H not
// generate the solver on L^H to preserve the Hermitian property of
// this preconditioner. LSolver(L)^H is not always LSolver^H(L^H).
Copy link
Member Author

Choose a reason for hiding this comment

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

@MarcelKoch I checked with @upsj about this behavior. It is indeed intentional because it tries to keep the Hermitian property of IC. Thus, I revert the code changes here and the test but update documentation.

Copy link
Member

Choose a reason for hiding this comment

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

Additionally, transposing a preconditioner is generally cheaper than computing it, so this behavior is also preferable for many preconditioner types (except for triangular solvers, where it makes no difference, since we need to rerun the analysis in either case)

@yhmtsai yhmtsai added the 1:ST:ready-to-merge This PR is ready to merge. label May 10, 2025
Copy link

Copy link

codecov bot commented May 11, 2025

Codecov Report

Attention: Patch coverage is 95.52239% with 3 lines in your changes missing coverage. Please review.

Project coverage is 88.73%. Comparing base (4015c54) to head (8bd0569).
Report is 8 commits behind head on develop.

Files with missing lines Patch % Lines
core/config/preconditioner_ilu_config.cpp 83.33% 1 Missing ⚠️
include/ginkgo/core/preconditioner/ic.hpp 83.33% 1 Missing ⚠️
reference/test/preconditioner/ilu.cpp 97.72% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1828      +/-   ##
===========================================
- Coverage    88.77%   88.73%   -0.04%     
===========================================
  Files          844      844              
  Lines        70878    70902      +24     
===========================================
- Hits         62919    62916       -3     
- Misses        7959     7986      +27     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@yhmtsai yhmtsai merged commit 2deab4b into develop May 11, 2025
21 of 22 checks passed
@yhmtsai yhmtsai deleted the ilu_with_linop branch May 11, 2025 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1:ST:ready-for-review This PR is ready for review 1:ST:ready-to-merge This PR is ready to merge. mod:core This is related to the core 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:preconditioner This is related to the preconditioners
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants