[Numpy-discussion] Simple shared arrays

Paul Ivanov pivanov314@gmail....
Fri Dec 31 01:13:21 CST 2010


Erik Rigtorp, on 2010-12-30 21:30,  wrote:
> Hi,
> 
> I was trying to parallelize some algorithms and needed a writable
> array shared between processes. It turned out to be quite simple and
> gave a nice speed up almost linear in number of cores. Of course you
> need to know what you are doing to avoid segfaults and such. But I
> still think something like this should be included with NumPy for
> power users.
> 
> This works by inheriting anonymous mmaped memory. Not sure if this
> works on windows.
--snip--

I've successfully used (what I think is) Sturla Molden's
shmem_as_ndarray as outline here [1] and here [2] for these
purposes.

1. http://groups.google.com/group/comp.lang.python/browse_thread/thread/79fcf022b01b7fc3
2. http://folk.uio.no/sturlamo/python/multiprocessing-tutorial.pdf

-- 
Paul Ivanov
314 address only used for lists,  off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
Url : http://mail.scipy.org/pipermail/numpy-discussion/attachments/20101230/d112db94/attachment.bin 


More information about the NumPy-Discussion mailing list