CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Parallel Fortran

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By DoHander

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 3, 2010, 03:05
Default Parallel Fortran
  #1
New Member
 
afshar
Join Date: Apr 2010
Posts: 5
Rep Power: 14
ho_afshar is on a distinguished road
Hi every body.
I'm working on a cfd code in fortran. Run times take several days so I need to run my code in parallel mode. As I have not used parallel commands, is there any way to run it on multiple Cpus.

Thanks.
Hossein.
Ho_afshar@yahoo.com
ho_afshar is offline   Reply With Quote

Old   April 3, 2010, 03:40
Default
  #2
New Member
 
Aladdin
Join Date: Jan 2010
Posts: 26
Rep Power: 14
aladdincham is on a distinguished road
you can read the user manual of fortran,it will tell you what do you want to know!
aladdincham is offline   Reply With Quote

Old   April 3, 2010, 03:56
Default
  #3
New Member
 
afshar
Join Date: Apr 2010
Posts: 5
Rep Power: 14
ho_afshar is on a distinguished road
Quote:
Originally Posted by aladdincham View Post
you can read the user manual of fortran,it will tell you what do you want to know!

Thanks,
You mean that it's possible to run a serial program on multiple cpus in all versions of fortran?
I will be thankful if you send me the related documents.
ho_afhar@yahoo.com...
(ho_afshar)
Regards.
ho_afshar is offline   Reply With Quote

Old   April 3, 2010, 07:49
Default
  #4
Senior Member
 
TWB
Join Date: Mar 2009
Posts: 338
Rep Power: 16
quarkz is on a distinguished road
to run your code in parallel, u 'll 've to modify the code ie add some commands in your code to instruct how to run it in parallel. u can use openmp, which seems to be easier, or mpi, which seems more flexible.
quarkz is offline   Reply With Quote

Old   April 3, 2010, 13:57
Default
  #5
Senior Member
 
Join Date: Nov 2009
Posts: 411
Rep Power: 17
DoHander is on a distinguished road
You need to re-write your code to be able to run this in parallel. You need to specifically develop a parallel version of your code.

Search some tutorials (on Google) about OpenMp and MPI to clarify your ideas about parallel programming. My recommendation is to use OpenMP if you have a multiprocessor machine and MPI if you have a cluster made by a few computers.

Do
DoHander is offline   Reply With Quote

Old   April 4, 2010, 02:04
Default
  #6
New Member
 
afshar
Join Date: Apr 2010
Posts: 5
Rep Power: 14
ho_afshar is on a distinguished road
Quote:
Originally Posted by DoHander View Post
You need to re-write your code to be able to run this in parallel. You need to specifically develop a parallel version of your code.

Search some tutorials (on Google) about OpenMp and MPI to clarify your ideas about parallel programming. My recommendation is to use OpenMP if you have a multiprocessor machine and MPI if you have a cluster made by a few computers.

Do

Dear Do,
Thank you very much for your comment.
I had heard that some versions of fortran are capable to handle a serial program on multiple cpus. The one who told me about that is not available now. So I asked if someone else has done so.

Cheers.
Hossein
ho_afshar is offline   Reply With Quote

Old   April 4, 2010, 10:31
Default
  #7
Senior Member
 
TWB
Join Date: Mar 2009
Posts: 338
Rep Power: 16
quarkz is on a distinguished road
Well, u are partly right in saying that. intel fortran has an auto parallel option to enable openmp on some loops. however, u need to make sure it won't cause any error.
quarkz is offline   Reply With Quote

Old   April 4, 2010, 12:52
Default
  #8
New Member
 
afshar
Join Date: Apr 2010
Posts: 5
Rep Power: 14
ho_afshar is on a distinguished road
Quote:
Originally Posted by quarkz View Post
Well, u are partly right in saying that. intel fortran has an auto parallel option to enable openmp on some loops. however, u need to make sure it won't cause any error.

Ok. Thanks.
I need that in Compaq Visual Fortran 6.
Whould you explain more how I can use this parallel option.

Thanks.
ho_afshar is offline   Reply With Quote

Old   April 6, 2010, 11:20
Default
  #9
Senior Member
 
Join Date: Nov 2009
Posts: 411
Rep Power: 17
DoHander is on a distinguished road
I'm sorry to inform you but Compaq Visual Fortran does not have an auto parallel option and it is a quite old Fortran compiler.

