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

PrefetchInsertionOpt="prefetchAggressive"

Nick2
New Contributor I
992 Views

I'm trying to change a few compiler flags to get a faster run time on ifort 2015 Update 4, x64, on E5-2699v3 and E5-1650v3.  I started with:

                <Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true" MultiProcessorCompilation="true" Optimization="optimizeFull" GenAlternateCodePaths="codeForCommonAVX512" IntegerKIND="integerKIND8" RealKIND="realKIND8" LocalSavedScalarsZero="true" FloatingPointExceptionHandling="fpe0" FloatingPointModel="source" FlushDenormalResultsToZero="true" Traceback="true"/>

This was my base case, #01, with a (normalized) running time of 1.0.

For case #02, I added QxSSE41, and now my running time went up to about 1.07, and the number of required timesteps went up by 4.6%.  I thought this flag would have no effect on CPUs that have AVX instructions?  The reason I added this, is because I thought it would be a pre-requisite for case #03.

Now for case #03 I added Aggressive Prefetch flag.  Now my running time went down to 0.94.  Results are digit for digit identical to case #02.  Nice performance improvement!  But...

For case #04, I tried to set the "required" flags to be for CPUs supporting AVX (I figure, less code to detect what kind of CPU instructions are available should enhance the running time), so now I have:

                <Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true" MultiProcessorCompilation="true" Optimization="optimizeFull" GenAlternateCodePaths="codeForCommonAVX512" UseProcessorExtensions="codeExclusivelyAVX" PrefetchInsertionOpt="prefetchAggressive" EnableEnhancedInstructionSet="codeArchAVX" IntegerKIND="integerKIND8" RealKIND="realKIND8" LocalSavedScalarsZero="true" FloatingPointExceptionHandling="fpe0" FloatingPointModel="source" FlushDenormalResultsToZero="true" Traceback="true"/>

Now, for case #04, my results are digit for digit identical with case #01, and the running time is 0.99.  It looks like the Prefetch flag got disabled.

So, my questions are:

-How exactly does the Prefetch flag work?  It looks like a very nice way to get some respectable performance gains, but I can't get it to work consistently.

-What do the UseProcessorExtensions/EnableEnhancedInstructionSet flags do to change the results, or disable the Prefetch optimization, given that I already have GenAlternateCodePaths="codeForCommonAVX512"?

0 Kudos
1 Reply
Steven_L_Intel1
Employee
992 Views

My understanding is that prefetching is best handled by the processor (except for Xeon Phi, another topic.) I don't see a lot of people using prefetch options or the prefetch intrinsics.

For immediate use, I suggest sticking with the /Qx options and not /Qax. Use the optimization reports and VTune to understand what you can do to help performance and where the bottlenecks are.

0 Kudos
Reply