Does Parallel Python PP always get back jobs'results in the order we created them?
Question: We are launching processes using PP and need to aggregate the results of jobs
in the order we sent them to the server. Is there a kind of pile to control
the aggregation of the results?

    
    
    import pp, numpy
    def my_silly_function(a,b):
       return a**4+b**15
    
    # call the server (with pile?)
    ppservers = ()
    job_server = pp.Server(ppservers=ppservers, secret="password")
    # launch jobs and aggregate them into a list 
    jobs1=numpy.array[job_server.submit(my_silly_function, args=(w,w+40)) for w in xrange(1000)]
    

\--> we hope that results will be returned in the same order we sent them (and
thus don't need a lexsort to get them in the order we are asking for?


Answer: The answer is yes. The order is maintained. If you'd like to choose how to get
your results back, with a blocking map, iterative map, or asynchronous
(unordered) map, then you can use the fork of `pp` in `pathos`. The
`pathos.pp` fork also works with python 3.x.

    
    
    >>> # instantiate and configure the worker pool
    >>> from pathos.pp import ParallelPythonPool
    >>> pool = ParallelPythonPool(nodes=4)
    >>>
    >>> # do a blocking map on the chosen function
    >>> print pool.map(pow, [1,2,3,4], [5,6,7,8])
    [1, 32, 729, 16384]
    >>>
    >>> # do a non-blocking map, then extract the results from the iterator
    >>> results = pool.imap(pow, [1,2,3,4], [5,6,7,8])
    >>> print "..."
    >>> print list(results)
    [1, 32, 729, 16384]
    >>>
    >>> # do an asynchronous map, then get the results
    >>> results = pool.amap(pow, [1,2,3,4], [5,6,7,8])
    >>> while not results.ready():
    >>>     time.sleep(5); print ".",
    >>> print results.get()
    [1, 729, 32, 16384]
    

get `pathos.pp` here: <https://github.com/mmckerns>

