Thinking Parallel

A Blog on Parallel Programming and Concurrency by Michael Suess

More reasons why OpenMP is the way to go for parallel programming

Expanding on my earlier article about Why OpenMP is the way to go for parallel programming, I would like to point out a couple more strengths of OpenMP. And the best thing about this is: I do not have to do it myself this time, because OpenMP evangelist Ruud van der Pas has already done the work in his nice article on Using OpenMP to parallelize for CMT. Therefore I will just tease you with the main advantages he has come up with (shamelessly copied from his article):

  • Portable – Every major hardware vendor and several ISVs provide an OpenMP compiler
  • Modest programming effort – Implementing OpenMP is usually fairly easy compared to other programming models
  • Incremental parallelization – One can implement the parallelization step by step
  • Local impact – Often, the OpenMP specific part in an application is relatively small
  • Easier to test – By not compiling for OpenMP you “de-activate” it
  • Natural mapping onto CMT architectures – OpenMP maps elegantly onto a CMT processor
  • Assistance from tools – You get a compiler to help you
  • Preserves sequential program – If done correctly, you can have your sequential program still built in

Pretty nice and long list, don’t you think? Now the only remaining question is, why I did not come up with all those reasons for my last article :D . Anyways, if you ever get the chance to visit one of Ruuds presentations, I encourage you to grab that chance and listen to him, as he has very interesting stories to tell (had the pleasure to listen to him at this years IWOMP conference and learned a great deal from it). It’s a shame he is not blogging more often ;)

3 Responses to More reasons why OpenMP is the way to go for parallel programming »»


Comments

  1. Comment by Christopher C. Aycock | 2006/08/16 at 17:42:04

    As you point out, the best features of OpenMP are that it’s (1) mature, and (2) builds on existing sequential C code.

    I’d be interested to see a programming construct based on the aspect-oriented paradigm, though I have yet to find one. That is, instead of including compiler directives in the original code, the programmer can simply include details about parallelization in an external file.

    The other item I’m interested in is better parallelization of math-specific languages like MATLAB or Mathematica. It seems that the industry is definitely moving in this direction with Star-P, as well as packages from both MathWorks and Wolfram.

  2. Comment by Michael Suess | 2006/08/18 at 17:52:46

    Parallel aspect oriented programming, thats an interesting idea for sure. The problem I see with it is that parallelisation is usually more than an “aspect” and therefore the aspect-oriented approach may not be “fine-grained” enough to cover it. But since my knowledge of aspect-oriented programming is more than half a year old by now, maybe that problem is solved already…

  3. Comment by Jakob Engblom | 2007/11/28 at 09:11:28

    I just started reading about OpenMP in a recent Intel book on parallel programming (for Intel hyperthreaded and multicore machines), and was kind of shocked to realize that the compiler doesn’t check for data dependences and data that is shared between threads that could pose a race condition problem. To me, this sounds like “automatic” is a bit too strongly worded; as a programmer, you still have some seriously hard thinking to do before your serial loop actually parallelizes in the right way.

    In principle, the compiler should be able to detect dangerous conditions, it has been done in Fortran for a long time. And warn when it cannot understand things (with some pointers and structs you can throw off any C compiler’s understanding of your code). There are systems that do this better than OpenMP, like SieveC from CodePlay (helped by somewhat modified C semantics, of course).

    The Intel book is actually not too shabby if you can live with lots of (TM) notices and a very clear slant towards Intel HW and its Windows/Linux software ecosystem. It gives an overview of a range of programming systems (Windows API, .Net, pthreads, OpenMP). see http://www.intel.com/intelpress/sum_mcp.htm


Leave a Reply

HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>