chapel
chapel copied to clipboard
Draft optimization to localize const domains in an inferred array type copy setting
After hitting #13213 this afternoon and talking to Jade about it, I started wondering aloud whether it might be very easy to implement an optimization that would localize the domain of an array variable being created from scratch if the original was a remote, const domain. This quick sketch suggests maybe it is, where some remaining TODOs are:
- [ ] disable the optimization if the domain is already privatized
- [ ] make sure that the array element copy is done in bulk
- [x] figure out what's going on with the (incorrect?) compiler warnings
- [ ] make sure it doesn't break other tests
- [ ] file an issue + future about
myArr.domain.locale
generating a warning? Is the answer wrong too? (seemed like it wasn't...) - [ ] impact on sparse / associative?
- [ ] creating copy would thwart "identical domain" check—does that matter?
- [ ] impact on swap, say?
- [ ] impact on array-of-arrays?
- [ ] which ops go through domain with
--fast
?- [ ] and what fields could we re-store in the array to avoid comm
- [ ] relationship with Engin's notion of optimizing arrays with anonymous domains to avoid reference counting statically