Comments (5)
I don't there can be a standard suggestion, because it depends on both the number of elements and the number of threads in the pool, at least. In theory it will have logarithmic depth, but work-stealing will lengthen that further.
I wonder if we need to be smarter about MAX_SEQUENTIAL
here:
Lines 754 to 756 in 990841b
i.e. rather than just a fixed constant, maybe that should also consider num_elem / num_threads
and some additional factor to account for imbalance. Then it should use a higher limit when you're starting with billions, and you won't get so much stack use due to work stealing.
Similarly, the stable sort has two constants, CHUNK_SIZE
while splitting and MAX_SEQUENTIAL
while merging:
Lines 621 to 623 in 990841b
Lines 440 to 444 in 990841b
from rayon.
Well, what if I know the number of elements, their size, and the number of threads in the pool? Just ballpark.
from rayon.
I don't know. You'll get a better answer if you run a few experiments yourself.
from rayon.
I'm running into the same issue and have found that around 5-10B elements the default of 2MB seems to break, so I'm testing out a heuristic of using max[1, log2(N / 5e9)] * 2 MB right now.
(this is sorting a memory mapped slice of u64 on a machine with 48 physical cores)
from rayon.
Update: I actually ran into a bus error (core dumped)
when using the logarithmic scaling. Linear scaling would sort of defeat the purpose of memory mapping the data, so I might try square root scaling.
from rayon.
Related Issues (20)
- Tag missing for release 1.10.0 HOT 1
- Unable to parallelize properly using `par_iter` or `par_bridge` HOT 8
- Documentation for `ParallelIterator::fold` and/or `ParallelIterator::reduce` seam to be incorrect HOT 5
- Slowdown when using deeply nested vector HOT 6
- Potential `len` method ambiguity in `src/range.rs` HOT 5
- Potential to fix memory ordering for value HOT 2
- a broadcast that only gets executed on idle threads
- `in_place_scope` documentation is confusing/unclear HOT 14
- use_current_thread and the global thread pool HOT 2
- Why does ThreadPool block until a operation is finished? HOT 1
- A way to hook before/after job execution (and/or a way to see a number of tasks in the processing queue)
- Function dependencies with Rayon without blocking the thread / Rayon synchronization primitives?
- Add synchronization guarantees for `ParallelIterator::for_each*` HOT 1
- Par bridge with optional buffering IO handling HOT 1
- Thread pool without work stealing HOT 6
- Question about return types from .map() HOT 4
- Terribly inefficient design and possible solution HOT 5
- [Discussion] Is it possible to impl `IntoIterator` for `ParallelIterator`? HOT 3
- Yield locks HOT 1
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.