[Numpy-discussion] Question about Optimization (Inline and Pyrex)

Anne Archibald peridot.faceted@gmail....
Tue Apr 17 14:55:12 CDT 2007


On 17/04/07, Lou Pecora <lou_boog2000@yahoo.com> wrote:
> I get what you are saying, but I'm not even at the
> Stupidly Easy Parallel level, yet.  Eventually.

Well, it's hardly wonderful, but I wrote a little package to make idioms like:

d = {}
def work(f):
    d[f] = sum(exp(2.j*pi*f*times))
foreach(work,freqs,threads=3)

work fine.

Of course you need to make sure your threads don't accidentally
trample all over each other, but otherwise it's an easy way to get a
factor-of-two speedup.

Anne
-------------- next part --------------
A non-text attachment was scrubbed...
Name: handythread.py
Type: text/x-python
Size: 1046 bytes
Desc: not available
Url : http://projects.scipy.org/pipermail/numpy-discussion/attachments/20070417/9b159ac6/attachment.py 


More information about the Numpy-discussion mailing list