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 issue with shared pointer being garbage collected in meshblock iterator performance test #618

Merged
merged 2 commits into from
Dec 1, 2021

Conversation

Yurlungur
Copy link
Collaborator

@Yurlungur Yurlungur commented Nov 30, 2021

PR Summary

Fixes bug accidentally introduced into develop in PR #617. The issue is only in the tests. MeshBlockData::PackVariables now requires a valid MeshBlock to access to set the coords object. A shared pointer to a MeshBlock is initialized in this test, but it's garbage collected away before it can be used. This PR moves it up one scope so it isn't garbage collected.

PR Checklist

  • Code passes cpplint
  • New features are documented.
  • Adds a test for any bugs fixed. Adds tests for new features.
  • Code is formatted
  • Changes are summarized in CHANGELOG.md
  • CI has been triggered on Darwin for performance regression tests.
  • (@lanl.gov employees) Update copyright on changed files

@Yurlungur Yurlungur added bug Something isn't working ci testing labels Nov 30, 2021
@Yurlungur Yurlungur self-assigned this Nov 30, 2021
Copy link
Collaborator

@pgrete pgrete 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'll trigger the full suite now, just to be sure.

@codecov
Copy link

codecov bot commented Dec 1, 2021

Codecov Report

Merging #618 (7011c7f) into develop (c99874d) will increase coverage by 0.15%.
The diff coverage is 64.37%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #618      +/-   ##
===========================================
+ Coverage    54.10%   54.25%   +0.15%     
===========================================
  Files          124      125       +1     
  Lines        13606    13699      +93     
===========================================
+ Hits          7361     7433      +72     
- Misses        6245     6266      +21     
Impacted Files Coverage Δ
.../stochastic_subgrid/stochastic_subgrid_package.cpp 0.00% <0.00%> (ø)
src/defs.hpp 100.00% <ø> (ø)
src/kokkos_abstraction.hpp 95.91% <ø> (ø)
src/mesh/meshblock.hpp 100.00% <ø> (ø)
src/outputs/formatted_table.cpp 0.00% <0.00%> (ø)
src/outputs/outputs.hpp 64.28% <ø> (ø)
src/outputs/vtk.cpp 0.00% <0.00%> (ø)
src/utils/utils.hpp 24.00% <24.00%> (ø)
src/parthenon_manager.cpp 81.45% <33.33%> (+2.54%) ⬆️
src/interface/update.cpp 25.71% <50.00%> (ø)
... and 18 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 08a0208...7011c7f. Read the comment docs.

@Yurlungur
Copy link
Collaborator Author

Looks like all tests pass. @brryan @lroberts36 @jdolence @forrestglines can someone just quickly add one more approval?

@Yurlungur Yurlungur enabled auto-merge December 1, 2021 16:34
Copy link
Collaborator

@brryan brryan left a comment

Choose a reason for hiding this comment

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

I've run into this kind of problem before too. LGTM

@Yurlungur Yurlungur merged commit 379e5fa into develop Dec 1, 2021
@Yurlungur Yurlungur deleted the jmm/fix-performance-garbage-collection branch December 1, 2021 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ci testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants