Hprc banner tamu.png

Curie:Numerical libraries

Jump to: navigation, search

ESSL Library

The IBM Engineering and Scientific Subroutine Library (ESSL) contains a collection of highly optimized mathematical subroutines, with, depending on version, incomplete implementations of BLAS, LAPACK or FFTW support. The ESSL libraries are thread safe and work with C,C++, and Fortran programs. ESSL includes serial as well as SMP versions.

Compiling/linking programs containing ESSL routines depends on a number of factors; language, serial/SMP, integer size. Below we will provide the various compiler commands for the various cases (for illustration purposes all examples compile a program named hello_essl):

Fortran programs, 32-bit (default) integers :

Serial:  xlf_r -O -qnosave  hello_essl.f90 -lessl
SMP   :  xlf_r -O -qnosave -qsmp hello_essl.f90 -lesslsmp

Fortran programs, 64-bit integers :

Serial:  xlf_r -O -qnosave -qintsize=8 hello_essl.f90 -lessl6464
SMP:     xlf_r -O -qnosave -qsmp  -qintsize=8 hello_essl.f90 -lesslsmp6464

C programs, 32-bit (default) integers :

Serial:  xlc_r -O hello_essl.c -lessl -lxlf90_r -lxlomp_ser
SMP   :  xlc_r -O -qsmp hello_essl.c -lesslsmp  -lxlf90_r -lxlsmp

C programs, 64-bit integers :

Serial:  xlc_r -O -D_ESV6464 hello_essl.c -lessl6464 -lxlf90_r -lxlsmp
SMP:     xlc_r -O -D_ESV6464 hello_essl.c -lesslsmp6464 -lxlf90_r -lxlsmp

NOTE: for C++ programs the compiler commands are very similar to the commands to compile C programs.

NOTE: for C/C++ programs you will also need to include "<essl.h>" to your source code

For more information about the ESSL library, please visit http://publib.boulder.ibm.com/epubs/pdf/a2322684.pdf

MASS Library

The Mathematical Acceleration SubSystem (MASS) is a collection of optimized mathematical functions. These functions are thread-safe, and can be used with C, C++ and Fortran programs. To load the MASS Library module type "module load xlmass".

MASS scalar library

The MASS scalar library contains a collection of scalar mathematical function (e.g. sin, cos, erfc). To link the MASS scalar library add the "-lmass_64" flag ("-lmass" for 32 bit applications) to your compile/link command

Example: compile program hello_mass.c and link with MASS scalar library

xlc -lmass_64 hello_mass.c

MASS vector library

The MASS vector library contains a collection of vector mathematical function (e.g. vsin, vcos, verfc). To link the MASS vector library add the "-lmassv_64" ("-lmassv" for 32 bit applications) to your compile/link command

Example: compile program hello_mass.c and link with MASS scalar library

xlc -lmassv_64 hello_mass.c

NOTE: if you compile your program using "-qhot -O3", "-O4", or "-O5" the compiler will try to vectorize system math functions by calling equivalent MASS vector functions if possible. Otherwise the compiler will replace system math functions with scalar MASS functions.

NAG Fortran Library

the NAG Libraries contain an extensive set of numerical and statistical algorithms (including full BLAS and LAPACK functionality). On curie the only library currently available is the Fortran Library (serial version). To load the NAG Fortran module type "module load NAG/Fortran-Library". This will define the following 2 environmental variables:

Environmental variables Descriptions
NAG_FORTRANLIB_INCLUDE location of include files
NAG_FORTRANLIB_INCLUDE locations of libraries

To compile/link a program that contains calls to NAG functions, you have add the include/library paths to your compile command.

Example: compile program hello_nag.f90 and link with NAG library