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

map should have timeout to mitigate hang on missing import #7

Open
mmckerns opened this issue Nov 23, 2015 · 0 comments
Open

map should have timeout to mitigate hang on missing import #7

mmckerns opened this issue Nov 23, 2015 · 0 comments

Comments

@mmckerns
Copy link
Member

This works:

>>> def model(x):
...   from mystic.models import griewangk
...   return griewangk(x)
... 
>>> from pathos.pools import ParallelPool    
>>> p = ParallelPool()
>>> p.map(model, [[1,2,3],[4,5,6]])
[1.0170279701835734, 1.591708292293129]
>>> 

However, without the encapsulated import, the map will hang (and require python to be manually killed). ppft provides the ability for the user to pass the appropriate required modules to the map, however a timeout could also be added for when the import is missing (or something else has gone awry that is causing the map to hang).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant