Skip to content

Conversation

@upsj
Copy link
Member

@upsj upsj commented Nov 16, 2025

Closes #1879

@upsj upsj self-assigned this Nov 16, 2025
@upsj upsj added this to the Ginkgo 1.11 milestone Nov 16, 2025
@ginkgo-bot ginkgo-bot added 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:solver This is related to the solvers type:stopping-criteria This is related to the stopping criteria labels Nov 16, 2025
@upsj upsj changed the base branch from develop to simpler_stop_interface November 16, 2025 22:24
Copy link
Member

@pratikvn pratikvn left a comment

Choose a reason for hiding this comment

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

Some mising documentation, but otherwise LGTM!

In addition to ensuring minimum iterations when the initial residual is small, it also probably helps in performance when residual (norm) computations dont need to be performed for the first min number of iterations.

deferred_factory_parameter<Iteration::Factory> max_iters(size_type count);


deferred_factory_parameter<CriterionFactory> min_iters(
Copy link
Member

Choose a reason for hiding this comment

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

Some documentation would be needed here, so that users know how to use this wrapper.

deferred_factory_parameter<Iteration::Factory> max_iters(size_type count);


deferred_factory_parameter<CriterionFactory> min_iters(
Copy link
Member

Choose a reason for hiding this comment

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

Any idea how this can be realized in the file config? From the user side this:

criteria:
  max_iters: 100
  relative_residual_norm: 1e-6
  min_iters: 10

should be pretty clear, i.e. the first two only activate once min_iters is hit, even though the list of criteria is usually an OR list.

Copy link
Member

Choose a reason for hiding this comment

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

It looks good from the first sight. but feel weird trying explaining it in consistent way

Copy link
Member

Choose a reason for hiding this comment

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

require_iters sounds stronger but it does not fit the class name

@upsj upsj force-pushed the simpler_stop_interface branch from f33c0d0 to 89fe7e0 Compare November 20, 2025 12:46
@upsj upsj marked this pull request as ready for review November 20, 2025 14:08
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. but need to add the corresponding config setup

Comment on lines +102 to +103
* @param count the number of iterations after which to start checking the
* inner criterion
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* @param count the number of iterations after which to start checking the
* inner criterion
* @param count the number of iterations after which to start checking the
* inner criterion

nit

Comment on lines +106 to +107
* stopping criterion behaves like the inner criterion.
* @return a deferred_factory_parameter that can be passed to the
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* stopping criterion behaves like the inner criterion.
* @return a deferred_factory_parameter that can be passed to the
* stopping criterion behaves like the inner criterion.
*
* @return a deferred_factory_parameter that can be passed to the

nit

deferred_factory_parameter<Iteration::Factory> max_iters(size_type count);


deferred_factory_parameter<CriterionFactory> min_iters(
Copy link
Member

Choose a reason for hiding this comment

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

require_iters sounds stronger but it does not fit the class name

@upsj
Copy link
Member Author

upsj commented Nov 26, 2025

I think the config setup should ideally happen in a subsequent PR, as I'm not that familiar with it, and don't have much time to continue working on this

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

Labels

mod:core This is related to the core module. mod:reference This is related to the reference module. reg:testing This is related to testing. 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.

Feature request: support for minimum iterations in stop criteria

6 participants