Cheng Soon Ong
chengsoon.ong at inf.ethz.ch
Tue Jul 7 17:08:20 CEST 2009
I'm trying to automate the use of multiprocessing when it is available. The
setting I have is quite simple, with a for loop where the operations inside are
independent of each other. Here's a bit of code. function_inputs is a list of
dictionaries, each of which match the signature of function_handle.
# Passing keyword arguments to map still doesn't work
cpus = multiprocessing.Pool()
function_outputs = cpus.map(function_handle, function_inputs)
function_outputs = 
for kwargs in function_inputs:
cur_out = function_handle(**kwargs)
Am I missing something here? I cannot seem to get map to pass on keyword arguments.
Thanks in advance,
More information about the Python-list