- Math Libraries
- Scientific Data Libraries
Before using compilers on the system you must load the compiler module:
Compiling Fortran Code
ifort command either on the command line or in a makefile to invoke the Intel Fortran compiler:
For more information see the Intel® Fortran Compiler User and Reference Guide.
Compiling C/C++ Code
You can invoke the C/C++ compiler on the command line with either
icpc. When you invoke the compiler with
icc it compiles C source files using C libraries and C include files. If you use
icc with a C++ source file, it is compiled as a C++ file.
When you invoke the compiler with
icpc it compiles C++ source files using C++ libraries and C++ include files. If you use
icpc with a C source file, it is compiled as a C++ file.
For more information see the Intel® C++ Compiler User and Reference Guide.
Compiling and Linking MPI Programs
To compile and link MPI programs first load the mpt module
Commands to build MPI applications:
Compiling OpenMP Code
When compiling code using OpenMP ($OMP) directives include the
-openmp option, e.g. C++ program:
Recommended Compiler Options
This is the default opimization level including loop unrolling, inlining of intrinsics and dead-code elimination.
Generate optimized code specialized for the Sandy Bridge processor using Advanced Vector Extensions (AVX) instructions
Underflow occurs when the result of an arithmetic operation is smaller than the smallest normal floating point number of the target datatype. Smaller numbers, subnormal or denormal numbers, can be represented but with fewer bits of precision. Production of a subnormal numbers is called gradual underflow. One way to deal with such underflow is to flush denormal results to zero. This will lead to some loss of precision when results are very small but may improve performance since frequent gradual underflow calculations consume a lot of system time. If subnormal values are critical to the behavior of your program you should add the
-no-ftz option when using
-O1 or higher optimization level.
Flush denormal results to zero. This is the default option with every optimization except
Do not flush denormal results to zero
The Boost library version 1.61.0 includes bjam/b2 and the necessary files for building python extensions with Boost.Python. Boost.Python is a C++-library which enables interoperability between C++ and the Python programming language. Methods and abstracted data types implemented with C++ can be made availabe for use by Python.The Boost Web page lists what is supported by the library.
Example: Import methods to Python
Chapter 1 of Numerical Recipes implements three methods
- flmoon() :: The method calculates the phases of the moon
- julday() :: The method calculates the Julian Day Number
- caldat() :: The method returnd the date based on the Julian Day Number as input
With this methods available in a python interactive session it is for example easier to search for future occurrences of a full moon on Friday 13th ( a suggested exercise at the end of Chapter 1 of Numerical Recipes.)
Note that this page do not show the implementation of these methods. You need to go to Numerical Recipes to see the implementation
Let us first look at the methods interfaces
Both flmoon() and caldat() having arguments passing by reference. The results of the calculations are returned through these. This is not doable in Python. One way to get around this is by defining local variables and let the functions return a tuple. Note that the implementations in Numerical Recipes use defined types (Int and Doub). This example will use built-in types (int and double).
After the function decfini
Our directory have the following contents:
We now execute b2 or bjam (they are equivalent) in the directory containing flmoon.cpp. b2/bjam will build a debug version of the flmoon extension, which we can load into a python interpreter. We need to set the necessary environmental variables to have access to the Intel compiler, boost library and python - note the module loads before executing b2/bjam.
We start a python interpreter and load the extension library.
Intel Math Kernel Library (MKL)
See the MKL page.
See the GSL page.
See the FFTW page.
Scientific Data Libraries
See the NetCDF page.
See the HDF5 page.