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

Getting started with MKL+ScaLAPACK!

Georgios_S_
New Contributor II
1,036 Views

I am a student and this is my first time using MKL. I am interesting in applying a Cholesky factorization to a SPD huge matrix and then invert it. I have the chance to use many computers for that purpose, thus I am only interested in distributed solutions. For that reason, I would like to use MKL with ScaLAPACK.

Is there any introductory tutorial for my level? The Cookbook seems to have some examples, but they do not seem introductory.

Does MKL provide a C interface for that? From this old post, the answer seems to be no. But if so, why not just using only ScaLAPACK? I do not know Fortran and I thought MKL would get me out of trouble by providing a C interface for ScaLAPACK.

0 Kudos
1 Solution
Ying_H_Intel
Employee
1,036 Views
Hello Georgios, No problem. Regarding your last question, the answer is no, MKL have same interface as ScaLAPACK. Best Regards, Ying

View solution in original post

0 Kudos
7 Replies
TimP
Honored Contributor III
1,036 Views

First, all cautions about avoiding inversion when there is an alternative apply with more force to SPD matrix (even it is not sparse).

There is a quick outline of Pardiso facilities for symmetric: https://software.intel.com/en-us/node/470282

There will be more web searchable hints outside of MKL, since the MKL BLAS functions are work-alike compatible with the open source ones. This may help you form a better idea of your strategy.

SPD requires use of effectively single dimensioned data arrays so there is no fundamental difference between calling from Fortran or C or way a C wrapper could simplify much.

0 Kudos
Georgios_S_
New Contributor II
1,036 Views

I agree. I am very sorry, but I forgot to mention that my matrix is ***dense***, thus Pardiso seems to be not helpful.

However, my main question is: Does MKL provides a C (or C++, but I do not think so) interface for ScaLAPACK?

0 Kudos
Ying_H_Intel
Employee
1,036 Views

Hi Georgios, 

Although ScaLAPACK  is in fortran interface, but it can definitely be used in C program.  

You may refer to the MKL Scalapack  sample under MKL install directory.   All of them are in C.  

>tar -xzvf examples_cluster.tgz

>cd /pblasc,  the sample c code  under source, 

and build & run the sample.  You will see how the fortran function are called in C. 

Here is one other sample:  

https://software.intel.com/en-us/articles/using-cluster-mkl-pblasscalapack-fortran-routine-in-your-c-program

Best Regards,

Ying 

0 Kudos
Georgios_S_
New Contributor II
1,036 Views

Hi Ying,

thanks for the reply! Where can I find examples_cluster.tgz?

Moreover, since this is for my school, I have to justify why I would like to use MKL with ScaLAPACK instead of ScaLAPACK alone. My initial idea was that MKL would offer a C interface for ScaLAPACK, but doesn't seem to be the case. So how I am going to justify the choice of MKL? I mean why one should use MKL with ScaLAPACK instead of ScaLAPACK alone in a school project like mine's?

You see, I am *only* interested in using a Cholesky factorization and then invert the matrix!

Regards,

Georgios

0 Kudos
Ying_H_Intel
Employee
1,036 Views

Hi Georgios, 

Have you install  MKL ( in or Parallel Studio XE )?  you may get it from MKL product page : https://software.intel.com/en-us/intel-mkl/

Once you install, you will see the sample under install directory, for example, /opt/intel/mkl

Regarding why MKL, different person may have different views,  it may depend on your needs,  for example,  C interface 

MKL Scalapack interface is  fortran-style, but can be used in C seamlessly.  

and other advantages, like high performance , completed documentation, user guide, c and fortran sample etc  describled  in  MKL product page : https://software.intel.com/en-us/intel-mkl/. ;

Best Regards,

Ying 

 

0 Kudos
Georgios_S_
New Contributor II
1,036 Views

Hello Ying,

sorry for keep posting. Thanks for the information.

About my case, I am still not convinced. I feel like MKL might be an overkill for me and since this is for my school, this will have a bad effect on my grade.

As I said what I want to do with Linear Algebra is only use Cholesky and then invert a dense SPD matrix, in a *distributed* environment. So, if ScaLAPACK provides me with the same exact interace with MKL+ScaLAPACL, then I feel that my professor won't be satisfied. So the question is: does MKL provides a different interaface for ScaLAPACL, than the one ScaLAPACK already provides?

Sorry again,

Georgios

0 Kudos
Ying_H_Intel
Employee
1,037 Views
Hello Georgios, No problem. Regarding your last question, the answer is no, MKL have same interface as ScaLAPACK. Best Regards, Ying
0 Kudos
Reply