Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

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:  25573 views
Comments:  

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.

Report abuse help

Report abuse

Thank you. This entry has been flagged for moderator attention.


Report abuse help

Report abuse

Report abuse submission failed. Please try again later.


developerWorks: Sign in


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

Choose your display name

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


Rate this article

Comments

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=