www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - std.parallelism: Call for benchmarks

reply dsimcha <dsimcha yahoo.com> writes:
Andrei asked a while back for me to motivate the inclusion of 
std.parallelism in Phobos with some benchmarks.  I've been putting this 
off because I can't think of many good ones.  Pretty much everything 
I've thought of falls into one of two categories:

1.  A full-fledged real-world example (mostly from my thesis research) 
of where I've used std.parallelism.  These are way too complicated, have 
way too many dependencies, and are way too far from the kinds of 
problems that most programmers are familiar with to serve as motivating 
examples.  Most of them involve algorithms for analyzing 
genomic/transcriptomic data of some kind and are hundreds or thousands 
of lines of code.

2.  Something so trivial that nobody would ever actually parallelize it, 
and that probably wouldn't parallelize well because the parallelism is 
ridiculously fine-grained and/or the computations involved are more 
memory bandwidth bound than CPU bound.

Russel Winder has shown a decent pi-calculating benchmark, which I'd 
like to use with his permission.  Could anyone else please submit some 
benchmarks, or at least some ideas for benchmarks that are simple enough 
to serve as motivating examples, yet non-trivial enough to be worth 
parallelizing?
Feb 25 2011
next sibling parent reply bearophile <bearophileHUGS lycos.com> writes:
dsimcha:

 Could anyone else please submit some 
 benchmarks, or at least some ideas for benchmarks that are simple enough 
 to serve as motivating examples, yet non-trivial enough to be worth 
 parallelizing?
The authors of Cilk/Cilk++ used to have a blog with many examples of parallel programs, like this one (this is not from the blog): http://software.intel.com/en-us/articles/multicore-enabling-the-n-queens-problem-using-cilk/ But many of them probably need micro-parallelism. A possible program is a parallel version of a little ray-tracer. It's very easy to parallelize it. Bye, bearophile
Feb 25 2011
parent "Robert Jacques" <sandford jhu.edu> writes:
On Fri, 25 Feb 2011 22:04:00 -0500, bearophile <bearophileHUGS lycos.com>  
wrote:

 dsimcha:

 Could anyone else please submit some
 benchmarks, or at least some ideas for benchmarks that are simple enough
 to serve as motivating examples, yet non-trivial enough to be worth
 parallelizing?
The authors of Cilk/Cilk++ used to have a blog with many examples of parallel programs, like this one (this is not from the blog): http://software.intel.com/en-us/articles/multicore-enabling-the-n-queens-problem-using-cilk/ But many of them probably need micro-parallelism. A possible program is a parallel version of a little ray-tracer. It's very easy to parallelize it. Bye, bearophile
Although std.parallelism isn't as low-overhead as Cilk yet, it shares the same basic design philosophies (i.e. it's task based) and efficient micro-parallelism is an ultimate goal.
Feb 25 2011
prev sibling next sibling parent Kevin Bealer <kevindangerbealer removedanger.gmail.com> writes:
I would say look for small things people do which are CPU intensive.  One
example
is sorting -- it can be parallelized fairly well and yet sorting 10_000_000
elements still takes long enough to be worth parallelizing.

If you want examples of working parallel sort etc you can look in the 'Futurism'
library that I wrote when exploring Futures for D a few years ago, it's on
dsource.  Feel free to use whatever you find in there... There might be some
other
examples but I don't remember off hand.

Kevin
Feb 26 2011
prev sibling parent Jonas Drewsen <jdrewsen nospam.com> writes:
Here are some ideas:

* Ray tracing
* A simple parallel ODE solver (actually thought about doing one myself 
for a little game)
* Quicksort

/Jonas
Feb 26 2011