Skip to main content

TechReview, Part 1: Discover the LAPACK library

Learn about the four versions of this interface for commonly used linear algebra operations in high performance computing

Kane Scarlett, Editor, Multicore acceleration, IBM
Kane Scarlett
Kane Scarlett is a technology journalist/analyst with 20 years in the business, working for such publishers as National Geographic, Population Reference Bureau, Miller Freeman, and IDG, and managing, editing, and writing for such august journals as JavaWorld, LinuxWorld, and of course, developerWorks.

Summary:  For application programmers using the IBM Software Development Kit for Multicore Acceleration (SDK), this article explains the basic structure of the IBM Linear Algebra Package (LAPACK) library. The LAPACK is based on a published standard interface for commonly used linear algebra operations in high performance computing and other scientific domains.

View more content in this series

Date:  02 Sep 2008
Level:  Introductory PDF:  A4 and Letter (28KB)Get Adobe® Reader®
Activity:  3835 views

Introduction

This review gives a quick look at the LAPACK library through the eyes of the original documentation, "LAPACK: Linear Algebra Package Library Programmer's Guide and API Reference" (see Resources). The article focuses on introducing the library versions and functions and on overviewing the basic structure of the library. Use this article with the most current version of IBM SDK for Multicore Acceleration (also known as the Cell/B.E.® SDK), which is the version with fixpack 3.0.0.3.

Discovering LAPACK

LAPACK is a software library that provides routines for solving systems of:

  • Simultaneous linear equations: Algebraic equations in which each term is a constant (or the product of a constant) and a single variable (with one or more variables).
  • Least-squares solutions of linear systems of equations: A method of fitting data often used in statistical contexts such as regression analysis.
  • Eigenvalue problems: The corresponding scalar value of the eigenvector, which is a nonzero vector that changes in length (but not direction) when applied to the linear transformation of which it is a part.
  • Householder transformation: The reflection of a vector in a plane in 3D space. Householder transformation is often used to implement decomposition on a matrix.

LAPACK is written in FORTRAN 77. LAPACK95 uses features of FORTRAN 95 to simplify the interface of the routines. In a way, LAPACK is the successor of LINPACK, which was designed to run on vector computers with shared memory. One of the major differences, though, is that LAPACK depends on Basic Linear Algebra Subprograms (see Resources for more information about BLAS) to leverage the cache found in modern cache-based systems architectures. (And, if your BLAS is well tuned, LAPACK leaves LINPACK in the dust!) The library can also run on distributed-memory systems, including ScaLAPACK and PLAPACK.

The API is available with standard ANSI C and standard FORTRAN 77 interfaces. Implementations of the APIs are available as open source from Netlib Repository.

Versions

Each LAPACK routine has up to four versions:

  • Real single precision is denoted by the prefix S.
  • Real double precision is denoted by the prefix D.
  • Complex single precision is denoted by the prefix C.
  • Complex double precision is denoted by the prefix Z.

The LAPACK library in the Cell/B.E. SDK supports only real double precision (or DP). DP routines are available as PPE APIs, and the routines conform to the standard LAPACK FORTRAN 77 interface.

Optimized routines

The following routines have been optimized to use features of the Synergistic Processing Elements (SPEs):

  • DGETRF : Compute the LU factorization of a general matrix. LU is a matrix decomposition that writes a matrix as the product of a lower and upper triangular matrix.
  • DGETRI: Compute the inverse of a general matrix using the LU factorization.
  • DGEQRF: Compute the QR factorization of a general matrix. QR is a decomposition of the matrix into an orthogonal and a triangular matrix.
  • DPOTRF: Compute the Cholesky factorization of a symmetric positive matrix. Cholesky is a decomposition of a symmetric positive-definite matrix into a lower triangular matrix and the transpose of the lower triangular matrix.
  • DBDSQR: Compute the singular value decomposition of a real bi-diagonal matrix using the implicit zero-shift QR algorithm.
  • DSTEQR: Compute the singular value decomposition of a real symmetric tridiagonal matrix using the implicit QR algorithm.

Understanding the basic library structure

Table 1 shows where to find various library, header, and code example files in the LAPACK library for Cell/B.E. and x86 systems.


Table 1. Where the files are
PlatformCell/B.E. or Power host (development or execution, including simulator)x86 or x86_64 (development)
PPE 32-bit library/usr/lib/liblapack.a
/usr/lib/liblapack.so
/usr/lib/liblapack.so.3.1.1
/opt/cell/sysroot/usr/lib/liblapack.a
/opt/cell/sysroot/usr/lib/liblapack.so
/opt/cell/sysroot/usr/lib/liblapack.so.3.1.1
PPE 64-bit library/usr/lib64/liblapack.a
/usr/lib64/liblapack.so
/usr/lib64/liblapack.so.3.1.1
/opt/cell/sysroot/usr/lib64/liblapack.a
/opt/cell/sysroot/usr/lib64/liblapack.so
/opt/cell/sysroot/usr/lib64/liblapack.so.3.1.1
PPE header files/usr/include/lapack.h/opt/cell/sysroot/usr/include/lapack.h
Code examples/opt/cell/sdk/src/lapack-examples-source.tar/opt/cell/sdk/src/lapack-examples-source.tar

The following are the key file components of the LAPACK library:

  • lapack.h contains the C function interface of LAPACK on PPE for DP.
  • lapack.a contains the static library, which contains the LAPACK library for Cell/B.E.
  • lapack.so is a shared LAPACK library for Cell/B.E.
  • lapack-examples-source.tar contains two examples that show how to use the LAPACK library with the SDK for Multicore Acceleration.

Conclusion

The next TechReview of LAPACK introduces some basic programming and performance tuning tips for the library. If the anticipation of it grows unbearable, you can jet over to the original source document (see Resources).


Resources

Learn

Get products and technologies

Discuss

About the author

Kane Scarlett

Kane Scarlett is a technology journalist/analyst with 20 years in the business, working for such publishers as National Geographic, Population Reference Bureau, Miller Freeman, and IDG, and managing, editing, and writing for such august journals as JavaWorld, LinuxWorld, and of course, developerWorks.

Comments (Undergoing maintenance)



Trademarks  |  My developerWorks terms and conditions

Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Multicore acceleration
ArticleID=335087
ArticleTitle=TechReview, Part 1: Discover the LAPACK library
publish-date=09022008
author1-email=kane@us.ibm.com
author1-email-cc=

My developerWorks community

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere).

My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Special offers