SIRIUS 7.5.0
Electronic structure library and applications
Classes | Enumerations | Functions | Variables
sirius::la Namespace Reference

Interface to linear algebra BLAS/LAPACK functions. More...

Classes

class  BLACS_grid
 BLACS grid wrapper. More...
 
struct  constant
 
class  dmatrix
 Distributed matrix. More...
 
class  Eigensolver
 Interface to different eigen-solvers. More...
 
class  Eigensolver_cuda
 
class  Eigensolver_dlaf
 
class  Eigensolver_elpa
 
class  Eigensolver_lapack
 
class  Eigensolver_magma
 
class  Eigensolver_magma_gpu
 
class  Eigensolver_scalapack
 
class  linalg_base
 Base class for linear algebra interface. More...
 
class  wrap
 

Enumerations

enum class  ev_solver_t {
  lapack , scalapack , elpa , dlaf ,
  magma , magma_gpu , cusolver
}
 Type of eigen-value solver. More...
 
enum class  lib_t {
  none , blas , lapack , scalapack ,
  gpublas , cublasxt , magma , spla
}
 Type of linear algebra backend library. More...
 

Functions

template<typename M >
void setup_handler (elpa_t &handle__, int stage__, M const &m__, int na__, int nev__)
 
std::unique_ptr< EigensolverEigensolver_factory (std::string name__)
 
ev_solver_t get_ev_solver_t (std::string name__)
 Get type of an eigen solver by name (provided as a string). More...
 
template<typename T >
auto inverse_sqrt (la::dmatrix< T > &A__, int N__)
 Compute inverse square root of the matrix. More...
 
template<typename T >
void check_hermitian (std::string const &name, sddk::matrix< T > const &mtrx, int n=-1)
 
template<typename T >
real_type< T > check_hermitian (dmatrix< T > &mtrx__, int n__)
 
template<typename T >
double check_identity (dmatrix< T > &mtrx__, int n__)
 
template<typename T >
double check_diagonal (dmatrix< T > &mtrx__, int n__, sddk::mdarray< double, 1 > const &diag__)
 
template<typename T >
void unitary_similarity_transform (int kind__, dmatrix< T > &A__, dmatrix< T > const &U__, int n__)
 
auto get_lib_t (std::string name__)
 
std::string to_string (lib_t la__)
 
ftn_int FORTRAN() ilaenv (ftn_int *ispec, ftn_char name, ftn_char opts, ftn_int *n1, ftn_int *n2, ftn_int *n3, ftn_int *n4, ftn_len name_len, ftn_len opts_len)
 
ftn_double FORTRAN() dlamch (ftn_char cmach, ftn_len cmach_len)
 
int Csys2blacs_handle (MPI_Comm SysCtxt)
 
MPI_Comm Cblacs2sys_handle (int BlacsCtxt)
 
void Cblacs_gridinit (int *ConTxt, const char *order, int nprow, int npcol)
 
void Cblacs_gridmap (int *ConTxt, int *usermap, int ldup, int nprow0, int npcol0)
 
void Cblacs_gridinfo (int ConTxt, int *nprow, int *npcol, int *myrow, int *mycol)
 
void Cfree_blacs_system_handle (int ISysCtxt)
 
void Cblacs_barrier (int ConTxt, const char *scope)
 
void Cblacs_gridexit (int ConTxt)
 
void FORTRAN() psgemm (ftn_char transa, ftn_char transb, ftn_int *m, ftn_int *n, ftn_int *k, ftn_single const *aplha, ftn_single const *A, ftn_int *ia, ftn_int *ja, ftn_int const *desca, ftn_single const *B, ftn_int *ib, ftn_int *jb, ftn_int const *descb, ftn_single const *beta, ftn_single *C, ftn_int *ic, ftn_int *jc, ftn_int const *descc, ftn_len transa_len, ftn_len transb_len)
 
