Interface for Eigenvalue Methods John Wu Lawrence Berkeley National Laboratory [email protected]...
-
Upload
madeline-mckinney -
Category
Documents
-
view
219 -
download
3
Transcript of Interface for Eigenvalue Methods John Wu Lawrence Berkeley National Laboratory [email protected]...
![Page 1: Interface for Eigenvalue Methods John Wu Lawrence Berkeley National Laboratory john.wu@nersc.gov kwu@lbl.gov.](https://reader035.fdocuments.in/reader035/viewer/2022070411/56649f505503460f94c72ee6/html5/thumbnails/1.jpg)
Interface for Eigenvalue Interface for Eigenvalue MethodsMethods
John Wu Lawrence Berkeley National Laboratory
[email protected]@lbl.gov
![Page 2: Interface for Eigenvalue Methods John Wu Lawrence Berkeley National Laboratory john.wu@nersc.gov kwu@lbl.gov.](https://reader035.fdocuments.in/reader035/viewer/2022070411/56649f505503460f94c72ee6/html5/thumbnails/2.jpg)
OutlineOutline
• Review eigenvalue methodsReview eigenvalue methods
• Examine existing schemesExamine existing schemes
• Explore possible alternatives Explore possible alternatives
![Page 3: Interface for Eigenvalue Methods John Wu Lawrence Berkeley National Laboratory john.wu@nersc.gov kwu@lbl.gov.](https://reader035.fdocuments.in/reader035/viewer/2022070411/56649f505503460f94c72ee6/html5/thumbnails/3.jpg)
Types of Eigenvalue Types of Eigenvalue ProblemsProblems• Standard: Ax = Standard: Ax = xx
• Generalized: Ax = Generalized: Ax = BxBx
• Polynomial: -Ax+Polynomial: -Ax+BB11x+x+22BB22x+…=0x+…=0
• Constrains: Cx=0Constrains: Cx=0
![Page 4: Interface for Eigenvalue Methods John Wu Lawrence Berkeley National Laboratory john.wu@nersc.gov kwu@lbl.gov.](https://reader035.fdocuments.in/reader035/viewer/2022070411/56649f505503460f94c72ee6/html5/thumbnails/4.jpg)
Types of MethodsTypes of Methods
• QR based methods (direct methods)QR based methods (direct methods)– Need to access the elements of the Need to access the elements of the
matrixmatrix
– O(nO(n22) space complexity) space complexity
– O(nO(n33) time complexity) time complexity
• Projection based methods (iterative)Projection based methods (iterative)– Access matrix through MATVECAccess matrix through MATVEC
– Problem dependent space and time needProblem dependent space and time need
![Page 5: Interface for Eigenvalue Methods John Wu Lawrence Berkeley National Laboratory john.wu@nersc.gov kwu@lbl.gov.](https://reader035.fdocuments.in/reader035/viewer/2022070411/56649f505503460f94c72ee6/html5/thumbnails/5.jpg)
Existing SoftwareExisting Software
QR methodsQR methods
• LAPACKLAPACK
• EISPACKEISPACK
• ScaLAPACKScaLAPACK
• PLAPACKPLAPACK
Projection methodsProjection methods
• ARPACKARPACK
• LANSO, LASO, LANSO, LASO, LANZ, LANCZOS …LANZ, LANCZOS …
• Davidson method, Davidson method, JDQZ, …JDQZ, …
• RITZITRITZIT
• CG, CG,
![Page 6: Interface for Eigenvalue Methods John Wu Lawrence Berkeley National Laboratory john.wu@nersc.gov kwu@lbl.gov.](https://reader035.fdocuments.in/reader035/viewer/2022070411/56649f505503460f94c72ee6/html5/thumbnails/6.jpg)
Specifying an Eigenvalue Specifying an Eigenvalue ProblemProblem• Matrices: A, B, AMatrices: A, B, A-1-1, (A-, (A-B)B)-1-1B, BB, B-1-1AA
• Type of eigenvalues: largest, Type of eigenvalues: largest, smallest, around a center, in a smallest, around a center, in a rangerange
• Number of eigenvaluesNumber of eigenvalues
• Are eigenvectors needed as wellAre eigenvectors needed as well
![Page 7: Interface for Eigenvalue Methods John Wu Lawrence Berkeley National Laboratory john.wu@nersc.gov kwu@lbl.gov.](https://reader035.fdocuments.in/reader035/viewer/2022070411/56649f505503460f94c72ee6/html5/thumbnails/7.jpg)
Specifying an Eigenvalue Specifying an Eigenvalue Problem -- Computing Problem -- Computing IssuesIssues• Representations of matrices, Representations of matrices,
eigenvalues and eigenvectorseigenvalues and eigenvectors
• Interface to MATVEC and Interface to MATVEC and preconditionerpreconditioner
• Accuracy (reliability) requirementAccuracy (reliability) requirement
• Resource constrainsResource constrains
• Controlling parametersControlling parameters
![Page 8: Interface for Eigenvalue Methods John Wu Lawrence Berkeley National Laboratory john.wu@nersc.gov kwu@lbl.gov.](https://reader035.fdocuments.in/reader035/viewer/2022070411/56649f505503460f94c72ee6/html5/thumbnails/8.jpg)
netlib.org/lapackCase Study I -- LAPACKCase Study I -- LAPACK
SSYEVX(JOBZ, RANGE, UPLO, N, A, LDA, SSYEVX(JOBZ, RANGE, UPLO, N, A, LDA, VL, VU, IL, IU, ABSTOL, M, W, Z, LDZ, VL, VU, IL, IU, ABSTOL, M, W, Z, LDZ, WORK, LWORK, IWORK, IFAIL, INFO)WORK, LWORK, IWORK, IFAIL, INFO)
• QR based methodQR based method
• Representing matrices as arrays (1-D)Representing matrices as arrays (1-D)
• User provide workspaceUser provide workspace
• User must set all optionsUser must set all options
![Page 9: Interface for Eigenvalue Methods John Wu Lawrence Berkeley National Laboratory john.wu@nersc.gov kwu@lbl.gov.](https://reader035.fdocuments.in/reader035/viewer/2022070411/56649f505503460f94c72ee6/html5/thumbnails/9.jpg)
ftp://ftp.caam.rice.edu/pub/software/ARPACK
Case Study II -- ARPACKCase Study II -- ARPACK
DNAUPD(COMM, IDO, BMAT, N, WHICH, DNAUPD(COMM, IDO, BMAT, N, WHICH, NEV, TOL, RESID, NCV, V, LDV, IPARAM, NEV, TOL, RESID, NCV, V, LDV, IPARAM, IPNTR, WORKD, WORKL, LWORKL, INFO)IPNTR, WORKD, WORKL, LWORKL, INFO)
• Implicitly restarted Arnoldi methodImplicitly restarted Arnoldi method
• Reverse communication for MATVECReverse communication for MATVEC
• Arguments are arrays (1-D)Arguments are arrays (1-D)
• User provides workspaceUser provides workspace
![Page 10: Interface for Eigenvalue Methods John Wu Lawrence Berkeley National Laboratory john.wu@nersc.gov kwu@lbl.gov.](https://reader035.fdocuments.in/reader035/viewer/2022070411/56649f505503460f94c72ee6/html5/thumbnails/10.jpg)
lbl.gov/~kwu
Case Study III -- TRLANCase Study III -- TRLAN
TRLAN(OP, INFO, NROW, MEV, EVAL, TRLAN(OP, INFO, NROW, MEV, EVAL, EVEC, LDE)EVEC, LDE)
• thick-restart Lanczos methodthick-restart Lanczos method
• MATVEC (OP) has a prescribed interfaceMATVEC (OP) has a prescribed interface
• eigenvalues/eigenvectors are arrayseigenvalues/eigenvectors are arrays
• use Fortran 90 TYPE (INFO) to store use Fortran 90 TYPE (INFO) to store controlling parameterscontrolling parameters
![Page 11: Interface for Eigenvalue Methods John Wu Lawrence Berkeley National Laboratory john.wu@nersc.gov kwu@lbl.gov.](https://reader035.fdocuments.in/reader035/viewer/2022070411/56649f505503460f94c72ee6/html5/thumbnails/11.jpg)
Case Study IV -- ARPACK+Case Study IV -- ARPACK+++
#include “areig.h”#include “areig.h”
Nconv = areig(EigValR, EigValI, Nconv = areig(EigValR, EigValI, EigVec, n, nnz, A, inrow, pcol, nev);EigVec, n, nnz, A, inrow, pcol, nev);
• Based on ARPACKBased on ARPACK
• Simple data structures for matrix, Simple data structures for matrix, eigenvalues and eigenvectorseigenvalues and eigenvectors
ftp://ftp.caam.rice.edu/pub/software/ARPACK
![Page 12: Interface for Eigenvalue Methods John Wu Lawrence Berkeley National Laboratory john.wu@nersc.gov kwu@lbl.gov.](https://reader035.fdocuments.in/reader035/viewer/2022070411/56649f505503460f94c72ee6/html5/thumbnails/12.jpg)
Case Study V -- Case Study V -- RogueWaveRogueWave
#include <rw/deig.h>#include <rw/deig.h>
DoubleEigDecomp eig(a);DoubleEigDecomp eig(a);
• QR based methodsQR based methods
• Solution stored in eig objectSolution stored in eig object
• Eig.eigenValues() for eigenvaluesEig.eigenValues() for eigenvalues
www.roguewave.com
![Page 13: Interface for Eigenvalue Methods John Wu Lawrence Berkeley National Laboratory john.wu@nersc.gov kwu@lbl.gov.](https://reader035.fdocuments.in/reader035/viewer/2022070411/56649f505503460f94c72ee6/html5/thumbnails/13.jpg)
Two Basic StrategiesTwo Basic Strategies
Eigenvalue functionEigenvalue function
• Closer to Closer to traditional librariestraditional libraries
• Explicit arguments Explicit arguments for eigenvalue and for eigenvalue and eigenvectoreigenvector
• May be an May be an interface of a interface of a matrix classmatrix class
Decomposition classDecomposition class
• Computation is Computation is hiddenhidden
• Contains functions Contains functions to output to output eigenvalues, etceigenvalues, etc
• Decomposition is Decomposition is an objectan object
![Page 14: Interface for Eigenvalue Methods John Wu Lawrence Berkeley National Laboratory john.wu@nersc.gov kwu@lbl.gov.](https://reader035.fdocuments.in/reader035/viewer/2022070411/56649f505503460f94c72ee6/html5/thumbnails/14.jpg)
Basic Data ElementsBasic Data Elements
Eigenvalue functionEigenvalue function
• MatricesMatrices
• Eigenvalue and Eigenvalue and eigenvector are eigenvector are function arguments function arguments
• Controlling Controlling parameters are parameters are function argumentsfunction arguments
Decomposition classDecomposition class
• MatricesMatrices
• Eigenvalue and Eigenvalue and eigenvector stored eigenvector stored internallyinternally
• Controlling Controlling parameters set by parameters set by member functionmember function
![Page 15: Interface for Eigenvalue Methods John Wu Lawrence Berkeley National Laboratory john.wu@nersc.gov kwu@lbl.gov.](https://reader035.fdocuments.in/reader035/viewer/2022070411/56649f505503460f94c72ee6/html5/thumbnails/15.jpg)
Interaction With Other Interaction With Other ComponentsComponentsEigenvalue functionEigenvalue function
• Reverse Reverse communication or communication or function pointer or function pointer or direct access to direct access to the matricesthe matrices
Decomposition classDecomposition class
• Function pointer Function pointer (functor) or direct (functor) or direct access to matricesaccess to matrices
• External functions External functions must use must use prescribed prescribed interfaceinterface
![Page 16: Interface for Eigenvalue Methods John Wu Lawrence Berkeley National Laboratory john.wu@nersc.gov kwu@lbl.gov.](https://reader035.fdocuments.in/reader035/viewer/2022070411/56649f505503460f94c72ee6/html5/thumbnails/16.jpg)
Feature ComparisonFeature Comparison
Function Classusability Familiar feel,
explicitargument
Pure objects,easy for starters
performance Do not impedeperformance
May need extracopy
externdability Need newinterface
Easy to add newthings
Eigenvalue Class always has a decomposefunction, but it may not be public
![Page 17: Interface for Eigenvalue Methods John Wu Lawrence Berkeley National Laboratory john.wu@nersc.gov kwu@lbl.gov.](https://reader035.fdocuments.in/reader035/viewer/2022070411/56649f505503460f94c72ee6/html5/thumbnails/17.jpg)
Relation With Equation Relation With Equation SolversSolvers• Share the same basic elements: Share the same basic elements:
vector, multi-vector, matricesvector, multi-vector, matrices
• Share the same external/user-Share the same external/user-supplied functions: MATVEC, supplied functions: MATVEC, preconditionerpreconditioner
• Eigenvalue solver may use equation Eigenvalue solver may use equation solversolver
![Page 18: Interface for Eigenvalue Methods John Wu Lawrence Berkeley National Laboratory john.wu@nersc.gov kwu@lbl.gov.](https://reader035.fdocuments.in/reader035/viewer/2022070411/56649f505503460f94c72ee6/html5/thumbnails/18.jpg)
Relation With Existing Relation With Existing SoftwareSoftware• Existing matrix libraries may be Existing matrix libraries may be
used to specify basic data elementsused to specify basic data elements
• Existing Fortran/C libraries may be Existing Fortran/C libraries may be used to perform the actual used to perform the actual computationscomputations
• Should make it easy to interact with Should make it easy to interact with existing frameworks, e.G., POOMAexisting frameworks, e.G., POOMA
![Page 19: Interface for Eigenvalue Methods John Wu Lawrence Berkeley National Laboratory john.wu@nersc.gov kwu@lbl.gov.](https://reader035.fdocuments.in/reader035/viewer/2022070411/56649f505503460f94c72ee6/html5/thumbnails/19.jpg)
Future WorkFuture Work
• Reviewing other OO eigenvalue Reviewing other OO eigenvalue softwaresoftware
• Concrete interface specificationConcrete interface specification
• Data structure of the basic elementsData structure of the basic elements
• Interface of MATVEC and Interface of MATVEC and preconditionerpreconditioner