Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hanging mpire worker_pool.map_unordered #32

Closed
fzonneveld opened this issue Feb 9, 2022 · 6 comments
Closed

Hanging mpire worker_pool.map_unordered #32

fzonneveld opened this issue Feb 9, 2022 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@fzonneveld
Copy link

When creating many processes which return large result, mpire will hang in collecting the results.
Analyzed is caused by crossing the system limit size for the os pipes, for linux defaults to 4K.

@sybrenjansen
Copy link
Owner

Would it be possible to provide a minimal working example where this happens? That would save me a lot of time.

And please share the MPIRE version you're using, thnx.

@fzonneveld
Copy link
Author

fzonneveld commented Feb 12, 2022

import mpire    
    
def time_consuming_function(x):    
    print(os.getpid())    
    return os.urandom(1024 * 20)    
    
with mpire.WorkerPool(n_jobs=5) as pool: 
    results = pool.mapi_unordered(time_consuming_function, range(10), worker_lifespan=1)    
    print(len(results))    

Without the worker_lifespan it works fine.
Also pool.map has the same behavior.

@sybrenjansen
Copy link
Owner

Thnx for the example code. I can confirm that it indeed is hanging. I will have a look at this this week.

@sybrenjansen sybrenjansen self-assigned this Feb 21, 2022
@sybrenjansen sybrenjansen added the bug Something isn't working label Feb 21, 2022
@sybrenjansen
Copy link
Owner

sybrenjansen commented Feb 21, 2022

Already found the culprit. Will try to find an elegant solution now. Fix will be available in next release of mpire

sybrenjansen pushed a commit that referenced this issue Feb 21, 2022
@fzonneveld
Copy link
Author

fzonneveld commented Feb 23, 2022 via email

@sybrenjansen
Copy link
Owner

Fixed in v2.3.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants