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

PARDISO: different results each time I solve the same system

roper
Beginner
762 Views
Hi,

I am comparing several solvers, and while some ones give expected results, PARDISO keeps giving very different results each time I run the program, or even different results if I call it two consecutive times.

It happens mainly with large matrices (80000 rows, 1000000 nonzeros) while other tests I made with very small matrices (eg: 5x5) give correct results.

With some settings it even crashes.

I mainly use default options for iparm.

I also tried DSS interface, and I get almost the same behavior.

Any idea ?

--
Rodrigo
0 Kudos
12 Replies
Alexander_K_Intel2
762 Views
Hi,
Try to check correctness of initial matrix data by matrix checker (set iparm[26]=1 in C or iparm(27)=1 in Fortran)
With best regards,
Alexander Kalinkin
0 Kudos
roper
Beginner
762 Views
Thanks, I did it but there were no warnings.

But I changed from:
setting all iparm to 0 except iparm(3) to the number of cores,
to
setting all iparm to 0 except iparm(1) to 1 and iparm(3) to the number of cores and iparm(27) to 1,
and now it gives a more-less correct solution with an estimated error of 0.6 %

Anyway, it still crashes with a symmetric matrix passed as unsymmetric...

--
Rodrigo
0 Kudos
Gennady_F_Intel
Moderator
762 Views
Rodrigo,
that's not good idea to set all iparm to 0.
please try first to set iparm(1) == 0 then all items iparm(2)-iparm(64) are filled with default values.
what MKL version you use?
then iparm(3) is not releavant since version 10.2.
--Gennady
0 Kudos
Alexander_K_Intel2
762 Views
Hi,
Am I right that you try to solve matrix A by PARDISO with mtype=2 or -2 and mtype=11 with similar ia,ja? If so the solution must not be the same because for mtype 2 and -2 PARDISO needs only lower part of initial matrix. Also I need to underline that if you set iparm(0) = 0 than matrix checker wouldn't work because default iparm(27) = 0. If you want to turn it on you need to set iparm(1) = 1 and set other iparm manually.
With best regards,
Alexander Kalinkin
0 Kudos
roper
Beginner
762 Views
Hi Alexander and Gennady,

I set all iparm to 0 before calling pardiso, anyway iparm should have some random values before is initialized, so it does not hurt setting it to 0, I think.

And yes, I did set iparm(1) = 1 and iparm(27) = 1

For mtype I use 6 and 13 because they are complex matrices.

For mtype=6 I pass only the UPPER part of the matrix, with diagonal included, as it is said in the manual. Do you say the LOWER part?

I am using now MKL version 10.2.5.035

In my last tests It worked for iparm(1) = 1; iparm(27) = 1 and symmetric (error: 1e-4 %) and crashed for unsymmetric,
and worked for iparm(1) = 0 and unsymmetric (but with an error of 5%) and crashed for symmetric.

--
Rodrigo
0 Kudos
roper
Beginner
762 Views
Also I observed in this these tests that, in the cases where version 10.2.5.035 crashed, version 10.0.011 gave all NaN.

0 Kudos
Alexander_K_Intel2
762 Views
Hi,
For unsymmetric case try to set iparm(10) not zero, for example 13, and turn on matching and scaling (iparm(11) and iparm(13) are equals 1).
For symmetric use iparm(1) = 1 and turn on matrix checker by iparm(27) = 1.
If in such cases you will get crash or NAN in output could you prepare testcase (example that we could execute to reproduce your problem) and upload it here?
With best regards,
Alexander Kalinkin
0 Kudos
roper
Beginner
762 Views
Thanks.
With those parameters, it did not crash, and it did not give NaN.
For symmetric case, I computed an relative mean error of 0.0001% to 0.7%, which is relatively high,
and for unsymmetric case it gave from 6 to 9%, although this one was done with a symmetric matrix (with both upper and lower part) passed as unsymmetric.
(well, the errors were calculated on a postprocessed field)

But, should not PARDISO work well with default parameters ?
0 Kudos
Alexander_K_Intel2
762 Views
Hi,
PARDISO work well with default parameters. The one reason I've asked you to change default parameters is turn on matrix checker. Moreover, as I understood the problem with default parameters was only in simmetric case. Is matrix checker helped to resolved the problem?
With best regards,
Alexander Kalinkin
0 Kudos
roper
Beginner
762 Views
Not, matrix checker did not report anything. I guess it should stop the program if it encountered errors, but I did not see any change.

--
Rodrigo
0 Kudos
mecej4
Honored Contributor III
762 Views
If you can make the erroneous behavior occur with a matrix size slightly greater than 5 X 5 (and definitely far smaller than 80000 X 80000), there will be better chances of pinpointing the reasons. How are your matrices generated?
0 Kudos
barragan_villanueva_
Valued Contributor I
762 Views
Hi,

Could you please check that all gotten results in fact are consistent or not?
So, do you consider that results are to beidentical from run to run?
0 Kudos
Reply