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

preconjugate cg

fachfan
Beginner
868 Views

Hallo

Ive worked a lot with the mkl library. But now I have some problems. First one: I want to use the cg routines for solving hugh linear problems. There are two parameters in the cg interface I doesnt know the function. These parameters are dpar(6) and dpar(7) (alpha and beta). Can anyone help me about these two parameters! Thx.

The next question: Have anyone a good idea for a precondition section (RCI_request 3)? I want to try to using the SOR-Funktion but I doesnt how to create this function with the blas and lapack routines! The normal Preconditioner by using mkl (ILU) doesnt work with the cg routines.

Thanks for helping me!

fachfan

0 Kudos
7 Replies
Sergey_G_Intel
Employee
868 Views

Hi Fachfan,

If I'm not mistaken, parameters alpha and beta are located in dpar(7) and dpar(8) (Fortran convention) according to MKL Manual unless you use C-convention (dpar[6] and dpar[7]). If you really meant parameters dpar(6) and dpar(7) in Fortran convention, please let me know and I'll provide you with the information about them.

Actually, you can try to use RCI CG method from MKLwithout knowing anything about parameters alpha and beta. Anyway, at iteration number k alpha is equal to (rk,rk)/(Apk,pk), beta is equal to (rk+1,rk+1)/(rk,rk), where rk is the current residual vector, and pk is the vector containing current search direction. Scalars alpha and beta are used to construct CG recursion. You can find more details in the book of Yousef Saad "Iterative methods for sparse linear systems". (It could be available on-line at Saad's home-page).

As for the SSOR preconditioner, please look at the examples located in MKL examples/solver/source folder named cg_ssor_precon.f (Fortran example) and cg_ssor_precon_c.c (C example). In these examples, you canlook at the usage ofBLAS and Sparse BLAS routines to construct SSOR preconditioner.

Thank you for using Intel MKL! If you have any more questions, we would be happy to answer them.

-SergeyG

0 Kudos
fachfan
Beginner
868 Views

First: Thx for the good answer Sergey.

I use C-convention but i have taken a look into the book you mentioned. Its very good. And than it is clear what these two parameters are. Thank you for the help.

In the field of the preconditioner there is a lot of stuff in the book. I tried the example and it works, but the convergence rate isnt so high as I supposed. But I have a nother idea.Since it ispossible to use a cholesky-routine before you start the cg-routineis itpossible touse acg-routine with SSOR-preconditioner?

- Fachfan

0 Kudos
Sergey_G_Intel
Employee
868 Views

You are always welcome, Fachfan!

It is not an easy task to find a good preconditioner for a given problem. It requires quite a lot of research before the good results appear.

As far as I know, Cholesky factorization works only for dense, packed, and bandedmatrices (for details, please refer to"Matrix Arguments" Section in Appendix B of MKL Manual). If you have enough memory to get Cholesky factorization, then your problem is solved and you don't needto go throughCG iterations. However, if the matrix is difficult (roughly speaking, it has big condition number of order 1015 or higher), then Cholesky factorization can result in inaccurate L*LT factorization. In this case, you might want to use (CG+SSOR) or(CG+inaccurate Cholesky)iterations to get more accurate results.

Generally speaking, it is possible to use CG with any symmetric positive definite preconditioner. While symmetry can be checked easily, positive definiteness property is hard to estimate without additional information about the problem.

0 Kudos
fachfan
Beginner
868 Views

Thanks for fast reply

I want to solve a linear finite element problem and the matrix in this field are mostly positiv definit. The problem is, that the size of the problem I want to solve is very hugh. I would say about 3.000.000. This lead me to the problem with the memory. I have a computer with linux (64bit) and enough memory to solve the problem dirct (with the pardiso solver) but now I want to calculate the results on a normal pc. And there isnt so much memory. Due to the fact the convergence rate isnt so high I search for a good possibility to get more performance. So I tried the SSOR with the help of the mkl-functions. But the time you get the results are very different. The Pardiso Solver need 15 min and the SSOR-CG 10 hours! And this is my main problem! Have anyone got a good idea? I tried Cholesky preconditioning and SSOR! Thank you

- fachfan

0 Kudos
Sergey_G_Intel
Employee
868 Views

Hi Fachfan,

Please excuseme for the late reply. I had to consult my colleagues to find appropriate solution for your problem. Currently, we have onlyone option left. Youcan try to use Out-of-core version of PARDISO (availablein MKL 10.0 Gold and later releases). It may happen that you'll be able to solve the problem within reasonable timeframe on your PC.

Other solution to your problem would be the development of a good preconditioner for your problem. Unfortunately, we cannot help you much with the preconditionerdevelopment.

0 Kudos
fachfan
Beginner
868 Views

Hi

Thanks for the time you spend! You have recogniced my problem! The next step is, that I try to use the Pardiso Out-of-core version. I find a good preconditionier but it do not work with the functions of the sparseblas routines. These will be the next step.

But we have recogniced a very strange situation: We run Pardiso solver in multicore application but we found a little problem. We have a computer with four cores but if we want to use only 2 cores during the calculation it crashes. We found out that you can use oen core or the maximum cores of the computer! Have anyone recongniced the same effect?

Thanks for reply

fachfan

0 Kudos
Sergey_G_Intel
Employee
868 Views

Hi Fachfan,

Could you send us MKL version, all iparm settings, matrix type, and PARDISO version (out-of-core or regular) please? Thank you!

0 Kudos
Reply