Skip to content

[Refactor] Restructure the standard/generalized eig driver of LAPACK #6592

@Cstandardlib

Description

@Cstandardlib

Describe the Code Quality Issue

  • Now the interfaces of standard/generalized eig driver, i.e. {he,sy}ev[d,r,x] & {he,sy}gv[d,r,x] are used in HSolver to solve dense eigenvalue & eigenvector problem.
  • In HSolver, iteration methods (CG, Davidson, etc.) use these LAPACK routines encapsulated in the file hegvd_op.h.
  • Now that lapackConnector has been moved to a uniform interface in source/source_base/module_container/base/third_party/lapack.h, high-level interfaces are supposed to be placed in source/source_base/module_container/ATen/kernels/lapack.h. And the hegvd_op should be moved there.

Note

  • The original interfaces in (including lapack_heevd and lapack_hegvd defined in source/source_base/module_container/base/third_party/lapack.h, never referenced) does not support different order of the matrices and leading dimension, which is essential. Therefore, they will also be refactored.

Uniform design of work memory

The original LAPACK routine will destroy/overwrite input matrix A and B.
There are now two ways to resolve this:

  1. To manually recover the inut matrix memory after calling LAPACK routines. (as Dav_Subspace does)
  2. To use an inner auxiliary memory block to store the INPUT MATRIX as referred by LAPACK. (as Davidson does)
    The latter is preferred, and after this refactoring it should be unified to this one.

Metadata

Metadata

Assignees

Labels

RefactorRefactor ABACUS codes

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions