Skip to content

Conversation

@ax3l
Copy link
Member

@ax3l ax3l commented Nov 10, 2025

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 PolymorphicArena allocators, 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:

  • fix a bug or incorrect behavior in AMReX
  • add new capabilities to AMReX
  • changes answers in the test suite to more than roundoff level
  • are likely to significantly affect the results of downstream AMReX users
  • include documentation in the code and/or rst files, if appropriate

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
`PolymorphicArena` allocators, shorter/cleaner in user
code.
@ax3l ax3l requested review from WeiqunZhang and atmyers November 10, 2025 05:00
@ax3l ax3l changed the title PC::make_alike<Allocator> PC::make_alike<Allocator> Change Default Nov 10, 2025
@ax3l ax3l merged commit d0e2504 into AMReX-Codes:development Nov 14, 2025
73 checks passed
@ax3l ax3l deleted the pc-make-alike-same-alloc branch November 14, 2025 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants