Skip to content

Conversation

@markscheel
Copy link
Contributor

Proposed changes

See comments in code. This fixes a rare bug uncovered by @moxcodes , where
an InterpolationTarget can be finished with its work and can have already cleaned up,
but yet there are still elements sending data to that InterpolationTarget (where the data is
for points that are duplicated because they are on exactly the boundary between two or more elements).

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
    major new feature if appropriate.

Further comments

TemporalId, Variables<typename InterpolationTargetTag::
vars_to_interpolate_to_target>>*>
vars_dest_all_times) noexcept {
if (UNLIKELY(0 == vars_dest_all_times->count(temporal_id))) {
Copy link
Contributor

@moxcodes moxcodes Jun 8, 2021

Choose a reason for hiding this comment

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

When testing a bit more last night, I found that we also need another similar check in have_data_at_all_points, because after the control flow exits this routine early, it will try to check if it needs to clean up the already cleaned-up temporal id.

vars_dest_all_times) noexcept {
if (UNLIKELY(0 == vars_dest_all_times->count(temporal_id))) {
// vars_dest_all_times will almost always have an entry for
// temporal_id. This is because that entry is added by
Copy link
Member

Choose a reason for hiding this comment

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

remove "by"?

@markscheel markscheel force-pushed the InterpolatorRepeatedPointFix branch from c83ee7a to 6eb8c4b Compare June 8, 2021 23:46
@markscheel
Copy link
Contributor Author

I completely re-did this PR. I put the checks elsewhere, so that have_data_at_all_points and add_received_variables don't need to make assumptions about what the code that calls them does after the call. I also use CompletedTemporalIds for the check, which is important for InterpolationTargetVarsFromElement (which may not have even initialized the various things like Tags::InterpolatedVars at the given temporal_id).

Copy link
Contributor

@moxcodes moxcodes left a comment

Choose a reason for hiding this comment

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

Looks good -- I''ve used this patch for my latest runs and so far I haven't hit the problem again.
Thanks!

@kidder kidder merged commit 18d02d6 into sxs-collaboration:develop Jun 10, 2021
@nilsvu nilsvu added the bugfix label Jul 6, 2021
@markscheel markscheel deleted the InterpolatorRepeatedPointFix branch August 2, 2021 19:56
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.

4 participants