Development/Intel Compiler: Difference between revisions

From bwHPC Wiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 1: Line 1:
{{Softwarepage}}

{| width=600px class="wikitable"
{| width=600px class="wikitable"
|-
|-
Line 49: Line 51:
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:
* [[BwHPC_BPG_for_Parallel_Programming|Best Practices Guide for Parallel Programming]].
* [[BwHPC_BPG_for_Parallel_Programming|Best Practices Guide for Parallel Programming]].
<br>

= 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>
== Loading the module ==
=== Default Version ===
You can load the default version of the Intel Compiler with the command
<pre>
$ module load compiler/intel
</pre>
If loading the module fails, check if you have already loaded the module
with 'module list'.
<br>
<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 17.0, execute:
<pre>
$ module unload compiler/intel
$ module load compiler/intel/17.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.
<br>
<br>

= 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>


Line 107: Line 57:
* [https://software.intel.com/en-us/articles/intel-c-composer-xe-documentation Intel® C-Compiler 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 =
= Debugger =

Revision as of 10:14, 16 December 2021

The main documentation is available via module help <category>/<softwarename> on the cluster. Most software modules for applications provide working example batch scripts.


Description Content
module load compiler/intel
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 of the Intel Composer XE Suite consists of tools to compile and debug C, C++ and Fortran programs:

icc Intel C compiler
icpc Intel C++ compiler
ifort Intel Fortran compiler
idb Intel debugger in GUI mode (until version 14 only)
gdb-ia Intel version of GNU debugger in console mode (from version 15)
idbc Intel debugger in console mode (until version 14 only)

The intel compiler suite also includes the TBB (Threading Building Blocks) and IPP (Integrated Performance Primitives) libraries.

More information about the MPI versions of the Intel Compiler is available here:


Documentation

Online documentation

Debugger

Please use DDT. It is a parallel debugger with graphical user interface and can also be used for debugging serial programs. The description of the debugger can be found on the website
http://www.bwhpc-c5.de/wiki/index.php/DDT

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 icc -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: icc -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: icc -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 icc -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): icc -prof-use -O2 ex.c -o ex.

Further literature

A tutorial on optimization can be found at Compiler-Essentials.pdf and to get the different optimization options execute icc -help opt icc -help advanced
or the previously described catch-all option -v --help.