Skip to content

Commit

Permalink
added results for rayon git, more crates to check
Browse files Browse the repository at this point in the history
  • Loading branch information
willi-kappler committed Jan 24, 2016
1 parent fe51a9c commit b95031e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Supported command line options:
--img_size <IMAGE_SIZE> size of image in pixel (square, default: 1024, must be a power of two)
--img1 <IMAGINARY1> lower part (default: -1.50)
--img2 <IMAGINARY2> upper part (default: 1.50)
--write_meta_data write meta data like run time into the ppm file (default: off)
--max_iter <MAX_ITER> maximum number of iterations (default: 2048)
--num_threads <NUMBER_OF_THREADS> number of threads to use (default: 2)
--re1 <REAL1> left real part (default: -2.0)
Expand Down Expand Up @@ -62,17 +63,21 @@ simple parallel | 1 | 2508.58119
simple parallel | 8 | 389.50966
simple parallel | 24 | 161.75248
rayon* | 24 | 139.04431
rayon git* | 24 | 127.69423

(*) Note that rayon uses whatever number of cores are available at the moment.

With just using one thread the overhead for both scoped thread pool and simple parallel is too high and thus both are slower than the serial version.
Using all cores (including virtual one due to hyper threading) rayon is the fastest method. Is uses explicit work stealing to utilize all the cores more efficiently.

# TODO:
- [ ] Check ArrayFire
- [ ] Check Collenchyma
- [ ] Check Timely Dataflow
- [ ] Check Crossbeam
- [ ] Check [ArrayFire](https://github.com/arrayfire/arrayfire-rust)
- [ ] Check [Collenchyma](https://github.com/autumnai/collenchyma)
- [ ] Check [Timely Dataflow](https://github.com/frankmcsherry/timely-dataflow)
- [ ] Check [Crossbeam](https://github.com/aturon/crossbeam)
- [ ] Check [rust-threadpool](https://github.com/frewsxcv/rust-threadpool)
- [ ] Check [jobsteal](https://github.com/rphmeier/jobsteal)
- [ ] Check [forkjoin](https://github.com/faern/forkjoin)
- [ ] Use rust-fmt on source code (Thanks to matklad)
- [ ] Check docopt (instead of clap ? Thanks to matklad)

Expand Down
Binary file modified plot/mandel_bench.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion plot/plot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ gnuplot <<PLOT
plot "serial.txt" title "serial", \
"scoped_thread_pool.txt" title "scoped thread pool", \
"simple_parallel.txt" title "simple parallel", \
"rayon.txt" title "rayon"
"rayon.txt" title "rayon", \
"rayon_git.txt" title "rayon git"
PLOT

1 change: 1 addition & 0 deletions plot/rayon_git.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
24 127.69423
3 changes: 3 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ fn rayon_mandel(mandel_config: &MandelConfig, image: &mut [u32]) {
rayon_mandel_helper(mandel_config, image, 0);
}

// Rayon helper function for recursive divide-and-conquer call
fn rayon_mandel_helper(mandel_config: &MandelConfig, slice: &mut [u32], y: u32) {
if slice.len() == (mandel_config.img_size as usize) { // just process one scanline of the mandelbrot image
for x in 0..mandel_config.img_size {
Expand All @@ -214,6 +215,8 @@ fn rayon_mandel_helper(mandel_config: &MandelConfig, slice: &mut [u32], y: u32)
}
}



// Prepares and runs one version of the mandelbro set calculation
fn do_run(file_name_prefix: &str, mandel_func: &Fn(&MandelConfig, &mut [u32]) -> (),
mandel_config: &MandelConfig, image: &mut [u32], time_now: &str) {
Expand Down

0 comments on commit b95031e

Please sign in to comment.