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

CarpetX: CarpetX errors out when it cycles time levels if those levels are not valid everywhere. #328

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

stevenrbrandt
Copy link
Contributor

CarpetX: CarpetX errors out when it cycles time levels if those levels are not valid everywhere.

This breaks code using presync-only.

This commit causes CarpetX to sync these grid functions (if presync-only is enabled) instead of erroring out.

…s are not valid everywhere.

This breaks code using presync. This commit causes CarpetX to sync these grid functions
instead of erroring out.

Co-authored-by: Max Morris <[email protected]>
@stevenrbrandt stevenrbrandt requested a review from rhaas80 January 6, 2025 18:44
@rhaas80 rhaas80 requested a review from eschnett January 6, 2025 18:51
for (int vi = 0; vi < groupdata.numvars; ++vi)
bool presync_only = CCTK_EQUALS(presync_mode, "presync-only");
if (presync_only && groupdata.do_checkpoint) {
std::set<int> sync_set;
Copy link
Collaborator

Choose a reason for hiding this comment

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

A std::vector<bool>(CCTK_Num_Groups()) would probably be faster.

}
// check that what we have is correct
if (groupdata.do_checkpoint) {
std::set<int> sync_set;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This seems unused.

std::set<int> sync_set;
for (int tl = (ntls == 1 ? 0 : 1); tl < ntls; ++tl) {
for (int vi = 0; vi < groupdata.numvars; ++vi) {
sync_set.insert(gi);
Copy link
Collaborator

Choose a reason for hiding this comment

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

That's weird. You insert the same number into the set several times.

@eschnett
Copy link
Collaborator

If I understand, this patch adds code before cycling time levels in presync mode. Is that correct? It doesn't change existing code?

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