[SciPy-User] Speeding things up - how to use more than one computer core

J. David Lee johnl@cs.wisc....
Mon Apr 8 13:22:10 CDT 2013



On 04/08/2013 11:55 AM, Gael Varoquaux wrote:
> On Mon, Apr 08, 2013 at 07:44:20AM -0500, J. David Lee wrote:
>> I've used shared memory arrays in the past, and it's actually quite easy. They
>> can be created using the multiprocessing module in a couple of lines,
>> mp_arr = multiprocessing.Array(ctypes.c_double, 100)
>> arr = np.frombuffer(mp_arr.get_obj())
> I believe that this does synchronization by message passing. Look at the
> corresponding multiprocessing code if you want to convince yourself. Thus
> you are not in fact sharing the memory between processes.
I think you are right, but it looks like you can fix that trivially by 
replacing Array with RawArray.

David


More information about the SciPy-User mailing list