Next Generation Iterative Next Generation Iterative Solvers: Belos & Anasazi Solvers: Belos & Anasazi November 3 rd , 9:30-10:30am Mike Heroux Ulrich Hetmaniuk Rich Lehoucq Heidi Thornquist 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.
25
Embed
Next Generation Iterative Solvers: Belos & Anasazi Next Generation Iterative Solvers: Belos & Anasazi November 3 rd, 9:30-10:30am Mike Heroux Ulrich Hetmaniuk.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Next Generation Iterative Next Generation Iterative Solvers: Belos & AnasaziSolvers: Belos & Anasazi
November 3rd, 9:30-10:30am
Mike HerouxUlrich Hetmaniuk
Rich LehoucqHeidi Thornquist
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.
Generic Iterative MethodGeneric Iterative MethodStatus Test
Generic OperatorInterface
Generic LinearAlgebra Interface Output Manager
Linear/Eigen Problem
Benefits of Generic ProgrammingBenefits of Generic Programming
1) Generic programming techniques ease the implementation of complex algorithms.
2) Developing algorithms with generic programming techniques is easier on the developer, while still allowing them to build a flexible and powerful software package.
3) Generic programming techniques also allow the user to leverage their existing software investment.
Caveat: It’s not as easy as taking a piece of code and adding:
template <typename OT, typename ST>
More work has to be done to handle “numeric traits”
{ OrdinalType izero = OrdinalTraits<OrdinalType>::zero(); OrdinalType ione = OrdinalTraits<OrdinalType>::one(); ScalarType result = ScalarTraits<ScalarType>::zero(); OrdinalType i, ix = izero; if ( n > izero ) { // Set the initial index. if (incx < izero) { ix = (-n+ione)*incx; }
for(i = izero; i < n; i++) { result += ScalarTraits<ScalarType>::conjugate(x[ix]) * x[ix]; ix += incx; } result = ScalarTraits<ScalarType>::squareroot(result); } return result; } /* end NRM2 */
double DNRM2( const int n, const double* x, const int incx) const { int i, ix = 0; double result 0.0; if ( n > 0 ) { // Set the initial index. if (incx < 0) { ix = (-n+1)*incx; }
for(i = 0; i < n; ++i) { result += x[ix] * x[ix]; ix += incx; } result = std::sqrt(result); } return result; } /* end NRM2 */
New Packages: Belos and AnasaziNew Packages: Belos and Anasazi
Next generation linear solvers (Belos) and eigensolvers (Anasazi) libraries, written in templated C++.
Provide a generic interface to a collection of algorithms for solving large-scale linear problems and eigenproblems.
Algorithm implementation is accomplished through the use of abstract base classes (mini interface). Interfaces are derived from these base classes to operator-vector products, status tests, and any arbitrary linear algebra library.
Includes block linear solvers and eigensolvers. Release Dates:
Internal (SNL): May 2004 External (Public): March 2005
Why are Block Solvers Useful?Why are Block Solvers Useful?
Block Solvers ( in general ): Achieve better performance for operator-vector products.
Belos: Solvers: BlockCG and BlockGMRES Linear algebra adapters for Epetra and NOX/LOCA Belos::EpetraOperator allows for integration into other codes Epetra interface accepts Epetra_Operators, so can be used with
ML, AztecOO, Ifpack, Belos, etc… Block size is independent of number of right-hand sides
Anasazi: Solvers: Block Krylov-Schur Method and Modal Analysis Solvers
(Davidson, Jacobi-Davidson, LOBPCG, etc…) Linear algebra adapters for Epetra and NOX/LOCA Can solve standard and generalized eigenproblems Epetra interface accepts Epetra_Operators, so can be used with
Belos, AztecOO, etc… Block size is independent of number of requested eigenvalues
Belos/Anasazi DesignBelos/Anasazi Design
LinearSolver / Eigensolver Class LinearProblem / Eigenproblem Class Sorting and Orthogonalization Class StatusTest Class OutputManager Class Configurable via Teuchos::ParameterList Interface current Belos/Anasazi abstract linear
algebra classes with TSFCore abstract linear algebra classes.
Belos/Anasazi Linear Algebra Interface Belos/Anasazi Linear Algebra Interface ( Mini-interface )( Mini-interface )
(Belos/Anasazi)::MultiVec Abstract interface to define the linear algebra required by
most iterative linear solvers / eigensolvers :• clone methods
• dot product
• update methods
• norms
• initialize / randomize
(Belos/Anasazi)::Operator Abstract interface to define the linear operator interface
required by most iterative linear solvers / eigensolvers :• apply methods
Belos: Solvers: CG, BlockCG, BlockGMRES, and BlockFGMRES Interfaces are defined for Epetra, NOX/LOCA, and TSFCore Configurable via a Teuchos::ParameterList
Anasazi: Solvers: Block Krylov-Schur Method and Modal Analysis
Solvers (Davidson, Jacobi-Davidson, LOBPCG, etc…) Interfaces are defined for Epetra, NOX/LOCA, and TSFCore Abstract interface to sorting and orthogonalization (???) Configurable via a Teuchos::ParameterList
Future Anasazi/Belos DevelopmentFuture Anasazi/Belos Development
Belos Algorithms: FCG and BiCGSTAB GMRES not necessary Abstract orthogonalization class, user-determined Krylov
subspace breakdown Higher-level robust managers to orchestrate solvers