void FORTRAN() pdgemm (ftn_char transa, ftn_char transb, ftn_int *m, ftn_int *n, ftn_int *k, ftn_double const *aplha, ftn_double const *A, ftn_int *ia, ftn_int *ja, ftn_int const *desca, ftn_double const *B, ftn_int *ib, ftn_int *jb, ftn_int const *descb, ftn_double const *beta, ftn_double *C, ftn_int *ic, ftn_int *jc, ftn_int const *descc, ftn_len transa_len, ftn_len transb_len)
 
void FORTRAN() pcgemm (ftn_char transa, ftn_char transb, ftn_int *m, ftn_int *n, ftn_int *k, ftn_complex const *aplha, ftn_complex const *A, ftn_int *ia, ftn_int *ja, ftn_int const *desca, ftn_complex const *B, ftn_int *ib, ftn_int *jb, ftn_int const *descb, ftn_complex const *beta, ftn_complex *C, ftn_int *ic, ftn_int *jc, ftn_int const *descc, ftn_len transa_len, ftn_len transb_len)
 
void FORTRAN() pzgemm (ftn_char transa, ftn_char transb, ftn_int *m, ftn_int *n, ftn_int *k, ftn_double_complex const *aplha, ftn_double_complex const *A, ftn_int *ia, ftn_int *ja, ftn_int const *desca, ftn_double_complex const *B, ftn_int *ib, ftn_int *jb, ftn_int const *descb, ftn_double_complex const *beta, ftn_double_complex *C, ftn_int *ic, ftn_int *jc, ftn_int const *descc, ftn_len transa_len, ftn_len transb_len)
 
void FORTRAN() descinit (ftn_int const *desc, ftn_int *m, ftn_int *n, ftn_int *mb, ftn_int *nb, ftn_int *irsrc, ftn_int *icsrc, ftn_int *ictxt, ftn_int *lld, ftn_int *info)
 
void FORTRAN() pctranc (ftn_int *m, ftn_int *n, ftn_complex *alpha, ftn_complex *a, ftn_int *ia, ftn_int *ja, ftn_int const *desca, ftn_complex *beta, ftn_complex *c, ftn_int *ic, ftn_int *jc, ftn_int const *descc)
 
void FORTRAN() pztranc (ftn_int *m, ftn_int *n, ftn_double_complex *alpha, ftn_double_complex *a, ftn_int *ia, ftn_int *ja, ftn_int const *desca, ftn_double_complex *beta, ftn_double_complex *c, ftn_int *ic, ftn_int *jc, ftn_int const *descc)
 
void FORTRAN() pztranu (ftn_int *m, ftn_int *n, ftn_double_complex *alpha, ftn_double_complex *a, ftn_int *ia, ftn_int *ja, ftn_int const *desca, ftn_double_complex *beta, ftn_double_complex *c, ftn_int *ic, ftn_int *jc, ftn_int const *descc)
 
void FORTRAN() pstran (ftn_int *m, ftn_int *n, ftn_single *alpha, ftn_single *a, ftn_int *ia, ftn_int *ja, ftn_int const *desca, ftn_single *beta, ftn_single *c, ftn_int *ic, ftn_int *jc, ftn_int const *descc)
 
void FORTRAN() pdtran (ftn_int *m, ftn_int *n, ftn_double *alpha, ftn_double *a, ftn_int *ia, ftn_int *ja, ftn_int const *desca, ftn_double *beta, ftn_double *c, ftn_int *ic, ftn_int *jc, ftn_int const *descc)
 
ftn_int FORTRAN() numroc (ftn_int *n, ftn_int *nb, ftn_int *iproc, ftn_int *isrcproc, ftn_int *nprocs)
 
ftn_int FORTRAN() indxl2g (ftn_int *indxloc, ftn_int *nb, ftn_int *iproc, ftn_int *isrcproc, ftn_int *nprocs)
 
ftn_len FORTRAN() iceil (ftn_int *inum, ftn_int *idenom)
 
void FORTRAN() pzgemr2d (ftn_int *m, ftn_int *n, ftn_double_complex *a, ftn_int *ia, ftn_int *ja, ftn_int const *desca, ftn_double_complex *b, ftn_int *ib, ftn_int *jb, ftn_int const *descb, ftn_int *gcontext)
 

