Comments (8)
@cuviper well-- consistency is a lot to ask =)
In any case, I feel all right about just requiring associativity.
from rayon.
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.
from rayon.
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.
from rayon.
Hmm, the new reduce
says just associative, but reduce_with
still says commutative too. Then sum
, mul
, min
, and max
all mention commutative operators.
from rayon.
Are there tests for just-associative reduction functions (String::push
?) already?
from rayon.
Using collect
into any of the ordered collections will exercise associative non-commutative reduce. Look at their FromParallelIterator
implementations.
Any further question about this? Otherwise, I think we can close this issue.
from rayon.
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".
from rayon.
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, find_first
et al. would make no sense if we didn't maintain order.
from rayon.
Related Issues (20)
- How to implement ParallelIterator for a custom Range? HOT 13
- How to dynamically change the number of threads during runtime? HOT 2
- `ParallelExtend` for tuples of references HOT 3
- Using async iterator-like SQLX fetch with Rayon HOT 4
- Docs on "spawn" don't say what exactly this function does HOT 1
- Add SIMD SORT as an option HOT 1
- Handle/guard support for current thread pool HOT 1
- Optional parallelization
- Way to have assertion whether something is outside of a rayon task HOT 2
- how drop rayon whren it in a dylib and dylib should be droped? HOT 4
- Error reporting in scoped tasks
- cooperative yield in ThreadPool::install() causes unexpected behavior in nested pools HOT 4
- rayon-core tests fail to build. HOT 6
- Matrix multiplication with Rayon doesn't see perf improvements HOT 3
- general purpose WASM support? HOT 1
- `fold` creates identity for each sublist HOT 10
- Support for some sort of collect()/extend() into `LinkedList<Vec<T>>` HOT 1
- A yield_now/yield_local alternative that allows the thread to go to sleep HOT 3
- Rayon slower than single threaded performance when mixing iter and par_iter HOT 9
- Potential to modify ordering for split_count and tour_counter HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rayon.