Skip to content

Specialize a Polymorphic ParticleContainer#428

Merged
ax3l merged 9 commits intoAMReX-Codes:developmentfrom
ax3l:topic-polymorphic-pc
Feb 14, 2026
Merged

Specialize a Polymorphic ParticleContainer#428
ax3l merged 9 commits intoAMReX-Codes:developmentfrom
ax3l:topic-polymorphic-pc

Conversation

@ax3l
Copy link
Copy Markdown
Member

@ax3l ax3l commented Mar 18, 2025

Using the amrex::PolymorphicArenaAllocator. Close #425

To Do

Later On

@ax3l ax3l added the component: particles Particles label Mar 18, 2025
@ax3l ax3l requested a review from atmyers March 18, 2025 22:46
@ax3l ax3l added the help wanted Extra attention is needed label Mar 18, 2025
@ax3l ax3l force-pushed the topic-polymorphic-pc branch 2 times, most recently from 7fec74f to 3f4a8d2 Compare November 8, 2025 21:02
@ax3l ax3l mentioned this pull request Nov 10, 2025
7 tasks
@ax3l ax3l force-pushed the topic-polymorphic-pc branch from a861396 to 3f8e140 Compare November 11, 2025 04:14
@ax3l ax3l force-pushed the topic-polymorphic-pc branch from 3f8e140 to 602802b Compare November 11, 2025 04:46
@ax3l ax3l force-pushed the topic-polymorphic-pc branch from 602802b to 13fa823 Compare December 12, 2025 23:20
@atmyers
Copy link
Copy Markdown
Member

atmyers commented Dec 18, 2025

AMReX-Codes/amrex#4859 adds a test for this at the C++ level.

@ax3l ax3l force-pushed the topic-polymorphic-pc branch from 13fa823 to e76f728 Compare January 13, 2026 18:04
@ax3l ax3l force-pushed the topic-polymorphic-pc branch from e76f728 to e3794f0 Compare January 23, 2026 21:29
ax3l added 5 commits February 9, 2026 22:52
Using the `amrex::PolymorphicArenaAllocator`
Skip all the other templated PC to save compile
and link time.
Writable (with getter and setter).
@ax3l ax3l force-pushed the topic-polymorphic-pc branch from e3794f0 to e8564b0 Compare February 10, 2026 06:52
@ax3l ax3l force-pushed the topic-polymorphic-pc branch from 8e63304 to f15d882 Compare February 10, 2026 07:12
@ax3l ax3l closed this Feb 10, 2026
@ax3l ax3l reopened this Feb 10, 2026
@ax3l
Copy link
Copy Markdown
Member Author

ax3l commented Feb 11, 2026

Dang, the CUDA builder is exceeding some kind of resources:

2026-02-10T23:55:26.7435795Z gmake[3]: *** [CMakeFiles/pyAMReX_2d.dir/build.make:728: CMakeFiles/pyAMReX_2d.dir/src/Particle/ParticleContainer.cpp.o] Terminated
2026-02-10T23:55:26.7441940Z gmake[3]: *** [CMakeFiles/pyAMReX_1d.dir/build.make:698: CMakeFiles/pyAMReX_1d.dir/src/Particle/ParticleContainer.cpp.o] Terminated
2026-02-10T23:55:26.7443121Z gmake[2]: *** [CMakeFiles/Makefile2:1376: CMakeFiles/pyAMReX_1d.dir/all] Terminated
2026-02-10T23:55:26.7460354Z gmake[1]: *** [CMakeFiles/Makefile2:1649: CMakeFiles/pip_install.dir/rule] Terminated
2026-02-10T23:55:26.7465358Z gmake: *** [Makefile:650: pip_install] Terminated
2026-02-10T23:55:26.8153274Z ##[error]The runner has received a shutdown signal. This can happen when the runner service is stopped, or a manually started runner is canceled.
2026-02-10T23:55:28.0419398Z ##[error]The operation was canceled.

Unlikely disk space, because we clean a lot, but maybe RAM or so. We already run with only -j 2 although we can use 4 vcores these days... We need to split out ParticleContainer.cpp more carefully so it is not such a huge banger TU...

Simplify the TU, CI seems to exchaust RAM resources while
compiling with NVCC.
Comment on lines +175 to +177
// work-around for https://github.com/pybind/pybind11/pull/4581
//make_ArrayOfStructs<ParticleType, std::allocator> (m, "std");
//make_ArrayOfStructs<ParticleType, amrex::ArenaAllocator> (m, "arena");

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
Comment on lines +110 to +112
// work-around for https://github.com/pybind/pybind11/pull/4581
//make_StructOfArrays<NReal, NInt, std::allocator, use64BitIdCpu>(m, "std");
//make_StructOfArrays<NReal, NInt, amrex::ArenaAllocator, use64BitIdCpu>(m, "arena");

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
@ax3l ax3l merged commit ff0965d into AMReX-Codes:development Feb 14, 2026
19 checks passed
@ax3l ax3l deleted the topic-polymorphic-pc branch February 14, 2026 05:01
atmyers pushed a commit to BLAST-WarpX/warpx that referenced this pull request Feb 20, 2026
- [x] replace all templates
- [x] `setArena`, update `define()` calls, etc.
- [x] remove unnecessary classes (e.g.,
`PinnedMemoryParticleContainer`): if `WarpXParticleContainer` had not
purely virtual functions, this would be cleaner to implement (adding a
`WarpXParticleContainer::Base` for now).
- [x] test again on GPU at runtime
- [x] rebase on AMReX-Codes/pyamrex#428
- [x] rebase on AMReX-Codes/amrex#4771 and
simplify `make_alike` calls
- [x] rebase on AMReX-Codes/amrex#4776 and
AMReX-Codes/amrex#4948 and
AMReX-Codes/amrex#4949
atmyers pushed a commit to atmyers/WarpX that referenced this pull request Mar 23, 2026
- [x] replace all templates
- [x] `setArena`, update `define()` calls, etc.
- [x] remove unnecessary classes (e.g.,
`PinnedMemoryParticleContainer`): if `WarpXParticleContainer` had not
purely virtual functions, this would be cleaner to implement (adding a
`WarpXParticleContainer::Base` for now).
- [x] test again on GPU at runtime
- [x] rebase on AMReX-Codes/pyamrex#428
- [x] rebase on AMReX-Codes/amrex#4771 and
simplify `make_alike` calls
- [x] rebase on AMReX-Codes/amrex#4776 and
AMReX-Codes/amrex#4948 and
AMReX-Codes/amrex#4949
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: particles Particles help wanted Extra attention is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Particle Container with Polymorphic Arena

3 participants