Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fortran time optimization flags

Status
Not open for further replies.

javier_carrero

Programmer
Mar 13, 2019
1
ES
Hello everyone.

My problem is related to runtime of a .exe app. I've been given a very large code (wich I know it's bug free) but it takes too much time to run. I have compiled it with GNU, trying with some different flags such as the -O optimization levels. I'm not able to use the parallel programming neither due to my computer has only two processors.

I am trying to optimize it with the flags compilation options, but I cannot find any rewarding information in the Internet. So my question is if there are any compiling options I can use in order to reduce the runtime of the program.

Thank you in advance.
 
You could refactor it and change some of the algorithms.
 
The fastest you can get is obtained with the -Ofast flag. That's the best you can do without getting your hands inside the code. Of course, the best would be to parallelize the code, but with only two cores, the best you will get will be to reduce the time by a factor of 2.
 
Using gfortran I had quite a long program with many recursive subroutines,an input and output file etc. etc. and compiling using
gfortran -O3 -ffast-math ii.F03
vs compiling using just
gfortran ii.F03
the ii.exe program ran usually around 4 to 5 times as fast for the same input file parameters.
There were no parallel operations.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top