Teuchos: Utilities for Developers & Users November 2nd, 3:30-4:30pm Roscoe Bartlett Mike Heroux Kris Kampshoff Kevin Long Paul Sexton Heidi.

Slides:



Advertisements
Similar presentations
Yafeng Yin, Lei Zhou, Hong Man 07/21/2010
Advertisements

Computational Physics Linear Algebra Dr. Guy Tel-Zur Sunset in Caruaru by Jaime JaimeJunior. publicdomainpictures.netVersion , 14:00.
Chapter 7 Introduction to Procedures. So far, all programs written in such way that all subtasks are integrated in one single large program. There is.
1/1/ / faculty of Electrical Engineering eindhoven university of technology Introduction Part 2: Data types and addressing modes dr.ir. A.C. Verschueren.
Sandia is a multiprogram laboratory operated by Sandia Corporation, a Lockheed Martin Company, for the United States Department of Energy under contract.
Ensemble Emulation Feb. 28 – Mar. 4, 2011 Keith Dalbey, PhD Sandia National Labs, Dept 1441 Optimization & Uncertainty Quantification Abani K. Patra, PhD.
MATH 685/ CSI 700/ OR 682 Lecture Notes
SOLVING SYSTEMS OF LINEAR EQUATIONS. Overview A matrix consists of a rectangular array of elements represented by a single symbol (example: [A]). An individual.
Theoretical Program Checking Greg Bronevetsky. Background The field of Program Checking is about 13 years old. Pioneered by Manuel Blum, Hal Wasserman,
Next Generation Iterative Solvers: Belos & Anasazi Next Generation Iterative Solvers: Belos & Anasazi November 3 rd, 9:30-10:30am Mike Heroux Ulrich Hetmaniuk.
Problem Uncertainty quantification (UQ) is an important scientific driver for pushing to the exascale, potentially enabling rigorous and accurate predictive.
Chapter 2, Linear Systems, Mainly LU Decomposition.
1cs542g-term Notes  Assignment 1 will be out later today (look on the web)
1cs542g-term Notes  Assignment 1 is out (questions?)
Systems of Linear Equations
AceGen and AceFEM packages
Chapter 8 Objectives Understanding matrix notation.
A Factored Sparse Approximate Inverse software package (FSAIPACK) for the parallel preconditioning of linear systems Massimiliano Ferronato, Carlo Janna,
Exercise problems for students taking the Programming Parallel Computers course. Janusz Kowalik Piotr Arlukowicz Tadeusz Puzniakowski Informatics Institute.
Sandia is a multiprogram laboratory operated by Sandia Corporation, a Lockheed Martin Company, for the United States Department of Energy’s National Nuclear.
Numerical Computations in Linear Algebra. Mathematically posed problems that are to be solved, or whose solution is to be confirmed on a digital computer.
® Backward Error Analysis and Numerical Software Sven Hammarling NAG Ltd, Oxford
CS 591x – Cluster Computing and Programming Parallel Computers Parallel Libraries.
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
Solving Scalar Linear Systems Iterative approach Lecture 15 MA/CS 471 Fall 2003.
Page 1 Trilinos Software Engineering Technologies and Integration Capability Area Overview Roscoe A. Bartlett Department.
MATLAB Tutorials Session I Introduction to MATLAB Rajeev Madazhy Dept of Mechanical Engineering LSU.
Sandia is a multiprogram laboratory operated by Sandia Corporation, a Lockheed Martin Company, for the United States Department of Energy’s National Nuclear.
Teuchos: Utilities for Developers & Users November 4 th, 1:15-4:30pm Roscoe Bartlett Mike Heroux Kris Kampshoff Kevin Long Paul Sexton Heidi Thornquist.
PyTrilinos: A Python Interface to Trilinos Bill Spotz Sandia National Laboratories Reproducible Research in Computational Geophysics August 31, 2006.
Page 1 Trilinos Software Engineering Technologies and Integration Capability Area Overview Roscoe A. Bartlett Department.
Page 1 Trilinos Software Engineering Technologies and Integration Numerical Algorithm Interoperability and Vertical Integration –Abstract Numerical Algorithms.
Wrapping Fortran libraries Arjen Markus June 2010.
Review of Matrices Or A Fast Introduction.
MATLAB for Engineers 4E, by Holly Moore. © 2014 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. This material is protected by Copyright.
Page 1 Embedded Sensitivities and Optimization From Research to Applications Roscoe A. Bartlett Department of Optimization & Uncertainty Estimation Sandia.
CMPS 1371 Introduction to Computing for Engineers MATRICES.
Chapter 3 Solution of Algebraic Equations 1 ChE 401: Computational Techniques for Chemical Engineers Fall 2009/2010 DRAFT SLIDES.
Sandia is a multiprogram laboratory operated by Sandia Corporation, a Lockheed Martin Company, for the United States Department of Energy’s National Nuclear.
Amesos Sparse Direct Solver Package Tim Davis, Mike Heroux, Rob Hoekstra, Marzio Sala, Ken Stanley, Heidi Thornquist, Jim Willenbring Trilinos Users Group.
1 Incorporating Iterative Refinement with Sparse Cholesky April 2007 Doron Pearl.
Amesos Interfaces to sparse direct solvers October 15, :30 – 9:30 a.m. Ken Stanley.
Scalable Linear Algebra Capability Area Michael A. Heroux Sandia National Laboratories Sandia is a multiprogram laboratory operated by Sandia Corporation,
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
New Features in ML 2004 Trilinos Users Group Meeting November 2-4, 2004 Jonathan Hu, Ray Tuminaro, Marzio Sala, Michael Gee, Haim Waisman Sandia is a multiprogram.
1 Stratimikos Unified Wrapper to Trilinos Linear Solvers and Preconditioners Roscoe A. Bartlett Department of Optimization & Uncertainty Estimation Sandia.
Parallel Solution of the Poisson Problem Using MPI
Sandia is a multiprogram laboratory operated by Sandia Corporation, a Lockheed Martin Company, for the United States Department of Energy’s National Nuclear.
Implementing Hypre- AMG in NIMROD via PETSc S. Vadlamani- Tech X S. Kruger- Tech X T. Manteuffel- CU APPM S. McCormick- CU APPM Funding: DE-FG02-07ER84730.
Thyra For Developers Roscoe A. Bartlett Department of Optimization & Uncertainty Estimation Sandia National Laboratories Trilinos Users Group Meeting (Developers.
Linear Algebra Libraries: BLAS, LAPACK, ScaLAPACK, PLASMA, MAGMA
Trilinos Strategic (and Tactical) Planning Sandia is a multiprogram laboratory operated by Sandia Corporation, a Lockheed Martin Company, for the United.
An Overview of Belos and Anasazi October 16 th, 11-12am Heidi Thornquist Teri Barth Rich Lehoucq Mike Heroux Computational Mathematics and Algorithms Sandia.
Page 1 CMake Trilinos? Roscoe A. Bartlett Department of Optimization & Uncertainty Estimation Esteban J. Guillen Department.
Photos placed in horizontal position with even amount of white space between photos and header Sandia National Laboratories is a multi-program laboratory.
STL CSSE 250 Susan Reeder. What is the STL? Standard Template Library Standard C++ Library is an extensible framework which contains components for Language.
Combining Trilinos Packages To Solve Linear Systems Michael A. Heroux Sandia National Labs.
CSE 332: C++ STL iterators What is an Iterator? An iterator must be able to do 2 main things –Point to the start of a range of elements (in a container)
What’s New for Epetra Michael A. Heroux Sandia National Laboratories Sandia is a multiprogram laboratory operated by Sandia Corporation, a Lockheed Martin.
Parallel Programming & Cluster Computing Linear Algebra Henry Neeman, University of Oklahoma Paul Gray, University of Northern Iowa SC08 Education Program’s.
Linear Algebra Libraries: BLAS, LAPACK, ScaLAPACK, PLASMA, MAGMA Shirley Moore CPS5401 Fall 2013 svmoore.pbworks.com November 12, 2012.
Intro to Scientific Libraries Intro to Scientific Libraries Blue Waters Undergraduate Petascale Education Program May 29 – June
Introduction to Programming Lecture # 43. Math Library Complex number Matrix Quadratic equation and their solution …………….…
TEMPLATE DESIGN © H. Che 2, E. D’Azevedo 1, M. Sekachev 3, K. Wong 3 1 Oak Ridge National Laboratory, 2 Chinese University.
A Kriging or Gaussian Process emulator has: an unadjusted mean (frequently a least squares fit: ), a correction / adjustment to the mean based on data,
DOE/Office of Science/ASCR (Sandia National Laboratories)
Introduction to cuBLAS
Trilinos Software Engineering Technologies and Integration
GPU Implementations for Finite Element Methods
Presentation transcript:

Teuchos: Utilities for Developers & Users November 2nd, 3:30-4:30pm Roscoe Bartlett Mike Heroux Kris Kampshoff Kevin Long Paul Sexton Heidi Thornquist Questions from audience Can you use another matrix-vector multiply? Are multivectors supported? Are Petsc and Hypre available via TSF? How does Trilinos differ from Petsc? Sandia is a multiprogram laboratory operated by Sandia Corporation, a Lockheed Martin Company, for the United States Department of Energy under contract DE-AC04-94AL85000.

What is Teuchos (TEF-hos)? Lightweight, portable utility package What’s new? First release in Trilinos 4.0 Templated BLAS/LAPACK interface Templated serial dense matrix / vector Timing classes Templated parameter list Numeric traits mechanisms ( ordinal / scalar ) Memory management: Reference-counted pointers Pre-allocated workspace Exception handling Command-line parsing “Extended” utilities: XML parsing MPI communicators / traits Users Developers

Templated Parameter List Design based on NOX parameter list Adopted by Amesos, ML, Ifpack, AztecOO, … Parameter lists can be queried for attributes. No mechanism for “smart” queries of tags. // Has a solver been chosen? bool solver_defined = My_List.isParameter(“Solver”); // Has a preconditioner been chosen? bool prec_defined = My_List.isSublist(“Preconditioner”); // Has a double-precision drop tolerance been chosen? (Helper function) bool drop_tol = Teuchos::isParameterType<double>(Prec_List, “Drop Tolerance”); // What if we use the wrong parameter name? bool solve_tol = My_List.isParameter(“tolerance”); ReturnType foo_solver( Teuchos::ParameterList& solverPL,… ) { // Getting parameters int max_iters = solverPL.template<int> get("Max Iters"); std::string solver = getParameter(solverPL, “Solver”) double tol = solverPL.get("Tolerance", 1e-8); // Get sublist ( same as making sublist ) Teuchos::ParameterList precPL = solverPL.sublist("Preconditioner"); … return Ok; } Parameters can be input and retrieved with templated “set” and “get” methods, as well as helper functions. Parameters can be numeric datatypes, pointers to vectors or functions, and other parameter lists. // Empty parameter list Teuchos::ParameterList My_List; // Setting parameters My_List.set("Max Iters", 1550); My_List.set("Tolerance", 1e-10); My_List.set("Solver", "GMRES"); // Create sublist Teuchos::ParameterList& Prec_List = My_List.sublist("Preconditioner"); // Setting parameters in sublist Prec_List.set("Type", "ILU"); Prec_List.set("Drop Tolerance", 1e-3); Parameters can be input and retrieved with templated “set” and “get” methods, as well as helper functions.

Numeric Traits Mechanisms Generic programming technique that uses templated interfaces to define the standard behavior of datatypes. Assumed: addition, subtraction, multiplication, and division OrdinalTraits zero & one int & long int ScalarTraits zero, one, magnitude type, absolute value, conjugate, square root, random number generator, … std::numeric_limits float, double, complex<float>, and complex<double> Required: none, a compile-time check is performed. What about arbitrary precision arithmetic?

Arbitrary Precision Libraries ARPREC & GNU MP ARPREC (Bailey, et. al.) uses arrays of 64-bit floating-point numbers to represent high-precision floating-point numbers. provides support for datatypes with differing precision levels. --enable-teuchos-arprec GNU MP uses fullwords, arbitrary precision mantissa, and limited precision exponent to represent high-precision floating-point numbers. platform specific kernels written in assembly language perform common inner-loop functions. --enable-teuchos-gmp Caveat: Arbitrary precision arithmetic is expensive, but can be used selectively to overcome numerical inaccuracy.

Templated BLAS Interface Basic Linear Algebra Subroutines (BLAS) Robust, high-performance dense vector-vector, matrix-vector, and matrix-matrix routines. Written in Fortran Fast and efficient Fortran is highly portable; however, the interface between it and C++ is platform-dependent Templated C++ wrappers for the BLAS Fortran routines are created through autoconf. Two main benefits of using a templated interface Template Specialization: template specialization can be used to support the four native datatypes of existing Fortran BLAS code. General Implementation: a generic C++ implementation can be created to handle many arbitrary datatypes.

Templated BLAS Interface Using Native Datatypes Teuchos::BLAS<int,double> blas; blas.AXPY(…) … blas.GEMV(…) … blas.GEMM(…) Using ARPREC mp::mp_init(200); Teuchos::BLAS<int,mp_real> blas; blas.AXPY(…) … blas.GEMV(…) … blas.GEMM(…)

Templated LAPACK Interface Linear Algebra PACKage (LAPACK) Robust, high-performance dense routines for solving systems of simultaneous linear equations, least-squares solutions of linear systems of equations, eigenvalue problems, and singular value problems. Templated C++ wrappers for the LAPACK Fortran routines are created for the four native datatypes. no general implementations at this time Templated serial dense matrix / vector class designed to be compatible with BLAS/LAPACK interfaces. Fortran-style storage Similar to Epetra_SerialDenseMatrix

Hilbert Matrices A Hilbert matrix HN is a square N-by-N matrix such that: Notoriously ill-conditioned κ(H3)  524 κ(H5)  476610 κ(H10)  1.6025 x 1013 κ(H20)  7.8413 x 1017 κ(H100)  1.7232 x 1020 Theoretically, Hilbert matrices are SPD

Cholesky Factorization and Hilbert Matrices In practice, floating-point rounding error causes higher-order Hilbert matrices to no longer be positive definite Cholesky factorization is often done to determine whether or not a given matrix is positive definite As such, a Cholesky factorization will often fail on higher-order Hilbert matrices, even though such matrices “should” be positive definite Precision Largest N for which Cholesky Factorization is successful Single Precision 8 Double Precision 13 Arbitrary Precision (20) 29 Arbitrary Precision (40) 40 Arbitrary Precision (200) 145 Arbitrary Precision (400) 233*

Cholesky Factorization and Hilbert Matrices In addition to providing a higher limit on N, using arbitrary precision reduces error. By solving the linear system: where the vector b is constructed such that the true solution x is equal to a 1-vector we can look at the forward error.

Timing Classes Teuchos::Time Teuchos::TimeMonitor Basic wall-clock timing class Teuchos::TimeMonitor Uses Teuchos::Time internally Constructor starts timer, destructor stops it Can also maintain an array of timers Teuchos::Time timer(“My Timer”); timer.start(); … timer.stop(); double comp_time = timer.totalElapsedTime()

Teuchos Users Overview Parameter list is easy to use and quickly being adopted by most Trilinos packages. Numeric traits mechanism allows the use of arbitrary datatypes in templated code. Such arithmetic may be expensive, but the increased precision may be required for ill-conditioned problems Arbitrary-precision arithmetic can be used in only the places where it is needed most in order to retain speed Templated tools libraries are essential for the development of templated solver libraries. See Teuchos website for more info: http://software.sandia.gov/Trilinos/packages/teuchos