I have a piece of code like
for i in range(0, len(a))
b[i] = func(a[i])
where a and b are arrays of the same length, a is given (and large), func is some function that has many local variables, but does not use global variables.
I would like to distribute func calculations on multiple processors. Presumably I need to use the multiprocessing module, but I have not found suitable examples. Could you help me? Thank.
source
share