UMBC logo
UMBC High Performance Computing Facility
How to use LAPACK on tara

Introduction

The Linear Algebra PACKage (LAPACK) library is useful for matrix algebra operations like singular value decomposition, solving systems of linear equations, and computing eigenvalues. You may want to consider using it instead of writing your own routines. For lower level operations like matrix multiplication, see BLAS. In this tutorial, we will compile and run a program that uses LAPACK to compute SVDs. Before you begin, make sure to read the tutorial for compiling C programs.

Where to find documentation

On this page, we'll show how to use LAPACK functionality within AMD Core Math Library (ACML). We'll assume that you're using the default "pgi-9.0-mvapich2-1.4rc2" switcher setting - other MPI+compiler combinations may not work with the code below.

For more information about the LAPACK routines in ACML, see

Example

In this example we will create a matrix, then compute its singular value decomposition (SVD) using the LAPACK dgesvd function. The SVD of A (m x n) will consist of U (m x m), S (p x 1, where p = min(m,n)), and VT (n x n) Our matrices will contain doubles, and be stored in column-major order. Here is the code