comp.lang.ada
 help / color / mirror / Atom feed
From: "Rego, P." <pvrego@gmail.com>
Subject: Re: Ada and OpenMP
Date: Fri, 8 Mar 2013 06:24:59 -0800 (PST)
Date: 2013-03-08T06:24:59-08:00	[thread overview]
Message-ID: <1f08b9a5-8b9e-4831-b1f2-fdcc4eef666d@googlegroups.com> (raw)
In-Reply-To: <hr-dnULuncyRjqTM4p2dnAA@giganews.com>

Em quinta-feira, 7 de março de 2013 19h22min03s UTC-3, Peter C. Chapin  escreveu:
> 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).
> In Ada one might write, perhaps
> pragma OMP(Parallel_For)
> for I in 1 .. MAX loop
>    A(I) := A(I) + 1
> end loop;
> Doing this with Ada tasks in such a way that it uses an optimal number 
> of threads on each execution (based on core count) would be much more 
> complicated, I should imagine. Please correct me if I'm wrong!
> OpenMP has various other features, some of which could be done naturally 
> with tasks, but much of what OpenMP is about is semi-automatic fine 
> grained parallelization. It is to Ada tasking what Ada tasking is to the 
> explicit handling of locks, etc.
> Peter

Yes, that's the idea.



  parent reply	other threads:[~2013-03-08 14:24 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
2013-03-07 23:43     ` Georg Bauhaus
2013-03-08 10:18       ` Georg Bauhaus
2013-03-08 14:24     ` Rego, P. [this message]
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