Coder Social home page Coder Social logo

into_par_iter not defined for u64 about rayon HOT 11 CLOSED

russel avatar russel commented on August 17, 2024
into_par_iter not defined for u64

from rayon.

Comments (11)

cuviper avatar cuviper commented on August 17, 2024

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.

russel avatar russel commented on August 17, 2024

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.

cuviper avatar cuviper commented on August 17, 2024

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.

russel avatar russel commented on August 17, 2024

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.

cuviper avatar cuviper commented on August 17, 2024

If you only care about running on 64-bit, at least you can cast your u64 to/from usize without loss.

from rayon.

russel avatar russel commented on August 17, 2024

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.

nikomatsakis avatar nikomatsakis commented on August 17, 2024

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.

nikomatsakis avatar nikomatsakis commented on August 17, 2024

But I'm going to re-open this in any case.

from rayon.

Binero avatar Binero commented on August 17, 2024

Could you add a switch so it works on 64 bit systems?

from rayon.

cuviper avatar cuviper commented on August 17, 2024

See #144, which implements these as unindexed producers.

from rayon.

nikomatsakis avatar nikomatsakis commented on August 17, 2024

Closed by #144.

from rayon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.