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

Is -parallel broken?

Boris_B_
Beginner
678 Views
After a long break from using ifort, I just upgraded to version 10.1.007 for Mac OSX running Leopard. To see if it works, I tried it on my simple test program:

do i=1,10**9
x=i
s=s+sin(x)
end do
print*, s
end

I found it takes the same amount of time to run with the -parallel switch as without (approx 13 sec) on my Core 2 Duo Mac. I vaguely recall that under Tiger, and ifort version 9.something, it ran twice as fast with -parallel. So, is -parallel broken in 10.1.007, or is it my memory that's broken?

0 Kudos
2 Replies
TimP
Honored Contributor III
678 Views

-parallel doesn't thread a single level vectorizable loop, unless -par-threshold is set to make it more aggressive. One might argue that it should do so by default for loops longer than 20000 or so, in simpler cases than yours. Optimizing out your x=i step could be more valuable than threading:
x=1 !double precision needed to alleviate numerical problems
do....
..
x=x+1
enddo
With the combination of sum reduction, svml function calls and poorly optimized serial code, setting a suitable threshold would be difficult. If you think its threshold settings are "broken" for your real applications, submit an issue with evidence on premier.intel.com. If the compiler could make value judgements, it would ridicule this example for its numerical ineptitude.
0 Kudos
Boris_B_
Beginner
678 Views
I just rebooted, and find that -parallel now works! It indeed almost halves the CPU time for the above program on my 2-processor iMac. So I learnt something: reboot before blaming the software.....
0 Kudos
Reply