I have a loop which does a bunch of CPU intensive calculations and appends the result to a list, per iteration.
How can I have that working in parallel. On C# there are concurrent containers, how does it work in ipyparallel?
From the ipyparallel documentation:
Python’s builtin map() functions allows a function to be applied to a sequence element-by-element. This type of code is typically trivial to parallelize.
http://ipyparallel.readthedocs.io/en/latest/direct.html#parallel-map
So it's a matter of using the map function to have it running on parallel, but how can I append the results to a list? Are there concurrent containers here?
So, what I have now is something like this:
results = []
for element in list:
outcome = very_heavy_computation_function(element)
results.append(outcome)
How can I do this in parallel?