Numerical Libraries¶
ACML¶
http://developer.amd.com/tools-and-sdks/archive/amd-core-math-library-acml/
AMD Core Math Library, or ACML, provides a free set of thoroughly optimized and threaded math routines for HPC, scientific, engineering and related compute-intensive applications. ACML is ideal for weather modeling, computational fluid dynamics, financial analysis, oil and gas applications and more.
ATLAS¶
http://math-atlas.sourceforge.net/ The ATLAS (Automatically Tuned Linear Algebra Software) project is an ongoing research effort focusing on applying empirical techniques in order to provide portable performance. At present, it provides C and Fortran77 interfaces to a portably efficient BLAS implementation, as well as a few routines from LAPACK.
Licensing Terms and Conditions
It is released under a BSD-style license without advertising clause
Usage
List available versions
module avail atlas
module load atlas
Environment Variables¶
module show atlas
$ATLASROOT /apps/libraries/atlas/3.11.34
$INCLUDE /apps/libraries/atlas/3.11.34/include
$LD_LIBRARY_PATH /apps/libraries/atlas/3.11.34/lib
Link libraries¶
How do I link with all these libraries?
The user libs created by ATLAS are:
liblapack.a
The serial LAPACK routines provided by ATLAS.libcblas.a
The ANSI C interface to the BLAS.libf77blas.a
The Fortran77 interface to the BLAS.libptlapack.a
The threaded (parallel) LAPACK routines provided by ATLAS.libptcblas.a
The ANSI C interface to the threaded (SMP) BLAS. This library only appears if you have asked for SMP support.libptf77blas.a
The Fortran77 interface to the threaded (SMP) BLAS. This library only appears if you have asked for SMP support.libatlas.a
The main ATLAS library, providing low-level routines for all interface libs.
If you have missing symbols on link, make sure you are linking in all of the libraries you need, and remember that order is significant.
- For instance, a code calling the Fortran77 interface to the BLAS would need:
-L$(ATLASROOT)/lib/ -lf77blas -latlas
- The full LAPACK library created by merging ATLAS and netlib LAPACK requires both C and Fortran77 interfaces, and thus that serial link line would be:
-L$(ATLASROOT)/lib/ -llapack -lf77blas -lcblas -latlas
- While the threaded LAPACK link would be:
-L$(ATLASROOT)/lib/ -lptlapack -lptf77blas -lptcblas -latlas
If your are using C interface please use -lgfortran
flag too.
BLAS¶
Basic Linear Algebra Subprograms
The BLAS (Basic Linear Algebra Subprograms) are high quality “building block” routines for performing basic vector and matrix operations. Level 1 BLAS do vector-vector operations, Level 2 BLAS do matrix-vector operations, and Level 3 BLAS do matrix-matrix operations.
The BLAS library is available in several flavors:
CLhep¶
http://proj-clhep.web.cern.ch/proj-clhep/
CLHEP - A Class Library for High Energy Physics
ELPA¶
http://elpa.rzg.mpg.de/ http://elpa-lib.fhi-berlin.mpg.de/wiki/index.php/Main_Page
ELPA is a Fortran-based high-performance computational library for the (massively) parallel solution of symmetric or Hermitian, standard or generalized eigenvalue problems.
Licensing Terms and Conditions License
Usage
List available versions
module avail elpa
module load elpa
module show elpa
FFTW¶
FFTW (Fastest Fourier Transforms in the West) is a C subroutine library for computing the discrete Fourier transform (DFT) in one or more dimensions, of arbitrary input size, and of both real and complex data (as well as of even/odd data, i.e. the discrete cosine/sine transforms or DCT/DST). We believe that FFTW, which is free software, should become the FFT library of choice for most applications.
Licensing Terms and Conditions Free software, released under the GNU General Public License (GPL, see FFTW license).
FFTW version 2¶
List available versions
module avail fftw/2
module load fftw/2
Linking¶
Prefix:
- default (double precision):
-lfftw
compile with#include <fftw.h>
- single precision:
-lsfftw
compile with#include <sfftw.h>
- double precision:
-ldfftw
compile#include <dfftw.h>
Link flags:
- complex fft:
-lfftw -lm
- real fft:
-lrfftw -lfftw -lm
- parallel MPI
- complex:
-lfftw_mpi -lfftw -lm
- real:
-lrfftw_mpi -lfftw_mpi -lrfftw -lm
- complex:
- threaded
- complex:
-lfftw_threads -lfftw -lm -fopenmp
- real:
-lfftw_threads -lrfftw_threads -lfftw -lrfftw -fopenmp
- complex:
Example
gcc -I$FFTWROOT/include fftw2_example.c -L$FFTWROOT/lib -lfftw -lm
FFTW version 3¶
List available versions
module avail fftw/3.
module load fftw/3.
Linking¶
Prefix:
- default (double precision)
fftw3
- single
fftw3f
Link flags:
-
-lfftw3 -lm
-
threaded
-lfftw3_threads -lfftw3 -lpthread -lm
- openmp
-fopenmp -lfftw3_omp -lfftw3 -lm
- MPI
-lfftw3_mpi -lfftw3 -lm
Example
gcc -I$FFTWROOT/include fftw3_example.c -L$FFTWROOT/lib -lfftw3 -lm
FGSL¶
http://www.lrz.de/services/software/mathematik/gsl/fortran/
A Fortran interface to the GNU Scientific Library
Licensing Terms and Conditions
FGSL is released under Version 2 or later of the GPL
Usage
List available versions
module avail fgsl
module load fgsl
GSL¶
http://www.gnu.org/software/gsl/
The GNU Scientific Library (GSL) is a numerical library for C and C++ programmers. The library provides a wide range of mathematical routines such as random number generators, special functions and least-squares fitting. There are over 1000 functions in total with an extensive test suite.
Licensing Terms and Conditions
Unlike the licenses of proprietary numerical libraries the license of GSL does not restrict scientific cooperation. It allows you to share your programs freely with others. License
Usage
List available versions
module avail gsl
module load gsl
GLPK¶
http://www.gnu.org/software/glpk/
The GLPK (GNU Linear Programming Kit) package is intended for solving large-scale linear programming (LP), mixed integer programming (MIP), and other related problems. It is a set of routines written in ANSI C and organized in the form of a callable library.
GLPK supports the GNU MathProg modeling language, which is a subset of the AMPL language.
The GLPK package includes the following main components:
- primal and dual simplex methods
- primal-dual interior-point method
- branch-and-cut method
- translator for GNU MathProg
- application program interface (API)
- stand-alone LP/MIP solver
Usage
List available versions
module avail glpk
module load glpk
module show glpk
gcc -I$GLPKROOT/include glpk_example.c -L$GLPKROOT/lib -lglpk -lgmp -lm
LAPACK¶
Linear Algebra PACKage
LAPACK is written in Fortran 90 and provides routines for solving systems of simultaneous linear equations, least-squares solutions of linear systems of equations, eigenvalue problems, and singular value problems. The associated matrix factorizations (LU, Cholesky, QR, SVD, Schur, generalized Schur) are also provided, as are related computations such as reordering of the Schur factorizations and estimating condition numbers. Dense and banded matrices are handled, but not general sparse matrices. In all areas, similar functionality is provided for real and complex matrices, in both single and double precision.
The LAPACK library is available in several flavors:
LIBFLAME¶
http://www.cs.utexas.edu/~flame/web/libFLAME.html
libFLAME is a high performance dense linear algebra library that is the result of the FLAME methodology for systematically developing dense linear algebra libraries. The FLAME methodology is radically different from the LINPACK/LAPACK approach that dates back to the 1970s. For more information about the methodology, visit the Methodology page.
Licensing Terms and Conditions License
Usage
List available versions
module avail flame
module load flame
module show flame
LIBINT¶
http://sourceforge.net/p/libint/home
libint is two things: 1. a library of C/C++ functions for efficient evaluation of several kinds of two-body molecular integrals over Gaussian functions; 2. the optimizing compiler that generates a Libint library.
Licensing Terms and Conditions This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Refer to the full text of the GNU General Public License. You can obtain the most up-to-date version of GPL if you write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. License
Usage
List available versions
module avail libint
module load libint
module show libint
[LIBSMM][libsmm]¶
It is a library tuned for small size matrix multiplication, an area where regular BLAS is not so well-tuned.
Usage
List available versions
module avail libsmm
module load libsmm
module show libsmm
[libsmm]:
METIS¶
http://glaros.dtc.umn.edu/gkhome/metis/metis/overview
METIS is a set of serial programs for partitioning graphs, partitioning finite element meshes, and producing fill reducing orderings for sparse matrices. The algorithms implemented in METIS are based on the multilevel recursive-bisection, multilevel k-way, and multi-constraint partitioning schemes developed in our lab (Karypis Lab).
Usage
List available versions
module avail metis
module load metis
module show metis
MKL¶
https://software.intel.com/en-us/intel-mkl
- Linear Algebra [BLAS, LAPACK, ScaLAPACK]
- Sparse [CSR,CSC,BSR, DIA,Skyline, NIST, SparseKit]
- Fast Fourier Transform [serial, multi-thread, distributed]
- Vector Math Library (VML)
- Vector Statistical Library (VSL)
Licensing Terms and Conditions
Usage List available versions
module avail intel
Enviroment Variables¶
module show intel
$MKLROOT /apps/compilers/intel/composer_xe_2015.3.187/mkl
$INCLUDE /apps/compilers/intel/composer_xe_2015.3.187/mkl/include
$LD_LIBRARY_PATH /apps/compilers/intel/composer_xe_2015.3.187/mkl/lib
Link libraries¶
INTEL Math Kernel Library Link Line Advisor https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor/
C Lapack Example:¶
intel c/c++, 32 bit integers (standar)
## threaded version
icc -openmp -I${MKLROOT}/include dgesv_example.c -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a ${MKLROOT}/lib/intel64/libmkl_core.a ${MKLROOT}/lib/intel64/libmkl_intel_thread.a -Wl,--end-group -lpthread -lm
## sequential version
icc -I${MKLROOT}/include dgesv_example.c -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a ${MKLROOT}/lib/intel64/libmkl_core.a ${MKLROOT}/lib/intel64/libmkl_sequential.a -Wl,--end-group -lpthread -lm
gnu c/c++ 32 bit integers (standar)
## threaded version
gcc -fopenmp -m64 -I${MKLROOT}/include dgesv_example.c -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a ${MKLROOT}/lib/intel64/libmkl_core.a ${MKLROOT}/lib/intel64/libmkl_gnu_thread.a -Wl,--end-group -ldl -lpthread -lm
## sequential version
gcc -m64 -I${MKLROOT}/include dgesv_example.c -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a ${MKLROOT}/lib/intel64/libmkl_core.a ${MKLROOT}/lib/intel64/libmkl_sequential.a -Wl,--end-group -ldl -lpthread -lm
- for 64-bit integers (greater than 2^31) check for “ILP64 mkl interface”
FORTRAN Lapack Example:¶
intel ifort, 32 bit integers
## threaded version
ifort -openmp -I${MKLROOT}/include dgesv_example.f -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a ${MKLROOT}/lib/intel64/libmkl_core.a ${MKLROOT}/lib/intel64/libmkl_intel_thread.a -Wl,--end-group -lpthread -lm
## sequential version
ifort -I${MKLROOT}/include dgesv_example.f -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a ${MKLROOT}/lib/intel64/libmkl_core.a ${MKLROOT}/lib/intel64/libmkl_sequential.a -Wl,--end-group -lpthread -lm
gnu gfortran 32 bit integers
## threaded version
gfortran -fopenmp -m64 -I${MKLROOT}/include dgesv_example.f -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_gf_lp64.a ${MKLROOT}/lib/intel64/libmkl_core.a ${MKLROOT}/lib/intel64/libmkl_gnu_thread.a -Wl,--end-group -ldl -lpthread -lm
## sequential version
gfortran -m64 -I${MKLROOT}/include dgesv_example.f -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_gf_lp64.a ${MKLROOT}/lib/intel64/libmkl_core.a ${MKLROOT}/lib/intel64/libmkl_sequential.a -Wl,--end-group -ldl -lpthread -lm
- for 64-bit integers (greater than 2^31) check for “ILP64 mkl interface”
Threading¶
OMP_NUM_THREADS
MKL_NUM_THREADS
SCALAPACK Example¶
intel c/c++ Intel MPI
## threaded version
mpiicc -openmp -I${MKLROOT}/include scalapack_example.c ${MKLROOT}/lib/intel64/libmkl_scalapack_lp64.a -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a ${MKLROOT}/lib/intel64/libmkl_core.a ${MKLROOT}/lib/intel64/libmkl_intel_thread.a -Wl,--end-group ${MKLROOT}/lib/intel64/libmkl_blacs_intelmpi_lp64.a -lpthread -lm
## sequential version
mpiicc -I${MKLROOT}/include scalapack_example.c ${MKLROOT}/lib/intel64/libmkl_scalapack_lp64.a -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a ${MKLROOT}/lib/intel64/libmkl_core.a ${MKLROOT}/lib/intel64/libmkl_sequential.a -Wl,--end-group ${MKLROOT}/lib/intel64/libmkl_blacs_intelmpi_lp64.a -lpthread -lm
gnu c/c++ OpenMPI
## threaded version
mpicc -m64 -I${MKLROOT}/include scalpack_example.c ${MKLROOT}/lib/intel64/libmkl_scalapack_lp64.a -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a ${MKLROOT}/lib/intel64/libmkl_core.a ${MKLROOT}/lib/intel64/libmkl_sequential.a -Wl,--end-group ${MKLROOT}/lib/intel64/libmkl_blacs_openmpi_lp64.a -lpthread -lm
## sequential version
mpicc -fopenmp -m64 -I${MKLROOT}/include scalapack_example.c ${MKLROOT}/lib/intel64/libmkl_scalapack_lp64.a -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a ${MKLROOT}/lib/intel64/libmkl_core.a ${MKLROOT}/lib/intel64/libmkl_sequential.a -Wl,--end-group ${MKLROOT}/lib/intel64/libmkl_blacs_openmpi_lp64.a -lpthread -lm
OPENBLAS¶
https://github.com/xianyi/OpenBLAS
OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version.
Please read the documents on OpenBLAS wiki pages http://github.com/xianyi/OpenBLAS/wiki.
Licensing Terms and Conditions License
Usage
List available versions
module avail openblas
openblas/0.2.14/gnu/int4 openblas/0.2.14/intel/int4
openblas/0.2.14/gnu/int8 openblas/0.2.14/intel/int8
module load openblas
Prefix
int4
: 32 bit integerint8
: 64 bit integer
gnu
libopenblas_gfortran_i32.a
libopenblas_gfortran_i64.a
intel
libopenblas_ifort_i32.a
libopenblas_ifort_i64.a
Linking¶
CBLAS interface¶
- GNU
module load gnu openblas/0.2.14/gnu/int4
gcc openblas_example.c -I$BLASROOT/include/ -L$BLASROOT/lib -lopenblas_gfortran_i32 -lpthread -lgfortran
- INTEL
module load intel openblas/0.2.14/intel/int4
icc openblas_example.c -I$BLASROOT/include/ -L$BLASROOT/lib -lopenblas_ifort_i32 -lpthread -lifcore
BLAS Fortran interface¶
module load openblas/0.2.14/gnu/int4
gcc fopeblas_example.c /apps/libraries/openblas/0.2.14/gnu/int4/lib/libopenblas_gfortran_i32.a -lpthread
PARMETIS¶
http://glaros.dtc.umn.edu/gkhome/metis/parmetis/overview
ParMETIS is an MPI-based parallel library that implements a variety of algorithms for partitioning unstructured graphs, meshes, and for computing fill-reducing orderings of sparse matrices. ParMETIS extends the functionality provided by METIS and includes routines that are especially suited for parallel AMR computations and large scale numerical simulations. The algorithms implemented in ParMETIS are based on the parallel multilevel k-way graph-partitioning, adaptive repartitioning, and parallel multi-constrained partitioning schemes developed in our lab (Karypis Lab).
Usage
List available versions
module avail parmetis
module load parmetis
module show parmetis
PETSC¶
PETSc, pronounced PET-see (the S is silent), is a suite of data structures and routines for the scalable (parallel) solution of scientific applications modeled by partial differential equations.
Usage
List available versions
module avail petsc
module load petsc
module show petsc
SCALAPACK¶
Scalable Linear Algebra PACKage
ScaLAPACK is a library of high-performance linear algebra routines for parallel distributed memory machines. ScaLAPACK solves dense and banded linear systems, least squares problems, eigenvalue problems, and singular value problems. The key ideas incorporated into ScaLAPACK include the use of
- a block cyclic data distribution for dense matrices and a block data distribution for banded matrices, parametrizable at runtime;
-
block-partitioned algorithms to ensure high levels of data reuse;
-
well-designed low-level modular components that simplify the task of parallelizing the high level routines by making their source code the same as in the sequential case.
The LAPACK library is available in several flavors:
Netlib¶
Licensing Terms and Conditions
http://www.netlib.org/scalapack/
ScaLAPACK is a freely-available software package. It is available from netlib via anonymous ftp and the World Wide Web at http://www.netlib.org/scalapack . Thus, it can be included in commercial software packages (and has been). We only ask that proper credit be given to the authors.
The license used for the software is the modified BSD license
Usage
List available versions
module avail scalapack
module load scalapack
Link¶
-L$SCALAPACKROOT/lib -lscalapack
NOTE Scalapack is also available via MKL library
VORO++¶
Voro++ is a software library for carrying out three-dimensional computations of the Voronoi tessellation. A distinguishing feature of the Voro++ library is that it carries out cell-based calculations, computing the Voronoi cell for each particle individually. It is particularly well-suited for applications that rely on cell-based statistics, where features of Voronoi cells (eg. volume, centroid, number of faces) can be used to analyze a system of particles.