title: python for-loop parallelization using multiprocessing.pool
body: <p>I have a piece of code that looks like this:</p>
  
  <pre><code>def calc_stuff(x,a,b,c):
      ...
      return y
  x = range(N)
  y = zeros(x.shape)
  if __name__ == '__main__':
      p = Pool(nprocs)
      y = p.map(calc_stuff,x,a,b,c)
  </code></pre>
  
  <p>This does not work, and as I searched online, it is because the map function deals with iterables rather than argument lists. I wonder what's the simplest method to modify this code to parallelize it, i.e., x is the array/iterable that I want to parallelize.</p>
  
  <p>Thank you.</p>