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

Multiprocessing semantics in parallel.view.map #3077

Closed
hgrecco opened this issue Mar 25, 2013 · 2 comments · Fixed by #3282
Closed

Multiprocessing semantics in parallel.view.map #3077

hgrecco opened this issue Mar 25, 2013 · 2 comments · Fixed by #3282
Assignees
Labels
Milestone

Comments

@hgrecco
Copy link

hgrecco commented Mar 25, 2013

I have a script that is executed using either

  • the builtin map
  • using multiprocessing map
  • IPython view.map.

This is very convenient because I can easily debug and test scripts, as well as run the same script unchanged in different installations.

However, the semantics of map is different. While in multiprocessing a generator is accepted, in IPython is not (fails when it tries to take the length of the generator). Insider multiprocessing, the following code converts a generator to a list:

if not hasattr(iterable, '__len__'):
    iterable = list(iterable)

I do not really like this behavior (Explicit is better than implicit), but having the same semantics is convenient.

So, my questions are:
1.- Is it possible to have a map that does not require to know in advance the number of tasks?
2.- If not, what do you think about using the same semantics that multiprocessing?

@ghost ghost assigned minrk Apr 11, 2013
@minrk
Copy link
Member

minrk commented Apr 11, 2013

Matching multiprocessing should be trivial, failing to cast to a list might be tricky, but I will have a look.

@minrk
Copy link
Member

minrk commented Jun 19, 2013

closed by #3282

@minrk minrk closed this as completed Jun 19, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants