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

How to determine the pivoting perturbation value (iparm[9])

kwjung
Beginner
414 Views

Hi,

The manual says that the default value for nonsymmetric matrices is iparm[9] = 13.

However, in my experience, in some cases, performance can be improved by not using the default values. It also seems to affect not only performance, but also the accuracy of the solution. 

It seems that the optimal value varies depending on the condition of the matrix. Are there any factors or guidelines to determine this value?

Thanks,

Kwangok

Labels (1)
0 Kudos
3 Replies
Shiquan_Su
Moderator
309 Views

Hi, Kwangok:

Would you please provide your full compilable and runnable test code example, and your computation environment details?

The default value is not one size fits all, so you are definitely right that performance varies. By the minimum, you can trial and error several values of iparm[9] to pick the one you like the best.

 

Shiquan Su

0 Kudos
kwjung
Beginner
231 Views

Hi Shiquan,

I want to automatically set the optimised parameter based on the matrix condition.

I'm just wondering which factors can affect it. Probably the size of the matrix, nnz, value, etc. can affect it. Any idea what values might be hints? I'm testing this in our own code and will write the test code if needed.

0 Kudos
morskaya_svinka_1
New Contributor I
211 Views

Hi, there was a post on that topic https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/pardiso-is-random-and-inaccurate/td-p/1654446. I did not really investigate the dependency between iparm[9] value and condition number of the problem. There might be some correlation, but I do not think it can be useful in practical implementation of getting a general linear system solved. You can dig it further and check some publications on tips how to make static pivoting work, but what I do is just try iparm[9] = 5, 7, 9, 11, 13, 15 and choose the value with smallest relative residual. If you need to solve matrices with similar properties, some value of iparm[9] may work fine for all of them after you tune it once, but when they have different properties, I do not know the way to choose the best one without brute force for now. You may also try specifying your own procedure for handling pivots.
Anyway, I prefer direct solvers with dynamic pivoting for factorizing indefinite and unsymmetric matrices. They typically produce more precise solution for ill-conditioned systems when you specify threshold like 1e-2 or 1e-3 and solution process (choosing solver parameters) can be automated. You may get additional memory because of dynamic pivoting and solver may break, but then you can just restart factorization with increased allocation constant, say, by a factor of 1.5. If you did not obtain the solution with small enough relative residual, you can keep increasing pivoting threshold up to 1e+0. Note that some linear systems have limit on how small relative residual you can achieve due to their condition number. Say, there was a system that had an SPD matrix, but I was not able to solve it with residual smaller than 1e-4. So if you get relative residual greater or equal to 1e+0 or about 1e-1 or 1e-2, that typically means the precision is poor, but 1e-3 may already be fine (depends on how much precision you want in the solution).

0 Kudos
Reply