Comments (11)
That's because a Range<u64>
is not an ExactSizeIterator
, since its total length might not fit in a usize
. That concept from serial iterators also applies to rayon, since its lengths are also usize
.
from rayon.
This is sad since it leads to ugly as u32
and as u64
scattered around the place, and problems if you want say 10^30 items. However it sounds like this is a hard constraint and so not fixable. If so then this issue clearly has to be closed.
from rayon.
10^30 items?!?! At 1ns per item, I figure that will take about 32 trillion years of cpu time. You must have massive parallelization plans... 😉
It's more realistically annoying to be limited by u32::MAX on 32-bit platforms, this is true, and also annoying that 32-bit concerns are still limiting cases that 64-bit machines could handle just fine. Rayon is consistent with similar decisions in the standard library, for better or worse.
from rayon.
10^30 was an over-estimate. :-) Though if we want to do calculations for all the proton in the universe then that is 10^80 – at a rough guess.
For these sorts of computations, Rust has to compete with Chapel (and X10). The computers that excel at these things have many thousands of processors, and cost many millions of pounds.
It seems though the Rust standard library is dictating and they have made a very 32-bit decision in a clearly 64-bit world. :-( I will close this issue, but with a small tear.
from rayon.
If you only care about running on 64-bit, at least you can cast your u64 to/from usize without loss.
from rayon.
I think for production code I would use usize, and thus avoid the problem. But for some trivial language comparison codes, I have to guarantee 64-bit so that comparisons are not muddied by the 32-bit/64-bit integer and float numbers.
from rayon.
I think it's not out of the question to address this shortcoming. Not that I have a great idea how to do it.
from rayon.
But I'm going to re-open this in any case.
from rayon.
Could you add a switch so it works on 64 bit systems?
from rayon.
See #144, which implements these as unindexed producers.
from rayon.
Closed by #144.
from rayon.
Related Issues (20)
- 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 2
- 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
- the method `par_iter` exists for struct `ChunkByMut<'_, BinF32, {[email protected]:207:78}>`, but its trait bounds were not satisfied HOT 5
- Unupdated crossbeam dependency makes MIRI angry HOT 1
- help: How to implement memoized chunks for parallel iterator? HOT 2
- wrong repo, issue deleted HOT 3
- Comparison with Spice HOT 1
- Switching par_iter makes memory usage explode (40x) HOT 3
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.