Skip to content

Trouble with container handling in op reductions #264

@MTCam

Description

@MTCam

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:

if not isinstance(vec, DOFArray):

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.

@inducer says: (Snipped part about empty reductions, see #266.)

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions