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: Add interpolator self-checks #326

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

eschnett
Copy link
Collaborator

No description provided.

@eschnett
Copy link
Collaborator Author

This mostly improves error messages (when built with CCTK_DEBUG).

@eschnett eschnett requested a review from rhaas80 December 23, 2024 15:01
CCTK_VINFO("patch %d level %d component %d old_nparticles: %zu",
patch, lev, component, particles.size());
// CCTK_VINFO("patch %d level %d component %d old_nparticles: %zu",
// patch, lev, component, particles.size());
Copy link
Member

Choose a reason for hiding this comment

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

I'd remove or move behind a #ifdef DEBUG this code.

CCTK_VINFO("patch %d level %d component %d new_nparticles: %zu",
patch, lev, component, particles.size());
// CCTK_VINFO("patch %d level %d component %d new_nparticles: %zu",
// patch, lev, component, particles.size());
Copy link
Member

Choose a reason for hiding this comment

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

I'd remove or move behind a #ifdef DEBUG this code.

Copy link
Member

Choose a reason for hiding this comment

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

(also similar in line 611ff below)

@@ -850,6 +889,7 @@ extern "C" void CarpetX_Interpolate(const CCTK_POINTER_TO_CONST cctkGH_,
// Set result
CCTK_REAL *const restrict *const restrict resultptrs =
static_cast<CCTK_REAL *const *>(resultptrs_);
assert(int(recvbuf.size()) == (nvars + 1) * npoints);
Copy link
Member

Choose a reason for hiding this comment

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

assert is too late the code in CCTK_DEBUG in line 876 alreay touches all points.

Copy link
Member

Choose a reason for hiding this comment

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

This assert can trigger if there are points outside of the domain, can't it? 

In that case this assert does not adhere to the API set out in the ReferenceManual for CCTK InterpGridArrays which documents CCTK ERROR INTERP POINT OUTSIDE as a possible return value and does not indicate that the code would abort.

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