jipolanco / PencilArrays.jl

Distributed Julia arrays using the MPI protocol
https://jipolanco.github.io/PencilArrays.jl/dev/
MIT License
60 stars 8 forks source link

Allow singleton dimensions in PencilArray #55

Open jipolanco opened 2 years ago

jipolanco commented 2 years ago

Thinking about it, I'm not sure singleton dimensions are the best solution for broadcasting along dimensions that should behave like "constants".

The problem is that a (locally) singleton dimension doesn't always imply a "constant" dimension. For instance, if a given dimension has global size N and it is distributed along N processes, then the local size is 1, but this is not a "constant" dimension.

A better alternative would be to provide a Constant flag for dimensions that should behave like it, analogous to e.g. Flat in Oceananigans.