| Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente |
| compilation:intel-cluster-studio [2016/12/05 13:00] – [Example i] admin | compilation:intel-cluster-studio [2017/05/05 10:43] (Version actuelle) – [Compilers Options] admin |
|---|
| |-fast|Shorthand. ''-O3 -ipo -static -xHOST -no-prec-div''. Note that the processor specific optimization flag (''-xHOST'') will optimize for the processor compiled on it is the only flag of ''-fast'' that may be overridden.| | |-fast|Shorthand. ''-O3 -ipo -static -xHOST -no-prec-div''. Note that the processor specific optimization flag (''-xHOST'') will optimize for the processor compiled on it is the only flag of ''-fast'' that may be overridden.| |
| |**-O3**|-O2 optimizations plus more aggressive optimizations such as prefetching, scalar replacement, and loop transformations. Enables optimizations for technical computing applications (loop-intensive code): loop optimizations and data prefetch.| | |**-O3**|-O2 optimizations plus more aggressive optimizations such as prefetching, scalar replacement, and loop transformations. Enables optimizations for technical computing applications (loop-intensive code): loop optimizations and data prefetch.| |
| |**-axAVX**|This option tells the compiler to generate multiple, processor-specific auto-dispatch code paths for Intel processors if there is a performance benefit. It also generates a baseline code path which can run on non-AVX processors. The Intel processor-specific auto-dispatch path is usually more optimized than the baseline path.| | |**-axCORE-AVX2**|This option tells the compiler to generate multiple, processor-specific auto-dispatch code paths for Intel processors if there is a performance benefit. It also generates a baseline code path which can run on non-AVX processors. The Intel processor-specific auto-dispatch path is usually more optimized than the baseline path.| |
| |-p |Compiles and links for function profiling with gprof.| | |-p |Compiles and links for function profiling with gprof.| |
| |-g| Produces a symbol tables, i.e. line numbers for profiling are available.| | |-g| Produces a symbol tables, i.e. line numbers for profiling are available.| |
| |
| |
| <color blue>**-axAVX -O3 **</color> | <color blue>**-axCORE-AVX2 -O2 **</color> |
| </WRAP> | </WRAP> |
| |
| |
| <code bash> | <code bash> |
| $ icc -axAVX -O3 -fp-model precise -pc 64 pgm.c -o pgm | $ icc -axCORE-AVX2 -O3 -fp-model precise -pc 64 pgm.c -o pgm |
| </code> | </code> |
| |
| |
| <code bash> | <code bash> |
| $ ifort -axAVX -O3 -fp-model precise -pc 64 pgm.f -o pgm | $ ifort -axCORE-AVX2 -O3 -fp-model precise -pc 64 pgm.f -o pgm |
| </code> | </code> |
| |
| |
| <code bash> | <code bash> |
| $ icpc -axAVX -O3 -fp-model precise -pc 64 pgm.cpp -o pgm | $ icpc -axCORE-AVX2 -O3 -fp-model precise -pc 64 pgm.cpp -o pgm |
| </code> | </code> |
| |
| |
| <code bash> | <code bash> |
| $ icpc -openmp -axAVX -O3 -fp-model precise -pc 64 pgm.cpp -o pgm | $ icpc -openmp -axCORE-AVX2 -O3 -fp-model precise -pc 64 pgm.cpp -o pgm |
| </code> | </code> |
| |
| |
| <code bash> | <code bash> |
| $ ifort -openmp -axAVX -O3 -fp-model precise -pc 64 pgm.f -o pgm | $ ifort -openmp -axCORE-AVX2 -O3 -fp-model precise -pc 64 pgm.f -o pgm |
| </code> | </code> |
| ====== Compiler Auto Vectorization ====== | ====== Compiler Auto Vectorization ====== |
| Using the ''-xHost'' flag enables the highest level of vectorization supported on the processor on which the user compiles. Note that the Intel compiler will try to vectorize a code with SSE2 instructions at optimizations of ''-O2'' or higher. Disable this by specifying ''-no-vec''. | Using the ''-xHost'' flag enables the highest level of vectorization supported on the processor on which the user compiles. Note that the Intel compiler will try to vectorize a code with SSE2 instructions at optimizations of ''-O2'' or higher. Disable this by specifying ''-no-vec''. |
| |
| The Intel compiler can generate a single executable with multiple levels of vectorization with the ''-ax'' flag, which takes the same options as the ''-x'' flag (i.e., AVX, ..., SSE2). This flag will generate run-time checks to determine the level of vectorization support on the processor and ill then choose the optimal execution path for that processor. It will also generate a baseline execution path that is taken if the ''-ax'' level of vectorization specified is not supported. Example ''-axAVX''. | The Intel compiler can generate a single executable with multiple levels of vectorization with the ''-ax'' flag, which takes the same options as the ''-x'' flag (i.e.,AVX2 ,AVX, ..., SSE2). This flag will generate run-time checks to determine the level of vectorization support on the processor and ill then choose the optimal execution path for that processor. It will also generate a baseline execution path that is taken if the ''-ax'' level of vectorization specified is not supported. Example ''-axCORE-AVX2''. |
| |
| Another useful option for the Intel compiler is the ''-vec-report'' flag, which generates diagnostic information regarding vectorization to ''stdout''. The ''-vec-report'' flag takes an optional parameter that can be a number between 0 and 5 (e.g., ''-vec-report0''), with 0 disabling diagnostics and 5 providing the most detailed diagnostics about what loops were optimized, what loops were not optimized, and why those loops were not optimized. The output can be useful to identify possible strategies to get a loop to vectorize. | Another useful option for the Intel compiler is the ''-vec-report'' flag, which generates diagnostic information regarding vectorization to ''stdout''. The ''-vec-report'' flag takes an optional parameter that can be a number between 0 and 5 (e.g., ''-vec-report0''), with 0 disabling diagnostics and 5 providing the most detailed diagnostics about what loops were optimized, what loops were not optimized, and why those loops were not optimized. The output can be useful to identify possible strategies to get a loop to vectorize. |
| |
| ===== Example i===== | ===== Example ===== |
| Comparing a program, Matrix Multiply, compiled with with options: ''-O3'' and ''-03 -xAVX''. (N=6000) | Comparing a program, Matrix Multiply (sequential version), compiled with with options: ''-O3'' and ''-03 -xCORE-AVX2'' for **N=6000** |
| |
| ^Option^Time (s) ^ GFlops ^ | ^Option^Time (s) ^ MFlops ^ |
| | ''-O3'' | 12 | -| | | ''-O3'' | 145 | 4079 | |
| |''-O3 -xAVX''| 5 | - | | |''-O3 -xCORE-AVX2''| 49 |4405 | |
| ====== Links ====== | ====== Links ====== |
| |
| *https://software.intel.com/en-us/intel-sdp-home | *https://software.intel.com/en-us/intel-sdp-home |
| * http://mesowiki.univ-fcomte.fr/intelsuite/get_started_lc.htm | * http://mesowiki.univ-fcomte.fr/intelsuite/get_started_lc.htm |