comp.lang.ada
 help / color / mirror / Atom feed
* parallel programming
@ 1998-12-01  0:00 Paolo Pumilia
  1998-12-01  0:00 ` Samuel Tardieu
  1998-12-01  0:00 ` dennison
  0 siblings, 2 replies; 5+ messages in thread
From: Paolo Pumilia @ 1998-12-01  0:00 UTC (permalink / raw)


Hi all,
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.
I run through parallel-processing howto but i need some quick hints,
since i am very new to this matter.
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?

Finally, technical notes are welcome. My idea is to get two
celeron-intel processors with shared memory and pci bus. What about
heating of the chipset, when cpu intensive applications are run for
tens of hours?

thank you for your help

-- 
--- CSTC




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: parallel programming
  1998-12-01  0:00 ` Samuel Tardieu
@ 1998-12-01  0:00   ` Paolo Pumilia
  1998-12-01  0:00     ` Anders Gidenstam
  0 siblings, 1 reply; 5+ messages in thread
From: Paolo Pumilia @ 1998-12-01  0:00 UTC (permalink / raw)


Samuel Tardieu wrote:
> 
> Since you wrote you'll be using GNAT, the answer is "yes, if you use
> native threads".
> 
>   Sam

Will you please give a quick explaination about how using threads? I am
currently working with kernel 2.0.35. Should i compile the kernel
setting peculiar directives in the makefile?

thank you for your help

Paolo 

-- 
--- CSTC




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: parallel programming
  1998-12-01  0:00   ` Paolo Pumilia
@ 1998-12-01  0:00     ` Anders Gidenstam
  0 siblings, 0 replies; 5+ messages in thread
From: Anders Gidenstam @ 1998-12-01  0:00 UTC (permalink / raw)


In article <3663D346.F7495A89@est.it>,
	Paolo Pumilia <pumilia@est.it> writes:
> Samuel Tardieu wrote:
>> 
>> Since you wrote you'll be using GNAT, the answer is "yes, if you use
>> native threads".
>> 
>>   Sam
> 
> Will you please give a quick explaination about how using threads? I am
> currently working with kernel 2.0.35. Should i compile the kernel
> setting peculiar directives in the makefile?

You don't need to change the kernel, it's a matter of
configuring the gnat compiler. Read the README file for the compiler.
There is a problem though, programs using threads can only be run as
root unless you change a line in the ada runtimesystem.
( I don't remember which file, but it has been posted here before )

/Anders    

-- 
--------------------------------------------
"A well-written program is its own heaven; 
 a poorly-written program is its own hell."
  - The Tao of Programming 




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: parallel programming
  1998-12-01  0:00 parallel programming Paolo Pumilia
  1998-12-01  0:00 ` Samuel Tardieu
@ 1998-12-01  0:00 ` dennison
  1 sibling, 0 replies; 5+ messages in thread
From: dennison @ 1998-12-01  0:00 UTC (permalink / raw)


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    




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: parallel programming
  1998-12-01  0:00 parallel programming Paolo Pumilia
@ 1998-12-01  0:00 ` Samuel Tardieu
  1998-12-01  0:00   ` Paolo Pumilia
  1998-12-01  0:00 ` dennison
  1 sibling, 1 reply; 5+ messages in thread
From: Samuel Tardieu @ 1998-12-01  0:00 UTC (permalink / raw)


>>>>> "Paolo" == Paolo Pumilia <pumilia@est.it> writes:

Paolo> - will ada programs, given appropriate directives, run in
Paolo>   parallel on a two processor pc intel machine, provided that
Paolo>   that the linux kernel as been compiled setting SMP=1 in the
Paolo>   makefile?

Since you wrote you'll be using GNAT, the answer is "yes, if you use
native threads".

  Sam
-- 
Samuel Tardieu -- sam@ada.eu.org




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1998-12-01  0:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-12-01  0:00 parallel programming Paolo Pumilia
1998-12-01  0:00 ` Samuel Tardieu
1998-12-01  0:00   ` Paolo Pumilia
1998-12-01  0:00     ` Anders Gidenstam
1998-12-01  0:00 ` dennison

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