Security note for users of the third-party Codecov tool: https://about.codecov.io/security-update/

Commit a87aa965 authored by Andreas Marek's avatar Andreas Marek

Template for elpa_api

parent e9f29c6f
......@@ -84,6 +84,7 @@ endif
EXTRA_libelpa@SUFFIX@_private_la_DEPENDENCIES = \
src/elpa1/elpa_reduce_add_vectors.F90 \
src/elpa1/elpa_transpose_vectors.F90 \
src/elpa_api_math_template.F90 \
src/elpa_impl_template.F90 \
src/elpa1/elpa1_compute_template.F90 \
src/elpa2/elpa2_compute_real_template.F90 \
......@@ -657,6 +658,7 @@ EXTRA_DIST = \
manual_cpp \
nvcc_wrap \
src/GPU/cuUtils_template.cu \
src/elpa_api_math_template.F90 \
src/elpa_impl_template.F90 \
src/elpa1/elpa1_compute_template.F90 \
src/elpa1/elpa1_merge_systems_real_template.F90 \
......
......@@ -506,992 +506,39 @@ module elpa_api
! Actual math routines
!> \brief abstract definition of interface to solve double real eigenvalue problem
!>
!> The dimensions of the matrix a (locally ditributed and global), the block-cyclic distribution
!> blocksize, the number of eigenvectors
!> to be computed and the MPI communicators are already known to the object and MUST be set BEFORE
!> with the class method "setup"
!>
!> It is possible to change the behaviour of the method by setting tunable parameters with the
!> class method "set"
!> Parameters
!> \details
!> \param self class(elpa_t), the ELPA object
!> \param a double real matrix a: defines the problem to solve
!> \param ev double real: on output stores the eigenvalues
!> \param q double real matrix q: on output stores the eigenvalues
!> \result error integer, optional : error code, which can be queried with elpa_strerr
abstract interface
subroutine elpa_eigenvectors_d_i(self, a, ev, q, error)
use iso_c_binding
import elpa_t
implicit none
class(elpa_t) :: self
#ifdef USE_ASSUMED_SIZE
real(kind=c_double) :: a(self%local_nrows, *), q(self%local_nrows,*)
#else
real(kind=c_double) :: a(self%local_nrows, self%local_ncols), q(self%local_nrows, self%local_ncols)
#endif
real(kind=c_double) :: ev(self%na)
#ifdef USE_FORTRAN2008
integer, optional :: error
#else
integer :: error
#endif
end subroutine
end interface
!> \brief abstract definition of interface to solve single real eigenvalue problem
!>
!> The dimensions of the matrix a (locally ditributed and global), the block-cyclic distribution
!> blocksize, the number of eigenvectors
!> to be computed and the MPI communicators are already known to the object and MUST be set BEFORE
!> with the class method "setup"
!>
!> It is possible to change the behaviour of the method by setting tunable parameters with the
!> class method "set"
!> Parameters
!> \details
!> \param self class(elpa_t), the ELPA object
!> \param a single real matrix a: defines the problem to solve
!> \param ev single real: on output stores the eigenvalues
!> \param q single real matrix q: on output stores the eigenvalues
!> \result error integer, optional : error code, which can be queried with elpa_strerr
abstract interface
subroutine elpa_eigenvectors_f_i(self, a, ev, q, error)
use iso_c_binding
import elpa_t
implicit none
class(elpa_t) :: self
#ifdef USE_ASSUMED_SIZE
real(kind=c_float) :: a(self%local_nrows, *), q(self%local_nrows, *)
#else
real(kind=c_float) :: a(self%local_nrows, self%local_ncols), q(self%local_nrows, self%local_ncols)
#endif
real(kind=c_float) :: ev(self%na)
#ifdef USE_FORTRAN2008
integer, optional :: error
#else
integer :: error
#endif
end subroutine
end interface
!> \brief abstract definition of interface to solve double complex eigenvalue problem
!>
!> The dimensions of the matrix a (locally ditributed and global), the block-cyclic distribution
!> blocksize, the number of eigenvectors
!> to be computed and the MPI communicators are already known to the object and MUST be set BEFORE
!> with the class method "setup"
!>
!> It is possible to change the behaviour of the method by setting tunable parameters with the
!> class method "set"
!> Parameters
!> \details
!> \param self class(elpa_t), the ELPA object
!> \param a double complex matrix a: defines the problem to solve
!> \param ev double real: on output stores the eigenvalues
!> \param q double complex matrix q: on output stores the eigenvalues
!> \result error integer, optional : error code, which can be queried with elpa_strerr
abstract interface
subroutine elpa_eigenvectors_dc_i(self, a, ev, q, error)
use iso_c_binding
import elpa_t
implicit none
class(elpa_t) :: self
#ifdef USE_ASSUMED_SIZE
complex(kind=c_double_complex) :: a(self%local_nrows, *), q(self%local_nrows, *)
#else
complex(kind=c_double_complex) :: a(self%local_nrows, self%local_ncols), q(self%local_nrows, self%local_ncols)
#endif
real(kind=c_double) :: ev(self%na)
#ifdef USE_FORTRAN2008
integer, optional :: error
#else
integer :: error
#endif
end subroutine
end interface
!> \brief abstract definition of interface to solve single complex eigenvalue problem
!>
!> The dimensions of the matrix a (locally ditributed and global), the block-cyclic distribution
!> blocksize, the number of eigenvectors
!> to be computed and the MPI communicators are already known to the object and MUST be set BEFORE
!> with the class method "setup"
!>
!> It is possible to change the behaviour of the method by setting tunable parameters with the
!> class method "set"
!> Parameters
!> \details
!> \param self class(elpa_t), the ELPA object
!> \param a single complex matrix a: defines the problem to solve
!> \param ev single real: on output stores the eigenvalues
!> \param q single complex matrix q: on output stores the eigenvalues
!> \result error integer, optional : error code, which can be queried with elpa_strerr
abstract interface
subroutine elpa_eigenvectors_fc_i(self, a, ev, q, error)
use iso_c_binding
import elpa_t
implicit none
class(elpa_t) :: self
#ifdef USE_ASSUMED_SIZE
complex(kind=c_float_complex) :: a(self%local_nrows, *), q(self%local_nrows, *)
#else
complex(kind=c_float_complex) :: a(self%local_nrows, self%local_ncols), q(self%local_nrows, self%local_ncols)
#endif
real(kind=c_float) :: ev(self%na)
#ifdef USE_FORTRAN2008
integer, optional :: error
#else
integer :: error
#endif
end subroutine
end interface
!> \brief abstract definition of interface to solve double real eigenvalue problem
!>
!> The dimensions of the matrix a (locally ditributed and global), the block-cyclic distribution
!> blocksize, the number of eigenvectors
!> to be computed and the MPI communicators are already known to the object and MUST be set BEFORE
!> with the class method "setup"
!>
!> It is possible to change the behaviour of the method by setting tunable parameters with the
!> class method "set"
!> Parameters
!> \details
!> \param self class(elpa_t), the ELPA object
!> \param a double real matrix a: defines the problem to solve
!> \param ev double real: on output stores the eigenvalues
!> \result error integer, optional : error code, which can be queried with elpa_strerr
abstract interface
subroutine elpa_eigenvalues_d_i(self, a, ev, error)
use iso_c_binding
import elpa_t
implicit none
class(elpa_t) :: self
#ifdef USE_ASSUMED_SIZE
real(kind=c_double) :: a(self%local_nrows, *)
#else
real(kind=c_double) :: a(self%local_nrows, self%local_ncols)
#endif
real(kind=c_double) :: ev(self%na)
#ifdef USE_FORTRAN2008
integer, optional :: error
#else
integer :: error
#endif
end subroutine
end interface
!> \brief abstract definition of interface to solve single real eigenvalue problem
!>
!> The dimensions of the matrix a (locally ditributed and global), the block-cyclic distribution
!> blocksize, the number of eigenvectors
!> to be computed and the MPI communicators are already known to the object and MUST be set BEFORE
!> with the class method "setup"
!>
!> It is possible to change the behaviour of the method by setting tunable parameters with the
!> class method "set"
!> Parameters
!> \details
!> \param self class(elpa_t), the ELPA object
!> \param a single real matrix a: defines the problem to solve
!> \param ev single real: on output stores the eigenvalues
!> \result error integer, optional : error code, which can be queried with elpa_strerr
abstract interface
subroutine elpa_eigenvalues_f_i(self, a, ev, error)
use iso_c_binding
import elpa_t
implicit none
class(elpa_t) :: self
#ifdef USE_ASSUMED_SIZE
real(kind=c_float) :: a(self%local_nrows, *)
#else
real(kind=c_float) :: a(self%local_nrows, self%local_ncols)
#endif
real(kind=c_float) :: ev(self%na)
#ifdef USE_FORTRAN2008
integer, optional :: error
#else
integer :: error
#endif
end subroutine
end interface
!> \brief abstract definition of interface to solve double complex eigenvalue problem
!>
!> The dimensions of the matrix a (locally ditributed and global), the block-cyclic distribution
!> blocksize, the number of eigenvectors
!> to be computed and the MPI communicators are already known to the object and MUST be set BEFORE
!> with the class method "setup"
!>
!> It is possible to change the behaviour of the method by setting tunable parameters with the
!> class method "set"
!> Parameters
!> \details
!> \param self class(elpa_t), the ELPA object
!> \param a double complex matrix a: defines the problem to solve
!> \param ev double real: on output stores the eigenvalues
!> \result error integer, optional : error code, which can be queried with elpa_strerr
abstract interface
subroutine elpa_eigenvalues_dc_i(self, a, ev, error)
use iso_c_binding
import elpa_t
implicit none
class(elpa_t) :: self
#ifdef USE_ASSUMED_SIZE
complex(kind=c_double_complex) :: a(self%local_nrows, *)
#else
complex(kind=c_double_complex) :: a(self%local_nrows, self%local_ncols)
#endif
real(kind=c_double) :: ev(self%na)
#ifdef USE_FORTRAN2008
integer, optional :: error
#else
integer :: error
#endif
end subroutine
end interface
!> \brief abstract definition of interface to solve single complex eigenvalue problem
!>
!> The dimensions of the matrix a (locally ditributed and global), the block-cyclic distribution
!> blocksize, the number of eigenvectors
!> to be computed and the MPI communicators are already known to the object and MUST be set BEFORE
!> with the class method "setup"
!>
!> It is possible to change the behaviour of the method by setting tunable parameters with the
!> class method "set"
!> Parameters
!> \details
!> \param self class(elpa_t), the ELPA object
!> \param a single complex matrix a: defines the problem to solve
!> \param ev single real: on output stores the eigenvalues
!> \result error integer, optional : error code, which can be queried with elpa_strerr
abstract interface
subroutine elpa_eigenvalues_fc_i(self, a, ev, error)
use iso_c_binding
import elpa_t
implicit none
class(elpa_t) :: self
#ifdef USE_ASSUMED_SIZE
complex(kind=c_float_complex) :: a(self%local_nrows, *)
#else
complex(kind=c_float_complex) :: a(self%local_nrows, self%local_ncols)
#endif
real(kind=c_float) :: ev(self%na)
#ifdef USE_FORTRAN2008
integer, optional :: error
#else
integer :: error
#endif
end subroutine
end interface
!> \brief abstract definition of interface to solve double real generalized eigenvalue problem
!>
!> The dimensions of the matrix a and b (locally ditributed and global), the block-cyclic distribution
!> blocksize, the number of eigenvectors
!> to be computed and the MPI communicators are already known to the object and MUST be set BEFORE
!> with the class method "setup"
!>
!> It is possible to change the behaviour of the method by setting tunable parameters with the
!> class method "set"
!> Parameters
!> \details
!> \param self class(elpa_t), the ELPA object
!> \param a double real matrix a: defines the problem to solve
!> \param b double real matrix b: defines the problem to solve
!> \param ev double real: on output stores the eigenvalues
!> \param q double real matrix q: on output stores the eigenvalues
!> \param is_already_decomposed logical, input: is it repeated call with the same b (decomposed in the fist call)?
!> \result error integer, optional : error code, which can be queried with elpa_strerr
abstract interface
subroutine elpa_generalized_eigenvectors_d_i(self, a, b, ev, q, is_already_decomposed, error)
use iso_c_binding
use elpa_constants
import elpa_t
implicit none
class(elpa_t) :: self
#ifdef USE_ASSUMED_SIZE
real(kind=c_double) :: a(self%local_nrows, *), b(self%local_nrows, *), q(self%local_nrows, *)
#else
real(kind=c_double) :: a(self%local_nrows, self%local_ncols), b(self%local_nrows, self%local_ncols), &
q(self%local_nrows, self%local_ncols)
#endif
real(kind=c_double) :: ev(self%na)
logical :: is_already_decomposed
integer, optional :: error
end subroutine
end interface
!> \brief abstract definition of interface to solve single real generalized eigenvalue problem
!>
!> The dimensions of the matrix a and b(locally ditributed and global), the block-cyclic distribution
!> blocksize, the number of eigenvectors
!> to be computed and the MPI communicators are already known to the object and MUST be set BEFORE
!> with the class method "setup"
!>
!> It is possible to change the behaviour of the method by setting tunable parameters with the
!> class method "set"
!> Parameters
!> \details
!> \param self class(elpa_t), the ELPA object
!> \param a single real matrix a: defines the problem to solve
!> \param b single real matrix b: defines the problem to solve
!> \param ev single real: on output stores the eigenvalues
!> \param q single real matrix q: on output stores the eigenvalues
!> \param is_already_decomposed logical, input: is it repeated call with the same b (decomposed in the fist call)?
!> \result error integer, optional : error code, which can be queried with elpa_strerr
abstract interface
subroutine elpa_generalized_eigenvectors_f_i(self, a, b, ev, q, is_already_decomposed, error)
use iso_c_binding
use elpa_constants
import elpa_t
implicit none
class(elpa_t) :: self
#ifdef USE_ASSUMED_SIZE
real(kind=c_float) :: a(self%local_nrows, *), b(self%local_nrows, *), q(self%local_nrows, *)
#else
real(kind=c_float) :: a(self%local_nrows, self%local_ncols), b(self%local_nrows, self%local_ncols), &
q(self%local_nrows, self%local_ncols)
#endif
real(kind=c_float) :: ev(self%na)
logical :: is_already_decomposed
integer, optional :: error
end subroutine
end interface
!> \brief abstract definition of interface to solve double complex generalized eigenvalue problem
!>
!> The dimensions of the matrix a and b(locally ditributed and global), the block-cyclic distribution
!> blocksize, the number of eigenvectors
!> to be computed and the MPI communicators are already known to the object and MUST be set BEFORE
!> with the class method "setup"
!>
!> It is possible to change the behaviour of the method by setting tunable parameters with the
!> class method "set"
!> Parameters
!> \details
!> \param self class(elpa_t), the ELPA object
!> \param a double complex matrix a: defines the problem to solve
!> \param b double complex matrix b: defines the problem to solve
!> \param ev double real: on output stores the eigenvalues
!> \param q double complex matrix q: on output stores the eigenvalues
!> \param is_already_decomposed logical, input: is it repeated call with the same b (decomposed in the fist call)?
!> \result error integer, optional : error code, which can be queried with elpa_strerr
abstract interface
subroutine elpa_generalized_eigenvectors_dc_i(self, a, b, ev, q, is_already_decomposed, error)
use iso_c_binding
use elpa_constants
import elpa_t
implicit none
class(elpa_t) :: self
#ifdef USE_ASSUMED_SIZE
complex(kind=c_double_complex) :: a(self%local_nrows, *), b(self%local_nrows, *), q(self%local_nrows, *)
#else
complex(kind=c_double_complex) :: a(self%local_nrows, self%local_ncols), b(self%local_nrows, self%local_ncols), &
q(self%local_nrows, self%local_ncols)
#endif
real(kind=c_double) :: ev(self%na)
logical :: is_already_decomposed
integer, optional :: error
end subroutine
end interface
!> \brief abstract definition of interface to solve single complex generalized eigenvalue problem
!>
!> The dimensions of the matrix a (locally ditributed and global), the block-cyclic distribution
!> blocksize, the number of eigenvectors
!> to be computed and the MPI communicators are already known to the object and MUST be set BEFORE
!> with the class method "setup"
!>
!> It is possible to change the behaviour of the method by setting tunable parameters with the
!> class method "set"
!> Parameters
!> \details
!> \param self class(elpa_t), the ELPA object
!> \param a single complex matrix a: defines the problem to solve
!> \param b single complex matrix b: defines the problem to solve
!> \param ev single real: on output stores the eigenvalues
!> \param q single complex matrix q: on output stores the eigenvalues
!> \param is_already_decomposed logical, input: is it repeated call with the same b (decomposed in the fist call)?
!> \result error integer, optional : error code, which can be queried with elpa_strerr
abstract interface
subroutine elpa_generalized_eigenvectors_fc_i(self, a, b, ev, q, is_already_decomposed, error)
use iso_c_binding
use elpa_constants
import elpa_t
implicit none
class(elpa_t) :: self
#ifdef USE_ASSUMED_SIZE
complex(kind=c_float_complex) :: a(self%local_nrows, *), b(self%local_nrows, *), q(self%local_nrows, *)
#else
complex(kind=c_float_complex) :: a(self%local_nrows, self%local_ncols), b(self%local_nrows, self%local_ncols), &
q(self%local_nrows, self%local_ncols)
#endif
real(kind=c_float) :: ev(self%na)
logical :: is_already_decomposed
integer, optional :: error
end subroutine
end interface
!> \brief abstract definition of interface to compute C : = A**T * B for double real matrices
!> where A is a square matrix (self%a,self%na) which is optionally upper or lower triangular
!> B is a (self%na,ncb) matrix
!> C is a (self%na,ncb) matrix where optionally only the upper or lower
!> triangle may be computed
!>
!> the MPI commicators are already known to the type. Thus the class method "setup" must be called
!> BEFORE this method is used
!> \details
!>
!> \param self class(elpa_t), the ELPA object
!> \param uplo_a 'U' if A is upper triangular
!> 'L' if A is lower triangular
!> anything else if A is a full matrix
!> Please note: This pertains to the original A (as set in the calling program)
!> whereas the transpose of A is used for calculations
!> If uplo_a is 'U' or 'L', the other triangle is not used at all,
!> i.e. it may contain arbitrary numbers
!> \param uplo_c 'U' if only the upper diagonal part of C is needed
!> 'L' if only the upper diagonal part of C is needed
!> anything else if the full matrix C is needed
!> Please note: Even when uplo_c is 'U' or 'L', the other triangle may be
!> written to a certain extent, i.e. one shouldn't rely on the content there!
!> \param ncb Number of columns of global matrices B and C
!> \param a matrix a
!> \param self%local_nrows number of rows of local (sub) matrix a, set with method set("local_nrows,value")
!> \param self%local_ncols number of columns of local (sub) matrix a, set with method set("local_ncols,value")
!> \param b matrix b
!> \param nrows_b number of rows of local (sub) matrix b
!> \param ncols_b number of columns of local (sub) matrix b
!> \param nblk blocksize of cyclic distribution, must be the same in both directions!
!> \param c matrix c
!> \param nrows_c number of rows of local (sub) matrix c
!> \param ncols_c number of columns of local (sub) matrix c
!> \param error optional argument, error code which can be queried with elpa_strerr
abstract interface
subroutine elpa_hermitian_multiply_d_i (self,uplo_a, uplo_c, ncb, a, b, nrows_b, ncols_b, &
c, nrows_c, ncols_c, error)
use iso_c_binding
import elpa_t
implicit none
class(elpa_t) :: self
character*1 :: uplo_a, uplo_c
integer(kind=c_int), intent(in) :: nrows_b, ncols_b, nrows_c, ncols_c, ncb
#ifdef USE_ASSUMED_SIZE
real(kind=c_double) :: a(self%local_nrows,*), b(nrows_b,*), c(nrows_c,*)
#else
real(kind=c_double) :: a(self%local_nrows,self%local_ncols), b(nrows_b,ncols_b), c(nrows_c,ncols_c)
#endif
#ifdef USE_FORTRAN2008
integer, optional :: error
#else
integer :: error
#endif
end subroutine
end interface
!> \brief abstract definition of interface to compute C : = A**T * B
!> where A is a square matrix (self%na,self%na) which is optionally upper or lower triangular
!> B is a (self%na,ncb) matrix
!> C is a (self%na,ncb) matrix where optionally only the upper or lower
!> triangle may be computed
!>
!> the MPI commicators are already known to the type. Thus the class method "setup" must be called
!> BEFORE this method is used
!> \details
!>
!> \param self class(elpa_t), the ELPA object
!> \param uplo_a 'U' if A is upper triangular
!> 'L' if A is lower triangular
!> anything else if A is a full matrix
!> Please note: This pertains to the original A (as set in the calling program)
!> whereas the transpose of A is used for calculations
!> If uplo_a is 'U' or 'L', the other triangle is not used at all,
!> i.e. it may contain arbitrary numbers
!> \param uplo_c 'U' if only the upper diagonal part of C is needed
!> 'L' if only the upper diagonal part of C is needed
!> anything else if the full matrix C is needed
!> Please note: Even when uplo_c is 'U' or 'L', the other triangle may be
!> written to a certain extent, i.e. one shouldn't rely on the content there!
!> \param ncb Number of columns of global matrices B and C
!> \param a matrix a
!> \param self%local_nrows number of rows of local (sub) matrix a, set with method set("local_nrows",value)
!> \param self%local_ncols number of columns of local (sub) matrix a, set with method set("local_nrows",value)
!> \param b matrix b
!> \param nrows_b number of rows of local (sub) matrix b
!> \param ncols_b number of columns of local (sub) matrix b
!> \param nblk blocksize of cyclic distribution, must be the same in both directions!
!> \param c matrix c
!> \param nrows_c number of rows of local (sub) matrix c
!> \param ncols_c number of columns of local (sub) matrix c
!> \param error optional argument, error code which can be queried with elpa_strerr
abstract interface
subroutine elpa_hermitian_multiply_f_i (self,uplo_a, uplo_c, ncb, a, b, nrows_b, ncols_b, &
c, nrows_c, ncols_c, error)
use iso_c_binding
import elpa_t
implicit none
class(elpa_t) :: self
character*1 :: uplo_a, uplo_c
integer(kind=c_int), intent(in) :: nrows_b, ncols_b, nrows_c, ncols_c, ncb
#ifdef USE_ASSUMED_SIZE
real(kind=c_float) :: a(self%local_nrows,*), b(nrows_b,*), c(nrows_c,*)
#else
real(kind=c_float) :: a(self%local_nrows,self%local_ncols), b(nrows_b,ncols_b), c(nrows_c,ncols_c)
#endif
#ifdef USE_FORTRAN2008
integer, optional :: error
#else
integer :: error
#endif
end subroutine
end interface
!> \brief abstract definition of interface to compute C : = A**H * B
!> where A is a square matrix (self%na,self%a) which is optionally upper or lower triangular
!> B is a (self%na,ncb) matrix
!> C is a (self%na,ncb) matrix where optionally only the upper or lower
!> triangle may be computed
!>
!> the MPI commicators are already known to the type. Thus the class method "setup" must be called
!> BEFORE this method is used
!> \details
!>
!> \param self class(elpa_t), the ELPA object
!> \param uplo_a 'U' if A is upper triangular
!> 'L' if A is lower triangular
!> anything else if A is a full matrix
!> Please note: This pertains to the original A (as set in the calling program)
!> whereas the transpose of A is used for calculations
!> If uplo_a is 'U' or 'L', the other triangle is not used at all,
!> i.e. it may contain arbitrary numbers
!> \param uplo_c 'U' if only the upper diagonal part of C is needed
!> 'L' if only the upper diagonal part of C is needed
!> anything else if the full matrix C is needed
!> Please note: Even when uplo_c is 'U' or 'L', the other triangle may be
!> written to a certain extent, i.e. one shouldn't rely on the content there!
!> \param ncb Number of columns of global matrices B and C
!> \param a matrix a
!> \param self%local_nrows number of rows of local (sub) matrix a, set with the method set("local_nrows",value)
!> \param self%local_ncols number of columns of local (sub) matrix a, set with the method set("local_ncols",value)
!> \param b matrix b
!> \param nrows_b number of rows of local (sub) matrix b