1 / 18

Intro to Scientific Libraries

Intro to Scientific Libraries. Blue Waters Undergraduate Petascale Education Program May 29 – June 10 2011. Matrix Multiplication. How would/did you program it? How about parallelizing it? -Hint: N 2 operations that look like “ ab+cd ” that all can be done independently

Download Presentation

Intro to Scientific Libraries

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Intro to Scientific Libraries Blue Waters Undergraduate Petascale Education Program May 29 – June 10 2011

  2. Matrix Multiplication • How would/did you program it? How about parallelizing it? -Hint: N2 operations that look like “ab+cd” that all can be done independently • What is the most efficient way? Scientific Libraries BWUPEP2011, UIUC, May 29 - June 10 2011

  3. Answers to the previous questions Lazy answer #1: You don’t need to do either! • What is the most efficient way? Lazy answer #2: It depends. How would/did you program it? How about parallelizing it? Supercomputing in Plain English: Apps & Par Types BWUPEP2011, UIUC, May 29 - June 10 2011

  4. Explanation of Lazy Answer #1 The solution of a large number of very smart people over many years Your solution Solution Quality: Don’t reinvent the wheel Supercomputing in Plain English: Apps & Par Types BWUPEP2011, UIUC, May 29 - June 10 2011

  5. Scientific Libraries Loose Definition – A collection of mathematical optimized for various data types, computer architectures, numeric types, and scientific fields of study. Common example: Lapack- linear algebra library Supercomputing in Plain English: Apps & Par Types BWUPEP2011, UIUC, May 29 - June 10 2011

  6. How to identify your matrix General Matrix – Nothing too special going on with it Banded Matrix – A lines of data going diagonally down the matrix. Tri-diagonal matrix- A 3-width banded matrix Symmetric matrix- Supercomputing in Plain English: Apps & Par Types BWUPEP2011, UIUC, May 29 - June 10 2011

  7. The Sparse Matrix A larger matrix that is mostly empty. A good rule of thumb is approximately 90% - 95% empty. The opposite of a sparse matrix is a dense matrix. Supercomputing in Plain English: Apps & Par Types BWUPEP2011, UIUC, May 29 - June 10 2011

  8. BLAS Basic Linear Algebra System Fundamental level of linear algebra libraries Various highly optimized implementations by vendors Many other libraries built on top of BLAS Create your own optimized implementation using ATLAS Three levels: Level 1- Vector-vector operations - Level 2- Matrix-vector operations - Level 3- Matrix-matrix operations – Supercomputing in Plain English: Apps & Par Types BWUPEP2011, UIUC, May 29 - June 10 2011

  9. ATLAS Automatically Tuned Linear Algebra Software Performs a series of timed tests upon installation. These tests are used to tune the libraries for the individual system. Substantially faster on many systems. Supercomputing in Plain English: Apps & Par Types BWUPEP2011, UIUC, May 29 - June 10 2011

  10. Atlas Performance Supercomputing in Plain English: Apps & Par Types BWUPEP2011, UIUC, May 29 - June 10 2011

  11. Lapack Eigenvector Eigenvalue = Written on top of Basic Linear Algebra Subprograms (BLAS) Incorporates/retools EISPACK (eigenvalues) and LINPACK (least squares) Optimized for most modern shared memory architectures Supercomputing in Plain English: Apps & Par Types BWUPEP2011, UIUC, May 29 - June 10 2011

  12. Why LAPACK? Widely available. Lots of documentation and examples. Easy to use. Mostly preinstalled and tuned on most computers. Many versions are tuned for shared memory architectures. Since it is built on top of your BLAS installation, it’ll perform at least as well as BLAS. Supercomputing in Plain English: Apps & Par Types BWUPEP2011, UIUC, May 29 - June 10 2011

  13. Beginner’s Guide to LAPACK #1 RULE – Documentation is your friend!! First step: Install LAPACK -May involve installing BLAS first (Optional activity!) Supercomputing in Plain English: Apps & Par Types BWUPEP2011, UIUC, May 29 - June 10 2011

  14. Beginner’s Guide to LAPACK Data type + Matrix Type + Problem Not all subroutines have handy naming scheme. USE DOCUMENTATION • Second step- Look up what you want to do. -Handy naming scheme: Supercomputing in Plain English: Apps & Par Types BWUPEP2011, UIUC, May 29 - June 10 2011

  15. EXAMPLES • Simple LAPACK call- DGEMM • A bunch of calls repeated 1000 times • Bonus demo-Difficult part of libraries! Supercomputing in Plain English: Apps & Par Types BWUPEP2011, UIUC, May 29 - June 10 2011

  16. Leading dimensions? You have this: You want to perform an operation on this: LDA = 3 M=2 N=2 LDA = M This occurs the most Supercomputing in Plain English: Apps & Par Types BWUPEP2011, UIUC, May 29 - June 10 2011

  17. General “Don’t”s Don’t invert a matrix if it can be avoided. It is computationally very expensive. Figure out a way around it. Don’t write your own solvers. If it is a common mathematical operation, someone else most likely spent a lot of time and effort solving for the most efficient method. Don’t attempt to use a library without consulting the documentation and attempting a few example problems. Don’tattempt to program a solution (especially with libraries) if you don’t understand the problem’s mathematics/science! Supercomputing in Plain English: Apps & Par Types BWUPEP2011, UIUC, May 29 - June 10 2011

  18. Preview: Next Week ScaLAPACK DOE ACTs collection: 2nd lazy answer- How do we decide what to use to optimize efficiency? Supercomputing in Plain English: Apps & Par Types BWUPEP2011, UIUC, May 29 - June 10 2011

More Related