Comments (4)
That said, I can imagine two interpretations of your statement:
I was thinking more about option 1 because we have a better understanding of that case, but option 2 is indeed attractive in its own way. I think it would be great if we could support first-class privatization in the language that was optionally proactive or lazy.
from chapel.
As an update to set_granularity.txt
not working, I was able to determine that the problem was due to failing to get each locale's privatized version of the BlockArr/Dom class, and with @benharsh's help determined that this was due to the fact that the these()
iterators go through the _array.these()
wrapper, which takes care of such issues. set_granularity-blc.txt is a rewrite that avoids the locality issues in the OP. I am thinking about what more we could do here to reduce confusion and the chances for non-local accesses to privatized classes.
A slightly more detailed version of this appears in Gitter and the comments that precede it show some of the investigation that led to the conclusion.
from chapel.
My initial thoughts regarding privatized classes lean towards a compiler-assisted "localize" call when crossing on-statements. This could potentially cause issues in the (rare?) case where a user does not want the local instance.
Something I've occasionally brought up is the notion of on-statements supporting a with
clause to help define how variables are brought across locales. With such a feature we could define the default on-intent for privatized classes to be something like local in
, and a user could override that behavior with a simple `inor
const in``.
Something a bit less impactful on the language could simply be allowing for a local
intent in the "this-intent" space on methods:
proc local MyBlockArr.these(...) { ... }
These approaches rely on the compiler having some understanding of privatized classes, which does not yet exist today.
from chapel.
My initial thoughts regarding privatized classes lean towards a compiler-assisted "localize" call when crossing on-statements. This could potentially cause issues in the (rare?) case where a user does not want the local instance.
I'm glad to hear you say that because that's where my thoughts have been going this week, to the extent that I think I often believe that we already have this. But I think I'm getting mixed up w.r.t. the work we did on serializing slices (still off by default).
That said, I can imagine two interpretations of your statement:
- when a privatized class crosses an on-clause, we serialize it by passing its pid across the wire and then deserialize it by converting that pid back into the local class instance (where my head is)
- we don't proactively privatize classes at their declaration point (like today), but just serialize the classes as they cross on-clauses (which seems attractive, but seems like it could be expensive for things like descriptors that have numLocales-sized arrays)
These approaches rely on the compiler having some understanding of privatized classes, which does not yet exist today.
I think that makes sense though and seems likely in our future—certainly the current approach isn't great and I think users will want/need similar capabilities without wanting to build them themselves. Also relates a bit to the notion of having a more straightforward way of declaring "per-locale" variables (which I think you were playing with a bit recently, and which I think Daniel's work on local static variables is going to make us want as well).
from chapel.
Related Issues (20)
- Moving tasks to sublocales doesn't work in the library mode HOT 1
- [Bug]: `chpl-shim` produces empty json if run twice on mason HOT 2
- Include `CHPL_COMM_OFI_OOB` in printchplenv and unique'd library paths HOT 1
- Turn "localize array's remote domain" optimization on by default
- [Bug]: template errors in hipcub related to Chapel libc wrapper [HEAD] HOT 6
- register chpl-language-server and chplcheck on mason (neovim) HOT 6
- [Bug]: linter incorrectly complains about the indentation of a second `else if` in an if/else chain
- static variables should be able to use the `var` keyword instead of being forced to use `ref.
- [Bug]: incorrect error: illegal use of function that does not return a value, involving parenless proc HOT 2
- Split Chapel Documentation into distinct sections/sites? HOT 3
- [Feature Request]: Way to see how far you are into numtrials for a particular test with `start_test`
- [Feature Request]: Remote variables: allow non-locale arguments to `on`. HOT 3
- [Feature Request]: let CLS return a list of definitions for overloaded functions HOT 1
- [Bug]: GPU codegen fails with ROCm 5.4.3 with --devel HOT 4
- remote variables: always execute initialization expression on target locale
- Can we provide a way to call a CUDA/HIP kernel directly from Chapel?
- module search path ordering and name conflicts with bundled modules HOT 3
- Low CUDA API call performance when called from Chapel through interoperability HOT 1
- [Bug]: compiler crash with Release+Asserts build of LLVM and GCC-7.5.0 HOT 1
- [Bug]: Syntax error near proc HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chapel.