Variables

const std::string linalg_msg_no_scalapack = "not compiled with ScaLAPACK"
 

Detailed Description

Interface to linear algebra BLAS/LAPACK functions.

Enumeration Type Documentation

◆ ev_solver_t

enum class sirius::la::ev_solver_t
strong

Type of eigen-value solver.

Enumerator
lapack 

LAPACK.

scalapack 

ScaLAPACK.

elpa 

ELPA solver.

dlaf 

DLA-Future solver.

magma 

MAGMA with CPU pointers.

magma_gpu 

MAGMA with GPU pointers.

cusolver 

CUDA eigen-solver.

Definition at line 36 of file eigensolver.hpp.

◆ lib_t

enum class sirius::la::lib_t
strong

Type of linear algebra backend library.

Enumerator
none 

None.

blas 

CPU BLAS.

lapack 

CPU LAPACK.

scalapack 

CPU ScaLAPACK.

gpublas 

GPU BLAS (cuBlas or ROCblas)

cublasxt 

cuBlasXt (cuBlas with CPU pointers and large matrices support)

magma 

MAGMA with CPU pointers.

spla 

SPLA library. Can take CPU and device pointers.

Definition at line 69 of file linalg_base.hpp.

Function Documentation

◆ setup_handler()

template<typename M >
void sirius::la::setup_handler ( elpa_t &  handle__,
int  stage__,
M const &  m__,
int  na__,
int  nev__ 
)

Definition at line 18 of file eigenproblem.cpp.

◆ Eigensolver_factory()

std::unique_ptr< Eigensolver > sirius::la::Eigensolver_factory ( std::string  name__)

Definition at line 33 of file eigensolver.cpp.

◆ get_ev_solver_t()

ev_solver_t sirius::la::get_ev_solver_t ( std::string  name__)
inline

Get type of an eigen solver by name (provided as a string).

Definition at line 61 of file eigensolver.hpp.

◆ inverse_sqrt()

template<typename T >
auto sirius::la::inverse_sqrt ( la::dmatrix< T > &  A__,
int  N__ 
)
inline

Compute inverse square root of the matrix.

As by-product, return the eigen-vectors and the eigen-values of the matrix.

Definition at line 41 of file inverse_sqrt.hpp.

◆ check_hermitian() [1/2]

template<typename T >
void sirius::la::check_hermitian ( std::string const &  name,
sddk::matrix< T > const &  mtrx,
int  n = -1 
)
inline

Definition at line 1912 of file linalg.hpp.

◆ check_hermitian() [2/2]

template<typename T >
real_type< T > sirius::la::check_hermitian ( dmatrix< T > &  mtrx__,
int  n__ 
)
inline

Definition at line 1945 of file linalg.hpp.

◆ check_identity()

template<typename T >
double sirius::la::check_identity ( dmatrix< T > &  mtrx__,
int  n__ 
)
inline

Definition at line 1968 of file linalg.hpp.

◆ check_diagonal()

template<typename T >
double sirius::la::check_diagonal ( dmatrix< T > &  mtrx__,
int  n__,
sddk::mdarray< double, 1 > const &  diag__ 
)
inline

Definition at line 1991 of file linalg.hpp.

◆ unitary_similarity_transform()

template<typename T >
void sirius::la::unitary_similarity_transform ( int  kind__,
dmatrix< T > &  A__,
dmatrix< T > const &  U__,
int  n__ 
)
inline

Perform one of the following operations: A <= U A U^{H} (kind = 0) A <= U^{H} A U (kind = 1)

Definition at line 2018 of file linalg.hpp.

◆ get_lib_t()

auto sirius::la::get_lib_t ( std::string  name__)
inline

Definition at line 89 of file linalg_base.hpp.

◆ to_string()

std::string sirius::la::to_string ( lib_t  la__)
inline

Definition at line 112 of file linalg_base.hpp.

Variable Documentation

◆ linalg_msg_no_scalapack

const std::string sirius::la::linalg_msg_no_scalapack = "not compiled with ScaLAPACK"

Definition at line 59 of file linalg.hpp.