Parallel in Fortran90

This is a discussion on Parallel in Fortran90 within the Fortran forums in Programming Languages category; 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...

Go Back   Application Development Forum > Programming Languages > Fortran

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 09-03-2008, 06:34 AM
Fatemeh
Guest
 
Default Parallel in Fortran90

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
Reply With Quote
  #2  
Old 09-03-2008, 06:54 AM
Arjen Markus
Guest
 
Default Re: Parallel in Fortran90

On 3 sep, 12:34, Fatemeh <fateme.mirj...@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
Reply With Quote
  #3  
Old 09-03-2008, 08:15 AM
Dr Ivan D. Reid
Guest
 
Default Re: Parallel in Fortran90

On Wed, 3 Sep 2008 03:34:59 -0700 (PDT), Fatemeh <fateme.mirjani@gmail.com>
wrote in <d816d14b-41e9-49de-a606-4396b595b0e6@l42g2000hsc.googlegroups.com>:

> 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?


What is your compiler, and what is your target system? Intel
Fortran, for example, can parallelise sections of code for execution on
multi-core processors. For example, a dataset comparison I wrote (on
Linux) executed in 9 hours, but reported 13-1/4 hours CPU time on a 2.2
GHz dual-core Athlon. It ran much faster than that on a quad-core 2.4 GHz
Core 2 processor, but I think much of that was due to being able to use
SSE3 instructions (and maybe SSSE3). The compile flags I used were

ifort -O3 -parallel -ipo0

--
Ivan Reid, School of Engineering & Design, _____________ CMS Collaboration,
Brunel University. Ivan.Reid@[brunel.ac.uk|cern.ch] Room 40-1-B12, CERN
KotPT -- "for stupidity above and beyond the call of duty".
Reply With Quote
  #4  
Old 09-04-2008, 10:20 AM
Damian
Guest
 
Default Re: Parallel in Fortran90

On Sep 3, 3:54*am, Arjen Markus <arjen.mar...@wldelft.nl> wrote:
> On 3 sep, 12:34, Fatemeh <fateme.mirj...@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
Reply With Quote
  #5  
Old 09-05-2008, 06:47 AM
Colin Paul Gloster
Guest
 
Default Re: Parallel in Fortran90

On Wed, 3 Sep 2008, Fatemeh wrote:

|----------------------------------------------------------------------|
|"I have written a code in Fortran90, [..] |
| |
|[..]" |
|----------------------------------------------------------------------|

Dear Fatemeh,

When did you write this Fortran90 code?

With best regards,
Colin Paul
Reply With Quote
  #6  
Old 09-06-2008, 02:13 AM
Fatemeh
Guest
 
Default Re: Parallel in Fortran90

On Sep 5, 2:47 pm, Colin Paul Gloster <Colin_Paul_Glos...@ACM.org>
wrote:
> On Wed, 3 Sep 2008, Fatemeh wrote:
>
> |----------------------------------------------------------------------|
> |"I have written a code in Fortran90, [..] |
> | |
> |[..]" |
> |----------------------------------------------------------------------|
>
> Dear Fatemeh,
>
> When did you write this Fortran90 code?
>
> With best regards,
> Colin Paul


It's new. I have just written it. (can I see your code?)
Reply With Quote
  #7  
Old 09-06-2008, 05:57 AM
Gib Bogle
Guest
 
Default Re: Parallel in Fortran90

Fatemeh 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


Google is your friend.
Reply With Quote
  #8  
Old 09-09-2008, 09:50 AM
Colin Paul Gloster
Guest
 
Default Re: Parallel in Fortran90

On Fri, 5 Sep 2008, Fatemeh wrote:

|--------------------------------------------------------------------------|
|"On Sep 5, 2:47 pm, Colin Paul Gloster <Colin_Paul_Glos...@ACM.org> |
|wrote: |
|> On Wed, 3 Sep 2008, Fatemeh wrote: |
|> |
|> |----------------------------------------------------------------------||
|> |"I have written a code in Fortran90, [..] ||
|> | ||
|> |[..]" ||
|> |----------------------------------------------------------------------||
|> |
|> Dear Fatemeh, |
|> |
|> When did you write this Fortran90 code? |
|> |
|> With best regards, |
|> Colin Paul |
| |
|It's new. I have just written it." |
|--------------------------------------------------------------------------|

Thank you.

|--------------------------------------------------------------------------|
|" (can I see your code?)" |
|--------------------------------------------------------------------------|

I do not have code to show you.

Regards,
Colin Paul
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 02:31 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.