Intel (Fortran, C, and C++)
The Intel® compiler suite offers C, C++ and Fortran compilers with optimization features and multithreading capabilities, highly optimized performance libraries, and error-checking, security, and profiling tools. NERSC Intel compiler bugs are listed at Intel bugs.
The Intel compiler suite is available on Edison, Carver, and Hopper. It is the default compiler on Edison.
Using the Intel Compilers on Edison
The Intel compiler suite is the default on Edison. When you use the Cray ftn, cc, and CC wrappers, they will call the Intel compilers.
Using the Intel Compilers on Carver
To use the Intel compilers you must swap both the compiler and the OpenMPI modulefiles. Do this in the following way:
% module unload pgi openmpi
% module load intel openmpi-intel mkl
After doing this use the OpenMPI wrappers mpif90, mpicc, or mpiCC.
Using the Intel Compilers on Hopper
To use the Intel compilers you must swap the PrgEnv-xxx modulefile:
% module swap PrgEnv-pgi PrgEnv-intel
After doing this use the Cray compiler wrappers ftn, cc, or CC. More information can be found in Intel Compilers on Hopper.
Tips for Building Applications
Always use -no-ipo if you use -fast unless you are completely positive that your code would benefit from interprocedural analysis. In that case expect a much longer compilation time.
If you build a library always use -no-ipo if you use -fast, otherwise the build will fail. If you still have problems with the library with -fast -no-ipo, build it with the Intel default, no optimization options.
Codes built the -fast will run on Hopper, but on the average they run no faster than those built with the default Intel optimization, no explicit optimization arguments.
The -fast option does not work with MPI codes. They may appear to build successfully, but will fail at run time.
For questions about using the Intel compilers at NERSC contact the consultants at firstname.lastname@example.org.
On Carver you can find some documentation in the $PATH/Documentation/en_US/ directory, where $PATH is defined when you load the Intel modulefile. Man pages are available via man ifort (for Fortran) or man icc (for C/C++). There are User Guides, language Reference Manuals, and Quick-Reference Guides to Optimization available on the Intel web site.