uqfoundation / pathos

parallel graph management and execution in heterogeneous computing
http://pathos.rtfd.io
Other
1.38k stars 89 forks source link

Pathos amap is Broken #246

Closed fny closed 2 years ago

fny commented 2 years ago

I'm running version v0.2.9 on 3.9.

def process_analyte(x):
    print(x)
process_vital = process_analyte
analytes_cardinality = [100]
vitals_cardinality = analytes_cardinality

with ProcessPool(10) as pool:
    results1 = pool.amap(process_analyte, analytes_cardinality)
    results2 = pool.amap(process_vital, vitals_cardinality)
    while not (results1.ready() and results2.ready()):
        time.sleep(3)
        print('Working...', results1.ready(), results2.ready())

Working... False False
Working... False False
Working... False False
Working... False False
Working... False False

This works perfectly with the vanilla multiprocessing module.

mmckerns commented 2 years ago

There are no changes to the code since 0.2.9 was released that would cause something like this, and I can't reproduce your results with the current version of pathos on python 3.9:

Python 3.9.13 (main, May 21 2022, 02:35:37) 
[Clang 10.0.1 (clang-1001.0.46.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from pathos.pools import ProcessPool
>>> import time
>>> 
>>> def process_analyte(x):
...     print(x)
... 
>>> process_vital = process_analyte
>>> analytes_cardinality = [100]
>>> vitals_cardinality = analytes_cardinality
>>> 
>>> with ProcessPool(10) as pool:
...     results1 = pool.amap(process_analyte, analytes_cardinality)
...     results2 = pool.amap(process_vital, vitals_cardinality)
...     while not (results1.ready() and results2.ready()):
...         time.sleep(3)
...         print('Working...', results1.ready(), results2.ready())
... 
100
100
Working... True True
>>> 
>>> import pathos
>>> pathos.__version__
'0.3.0.dev0'
>>> import multiprocess
>>> multiprocess.__version__
'0.70.14.dev0'
>>> import dill
>>> dill.__version__
'0.3.6.dev0'
>>> 

Potentially, it could be an issue due to dill, or your OS. What version of dill and multiprocess are you using, and what OS are you using?

fny commented 2 years ago

I'm starting to suspect something wonky is happening with the OS. Closing this for now.