Professional Documents
Culture Documents
Parallel Systems
USING LAPACK, SCALAPCK, PETSc
Linear Algebra Libraries
• BLAS (The father)
• Children
1) LAPACK
2) ScaLAPACK
3) PETSc
BLAS routines in vendor supplied
libraries are tuned for architectures.
Symmetric: , Cholesky
Decomposition
An example: Linear solver
with LU factorization
• Our very familiar
problem! Linear solver
for .
The method to use LAPACK within MKL
• Determine what package and solver you need. Any linear algebra
problem you can think of, LAPACK has an implementation.
• Use link line advisor to gather an idea about what libraries are required.
• Decide if you want static or dynamic linking (i.e. whether the libraries
need to be included in the executable or looked up at runtime). Include
them in a Makefile.
• Write a wrapper for your use (note that this is opposite to the
philosophy in Numerical Recipes!).
• Now we will see a couple examples of BLAS and LAPACK wrappers for
Fortran.
How to build code with Intel MKL
• First decision – how to link libraries?
• Once you know how you want to link, what specific codes to use, what
platform to use it for, platform architecture – USE LINK LINE ADVISOR (
https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor)
Intel MKL Link Line
Advisor
Intel MKL Version
OS
Compiler
Architecture
Linking choices
Figure 2: The first two leading EOF modes of the Pan-Asian Monsoon summer precipitation and their
corresponding principal component over the period of 1979–2009. The first mode explained 15.92% of total
variance; the second mode explained 9.11% of total variance (Gao and Wang, 2015)
How to calculate EOF’s
• Then
if matrix has rows , matrix has columns as , then .