nbabel icon indicating copy to clipboard operation
nbabel copied to clipboard

Rust SIMD on stable

Open darleybarreto opened this issue 4 years ago • 3 comments

This change allows to run the Rust SIMD code on stable Rust.

darleybarreto avatar Feb 18 '21 11:02 darleybarreto

I was trying to make a version of this to run in parallel. But I couldn't figure out a easy way without using message passing, Mutex or Arc. I wish I know more Rust to have a easy way out. Wrt this PR, idk how good it will perform, since idk how wide works in general with the several SIMD features out there.

darleybarreto avatar Apr 29 '21 12:04 darleybarreto

@paugier what you think? Could this be merged as is?

darleybarreto avatar May 11 '21 12:05 darleybarreto

@paugier I just added a parallel version for Rust. On my machine I got the following

time ./nbabel-nbody/target/release/nbabel ../data/input2k 2
Running Parallel SIMD version
Final dE/E = -0.44307369910184735

real    0m40,392s
user    4m41,494s
sys     0m1,242s

time julia -t8 -O3 --check-bounds=no -- run.jl nbabel5_threads.jl ../data/input2k false

real    0m34,271s
user    4m2,255s
sys     0m1,009s

Since it's a very naive and rough translation of the nbabel5_threads.jl, I'd expect there's room to improve there. For the 1k file, both Rust and Julia have similar performance!

darleybarreto avatar Jul 28 '21 19:07 darleybarreto