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

Allow Singletons to use ExecutePhaseChange #6401

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

nikwit
Copy link
Contributor

@nikwit nikwit commented Dec 10, 2024

Proposed changes

This PR allows singletons to contribute to reduction data by calling ExecutePhaseChange. I needed this to checkpoint the worldtube singleton.

I duplicate the algorithm unit test for this action it to show that it works with singletons now as well.

@nikwit nikwit force-pushed the singleton-change-phase branch from bdd8fdd to 6944ebe Compare December 10, 2024 21:54
Copy link
Contributor

@knelli2 knelli2 left a comment

Choose a reason for hiding this comment

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

You can squash everything into just one commit

Comment on lines 7 to 8
# note that this is a vector of pairs, so has the peculiar '- -' for the
# elements
Copy link
Contributor

Choose a reason for hiding this comment

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

This comment is outdated from an old syntax for PhaseChangeAndTriggers.

Comment on lines +76 to +79
if constexpr (std::is_same_v<typename SenderComponent::chare_type,
Parallel::Algorithms::Singleton>) {
Parallel::local(Parallel::get_parallel_component<SenderComponent>(cache))
->contribute(static_cast<int>(reduction_data.size()),
Copy link
Contributor

Choose a reason for hiding this comment

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

Note that technically this could have been put into the other contribute_to_phase_change_reduction function that already uses Parallel::local, but then every phase change would have to be updated to call the other function for both arrays and singletons. I think this current way is cleaner.

@nikwit nikwit force-pushed the singleton-change-phase branch from 6944ebe to 093595a Compare December 12, 2024 09:50
@knelli2 knelli2 merged commit cbe1362 into sxs-collaboration:develop Dec 13, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants