comp.lang.ada
 help / color / mirror / Atom feed
From: Waldek Hebisch <hebisch@math.uni.wroc.pl>
Subject: Re: Ada and OpenMP
Date: Sun, 10 Mar 2013 18:00:04 +0000 (UTC)
Date: 2013-03-10T18:00:04+00:00	[thread overview]
Message-ID: <khihn4$b7v$1@z-news.wcss.wroc.pl> (raw)
In-Reply-To: khb8m6$933$1@munin.nbi.dk

Randy Brukardt <randy@rrsoftware.com> wrote:
> "Peter C. Chapin" <PChapin@vtc.vsc.edu> wrote in message 
> news:hr-dnULuncyRjqTM4p2dnAA@giganews.com...
> > OpenMP is a different animal than Ada tasks. It provides fine grained 
> > parallelism where, for example, it is possible to have the compiler 
> > automatically parallelize a loop. In C:
> >
> > #pragma omp parallel for
> > for( i = 0; i < MAX; ++i ) {
> >   array[i]++;
> > }
> >
> > The compiler automatically splits the loop iterations over an 
> > "appropriate" number of threads (probably based on the number of cores).
> 
> Isn't OpenMP aimed at SIMD-type machines (as in video processors), as 
> opposed to generalized cores as in typical Intel and ARM designs? 
> Fine-grained parallelism doesn't make much sense on the latter, because 
> cache coherence and core scheduling issues will eat up gains in almost all 
> circumstances. Ada tasks are a much better model.

Actually OpenMP only looks like fine-grained parallelism, but is not:
OpenMP creates (and destroys) tasks as needed.  Main advantage of
OpenMP is that is automates some common parallel patterns and
consequently code is much closer to seqential version.

It is very hard to get similar effect in fully automatic way,
without pragmas.  Simply, taking looses on fine-graned cases
and pragmas tell the compiler that code is coarse enough
to use several tasks.  Also, OMP pragmas control memory
consitency -- without them compiler would have to assume
worst case and generate slower code.

-- 
                              Waldek Hebisch
hebisch@math.uni.wroc.pl 



  parent reply	other threads:[~2013-03-10 18:00 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-07 18:04 Ada and OpenMP Rego, P.
2013-03-07 20:04 ` Ludovic Brenta
2013-03-07 22:22   ` Peter C. Chapin
2013-03-07 23:42     ` Randy Brukardt
2013-03-08  0:39       ` Peter C. Chapin
2013-03-08  3:31         ` Randy Brukardt
2013-03-08  7:17           ` Simon Wright
2013-03-08 23:40             ` Randy Brukardt
2013-03-08 12:07           ` Peter C. Chapin
2013-03-08 14:40         ` Rego, P.
2013-03-08  1:15       ` Shark8
2013-03-08  3:42         ` Randy Brukardt
2013-03-08 14:53           ` Rego, P.
2013-03-08 15:47             ` Georg Bauhaus
2013-03-08 23:40             ` Randy Brukardt
2013-03-08 16:52           ` Shark8
2013-03-08 23:36             ` Randy Brukardt
2013-03-09  4:13               ` Brad Moore
2013-03-10  4:24                 ` Randy Brukardt
2013-03-08  7:37       ` Simon Wright
2013-03-10 18:00       ` Waldek Hebisch [this message]
2013-03-07 23:43     ` Georg Bauhaus
2013-03-08 10:18       ` Georg Bauhaus
2013-03-08 14:24     ` Rego, P.
2013-03-07 22:52 ` Simon Wright
2013-03-08 21:37   ` Brad Moore
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox