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

Fix interpolation framework when there are no valid points to interpolate #5623

Merged
merged 4 commits into from
Nov 15, 2023

Conversation

kidder
Copy link
Member

@kidder kidder commented Nov 11, 2023

Proposed changes

If there were no valid interpolation points (i.e. all points were outside the Domain), the interpolation target was not informed. This led to a growing list of pending interpolations and uninterpolated volume data for sequential interpolation targets such as the apparent horizon finder.

Now I added a check for this case and send a message to the interpolation target that allows the interpolation target to do whatever it did when there was a mixture of valid and invalid interpolation points.

I also fixed a few minor things I encountered debugging this, as well as added tests that would have failed.

Upgrade instructions

Code review checklist

  • The code is documented and the documentation renders correctly. Run
    make doc to generate the documentation locally into BUILD_DIR/docs/html.
    Then open index.html.
  • The code follows the stylistic and code quality guidelines listed in the
    code review guide.
  • The PR lists upgrade instructions and is labeled bugfix or
    new feature if appropriate.

Further comments

@kidder kidder added the bugfix label Nov 11, 2023
test_interpolation_target_sphere<InterpTargetTestHelpers::ValidPoints::All>(
make_not_null(&gen), num_spheres, intrp::AngularOrdering::Strahlkorper);
test_interpolation_target_sphere<
InterpTargetTestHelpers::ValidPoints::None>(
Copy link
Member

Choose a reason for hiding this comment

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

Should this test have a "Some" check?

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 can add one, it would be non-trivial as the target spheres are randomly generated. I might be able to do it with an offset spherical domain.

"[Unit]") {
domain::creators::register_derived_with_charm();
run_test<InterpTargetTestHelpers::ValidPoints::All>();
run_test<InterpTargetTestHelpers::ValidPoints::None>();
Copy link
Member

Choose a reason for hiding this comment

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

Should this test test "Some"?

Copy link
Member Author

Choose a reason for hiding this comment

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

This would be more difficult to test as I would need to pass in which points are invalid. I didn't think it was worth the effort as the only difference between All and Some would be the invalid points print nan which is tested by None. I can add a comment saying so, or put in the effort for the additional test if you would prefere

Copy link
Member

Choose a reason for hiding this comment

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

You can just add a comment. Same for the other test I commented on.

wthrowe
wthrowe previously approved these changes Nov 14, 2023
@wthrowe
Copy link
Member

wthrowe commented Nov 14, 2023

Needs a rebase.

If the test fails with an uncaught exception, it will not delete the created output file.
There is a check run before writing the file, but it specified the incorrect name.
This will occur for example if all interpolated points are invalid in which case the
coordinates will be correct, but the data will be nans.
Add tests that they work correctly when there are invalid target points.
Prior to this change, if there were no valid target points, the interpolation
target never received a subsequent message, which meant no cleanup was done,
and the current temporal_id kept waiting for a message.  For sequential targets
this leads to a growing list of pending temporal_ids and accumulated volume data
waiting to be interpolated.

Now the interpolation target is sent a message, and will continue to do whatever
it would have done if there was a subset of target points that are invalid.

Added additional tests to some interpolation callbacks that would have failed
prior to this change when there are no valid target points.
@wthrowe wthrowe merged commit 4a21f5b into sxs-collaboration:develop Nov 15, 2023
21 of 22 checks passed
@kidder kidder deleted the fix_interp_no_valid_pts branch November 17, 2023 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants