[Cython] CEP: prange for parallel loops
Dag Sverre Seljebotn
d.s.seljebotn at astro.uio.no
Mon Apr 4 11:47:06 CEST 2011
On 04/04/2011 11:43 AM, Dag Sverre Seljebotn wrote:
> CEP up at http://wiki.cython.org/enhancements/prange
> This spec is the result of a number of discussions at Cython workshop
> 1. Quite a few different ways of expressing parallelism was looked at,
> and finally we decided to split the problem in two:
> * A simple and friendly solution that covers, perhaps, 80% of the
> cases, based on simply replacing range with prange.
> * Less friendly solutions for the remaining cases. These cases may
> well not even require language support in Cython, or only in indirect
> ways (e.g., cdef closures if normal closures are too expensive).
> This document focuses exclusively on the former solution and does not
> intend to cover all use-cases for parallel programming, only the most
> common ones.
> Note that me and Mark talked some more on the way to the airport, and
> also I got a couple of more ideas afterwards, so everybody interested
> should probably take a read even if you were there for discussions.
To be more specific, here's the main post-workshop changes:
* if cython.parallel.firstthreaditer()/lastthreaditer() # Use if-test
in loop for thread setup/teardown
* An idea for implementing threadnum() in a way so that we can drop
the rather complex Context idea.
* More thoughts on firstprivate/lastprivate
More information about the cython-devel