Replies: 1 comment 5 replies
-
I think a flag to prevent summing over containers is a bit of a blunt instrument. For example, is meaningful, because Maybe what we want is a way for containers to declare whether reductions across them are sensible? |
Beta Was this translation helpful? Give feedback.
-
I'm having a bit of trouble with container reductions when attempting to switch from EagerDGDisc to
op
namespace.This pattern is consistently used in grudge for container reductions:
grudge/grudge/reductions.py
Line 255 in 6c9e7b2
One problem is that this pattern is never what one wants when the array container components are each independent physical quantities. For example, when using a
CV
object in mirgecom, one would never want this:max(cv.mass, cv.energy, cv.momentum[0], cv.momentum[1], .... )
, however that is what these grudge reductions are wont to do.Discussing with @majosm , he suggested maybe we should add a flag to indicate whether we want to reduce across components of an array container. We don't want that in the vast majority of cases. Such a flag would help with the first problem. Maybe switching to a
map_array_container
approach would address the second part and then perform a 2nd reduction across components when the flag is set.Just wanting to start a discussion with this. Any ideas @inducer?
Beta Was this translation helpful? Give feedback.
All reactions