AMReX-Codes / pyamrex

GPU-Enabled, Zero-Copy AMReX Python Bindings including AI/ML
http://pyamrex.readthedocs.io
Other
35 stars 19 forks source link

MultiFab Fixture Cleanup via `FabArray::clear` #214

Closed ax3l closed 11 months ago

ax3l commented 11 months ago

Using a context manager and calling clear ensures that we will not hold device memory anymore once we hit AMReX::Finalize, even in the situation where an exception is raised in a test. This avoids segfaults for failing tests.

Related to #81

ax3l commented 11 months ago

@sayerhs I wonder if I shall just merge this for now and refactor it later, since it fixes issues we see on Perlmutter...?