Development/Intel Compiler: Difference between revisions
No edit summary |
(Update Intel Compiler for LLVM-based / OneAPI) |
||
(23 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
{{Softwarepage|compiler/intel}} |
|||
{| width=600px class="wikitable" |
{| width=600px class="wikitable" |
||
|- |
|- |
||
Line 4: | Line 6: | ||
|- |
|- |
||
| module load |
| module load |
||
| compiler/intel |
| compiler/intel/VERSION and compiler/intel/VERSION_llvm |
||
|- |
|- |
||
| License |
| License |
||
| Commercial. See $INTEL_HOME/install-doc/EULA.txt. | [https://software.intel.com/en-us/faq/licensing Intel Product |
| Commercial. See $INTEL_HOME/install-doc/EULA.txt. | [https://software.intel.com/en-us/faq/licensing Intel Product Licensing FAQ] |
||
|- |
|- |
||
|Citing |
|Citing |
||
Line 23: | Line 25: | ||
<br> |
<br> |
||
= Introduction = |
= Introduction = |
||
The '''Intel Compiler''' consists of tools to compile and debug C, C++ and Fortran programs, and currently is in a transition phase: the so-called legacy compiler (based on an Intel in-house development with many optimization hints) and the newer LLVM-based compiler (where many of these optimizations and hints are ported to). To smoothly handle this transition we offer the standard legacy compiler plus the new LLVM-based compiler with the ''_llvm'' prefix. |
|||
The '''Intel Compiler''' of the '''Intel Composer XE Suite''' consists of tools to compile and debug C, C++ and Fortran programs: |
|||
The following table shows the preferred names: |
|||
{| width=500px class="wikitable" |
|||
{| width=600px class="wikitable" |
|||
|- |
|||
|style="padding:3px"| '''Tool''' |
|||
|style="padding:3px"| '''Legacy name''' |
|||
|style="padding:3px"| '''LLVM-based name''' |
|||
|- |
|||
|- |
|- |
||
|style="padding:3px"| icc |
|||
|style="padding:3px"| Intel C compiler |
|style="padding:3px"| Intel C compiler |
||
|style="padding:3px"| icc |
|||
|style="padding:3px"| icx |
|||
|- |
|- |
||
|style="padding:3px"| icpc |
|||
|style="padding:3px"| Intel C++ compiler |
|style="padding:3px"| Intel C++ compiler |
||
|style="padding:3px"| icpc |
|||
|style="padding:3px"| icpx |
|||
|- |
|- |
||
|style="padding:3px"| ifort |
|||
|style="padding:3px"| [https://software.intel.com/en-us/fortran-compilers Intel Fortran compiler] |
|style="padding:3px"| [https://software.intel.com/en-us/fortran-compilers Intel Fortran compiler] |
||
|style="padding:3px"| ifort |
|||
|style="padding:3px"| ifx |
|||
|- |
|- |
||
|style="padding:3px"| [[#GUI|idb]] |
|||
|style="padding:3px"| Intel debugger in GUI mode (until version 14 only) |
|style="padding:3px"| Intel debugger in GUI mode (until version 14 only) |
||
|style="padding:3px"| [[#GUI|idb]] |
|||
|style="padding:3px"| N/A |
|||
|- |
|- |
||
|style="padding:3px"| Intel GNU debugger in console mode (from version 15) |
|||
|style="padding:3px"| [[#Console Mode|gdb-ia]] |
|style="padding:3px"| [[#Console Mode|gdb-ia]] |
||
|style="padding:3px"| |
|style="padding:3px"| gdb-oneapi |
||
|- |
|- |
||
|style="padding:3px"| [[#Console Mode|idbc]] |
|||
|style="padding:3px"| Intel debugger in console mode (until version 14 only) |
|style="padding:3px"| Intel debugger in console mode (until version 14 only) |
||
|style="padding:3px"| [[#Console Mode|idbc]] |
|||
|style="padding:3px"| N/A |
|||
|} |
|} |
||
The intel compiler suite also includes the TBB (Threading Building Blocks) |
The intel compiler suite also includes the TBB (Threading Building Blocks), IPP (Integrated Performance Primitives) and oneAPI libraries. |
||
<br> |
<br> |
||
<br> |
<br> |
||
More information about the MPI versions of the Intel Compiler is available here: |
More information about the MPI versions of the Intel Compiler is available here: |
||
* [[ |
* [[Development/Parallel_Programming|Best Practices Guide for Parallel Programming]]. |
||
= Versions and Availability = |
|||
A list of versions currently available on all [[:Category:BwHPC Cluster|bwHPC Clusters]] can be obtained from the cluster information system |
|||
<br> |
|||
[https://cis-hpc.uni-konstanz.de/prod.cis/ Cluster Information System] |
|||
<!-- |
|||
{{#widget:Iframe |
|||
|url=https://cis-hpc.uni-konstanz.de/prod.cis/bwUniCluster/compiler/intel |
|||
|width=99% |
|||
|height=700 |
|||
}} |
|||
!--> |
|||
On the command line interface of any bwHPC cluster you'll get a list of available versions |
|||
by executing: |
|||
<pre> |
|||
$ module avail compiler/intel |
|||
</pre> |
|||
<br> |
|||
<br> |
|||
== Loading the module == |
|||
=== Default Version === |
|||
You can load the default version of the Intel Compiler with the command |
|||
<pre> |
|||
$ module load compiler/intel |
|||
</pre> |
|||
<br> |
|||
If loading the module fails, check if you have already loaded the module |
|||
with 'module list'. |
|||
<br> |
|||
=== Specific (newer or older) Version === |
|||
If you wish to load a specific (older or newer) version (if available), |
|||
add the specific version number of the intel compiler, e.g. for loading Intel compiler suite 14.0, execute: |
|||
<pre> |
|||
$ module unload compiler/intel |
|||
$ module load compiler/intel/14.0 |
|||
</pre> |
|||
Note: Only one compiler can be loaded in your active session, hence, before loading a new intel compiler version you must to unload the current loaded version. |
|||
For unloading the intel compiler the version number is not required: |
|||
<pre> |
|||
$ module unload compiler/intel |
|||
</pre> |
|||
unloads any currently loaded intel compiler version. |
|||
= Intel Compiler Specific Environment Variables = |
|||
To see a list of all Intel Compiler environment variables set by the 'module load' command execute: |
|||
<pre> |
|||
module show compiler/intel |
|||
</pre> |
|||
<br> |
<br> |
||
= Documentation = |
= Documentation = |
||
== Online documentation == |
== Online documentation == |
||
* [ |
* [https://software.intel.com/en-us/articles/intel-c-composer-xe-documentation Intel® C-Compiler Documentation] |
||
* [https://software.intel.com/en-us/intel-software-technical-documentation Intel® Software Documentation Library] |
* [https://software.intel.com/en-us/intel-software-technical-documentation Intel® Software Documentation Library] |
||
== Local documentation == |
|||
For version specific documentation see the help page of the module. For example |
|||
<pre> |
|||
$ module help compiler/intel |
|||
</pre> |
|||
will show the information for the default version. |
|||
<!-- |
|||
<pre>$ module help compiler/intel |
|||
----------- Module Specific Help for 'compiler/intel/15.0' -------- |
|||
This module provides the Intel(R) compiler suite version 15.0.3 via |
|||
commands 'icc', 'icpc' and 'ifort' (version 15.0.3), the debugger 'gdb-ia' (version |
|||
7.8.3) as well as the Intel(R) Threading Building Blocks TBB (version 4.3.5) |
|||
and the Integrated Performance Primitives IPP libraries (version 8.2.2) |
|||
(for details see also 'http://software.intel.com/en-us/intel-compilers/'). |
|||
The related Math Kernel Library MKL module is 'numlib/mkl/11.2.3'. |
|||
The related Intel MPI module is 'mpi/impi/5.0.3-intel-15.0'. |
|||
The Intel 'icpc' should work well with GNU compiler version 4.4 to 4.8. |
|||
Before using TBB or IPP setup the corresponding environment, e.g. for 64bit+bash |
|||
source $INTEL_HOME/tbb/bin/tbbvars.sh intel64 |
|||
source $INTEL_HOME/ipp/bin/ippvars.sh intel64 |
|||
Commands: |
|||
icc # Intel(R) C compiler |
|||
icpc # Intel(R) C++ compiler |
|||
ifort # Intel(R) Fortran compiler |
|||
gdb-ia # Intel version of GNU debugger |
|||
# idb is not available anymore in Intel compiler suite 2015. |
|||
Local documentation: |
|||
Man pages: man icc; man icpc; man ifort; man gdb-ia |
|||
firefox $INTEL_DOC_DIR/beginusing_lc.htm |
|||
firefox $INTEL_DOC_DIR/beginusing_lf.htm |
|||
The html-pages are very detailed and cover TBB and IPP as well as MKL. |
|||
For some Intel(R) compiler option examples, hints on how to compile 32bit code |
|||
and solutions for less common problems see the tips and troubleshooting doc: |
|||
$INTEL_DOC_DIR/intel-compiler-tips-and-troubleshooting.txt |
|||
For details on library and include dirs please call |
|||
module show compiler/intel/15.0 |
|||
[...]</pre> |
|||
!--> |
|||
== Manual Pages == |
|||
For detailed lists of the different program options consult the particular man page |
|||
<pre> |
|||
$ man icc |
|||
$ man icpc |
|||
$ man ifort |
|||
$ man idb |
|||
$ man gdb-ia |
|||
</pre> |
|||
<br> |
|||
= Debugger = |
|||
== GUI == |
|||
The Intel Debugger is an Eclipse Rich Client Platform based GUI driven Debugger with exciting features for parallelism and threading. |
|||
* [https://software.intel.com/sites/default/files/04/0d/idb-linux-12.pdf Intel Debugger for Linux] |
|||
* [https://software.intel.com/en-us/search/gss/intel%20debugger%20gui More Infos...] |
|||
Start the GUI-debugger with the command ''''idb [binary-file-name] &''''. |
|||
[[File:Intel_Debugger.jpg]] |
|||
<br> |
|||
== Console Mode == |
|||
=== Intel Debugger === |
|||
The console-mode Intel debugger will be started using the command ''''idbc [binary-file]''''. |
|||
<pre>idbc module_avail_grep |
|||
Intel(R) Debugger for applications running on Intel(R) 64, Version 13.0, Build [80.483.23] |
|||
------------------ |
|||
object file name: module_avail_grep |
|||
Reading symbols from /pfs/data2/home/kn/kn_kn/kn_pop235844/module_avail_grep...done. |
|||
(idb) help |
|||
List of classes of commands: |
|||
breakpoints -- Commands for manipulation with breakpoints. |
|||
data -- Examining data. |
|||
extensions -- Idb extension commands. |
|||
files -- Specifying and examing files. |
|||
obscure -- Obscure features. |
|||
openmp -- OpenMP support. |
|||
parallel -- MPI support. |
|||
running -- Running the program. |
|||
stack -- Examining the stack. |
|||
status -- Status inquiries. |
|||
support -- Support facilities. |
|||
To display help on a particular command, enter "help" followed by the command |
|||
name. Command name abbreviations are allowed if unambiguous. |
|||
</pre><br> |
|||
=== GNU for Intel Debugger === |
|||
To debug applications natively on IA-32 or Intel64 Architecture systems, you may also use GDB with the following command: ''''gdb-ia''''. |
|||
<br> |
|||
The actual debugger usage is the same as for the GNU Project Debugger. Extensions for IA-32/Intel 64Architecture are described in the [https://software.intel.com/en-us/get-started-with-debugger-extension-for-linux?language=de#documentation debugger documentation]. |
|||
<pre>$ gdb-ia ./structure |
|||
[...] |
|||
GNU gdb (GDB) 7.5-1.0.81 |
|||
Copyright (C) 2012 Free Software Foundation, Inc; (C) 2013-2014 Intel Corp. |
|||
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> |
|||
This is free software: you are free to change and redistribute it. |
|||
There is NO WARRANTY, to the extent permitted by law. Type "show copying" |
|||
and "show warranty" for details. |
|||
This GDB was configured as "x86_64-unknown-linux-gnu". |
|||
For information about how to find Technical Support, Product Updates, |
|||
User Forums, FAQs, tips and tricks, and other support information, please visit: |
|||
<http://www.intel.com/software/products/support/>... |
|||
Reading symbols from /pfs/data1/software_uc1/bwhpc/common/bio/structure/2.3.4/console/structure...done. |
|||
[...] |
|||
(gdb)</pre> |
|||
[[GDB|More GDB-Infos here...]] |
|||
<br><br> |
|||
= Optimizations = |
= Optimizations = |
||
You can turn on various optimization options to enhance the performance of your program. Which options are the best depends on the specific program and can be determined by benchmarking your code. A command which gives good performance and a decent file size is |
You can turn on various optimization options to enhance the performance of your program. Which options are the best depends on the specific program and can be determined by benchmarking your code. A command which gives good performance and a decent file size is |
||
''' |
'''icx -xHost -O2 ex.c'''. |
||
With the option '''-xHost''' instructions for the highest instruction set available on the compilation host processor are generated. If you want to generate optimal code on bwUniCluster for both nodes with Sandy Bridge architecture and nodes with Broadwell architecture, you must compile your code with the options '''-xAVX -axCORE-AVX2''' (instead of '''-xHost'''). |
|||
<br> |
<br> |
||
There are more aggressive optimization flags and levels (e.g. -O3 or -fast and implied options) but the compiled programs can get quite large due to inlining. Additionally the compilation process will probably take longer. Moreover it may happen that the compiled program is even slower -- or may require installation of additional statically-linked libraries. Such a command would be for example: |
There are more aggressive optimization flags and levels (e.g. -O3 or -fast and implied options) but the compiled programs can get quite large due to inlining. Additionally the compilation process will probably take longer. Moreover it may happen that the compiled program is even slower -- or may require installation of additional statically-linked libraries. Such a command would be for example: |
||
''' |
'''icx -fast ex.c''' |
||
<br> |
<br> |
||
<br> |
<br> |
||
= Profiling = |
= Profiling = |
||
Profiling an application means augmenting the compiled binary with information on execution counts per source-line (and basic blocks) -- e.g. one may see how many times an if-statement has been evaluated to true. To do so, compile your code with the profile flag: |
Profiling an application means augmenting the compiled binary with information on execution counts per source-line (and basic blocks) -- e.g. one may see how many times an if-statement has been evaluated to true. To do so, compile your code with the profile flag: |
||
''' |
'''icx -p ex.c -o ex'''. |
||
<br> |
<br> |
||
Using the gprof tool, one may manually inspect execution count of each executed line of source code. |
Using the gprof tool, one may manually inspect execution count of each executed line of source code. |
||
<br> |
<br> |
||
For compiler optimization, recompile |
For compiler optimization, recompile your source using |
||
''' |
'''icx -prof-gen ex.c -o ex''' |
||
then execute the most co]]mmon and typical use-case of your application, and then recompile using the generated profile count (and using optimization): |
then execute the most co]]mmon and typical use-case of your application, and then recompile using the generated profile count (and using optimization): |
||
''' |
'''icx -prof-use -O2 ex.c -o ex'''. |
||
<br> |
<br> |
||
== Further literature == |
== Further literature == |
||
A tutorial on optimization can be found at [https:// |
A tutorial on optimization can be found at [https://www.intel.com/content/www/us/en/developer/articles/technical/vectorization-essential.html Vectorization Essentials] |
||
and to get the different optimization options execute |
and to get the different optimization options execute |
||
''' |
'''icx -help opt''' |
||
or |
|||
'''icc -help advanced''' |
|||
'''icx -help advanced''' |
|||
<br> |
<br> |
||
or the previously described catch-all option '''''-v --help'''''. |
or the previously described catch-all option '''''-v --help'''''. |
||
[[Category:Compiler_software]][[Category:bwUniCluster]][[Category:bwForCluster_Chemistry]][[Category:BwForCluster_BinAC]][[Category:bwForCluster_MLS&WISO_Production]] |
Latest revision as of 15:17, 9 October 2024
The main documentation is available via |
Description | Content |
---|---|
module load | compiler/intel/VERSION and compiler/intel/VERSION_llvm |
License | Commercial. See $INTEL_HOME/install-doc/EULA.txt. | Intel Product Licensing FAQ |
Citing | n/a |
Links | Intel C-Compiler Homepage |
Graphical Interface | Yes (Intel Debugger GUI-Verison) |
Included modules | icc | icpc | ifort | idb | gdb-ia |
Introduction
The Intel Compiler consists of tools to compile and debug C, C++ and Fortran programs, and currently is in a transition phase: the so-called legacy compiler (based on an Intel in-house development with many optimization hints) and the newer LLVM-based compiler (where many of these optimizations and hints are ported to). To smoothly handle this transition we offer the standard legacy compiler plus the new LLVM-based compiler with the _llvm prefix. The following table shows the preferred names:
Tool | Legacy name | LLVM-based name |
Intel C compiler | icc | icx |
Intel C++ compiler | icpc | icpx |
Intel Fortran compiler | ifort | ifx |
Intel debugger in GUI mode (until version 14 only) | idb | N/A |
Intel GNU debugger in console mode (from version 15) | gdb-ia | gdb-oneapi |
Intel debugger in console mode (until version 14 only) | idbc | N/A |
The intel compiler suite also includes the TBB (Threading Building Blocks), IPP (Integrated Performance Primitives) and oneAPI libraries.
More information about the MPI versions of the Intel Compiler is available here:
Documentation
Online documentation
Optimizations
You can turn on various optimization options to enhance the performance of your program. Which options are the best depends on the specific program and can be determined by benchmarking your code. A command which gives good performance and a decent file size is
icx -xHost -O2 ex.c.
With the option -xHost instructions for the highest instruction set available on the compilation host processor are generated. If you want to generate optimal code on bwUniCluster for both nodes with Sandy Bridge architecture and nodes with Broadwell architecture, you must compile your code with the options -xAVX -axCORE-AVX2 (instead of -xHost).
There are more aggressive optimization flags and levels (e.g. -O3 or -fast and implied options) but the compiled programs can get quite large due to inlining. Additionally the compilation process will probably take longer. Moreover it may happen that the compiled program is even slower -- or may require installation of additional statically-linked libraries. Such a command would be for example:
icx -fast ex.c
Profiling
Profiling an application means augmenting the compiled binary with information on execution counts per source-line (and basic blocks) -- e.g. one may see how many times an if-statement has been evaluated to true. To do so, compile your code with the profile flag:
icx -p ex.c -o ex.
Using the gprof tool, one may manually inspect execution count of each executed line of source code.
For compiler optimization, recompile your source using
icx -prof-gen ex.c -o ex
then execute the most co]]mmon and typical use-case of your application, and then recompile using the generated profile count (and using optimization):
icx -prof-use -O2 ex.c -o ex.
Further literature
A tutorial on optimization can be found at Vectorization Essentials
and to get the different optimization options execute
icx -help opt
or
icx -help advanced
or the previously described catch-all option -v --help.