-
Notifications
You must be signed in to change notification settings - Fork 497
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
Collection method for associative, but not commutative, reductions #132
Comments
I don't know if it's promised, but the current implementation should actually preserve order in the reductions, just with associative differences as you note. This is a natural implication of the way the jobs are split recursively and then joined as it returns. |
I believe that in https://github.com/nikomatsakis/rayon/pull/120 I went ahead and promised that the order would be deterministic when doing reduce or fold. |
Hmm, the new |
@cuviper well-- consistency is a lot to ask =) In any case, I feel all right about just requiring associativity. |
Are there tests for just-associative reduction functions ( |
Using Any further question about this? Otherwise, I think we can close this issue. |
Yeah, the issue can likely be closed. I was more wondering whether there were tests to this effect rather than "well, the implementation works that way". |
Ok, I don't think we have any plain mathematical tests of this, but all of the collection and string stuff mandates that it works this way. Also, |
Not sure how possible this is, but I'd like to be able to use parallel iterators with non-commutative reduction functions (e.g., collecting error messages in a deterministic order).
Maybe best to use
.enumerate()
and.sort()
aVec
populated by the parallel iterator?The text was updated successfully, but these errors were encountered: