feat: support subregion annotations - #187
Open
cmelone wants to merge 2 commits into
Open
Conversation
Signed-off-by: Caetano Melone <melone1@llnl.gov>
Signed-off-by: Caetano Melone <melone1@llnl.gov>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
ZwFink
reviewed
Aug 21, 2026
| struct MemoryRegionMetadata { | ||
| uint64_t Offset = 0; | ||
| uint64_t Extent = 0; | ||
| Metadata MD; |
Collaborator
There was a problem hiding this comment.
Design question: Do we need two distinct metadata types? Both describe some (Base Ptr, Offset, Additional Data). I don't see why we need to special-case here, rather than making the OG implementation more general.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Apps that depend on MFEM/Umpire may store fields as aliases inside a large device allocation rather than allocating each field separately.
Mneme currently only supports whole-allocation annotation, which doesn't work for these programs as the fields expose interior pointers inside a larger parent allocation.
Because multiple fields can share the same parent allocation, a mechanism to annotate "subregions" inside allocations will be helpful for apps that follow this pattern (eg, annotating
density_ptrandenergy_ptr):This PR adds support for registering annotations with a byte extent param, and preserves the existing API for annotating whole allocations.
Regarding the registration API, I'd appreciate some design discussion as it's a bit clunky at the moment. For instance, registering an annotation for
density_ptrwould involve:The callers have to calculate the byte extent manually for typed pointers, which we could improve with some convenience abstraction that takes non-void pointers and the element count, but I'm open to people's thoughts.
I also added some logging for when annotations are registered during record/used during replay.
TODO: