Developer Reference for Intel® oneAPI Math Kernel Library for C

ID 766684
Date 3/22/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

p?syev

Computes all eigenvalues and, optionally, eigenvectors of a symmetric matrix.

Syntax

void pssyev (char *jobz , char *uplo , MKL_INT *n , float *a , MKL_INT *ia , MKL_INT *ja , MKL_INT *desca , float *w , float *z , MKL_INT *iz , MKL_INT *jz , MKL_INT *descz , float *work , MKL_INT *lwork , MKL_INT *info );

void pdsyev (char *jobz , char *uplo , MKL_INT *n , double *a , MKL_INT *ia , MKL_INT *ja , MKL_INT *desca , double *w , double *z , MKL_INT *iz , MKL_INT *jz , MKL_INT *descz , double *work , MKL_INT *lwork , MKL_INT *info );

Include Files

  • mkl_scalapack.h

Description

The p?syevfunction computes all eigenvalues and, optionally, eigenvectors of a real symmetric matrix A by calling the recommended sequence of ScaLAPACK functions.

In its present form, the function assumes a homogeneous system and makes no checks for consistency of the eigenvalues or eigenvectors across the different processes. Because of this, it is possible that a heterogeneous system may return incorrect results without any error messages.

Input Parameters

np = the number of rows local to a given process.

nq = the number of columns local to a given process.

jobz

(global) Must be 'N' or 'V'. Specifies if it is necessary to compute the eigenvectors:

If jobz ='N', then only eigenvalues are computed.

If jobz ='V', then eigenvalues and eigenvectors are computed.

uplo

(global) Must be 'U' or 'L'. Specifies whether the upper or lower triangular part of the symmetric matrix A is stored:

If uplo = 'U', a stores the upper triangular part of A.

If uplo = 'L', a stores the lower triangular part of A.

n

(global) The number of rows and columns of the matrix A(n 0).

a

(local)

Block cyclic array of global size n*n and local size lld_a*LOCc(ja+n-1). On entry, the symmetric matrix A.

If uplo = 'U', only the upper triangular part of A is used to define the elements of the symmetric matrix.

If uplo = 'L', only the lower triangular part of A is used to define the elements of the symmetric matrix.

ia, ja

(global) The row and column indices in the global matrix A indicating the first row and the first column of the submatrix A, respectively.

desca

(global and local) array of size dlen_. The array descriptor for the distributed matrix A.

iz, jz

(global) The row and column indices in the global matrix Z indicating the first row and the first column of the submatrix Z, respectively.

descz

(global and local) array of size dlen_. The array descriptor for the distributed matrix Z.

work

(local)

Array of size lwork.

lwork

(local) See below for definitions of variables used to define lwork.

If no eigenvectors are requested (jobz = 'N'), then lwork ≥ 5*n + sizesytrd + 1,

where sizesytrdis the workspace for p?sytrd and is max(NB*(np +1), 3*NB).

If eigenvectors are requested (jobz = 'V') then the amount of workspace required to guarantee that all eigenvectors are computed is:

qrmem = 2*n-2

lwmin = 5*n + n*ldc + max(sizemqrleft, qrmem) + 1

Variable definitions:

nb = desca[mb_ - 1] = desca[nb_ - 1] = descz[mb_ - 1] = descz[nb_ - 1];

nn = max(n, nb, 2);

desca[rsrc_ - 1] = desca[rsrc_ - 1] = descz[rsrc_ - 1] = descz[csrc_ - 1] = 0

np = numroc(nn, nb, 0, 0, NPROW)

nq = numroc(max(n, nb, 2), nb, 0, 0, NPCOL)

nrc = numroc(n, nb, myprowc, 0, NPROCS)

ldc = max(1, nrc)

sizemqrleft is the workspace for p?ormtr when its side argument is 'L'.

myprowc is defined when a new context is created as follows:

call blacs_get(desca[ctxt_ - 1], 0, contextc)

call blacs_gridinit(contextc, 'R', NPROCS, 1)

call blacs_gridinfo(contextc, nprowc, npcolc, myprowc, mypcolc)

If lwork = -1, then lwork is global input and a workspace query is assumed; the function only calculates the minimum and optimal size for all work arrays. Each of these values is returned in the first entry of the corresponding work array, and no error message is issued by pxerbla.

Output Parameters

a

On exit, the lower triangle (if uplo='L') or the upper triangle (if uplo='U') of A, including the diagonal, is destroyed.

w

(global).

Array of size n.

On normal exit, the first entries contain the selected eigenvalues in ascending order.

z

(local).

Array, global size n*n, local size lld_z*LOCc(jz+n-1). If jobz = 'V', then on normal exit the first columns of z contain the orthonormal eigenvectors of the matrix corresponding to the selected eigenvalues.

If jobz = 'N', then z is not referenced.

work[0]

On output, work[0] returns the workspace needed to guarantee completion. If the input parameters are incorrect, work[0] may also be incorrect.

If jobz = 'N'work[0] = minimal (optimal) amount of workspace

If jobz = 'V'work[0] = minimal workspace required to generate all the eigenvectors.

info

(global)

If info = 0, the execution is successful.

If info < 0: If the i-th argument is an array and the j-entry had an illegal value, then info = -(i*100+j), if the i-th argument is a scalar and had an illegal value, then info = -i.

If info > 0:

If info= 1 through n, the i-th eigenvalue did not converge in ?steqr2 after a total of 30n iterations.

If info= n+1, then p?syev has detected heterogeneity by finding that eigenvalues were not identical across the process grid. In this case, the accuracy of the results from p?syev cannot be guaranteed.

See Also