Software development industry analysis by Larry O'Brien, the former editor of Software Development and Computer Language
Friday, May 04, 2007

 Michael Seuss has a good blog piece on parallelizing code that contains loop-carried dependenciess, which is to say, code such as the following, where the calculation in one pass is dependent on a previous pass' calculation. The moral of the story, though, is that even when run to the point where the doubles start to overflow (i.e., at the upper limits of the code's capability), the overhead of creating threads turns out to be an order of magnitude slower than the non-parallel version! (And this in code submitted by boffins on the OpenMP mailing list.)

This is a great example of why neither of the simplistic approaches to parallelization ("everything's a future" or "let the programmer decide") will ultimately prevail and how something akin to run-time optimization (a la HotSpot) will have to be used.

PLAIN TEXT

C:

  1. const double up = 1.1 ;

  2. double Sn=1000.0;

  3. double opt[N+1];

  4. int n;

  5. for (n=0; n<=N; ++n) {

  6.   opt[n] = Sn;

  7.   Sn *= up;

  8. }

Friday, May 04, 2007 7:07:03 AM (Hawaiian Standard Time, UTC-10:00) |  Disqus link  | Concurrency | Knowing | SD Futures#
Search
About Larry...
Flickr photostream
Subscribe: RSS 2.0 Atom 1.0
Popular Articles
Programming Sabre with Java, C#, and XML
Genetic Programming in C#
15 Exercises To Know A Programming Language
Top 10 Things I've Learned About Computers From the Movies and Any Episode of "24"
Recently Published Articles
HI
KonaKoder
Categories
Archive
Admin Login
Sign In
Toolroll