Skip to content

Scale corrected ir smoother#2036

Draft
greole wants to merge 8 commits into
developfrom
scaleCorrectionIR
Draft

Scale corrected ir smoother#2036
greole wants to merge 8 commits into
developfrom
scaleCorrectionIR

Conversation

@greole

@greole greole commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

This PR adds a scale corrected IR smoother which aims to improve convergence.

@ginkgo-bot ginkgo-bot added reg:build This is related to the build system. reg:testing This is related to testing. reg:example This is related to the examples. reg:benchmarking This is related to benchmarking. type:solver This is related to the solvers type:preconditioner This is related to the preconditioners type:matrix-format This is related to the Matrix formats type:factorization This is related to the Factorizations type:reordering This is related to the matrix(LinOp) reordering reg:helper-scripts This issue/PR is related to the helper scripts mainly concerned with development of Ginkgo. type:multigrid This is related to multigrid type:stopping-criteria This is related to the stopping criteria mod:all This touches all Ginkgo modules. labels Jun 23, 2026
@greole greole force-pushed the scaleCorrectionIR branch from 8770bc8 to 9a68ea5 Compare June 23, 2026 11:56

@yhmtsai yhmtsai left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

miss ir.hpp change, should remove scale-correction-mg-solver binary, need to add test

@greole greole force-pushed the scaleCorrectionIR branch from 6861d33 to 6eaf738 Compare June 23, 2026 14:39

@yhmtsai yhmtsai left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

still miss the test

Comment thread core/solver/ir.cpp
Comment thread core/solver/ir.cpp
std::shared_ptr<const LinOp>(dense_b, [](const LinOp*) {}), dense_x,
residual_ptr);

// Matches the OpenFOAM GAMGSolver::scale function:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

do you also have paper reference?

Comment thread core/solver/ir.cpp Outdated
Comment thread core/solver/ir.cpp Outdated
Comment on lines +259 to +260
if (const auto* de =
dynamic_cast<const DiagonalExtractable<ValueType>*>(local_A)) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this only check whether the diagonal can be extracted.
but it might have some zero in the diagonal

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can this be replaced by Jacobi-IR with 1 iteration?

Comment thread core/solver/ir.cpp
// then accumulate into x.
apply_scale_correction(inner_solution, residual_ptr);
}
dense_x->add_scaled(relaxation_factor_, inner_solution);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

should relaxation_factor be used together with the scale correction?

Comment thread include/ginkgo/core/solver/ir.hpp Outdated
* OpenFOAM never scales x directly, so mode 1 has no OpenFOAM
* equivalent.
*/
int GKO_FACTORY_PARAMETER_SCALAR(scale_correction, 0);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

maybe have a tag?
ir_method::richardson, backward, forward.
Is mode 1 used in some cases?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1 for tag.
It could be extended to use the approach in https://dl.acm.org/doi/full/10.1145/3712285.3759807

@greole greole marked this pull request as draft June 26, 2026 08:21
@greole greole force-pushed the scaleCorrectionIR branch from 8f86851 to 5abc13f Compare June 27, 2026 06:12
@ginkgo-bot

Copy link
Copy Markdown
Member

Error: The following files need to be formatted:

core/config/multigrid_config.cpp
core/config/registry.cpp

You can find a formatting patch under Artifacts here or run format! if you have write access to Ginkgo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:all This touches all Ginkgo modules. reg:benchmarking This is related to benchmarking. reg:build This is related to the build system. reg:example This is related to the examples. reg:helper-scripts This issue/PR is related to the helper scripts mainly concerned with development of Ginkgo. reg:testing This is related to testing. type:factorization This is related to the Factorizations type:matrix-format This is related to the Matrix formats type:multigrid This is related to multigrid type:preconditioner This is related to the preconditioners type:reordering This is related to the matrix(LinOp) reordering type:solver This is related to the solvers type:stopping-criteria This is related to the stopping criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants