Jd Baba
Jd Baba

Reputation: 6118

Decreasing the fortran run time by extra optimization flags

I have been trying to optimize my program for some time now. It has more than 100 subroutines. The optimization flags I have used so far with the Intel Fortran compiler are as follows.

Optimization flag Time of completion
-c                     0.190 hr
-O3                    0.185 hr
-fast                  0.155 hr

So, using the optimization flag "-fast" I was able to gain 18.42% speed. I was wondering are there any other optimization flag that I can try to make my program run even faster. Because right now, when I ran my program with just O2 flag for one of my problem, it took around 25 hours to finish. I really need to increase the computational efficiency.

I found the information about the "-fast" flag from https://support.scinet.utoronto.ca/wiki/images/7/77/Snug_techtalk_compiler.pdf

I am using the intel fortran 13.1 compiler in linux.

Any help is highly appreciated.

Thank you so much.

Best Regards,

Jdbaba

Upvotes: 1

Views: 3013

Answers (1)

M. S. B.
M. S. B.

Reputation: 29391

You don't say which compiler you are using but imply Intel with your link. With Intel ifort you can try -parallel and obtain automatic parallelization. Past some point the compiler will have done its best with your source code and further runtime decreases will require either improving bad coding decisions or algorithmic improvements, neither of which we have information from your question to offer specific suggestions. "profiling" is identifying where your program spends its runtime. There is no point in making subroutine A run ten times faster if the program only spends 1% of its runtime in subroutine A ... you will obtain very little overall improvement. Better to work on the subroutines in which the program spends 80% or 50% or ... of its runtime.

Upvotes: 3

Related Questions