comp.lang.ada
 help / color / mirror / Atom feed
From: dennison@telepath.com
Subject: Re: parallel programming
Date: 1998/12/01
Date: 1998-12-01T00:00:00+00:00	[thread overview]
Message-ID: <7412a0$hvb$1@nnrp1.dejanews.com> (raw)
In-Reply-To: 3663BCDF.E05A1B16@est.it

In article <3663BCDF.E05A1B16@est.it>,
  pumilia@est.it wrote:
> I plan to set up a libc6 based linux box with two processors on
> the mainboard to speed up the execution of cyclic fortran routines.
> I am currenlty involved with dynamilcal simulations in statistical
> physics where two or more do-loops are nested together and executed a
> very large number of times.
...
> Since i will not buy a commercial fortran compiler, i am exploring the
> possibility to translate to ada (the gnat gpl'd version) my routines
> to get a parallel code.
> My question is:
>  -  will ada programs, given appropriate directives, run in parallel
>     on a two processor pc intel machine, provided that that the linux
>     kernel as been compiled setting SMP=1 in the makefile?

It sounds like what you are looking for is some kind of High Performance
Fortran-like functionality in Ada. Not that it isn't possible, but I know of
no Ada compiler that will implicilty parallelize sequential code for you. Ada
has no equivalent of the "dopar"-type explicitly parallel looping constructs
of HPF.

To get the benifits of parallel execution in Ada, you will probably have to
write the loop in an Ada task type, create two of those tasks, and split the
input data between them yourself. Its not really as hard as it sounds, but it
does require you to learn a smidge about Ada tasks.

For that to actually execute in parallel, your Ada compiler will have to put
those tasks in separte OS threads (which Gnat will do), and your OS will have
to be able to run separte threads on separate processors (I don't know if
Linux does this).

The *good* news is that Ada's strong typing rules allow compilers to optimize
much better than a Fortran compiler can with the same amount of work. Gnat
itself probably doesn't optmize any better or worse that the gnu-based Fortran
though, since they both share the same back-end.

It occurrs to me that extending Gnat with "for" loop pragmas for the 3
parallel looping constructs of HPF would be a great reasearch project for a
graduate student...

--
T.E.D.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




  reply	other threads:[~1998-12-01  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-12-01  0:00 parallel programming Paolo Pumilia
1998-12-01  0:00 ` dennison [this message]
1998-12-01  0:00 ` Samuel Tardieu
1998-12-01  0:00   ` Paolo Pumilia
1998-12-01  0:00     ` Anders Gidenstam
replies disabled

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