title: Parallelizing a Numpy vector operation
body: <p>Let's use, for example, <code>numpy.sin()</code></p>
  
  <p>The following code will return the value of the sine for each value of the array <code>a</code>:</p>
  
  <pre><code>import numpy
  a = numpy.arange( 1000000 )
  result = numpy.sin( a )
  </code></pre>
  
  <p>But my machine has 32 cores, so I'd like to make use of them. (The overhead might not be worthwhile for something like <code>numpy.sin()</code> but the function I actually want to use is quite a bit more complicated, and I will be working with a huge amount of data.)</p>
  
  <p>Is this the best (read: smartest or fastest) method:</p>
  
  <pre><code>from multiprocessing import Pool
  if __name__ == '__main__':
      pool = Pool()
      result = pool.map( numpy.sin, a )
  </code></pre>
  
  <p>or is there a better way to do this?</p>