If you want a new, modern, Fortran compiler try Intel Fortran (commercial) or gfortran (free alternative).

Please try to understand that what you want a compiler that will magically transform your serial code to a parallel code does not exist (at least not after my knowledge). You have two alternatives:

1. OpenMP - this will allow you to parallelize your code in a relative simple way (work on multiprocessors machines), check this link for a short introduction and a few examples:

http://en.wikipedia.org/wiki/OpenMP

2. MPI - true parallel codes, this will run on multiple computers at once (a cluster). More complicated then 1.

Don't waist your time searching for a silver bullet and take some time and read about parallel programming, you will have a much clear idea about what you can use.

Do
AliE likes this.
DoHander is offline   Reply With Quote

Old   April 7, 2010, 07:47
Default
  #10
New Member
 
afshar
Join Date: Apr 2010
Posts: 5
Rep Power: 14
ho_afshar is on a distinguished road
Quote:
Originally Posted by DoHander View Post
I'm sorry to inform you but Compaq Visual Fortran does not have an auto parallel option and it is a quite old Fortran compiler.

If you want a new, modern, Fortran compiler try Intel Fortran (commercial) or gfortran (free alternative).

Please try to understand that what you want a compiler that will magically transform your serial code to a parallel code does not exist (at least not after my knowledge). You have two alternatives:

1. OpenMP - this will allow you to parallelize your code in a relative simple way (work on multiprocessors machines), check this link for a short introduction and a few examples:

http://en.wikipedia.org/wiki/OpenMP

2. MPI - true parallel codes, this will run on multiple computers at once (a cluster). More complicated then 1.

Don't waist your time searching for a silver bullet and take some time and read about parallel programming, you will have a much clear idea about what you can use.

Do

Thank you very much for your helpful comments.

Cheers
ho_afshar is offline   Reply With Quote

Old   November 8, 2018, 19:19
Default Fortran command
  #11
New Member
 
george
Join Date: Nov 2018
Posts: 1
Rep Power: 0
geoklavaris is on a distinguished road
Hey guys,


I am new in this field and i am trying to learn parallel computing in fortran for my CFD codes. In several scripts i found online, there is a command saying: " call update (id, p) " where id the identity of the thread and p the number of threads. However, i cannot use this command in my compiler and there is nothing online explaing what update does or what could be an alternitive for different version of fortran or compiler. If any one knows please help..
geoklavaris is offline   Reply With Quote

Old   November 9, 2018, 03:26
Default
  #12
Senior Member
 
Join Date: Dec 2017
Posts: 153
Rep Power: 6
AliE is on a distinguished road
Hi,
recently I have done the same task you are going to do using openmpi. if you want to run in parallel you need to modify the code in a not trivial way. The main task to be performed is the halos exachange during interpolation and fluxes calculation. This is not diffucult but you need a lot of testing to be sure that everithing is ok. Usually this operation is performed by isend/irecv/waitall calls but the context in which they are to be used hightly depends on your data structure (structured/unstructured code). Then you have to parallelize your linear solver, it is very diffucult to do in an efficient way, thus you should use an already existing library.openMP seems to be a bit more simple, you do not need any external library since it comes with your compiler if recently updated. However you can run your code only in shared memory machines, thus forget clusters, a part of intel's KNL (64procs).

I do not know the function update(id, p) and I am not using it in any case. Is maybe a user defined subroutine? Can you provide us an example?

In any case my advice is: do not think that make your code parallel is a one week task, it is not trivial at all but it is very interisting get the job done at the end.
AliE is offline   Reply With Quote

Reply

Tags
code, fortran, parallel

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
User fortran error when running CFX-10 in parallel CFDworker CFX 3 September 22, 2015 08:59
parallel fortran code Ahmed Main CFD Forum 1 October 23, 2008 07:15
Parallel Processing of Fortran Subroutine Ashwini Mishra CFX 1 November 3, 2004 10:02
definite integrals, parallel fortran dino Main CFD Forum 0 October 3, 2002 08:25
Parallel Computing Classes at San Diego Supercomputer Center Jan. 20-22 Amitava Majumdar Main CFD Forum 0 January 5, 1999 12:00


All times are GMT -4. The time now is 14:32.