-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
add comprehension support to @threads
#209
Comments
Is this particularly different from I.e., would it make sense to implement this kind of comprehension as just some syntactic sugar on pmap, or are you envisioning more to it than that? |
The syntactic sugar part could be But, we want to handle multiple dimensions, and it would be nice for it to return a distributed array. It would also be nice for each processor to compute points evenly spaced over the whole range, since this usually gives better load balancing. Then you might want to be able to move those results into a simpler distribution. |
Now implemented on the jb/multi branch! |
Sweet. Is this an indication that the new Darray model is more productive? |
Yes, a bit, but the only real difference in the interface is that the core operation is constructing a piece of an array from its indexes. The old DArray constructor could have been changed to work that way, but many other changes are needed too (distributing in all dimensions, and doing most operations lazily). I'm also not sure what to do about array references inside parallel comprehensions. What you want is for |
The basic thing is now on master, but it does not handle array references yet. Doing that rewrite may be too magical, but we should probably do it. |
@JeffBezanson , seems like you had already implemented this - which I have moved under @darray in #5512 . What do you mean by "does not handle array references yet" ? |
(cherry picked from commit 23af62a65487f626c7e5585d0fb4dfe7c4c9ce67)
This would be spelled |
FYI, using Transducers
tcollect(2x for x in 1:10) already does it in parallel. Filtering and flattening are also supported. |
@threads
For example:
The text was updated successfully, but these errors were encountered: