CTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/x html1/DTD/xhtml1-strict.dtd"> Intel Compiler Support

Intel Compiler Support

The Intel Linux Fortran and C/C++ compilers are for x86-32 32-bit (IA32) and x86-64 (EMT, Opteron) processor-based (and compatible) servers running the Linux operating system. These compilers have specific optimizations for Intel architectures. ITC has floating network licenses for the Intel compiler suite as as well as for the Math Kernel Libraries.

Intel Compiler Availability

The University has 2 floating network licenses for the Intel Fortran and 2 floating network license for the Intel C/C++ compilers on the Linux platform.

Getting Started with the Intel Compilers on Linux

Invoking the Intel compilers on the ITC Linux Clusters

The Intel compilers are accessed on the ITC Linux clusters by using the modules software to dynamically set the appropriate environmental variables (e.g. PATH and LD_LIBRARY_PATH).

To initalize your environment to use the Intel compilers, use the command

    module add intel

After you have modified your environment to access the Intel compilers, you can invoke the compiler on a source code file in the following ways.

For Fortran 77 or Fortran 90, use

    ifort [options] filename.f
for fixed form, or
    ifort [options] filename.f90
for free form.

For C use

    icc [options] filename.c

For C++ use

    icpc [options] filename.cpp
or
    icpc [options] filename.cxx

A list of compiler options can be obtained by invoking the compiler with the -help option, e.g.

 
    ifort -help 

Using the Intel Compilers and Tools

Intel compilers are quite intolerant of memory faults. If you are getting a segmentation fault, recompile with -g -CB (for debugging and bounds checking respectively) and run the program under the control of a debugger.

The Intel debugger is idb, but the version that comes with Intel 11 attempts to start an Eclipse environment. This requires an X server on the user's desktop, and even if one is available, Eclipse tends to crash. For the command-line Intel debugger, use idbc for current versions.

This only affects version 11 and up; older versions' debuggers do not attempt to start a graphical user interface unless requested (with idb -gui, which also requires an X server).

Once the program is debugged, be sure to remove the -g and certainly the -CB flags and recompile with -O or -O -ipo. If that works, try -O3 or -O3 -ipo for a higher level of optimization. Do not use architecture-specific optimization flags (-x?) as we have clusters with varying architectures.

The newer compilers are more aggressive about loop vectorization at the default optimization level. This has nothing to do with mathematical vectors but refers to the arrangement of instructions in the cpu's registers. A vectorized loop can be much faster than an unvectorized one. Branches, conditionals, and dependencies (e.g. a(i)=a(i+1)+2) inhibit loop vectorization.

Using the Math Kernel Libraries (MKL)

If mathematical libraries are needed, use the Math Kernel Libraries (MKL). They provide LAPACK, BLAS, and a number of other libraries. They are highly optimized, especially for Intel architecture, and they automatically work with the compiler. The intel module for any version loads the MKL that is compatible with that compiler. The module script sets an environment variable MKL_DIR (with MKLPATH as a synonym). This variable can be used in scripts and makefiles; e.g. in a [mM]akefile

LIBS=-L$(MKL_DIR)

The MKL consists of a number of libraries and which ones to link is not always obvious. Intel provides a line advisor at their site. Remember that default integers are 32 bits even on 64-bit systems.

MKL includes Scalapack but it is better to use our libraries

/opt/scalapack/mpich2/ethernet/icc/lib/libscalapack.a
along with the necessary BLACS libraries in
/opt/blacsmpi/mpich2/ethernet/icc/lib

Documentation

Intel has documentation for Fortran and C/C++ at their site. The debugger documentation can also be found starting from either of these.

The Intel Math Kernel Library documentation is available in HTML form at the Intel site.

If users cannot find the answers to their questions in the online documentation, they can email UVACSE.