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

add workspace for intermediate vector in and adapt apply_uses_initial_guess in Schwarz #1688

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

yhmtsai
Copy link
Member

@yhmtsai yhmtsai commented Oct 9, 2024

This adds a cache/workspace for the intermediate vector in advanced_apply of Schwarz.
Also, it makes apply_uses_initial_guess rely on the local_solver->apply_uses_initial_guess().
We might need to revisit this function after adding refining step in Schwarz.

@yhmtsai yhmtsai added the 1:ST:ready-for-review This PR is ready for review label Oct 9, 2024
@yhmtsai yhmtsai requested review from pratikvn and a team October 9, 2024 12:40
@yhmtsai yhmtsai self-assigned this Oct 9, 2024
@ginkgo-bot ginkgo-bot added reg:testing This is related to testing. mod:core This is related to the core module. type:preconditioner This is related to the preconditioners labels Oct 9, 2024
},
alpha, b, beta, x);
}


template <typename ValueType, typename LocalIndexType, typename GlobalIndexType>
template <typename VectorType>
void Schwarz<ValueType, LocalIndexType, GlobalIndexType>::set_cache_to(
Copy link
Member

Choose a reason for hiding this comment

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

You only need this function once, right? Then I would prefer to just add this directly, it's not that much IMO.

* (could also be done with writing `operator=` and copy
* constructor of the enclosing class by hand)
*/
mutable struct cache_struct {
Copy link
Member

Choose a reason for hiding this comment

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

I think this should be a DenseCache instead.

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 think it does not support distributed::Vector.

Copy link
Member

Choose a reason for hiding this comment

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

you're right. Perhaps it would make sense to add VectorCache, instead of using the cache construct.

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.

I agree with the Marcel that it can be a DenseCache instead of cache_struct. But otherwise looks good to me. I approve it as Marcel has already requested that change.

@MarcelKoch MarcelKoch added this to the Ginkgo 1.9.0 milestone Oct 17, 2024
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 mod:core This is related to the core module. 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