Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Optimization problem

Antoon
Beginner
725 Views

When selectingOptimization = Maximize Speed in the Properties Page of IVF , the results are rather different compared with optimization disabled. Differences found are in the order of 10-20 %, so you can't neglect it.

To be honest, I just expected my simulations to run faster, but was not prepared for this. How to deal with these differences, without reverting to disabling the optimization at all. Speed matters.

Thxs.

0 Kudos
3 Replies
TimP
Honored Contributor III
725 Views
Quoting - Antoon

When selectingOptimization = Maximize Speed in the Properties Page of IVF , the results are rather different compared with optimization disabled. Differences found are in the order of 10-20 %, so you can't neglect it.

To be honest, I just expected my simulations to run faster, but was not prepared for this. How to deal with these differences, without reverting to disabling the optimization at all. Speed matters.

If the differences are that large, I would be concerned about errors in the application. Some of those might surface with the /check options. Correctness matters. If you depend on promotion of single precision expressions to double, you should consider writing it in.

On current CPUs, you can set /Qprec-div /Qprec-sqrt /assume:protect_parens with little impact on performance. If you require /Qftz-, set that.

0 Kudos
jimdempseyatthecove
Honored Contributor III
725 Views

When optimizations are disabled you may also be disabling (some of the)vectorization and some loop unrolling. Depending on your application these may make a significant difference.

Jim Dempsey

0 Kudos
jimdempseyatthecove
Honored Contributor III
725 Views

Examine your code to see if dealing with Large Numbers +/- Small Differences. Thenin expressions (loops)where the Large Number portion can be computed seperately from the Small Differences portion do the extra effort of splitting up the values.

sum = 0.0
do i=1,N
sum = sum + A(i)
end do

becomes

sum = 0.0
sumL = 0.0
sumS = 0.0
do i=1,N
if(A(i) .ge. 1.0) then
sumL = sumL + A(i)
else
sumS = sumS + A(i)
endif
end do
sum = sumL + sumS

Jim Dempsey

0 Kudos
Reply