ChaseMpiMatrices

template<class T>
class ChaseMpiMatrices

A class to setup the buffers of matrices and vectors which will be used by ChaseMpi.

This class provides three constructors:

  • Allocating the buffers for ChaseMpi without MPI support.

  • Allocating the buffers for ChaseMpi with MPI support.

  • Allocating the buffers for ChaseMpi with MPI support in which the buffer to store the matrix to be diagonalised is externally allocated and provided by users.

Template Parameters:

T – the scalar type used for the application. ChASE is templated for real and complex scalar with both Single Precision and Double Precision, thus T can be one of float, double, std::complex<float> and std::complex<double>.

Public Functions

inline ChaseMpiMatrices()

A constructor of ChaseMpiMatrices for Non-MPI case which allocates everything required.

The private members of this class are initialized by the parameters of this constructor.

  • For H__ and H_, they are of size ldh * N.

  • For V1__, V1_, V2__ and V1_, they are of size N * max_block.

  • For ritzv__, ritzv_, resid__ and resid_, they are of size max_block.

Parameters:
  • N – size of the square matrix defining the eigenproblem.

  • max_block – Maximum column number of matrix V1_ and V2_. It equals to nev_ + nex_.

  • H – a pointer to the buffer H_.

  • ldh – the leading dimension of H_.

  • V1 – a pointer to the buffer V1_.

  • ritz – a pointer to the buffer ritz_.

  • V2 – a pointer to the buffer V2_.

  • resid – a pointer to the buffer resid_.

inline ChaseMpiMatrices(int mode, std::size_t N, std::size_t max_block, T *H, std::size_t ldh, T *V1, Base<T> *ritzv, T *V2 = nullptr, Base<T> *resid = nullptr)
inline ChaseMpiMatrices(int mode, MPI_Comm comm, std::size_t N, std::size_t m, std::size_t n, std::size_t max_block, T *H, std::size_t ldh, T *V1, Base<T> *ritzv)

A constructor of ChaseMpiMatrices for MPI case which allocates everything necessary except H_.

The private members of this class are initialized by the parameters of this constructor.

  • For V1__ and V1_, they are of size m_ * max_block.

  • For V2__ and V2_, they are of size n_ * max_block.

  • For ritzv__, ritzv_, resid__ and resid_, they are of size max_block.

  • H_ is allocated externally based the users, it is of size ldh_ * n_ with ldh_>=m_.

  • m and n can be obtained through ChaseMpiProperties::get_m() and ChaseMpiProperties::get_n(), respecitvely.

Parameters:
  • comm – the working MPI communicator of ChASE.

  • N – size of the square matrix defining the eigenproblem.

  • m – row number of H_.m can be obtained through ChaseMpiProperties::get_m()

  • n – column number of H_.n can be obtained through ChaseMpiProperties::get_n()

  • max_block – Maximum column number of matrix V1_ and V2_. It equals to nev_ + nex_.

  • H – the pointer to the user-provided buffer of matrix to be diagonalised.

  • ldh – The leading dimension of local part of Symmetric/Hermtian matrix on each MPI proc.

  • V1 – a pointer to the buffer V1_.

  • ritz – a pointer to the buffer ritz_.

  • V2 – a pointer to the buffer V2_.

  • resid – a pointer to the buffer resid_.

inline int get_Mode()
inline std::size_t get_ldh()

Return leading dimension of local part of Symmetric/Hermtian matrix on each MPI proc.

Returns:

ldh_, a private member of this class.

inline Matrix<T> H()
inline Matrix<T> C()
inline Matrix<T> C2()
inline Matrix<T> A()
inline Matrix<T> B()
inline Matrix<T> B2()
inline Matrix<Base<T>> Resid()
inline Matrix<Base<T>> Ritzv()
inline Matrix<T> vv()
inline T *C_comm()
inline T *C2_comm()
inline T *B_comm()
inline T *B2_comm()
inline T *A_comm()
inline Base<T> *Resid_comm()
inline T *vv_comm()

Private Members

std::size_t ldh_
int mode_
std::unique_ptr<Matrix<T>> H___
std::unique_ptr<Matrix<T>> C___
std::unique_ptr<Matrix<T>> C2___
std::unique_ptr<Matrix<T>> B___
std::unique_ptr<Matrix<T>> B2___
std::unique_ptr<Matrix<T>> A___
std::unique_ptr<Matrix<Base<T>>> Resid___
std::unique_ptr<Matrix<Base<T>>> Ritzv___
std::unique_ptr<Matrix<T>> vv___