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

Pardiso unable to solve a symmetric matrix

bryce155
Beginner
656 Views

Hello MKL tech support,

I have a positive definite matrix and using Pardiso to solve the problem. I kept receiving the error -4 for the solver. It is interative refinement problem in phase 33.

My params for pardiso are:

        iparm[7] = 15;
        iparm[10] = 0;
        iparm[12] = 0;
        iparm[0] = 1;
    iparm[1] = 0;
    iparm[3] = 0;
    iparm[4] = 0;
    iparm[5] = 0;
    iparm[6] = 0;
    iparm[9] = 13;
    
    iparm[11] = 0;
    iparm[13] = 0;


    iparm[17] = -1;
    iparm[18] = 0;
    iparm[19] = 0;
    iparm[20] = 0;
 
    iparm[26] = 1;
    iparm[27] = 0;
    iparm[34] = 1;
    iparm[59] = 0;

I am trying to solve Ax = y but there was no error in the factorization phase until the phase 33.

Thanks,

0 Kudos
14 Replies
Zhang_Z_Intel
Employee
656 Views

Please show us the code snippet that calls pardiso, in particular:

  • value of mtype?
  • value of phase?
  • Please set msglvl = 1 to produce statistical report

Check your iparm:

  • Check the value of iparm[29] on output to see if there're any zero or negative pivots.
  • Because you set iparm[0] = 1, then you must make sure you supply *all* values in iparm[1] through iparm[63].

Also, please let us know your MKL version, OS, compiler, and CPU type. Thanks.

0 Kudos
bryce155
Beginner
656 Views

Hi Zhang,

mtype = -2;

Please find the code snippet attached. The matrix was attached in the zip file in the previous post under CRS format. stiffness.txt is the values, and I tried to solve  Ax = y.

I am using vc10 compiler, MKL 11.0.3. The error only produced at the phase = 33. No zero pivot was detected.

Even when I set the maximum number of refinement iterative to 15 but it still stop at 4.

Thanks,

0 Kudos
Zhang_Z_Intel
Employee
656 Views

Thanks for providing the code. Your matrix can be solved using PARDISO. Please change the following iparm parameters:

iparm[7] = -5; // negative number means accumulation with extended precision

iparm[9] = 8; // pivot perturbation eps, 10-8 is recommended for symmetric indifinite matrices

iparm[20] = 1; // pivotting method, Bunch-Kaufman is recommended for symmetric indifinite matrices

Thanks.

0 Kudos
bryce155
Beginner
656 Views

Hi Zhang,

Thank you for your prompt response. I tried with your suggestion but it still stopped at 4 iterative refinement. I just wonder that if you really tried to solve the matrix. I attached a smaller matrix with similar problem. also stop at 4 refinement steps even when I increased the iparm[7] to -10.

Thank you for your helps,

0 Kudos
Zhang_Z_Intel
Employee
656 Views

Of course I solved the matrix successfully before posting my response! See my full program attached. It's based on your original version.

Note that iparm[7] sets the *maximum* number of iterative refinement steps. It doesn't mean it always goes through that many steps.

In my program, it actually needed 5 steps.

Do you still get an error in the solving step? What is it?

0 Kudos
Zhang_Z_Intel
Employee
656 Views

By the way, I'm using MKL 11.0.2 and the compiler is ICC 13.1.0. This is how I build the code:

icc -std=c99 -DMKL_ILP64 -I$MKLROOT/include pardiso_code.c -L$MKLROOT/lib/intel64 -lmkl_rt -lpthread -lm

0 Kudos
Hoang_Kien_D_
Beginner
656 Views

Thanks Zhang.

Ididnt have the intel compiler so I created a projectfrom your code with Microsoft Visual Studio 10 and Intel Composer XE 13 in 64 machine with 64bits library . It compiled successfully but when I ran the program it crashed right at the first call to PARDIO (phase = 11). (both with single dynamic layer (mkl_rt) or with the lirary from the Advisor line) (with both the interger32 and 64)

However, linking with 32bit with 32bit library was working fine. It didnt have enough memoryto solve for the first one that I sent you but for the second one it could solve the matrix.

My MKL version is 11.0.3 and intel composer XE 13 (the latest update for both)

Thanks

0 Kudos
Hoang_Kien_D_
Beginner
656 Views

I included the project so that you can see the configuration. Thanks.

0 Kudos
Roman_A_Intel
Employee
656 Views

Hi Bryce,

I have checked your matrix with the following settings:

iparm[0] =1, iparm[1]=2, iparm[7]=2, iparm[9]=13, iparm[34]=1, all other iparm set to 0. With this setting the relative residual of the solution is equal to 1.12e-12.

Increasing the number of iterations for this matrix cannot improve the solution of the system, that's why solving step return error. Nevertheless, as wrote above, norm of residual quite good, so you can switch off iterative refinement

Regards, Roman

0 Kudos
Hoang_Kien_D_
Beginner
656 Views
  • Thanks Roman. Could you take alook at the ms project file to see that why it crashed when compile in 64 bits?Many thanks for your help.Kien
0 Kudos
bryce155
Beginner
656 Views

Sorry I attached a wrong file. The correct project was attached.

I figured out that if we use the ilp64 library (with the option /DMKL_ILP64) the pardiso library has linking problem (I guess)

Thanks,

Kien

0 Kudos
Zhang_Z_Intel
Employee
656 Views

I was able to reproduce this problem. The execution ended abruptly in the analysis step (phase=11). I'm conducting more investigations and will update here as soon as possible.

Thanks!

bryce155 wrote:

Sorry I attached a wrong file. The correct project was attached.

I figured out that if we use the ilp64 library (with the option /DMKL_ILP64) the pardiso library has linking problem (I guess)

Thanks,

Kien

0 Kudos
Zhang_Z_Intel
Employee
656 Views

Finally, we know what's wrong with the code. You need to use "%lld" as the format string in those fscanf statements when reading integers from input files. This is because you want to use the 64-bit version of PARDISO (by either calling pardiso_64 or by defining MKL_ILP64). Then you must make sure every integer you read in is 64-bit!

After fixing this fscanf format problem, the code runs like a charm.

0 Kudos
bryce155
Beginner
656 Views

Hi Zhang,

Thank you so much for your helps. When I changed the string format to lld it did worked. However, when I used pardiso call the residual was 2.893196e-12 and when I call pardiso_64 (ilp64) the residual went to to 1.596730e+6. I attached the matrix.

Thanks,

0 Kudos
Reply