Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
6977 Discussions

question about some parameter of scalapack routine

Ye_C_
Beginner
480 Views

I have some questions about the use of scalapack. 

 

For example, I want to use the eigensolver pdsyev to obtain all the eigenvalues and eigenvectors.

By now, I can hardly understand the dimensions of parameter a (and also z). In the MKL manual, the dimensions of local matrix a should be "lld_a*LOCc(ja+n-1)", but I do not understand what is LOCc(ja+n-1). 

ja is the column index in the global matrix A indicating the first column of the submatrix a, and n is the number of the column of global matrix A. 

Would you please tell me what is LOCc(n), when ja = 1?

Another question is wether the memory layout of the eigenvectors can be set different with the matrix A?

For example, I have a 8*8 matrix and 2*2 process gird, and I want each process hold some whole eigenvectors rather than just parts of some eigenvectors. Is it possible?

Thanks for your help! 

   

 

0 Kudos
3 Replies
Ying_H_Intel
Employee
480 Views

Hi Ye.C

You may find some c example in MKL install directory.

and there are some scalapack usage discussed in the forum, you can refer to them too.

For example, one C dgesv sample in 

https://software.intel.com/en-us/forums/intel-math-kernel-library/topic/536962

and sample code in

https://software.intel.com/en-us/forums/intel-math-kernel-library/topic/558359

Best Regards,

Ying

0 Kudos
Ye_C_
Beginner
480 Views

Hi Ying,

Thank you for your reply. 

I can understand the LOCc now. 

There is an another question about the distribution of the solved eigenvectors. 

For example, I have a 4*4 trivial identical matrix: 

1    0    0    0 

0    1    0    0 

0    0    1    0

0    0    0    1

and a 2*2 process grid, say:

0   1

2    3

 Is it possible to let each process hold a eigenvector?

In other words, the distribution layout of the matrix and the eigenvector is different.  

Yours respectfully.

Ying H (Intel) wrote:

Hi Ye.C

You may find some c example in MKL install directory.

and there are some scalapack usage discussed in the forum, you can refer to them too.

For example, one C dgesv sample in 

https://software.intel.com/en-us/forums/intel-math-kernel-library/topic/536962

and sample code in

https://software.intel.com/en-us/forums/intel-math-kernel-library/topic/558359

Best Regards,

Ying

0 Kudos
Ying_H_Intel
Employee
480 Views

Hi Ye, 

The scalapack use 2d block cyclic distribution, like below, with 2x3 grid, blocksize=1,  usually, we use numroc to calculate the  locC , 

    locR = numroc_(&matrix_size, &block, &myrow, &izero, &nprow);
      locC = numroc_(&matrix_size, &block, &mycol, &izero, &npcol);

 Scalapack.png

 

The mkl manual has such discription:

 number of rows and columns of a global dense matrix that a particular process in a grid receives after
data distributing is denoted by LOCr() and LOCc(), respectively. To compute these numbers, you can use
the ScaLAPACK tool routine numroc.

"lld_a, Leading dimension of the local matrix A..

So the lld_axLocc() is local matrix on each grid.

for example "row major",  on grid(0,0) = they are 4x4. 

on grid(0,2) = they are 4x2. 

Regarding your question, Is it possible to let each process hold a eigenvector?  Not sure if i understand right.  But it is possible to get one process to hold one eigenvalue , for example, your  have a 4*4 trivial identical matrix and 2x2 process grid.   As eigen vector matrix was distributed as global matrix 2d block cyclic distribution, you may need send them back for complete eigen vector.  Although it is possible if redesign the implement (focus on eigen vector on one process), but as i understand,  current  scalapack don't support this. 

MKL manual explain the output z matrix as below: 

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

Best Regards,

Ying

and  the figure in https://software.intel.com/en-us/forums/intel-math-kernel-library/topic/562742, blocksize=2, process grid 2x2, matrix size =9x9

Scalapck.png

0 Kudos
Reply