enthought / distarray

Default Repo description from terraform module
BSD 3-Clause "New" or "Revised" License
5 stars 1 forks source link

O-13: distarray local API -- elemental and pure procedures (optional) #193

Open kwmsmith opened 10 years ago

kwmsmith commented 10 years ago

Objective: To provide functionality that allows end users to specify that a local function is “elemental” or “pure”. Elemental routines can be applied on an element-by-element basis to the contents of its arguments without modifying those arguments, and pure routines guarantee that they will not modify their arguments.

Relevance: Elemental and pure routines, by guaranteeing not to modify their arguments or the contents of their arguments if container objects, allow for certain patterns that are difficult to accomplish with non-pure routines. This functionality will allow end users to accomplish map-reduce style work flows, for example.

Description: This task will provide either a separate decorator analogous to the odin.local decorator described above, or allow the end user to specify in another manner that a local function is pure or elemental. Once specified, the ODIN runtime is allowed to take these functions and possibly apply them in a manner that has more latitude when working with redundant data that is reproduced for fault tolerance or for overlapping regions in finite differencing style computations.

kwmsmith commented 10 years ago

This has much overlap with the @vectorize decorator, when you think about it. Although it would be nice to allow functions to be marked "elemental" or "pure" to allow certain optimizations at the local level (they're trivially parallelizable, for example).

bgrant commented 10 years ago

@kwmsmith : move to 0.3 milestone?

kwmsmith commented 10 years ago

Yes.

We have a partial implementation of elemental / pure procedures with the @vectorize decorator.