rick.hudson at intel.com
Wed Aug 7 07:52:49 PDT 2013
When a parallel method such as mapPar is called with an elemental function that prevents parallelization, for example by writing to a global, we can either throw an exception or fall back to sequential execution. The current TC39 POR is to throw an exception. I think falling back to sequential execution is the better alternative.
To maintain temporal immutability and determinism the exception needs to be thrown before any global state is altered. This implies that that the elemental (callback) function needs to be instrumented to prevent writing to non-local variables before even being run once. Some JITs execute a few iterations using an interpreter in order to do gather type information. Instrumenting this code to throw before global state is modified comes at not only a performance hit but also will imposes considerable reworking of the JIT infrastructure for it to be reused to do the instrumenting. This is potentially a heavy implementation burden.
We should revisit the decision to throw an exception in light of these implementation issues and change to semantics that allow a sequential schedule to be a legal scheduling for any elemental function whether it is temporally immutable or not.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss