Skip to content

Conversation

@Cstandardlib
Copy link
Collaborator

@Cstandardlib Cstandardlib commented Oct 15, 2024

Linked Issue

Fix #5203

What's changed?

  • Remove DiagH Base class of eigensolvers used by LCAO.

Base Class:

namespace hsolver
{
template <typename T, typename Device = base_device::DEVICE_CPU>
class DiagH
{
  private:
    using Real = typename GetTypeReal<T>::type;

  public:
    virtual ~DiagH(){};
    // virtual void init()=0;
    std::string method = "none";

    virtual void diag(hamilt::Hamilt<T, Device>* phm_in, psi::Psi<T, Device>& psi, Real* eigenvalue_in)
    {
        ModuleBase::WARNING_QUIT("diagh", "diag method not implemented for the base class!");
    };
#ifdef __MPI
    // diagnolization used in parallel-k case
    virtual void diag_pool(hamilt::MatrixBlock<T>& h_mat, hamilt::MatrixBlock<T>& s_mat, psi::Psi<T>& psi, Real* eigenvalue_in, MPI_Comm& comm)
    {
        ModuleBase::WARNING_QUIT("diagh", "diag_pool method not implemented for the base class!");
    };
#endif
};
} // namespace hsolver

Including:

  • DiagoLapack
  • DiagoScalapack
  • DiagoCusolver
  • DiagoCusolverMP
  • DiagoElpa
  • DiagoElpaNative

@haozhihan haozhihan marked this pull request as ready for review October 17, 2024 05:53
Copy link

@haozhihan haozhihan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mohanchen mohanchen added the The Absolute Zero Reduce the "entropy" of the code to 0 label Oct 17, 2024
@mohanchen mohanchen merged commit 590ea5e into deepmodeling:develop Oct 17, 2024
14 checks passed
Fisherd99 pushed a commit to Fisherd99/abacus-BSE that referenced this pull request Mar 31, 2025
* Remove Base DiagH class of DiagoLapack

* Remove DiagH Base class of DiagoScalapack and lcao test

* Remove DiagH Base class of DiagoCusolver and lcao_cusolver_test

* Update docs in hsolver

* Remove Base DiagH pointer in diago_lapack_test

* Remove Base DiagH of DiagoElpa

* Remove Base DiagH of DiagoElpaNative

* Remove Base DiagH of DiagoCusolverMP

---------

Co-authored-by: Haozhi Han <haozhi.han@stu.pku.edu.cn>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

The Absolute Zero Reduce the "entropy" of the code to 0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Is it Necessary to Retain the DiagH Base Class in HSolver_pw?

3 participants