From 62af257a45be631e2bf1d3c4cf9de4ec746f375d Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Mon, 28 Feb 2022 18:07:15 -0600 Subject: [PATCH] Fix array container support in nodal_sum --- grudge/reductions.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/grudge/reductions.py b/grudge/reductions.py index b56866ae..a3474610 100644 --- a/grudge/reductions.py +++ b/grudge/reductions.py @@ -128,7 +128,9 @@ def nodal_sum(dcoll: DiscretizationCollection, dd, vec) -> "DeviceScalar": # NOTE: Don't move this from mpi4py import MPI - actx = vec.array_context + + from arraycontext import get_container_context_recursively + actx = get_container_context_recursively(vec) return actx.from_numpy( comm.allreduce(actx.to_numpy(nodal_sum_loc(dcoll, dd, vec)), op=MPI.SUM)) -- GitLab