Skip to content

Commit

Permalink
Remove Managed Memory Workarounds (#793)
Browse files Browse the repository at this point in the history
Two changes:
- the AMReX default for `the_arena_is_managed` is false for a while,
  so we do not need to "overwrite" it anymore
- our initial implementation of particle loss in apertures was reworked
  for a while and does not require managed GPU memory anymore: remove
  work-arounds in inputs
  • Loading branch information
ax3l authored Jan 10, 2025
1 parent 0267769 commit f68e03c
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 21 deletions.
2 changes: 1 addition & 1 deletion docs/source/usage/parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ Overall simulation parameters
* ``amrex.the_arena_is_managed`` (``0`` or ``1``; default is ``0`` for false)
When running on GPUs, device memory that is accessed from the host will automatically be transferred with managed memory.
This is useful for convenience during development, but has sometimes severe performance and memory footprint implications if relied on (and sometimes vendor bugs).
For all regular ImpactX operations, we therefore do explicit memory transfers without the need for managed memory and thus changed the AMReX default to false.
For all regular ImpactX operations, we therefore do explicit memory transfers without the need for managed memory.
`Please also see the documentation in AMReX <https://amrex-codes.github.io/amrex/docs_html/GPU.html#inputs-parameters>`__.

* ``amrex.omp_threads`` (``system``, ``nosmt`` or positive integer; default is ``nosmt``)
Expand Down
3 changes: 0 additions & 3 deletions examples/aperture/input_aperture.in
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ collimator.shape = rectangular
collimator.xmax = 1.0e-3
collimator.ymax = 1.5e-3

# work-around for https://github.com/ECP-WarpX/impactx/issues/499
amrex.the_arena_is_managed = 1


###############################################################################
# Algorithms
Expand Down
5 changes: 0 additions & 5 deletions examples/aperture/run_absorber.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,8 @@
#
# -*- coding: utf-8 -*-

import amrex.space3d as amr
from impactx import ImpactX, distribution, elements

# work-around for https://github.com/ECP-WarpX/impactx/issues/499
pp_amrex = amr.ParmParse("amrex")
pp_amrex.add("the_arena_is_managed", 1)

sim = ImpactX()

# set numerical parameters and IO control
Expand Down
5 changes: 0 additions & 5 deletions examples/aperture/run_aperture.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,8 @@
#
# -*- coding: utf-8 -*-

import amrex.space3d as amr
from impactx import ImpactX, distribution, elements

# work-around for https://github.com/ECP-WarpX/impactx/issues/499
pp_amrex = amr.ParmParse("amrex")
pp_amrex.add("the_arena_is_managed", 1)

sim = ImpactX()

# set numerical parameters and IO control
Expand Down
5 changes: 0 additions & 5 deletions examples/aperture/run_aperture_periodic.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,8 @@
#
# -*- coding: utf-8 -*-

import amrex.space3d as amr
from impactx import ImpactX, distribution, elements

# work-around for https://github.com/ECP-WarpX/impactx/issues/499
pp_amrex = amr.ParmParse("amrex")
pp_amrex.add("the_arena_is_managed", 1)

sim = ImpactX()

# set numerical parameters and IO control
Expand Down
2 changes: 0 additions & 2 deletions tests/python/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ def amrex_init(tmpdir):
"amrex.signal_handling=0",
# abort GPU runs if out-of-memory instead of swapping to host RAM
"amrex.abort_on_out_of_gpu_memory=1",
# do not rely on implicit host-device memory transfers
"amrex.the_arena_is_managed=0",
]
)
yield
Expand Down

0 comments on commit f68e03c

Please sign in to comment.