|
[Sponsors] |
April 3, 2010, 04:05 |
Parallel Fortran
|
#1 |
New Member
afshar
Join Date: Apr 2010
Posts: 5
Rep Power: 16 |
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 |
|
April 3, 2010, 04:40 |
|
#2 |
New Member
Aladdin
Join Date: Jan 2010
Posts: 26
Rep Power: 16 |
you can read the user manual of fortran,it will tell you what do you want to know!
|
|
April 3, 2010, 04:56 |
|
#3 | |
New Member
afshar
Join Date: Apr 2010
Posts: 5
Rep Power: 16 |
Quote:
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. |
||
April 3, 2010, 08:49 |
|
#4 |
Senior Member
TWB
Join Date: Mar 2009
Posts: 414
Rep Power: 19 |
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.
|
|
April 3, 2010, 14:57 |
|
#5 |
Senior Member
Join Date: Nov 2009
Posts: 411
Rep Power: 20 |
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 |
|
April 4, 2010, 03:04 |
|
#6 | |
New Member
afshar
Join Date: Apr 2010
Posts: 5
Rep Power: 16 |
Quote:
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 |
||
April 4, 2010, 11:31 |
|
#7 |
Senior Member
TWB
Join Date: Mar 2009
Posts: 414
Rep Power: 19 |
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.
|
|
April 4, 2010, 13:52 |
|
#8 | |
New Member
afshar
Join Date: Apr 2010
Posts: 5
Rep Power: 16 |
Quote:
Ok. Thanks. I need that in Compaq Visual Fortran 6. Whould you explain more how I can use this parallel option. Thanks. |
||
April 6, 2010, 12:20 |
|
#9 |
Senior Member
Join Date: Nov 2009
Posts: 411
Rep Power: 20 |
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 |
|
April 7, 2010, 08:47 |
|
#10 | |
New Member
afshar
Join Date: Apr 2010
Posts: 5
Rep Power: 16 |
Quote:
Thank you very much for your helpful comments. Cheers |
||
November 8, 2018, 20:19 |
Fortran command
|
#11 |
New Member
george
Join Date: Nov 2018
Posts: 1
Rep Power: 0 |
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.. |
|
November 9, 2018, 04:26 |
|
#12 |
Senior Member
Join Date: Dec 2017
Posts: 153
Rep Power: 8 |
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. |
|
Tags |
code, fortran, parallel |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
User fortran error when running CFX-10 in parallel | CFDworker | CFX | 3 | September 22, 2015 09:59 |
parallel fortran code | Ahmed | Main CFD Forum | 1 | October 23, 2008 08:15 |
Parallel Processing of Fortran Subroutine | Ashwini Mishra | CFX | 1 | November 3, 2004 11:02 |
definite integrals, parallel fortran | dino | Main CFD Forum | 0 | October 3, 2002 09:25 |
Parallel Computing Classes at San Diego Supercomputer Center Jan. 20-22 | Amitava Majumdar | Main CFD Forum | 0 | January 5, 1999 13:00 |