I have a sequential function that sorts through lists and performs tasks. For example... (this is not the actual code but is analagous)
def myFunction(list):
for item in list:
sublist_a=item[0]
sublist_b=item[1]
sublist_c=item[2]
sublist_d=item[3]
for row in sublist_a:
#(do tasks....)
for row in sublist_b:
#(do tasks....)
for row in sublist_c:
#(do tasks....)
for row in sublist_d:
#(do tasks....)
print "COMPLETE"
So this is overly simplified, but essentially these lists are quire large, and the order of execution is important (ie. for row in ....
), so I would like to split them between the available cores on my system.
Could someone please suggest a method for doing so?
Have never used the Multiprocessing library but it seems this is probably the best to use with python.