必要なのはmultiprocessing.Pool()のmapメソッドのようです:
map(func、iterable [、chunksize])
A parallel equivalent of the map() built-in function (it supports only
one iterable argument though). It blocks till the result is ready.
This method chops the iterable into a number of chunks which it submits to the
process pool as separate tasks. The (approximate) size of these chunks can be
specified by setting chunksize to a positive integ
たとえば、この関数をマップする場合は、次のようにします。
def f(x):
return x**2
range(10)には、組み込みのmap()関数を使用して実行できます。
map(f, range(10))
またはmultiprocessing.Pool()オブジェクトのメソッドmap()を使用します。
import multiprocessing
pool = multiprocessing.Pool()
print pool.map(f, range(10))