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

Minimal stopping criteria config #1613

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from
Draft

Conversation

MarcelKoch
Copy link
Member

This PR adds a minimal specification for configuring stopping criteria. The test now contains an example for this configuration. Since the main implementation to configure the criteria is already implemented, this adds only a bit of dispatching.

This is intended to continue the discussion in #1392, while not blocking the release.

Todo:

  • discuss the specification
  • test all allowed key-value pairs

@MarcelKoch MarcelKoch self-assigned this May 17, 2024
@ginkgo-bot ginkgo-bot added reg:testing This is related to testing. mod:core This is related to the core module. type:solver This is related to the solvers labels May 17, 2024
@MarcelKoch MarcelKoch mentioned this pull request May 17, 2024
}

if (config.get_tag() == pnode::tag_t::map) {
return parse_minimal_criteria(config, context, td);
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
return parse_minimal_criteria(config, context, td);
auto updated = config::update_type(td);
return parse_minimal_criteria(config, context, updated);

It is to support no valuetype available outside

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure what you mean here. I can specify the value type of the residual nom criterion, as you can see in the tests.

Copy link
Member

Choose a reason for hiding this comment

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

It's based on the type_descriptor from the outer loop.
I mean something like

"stop": {
  "value_type": "float64",
  "residual_norm": ...
}

in case no precision information from outside or want to specify certain precision for stop.

parse_or_get_criteria(const pnode& config, const registry& context,
const type_descriptor& td)
{
if (config.get_tag() == pnode::tag_t::array) {
Copy link
Member

Choose a reason for hiding this comment

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

The array can not accept 1 object now. you can use type to distinguish the path and reuse the parse_or_get_factory

@yhmtsai yhmtsai force-pushed the factory_config branch 2 times, most recently from 7735cc5 to 2629167 Compare May 27, 2024 09:22
Base automatically changed from factory_config to develop May 27, 2024 14:51
@MarcelKoch MarcelKoch force-pushed the minimal-stop-config branch from 0126f7d to 829b991 Compare May 29, 2024 07:49
@MarcelKoch MarcelKoch added the 1:ST:WIP This PR is a work in progress. Not ready for review. label Aug 15, 2024
@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1:ST:WIP This PR is a work in progress. Not ready for review. mod:core This is related to the core module. 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.

3 participants