Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
help="use overintegration in the RHS computations")
parser.add_argument("--numpy", action="store_true",
help="use numpy-based eager actx.")
parser.add_argument("--cupy", action="store_true",
help="use cupy-based eager actx.")

args = parser.parse_args()

Expand All @@ -51,7 +53,8 @@

from mirgecom.array_context import get_reasonable_array_context_class
actx_class = get_reasonable_array_context_class(
lazy=args.lazy, distributed=True, profiling=args.profile, numpy=args.numpy)
lazy=args.lazy, distributed=True, profiling=args.profile,
numpy=args.numpy, cupy=args.cupy)

restart_filename = None
if args.restart_file:
Expand Down
19 changes: 11 additions & 8 deletions y3prediction/actii_y3_cav5.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,11 @@ def __call__(self, dcoll, x_vec, eos, *, time=0.0):
y = np.zeros(self._nspecies, dtype=object)
for i in range(self._nspecies):
y[i] = self._mass_frac[i]
mass = eos.get_density(pressure=pres_left, temperature=temp_left,
species_mass_fractions=y)
energy = mass*eos.get_internal_energy(temperature=temp_left,
species_mass_fractions=y)
mass = actx.to_numpy(
eos.get_density(pressure=pres_left, temperature=temp_left,
species_mass_fractions=y))
energy = mass*actx.to_numpy(eos.get_internal_energy(temperature=temp_left,
species_mass_fractions=y))

velocity = np.zeros(self._dim, dtype=object)
mom = mass*velocity
Expand Down Expand Up @@ -257,10 +258,12 @@ def __call__(self, dcoll, x_vec, eos, *, time=0.0):
y = np.zeros(self._nspecies, dtype=object)
for i in range(self._nspecies):
y[i] = self._mass_frac[i]
mass = eos.get_density(pressure=pres_right, temperature=temp_right,
species_mass_fractions=y)
energy = mass*eos.get_internal_energy(temperature=temp_right,
species_mass_fractions=y)
mass = actx.to_numpy(
eos.get_density(pressure=pres_right, temperature=temp_right,
species_mass_fractions=y))
energy = mass*actx.to_numpy(
eos.get_internal_energy(temperature=temp_right,
species_mass_fractions=y))

velocity = np.zeros(self._dim, dtype=object)
mom = mass*velocity
Expand Down
8 changes: 5 additions & 3 deletions y3prediction/prediction.py
Original file line number Diff line number Diff line change
Expand Up @@ -5585,10 +5585,12 @@ def _sponge_source(sigma, cv, sponge_cv):
("memory_usage_hwm.max",
"| \t memory hwm: {value:7g} Mb\n")])

from mirgecom.array_context import actx_class_is_numpy
from mirgecom.array_context import (actx_class_is_numpy,
actx_class_is_cupy)

if not actx_class_is_numpy(actx_class):
# numpy has no CL mempool
if not (actx_class_is_numpy(actx_class) or
actx_class_is_cupy(actx_class)):
# numpy/cupy have no CL mempool
logmgr.add_watches([
("memory_usage_mempool_managed.max",
"| \t mempool total: {value:7g} Mb\n"),
Expand Down