PC::make_alike<Allocator> Change Default
#4771
Merged
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.
Summary
Change the template default of
make_alike<>()to use the same allocator as the creating allocator. This is a breaking change.In practice, this was so far used to create a pinned allocator, e.g., for I/O operations. It is more sensible to create the same allocator if unspecified as the creating PC and it also makes "modern"/future AMReX, which uses PCs with
PolymorphicArenaallocators, shorter/cleaner in user code.Additional background
Introduced a few years ago for BLAST codes. Not sure how widely this is used yet, will ask on Slack, too. I doubt in practice this is used a lot without explicit template arguments.
In pyAMReX, we already implement this only for the same allocator as the creating one (no break).
See the particle roadmap.
Checklist
The proposed changes: