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.
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 alongN
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.