[SciPy-user] shared memory machines

Sturla Molden sturla@molden...
Sun Feb 1 18:51:08 CST 2009


> Has anyone been able to take advantage of shared memory machines with
> scipy?  How did you do it?

I have either used OpenML in C or Fortran 90 extension modules, or
multiprocessing in Python. If you have lengthy calculations in extension
libraries you can also use Python threads, given that your extension
releases the GIL.

I have been working on a multiprocessing + NumPy cookbook tutorial. For
now the unfinished draft is here:

http://folk.uio.no/sturlamo/python/multiprocessing-tutorial.pdf

It only covers shared memory programming, though. I will also add how to
use Queues for message-passing. Many prefer message-passing to shared
memory. You avoid performance problems due to 'false sharing', and there
is often less resource contention.

The difference betwwen threading and multiprocessing should also be better
covered. Both are applicable, but in defferent contexts. And with
threading you can also choose between 'shared-objects' and message-passing
(Queue.Queue).


Sturla Molden



More information about the SciPy-user mailing list