chapel-lang / chapel

a Productive Parallel Programming Language
https://chapel-lang.org
Other
1.76k stars 414 forks source link

Add a user-facing query for distributed vs non-distributed arrays #19088

Open jlbyrne-hpe opened 2 years ago

jlbyrne-hpe commented 2 years ago

Working around #19087, I struggled to add an where-clause that could specialize the handling of non-distributed arrays. I ended up testing for DefaultDist, which seems to work, but it isn't intuitive and it isn't at all clear whether there are holes. More broadly, I think it might be useful for optimization.

@bradcray mentioned in an email that there is an internal interface --- "proc chpl__isDROrDRView() param : bool { ... }" --- but that a user-facing routine would be reasonable.

bradcray commented 2 years ago

We have a few different ways of doing this internally—one of which was the cause of #19087—and should really come up with a user-facing API and then replace all the current ways of doing it with that instead. Tagging @stonea and @vasslitvinov since this relates somewhat to the reviews of the domain and array modules we've been doing recently (it's not Chapel 2.0 in that it wouldn't be breaking to add later, but may be good / easy to knock out while we're discussing these things).