Re: Parallel in Fortran90
  Home FAQ Contact Sign in
comp.lang.fortran only
 
Advanced search
POPULAR GROUPS

more...

 Up
Re: Parallel in Fortran90         

Group: comp.lang.fortran · Group Profile
Author: Damian
Date: Sep 4, 2008 07:20

On Sep 3, 3:54 am, Arjen Markus wrote:
> On 3 sep, 12:34, Fatemeh gmail.com> wrote:
>
>> Dear all;
>
>> I have written a code in Fortran90, but this code is run for large
>> systems very slowly (because of large amount of data)
>> now I want to convert my program to a parallel one. but I haven't ever
>> written parallel program.
>> Would you please guide me what should I do?
>
>> I'm anxiously looking forward your reply and guidelines.
>
>> Kind regards,
>> Fatemeh
>
> There are roughly speaking three methods you can use:
> - OpenMP - the easiest method, as it involves compiler directives
>   mostly
> - multithreading (tricky to get right, but more flexible than
>   OpenMP)
> - multiprocessing (MPI is a commonly used method)
>
> Since you have no experience with it, I suggest you look at
> OpenMP. There are enough references and documents on the
> Internet to get you started.
>
> But be aware: you only get benefits from parallel programming
> techniques if the problem you are solving allows some form
> of parallel processing and if the hardware allows it (i.e.
> several processors within one machine or a collection of
> cooperating machines)
>
> Regards,
>
> Arjen

I too recommend OpenMP if you want really quick turnaround and very
modest speedups. Obviously, the actual speedup is very algorithm- and
hardware-dependent. On my applications, I can parallelize 95%% of the
code (~10,000 lines) with OpenMP in a day or two using mostly one or
two commands, but I could never get beyond a speedup in the 2-4 range
on 6-8 single-core processors.

My experiences with automatic parallelization by compilers proved even
less fruitful, but it's so easy to try that it's worth an attempt.

If you want large speedup on large numbers of processors, it seems MPI
is the only way to go, but it will require significant time investment
and will touch every part of your code. As a compromise, you might
consider a toolkit such as Bundle-Exchange-Compute (http://
www.cs.sandia.gov/BEC/). It is compatible with MPI (not a competitor)
but much simpler to use and apparentely gives speedup comparable to
hand-tuned MPI with far fewer commands.

A very important first step is to profile your code to determine which
parts are taking the most time and to concentrate your efforts there.
For serial code on Linux, you might use the 'gprof' system command.
For both serial and parallel (of any flavor), you might use the Timing
Analysis Utilities (TAU): http://www.cs.uoregon.edu/research/tau/cca/index.php.

Damian
no comments
diggit! del.icio.us! reddit!