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

## Why residual error is so high in PARDISO?

Novice
761 Views

Hello,

I am solving a big system by PARDISO but it gives me a very high residual error. In order to post and upload the code here, I just want to try for a small size (in this case the residual is 1463.71). So please can you suggest, what is the issue about high residual error?  The code is in the attachment .cpp file.

Best Regards,

Sal_Ahm

1 Solution
Moderator
689 Views

Hi Sal_Ahm,

Thanks for the details.

In your code, you calculate the value of Ax using the routine mkl_dcsrgemv() which employs one-based indexing while ia and ja values are actually used as zero-based indexing.

So adding 1 to each element of ia and ja values gave the low residual value. Please the below screenshot for more details.

And, the routine mkl_dcsrgemv() is deprecated, we recommend you to use the mkl_sparse_d_mv() for this sparse matrix-vector multiplication. For more details, please find the below link:

https://www.intel.com/content/www/us/en/docs/onemkl/developer-reference-c/2023-0/mkl-sparse-mv.html

And also, you can calculate the residual error value using loops. We have attached all the 3 methods in the attached file. Could you please try the below-attached code and let us know if you are able to run it without any errors?

Thanks & Regards,

Varsha

4 Replies
Moderator
705 Views

Hi Sal_Ahm,

Thanks for posting in Intel Communities.

We are working on your issue. We will get back to you soon.

Thanks & Regards,

Varsha

Moderator
690 Views

Hi Sal_Ahm,

Thanks for the details.

In your code, you calculate the value of Ax using the routine mkl_dcsrgemv() which employs one-based indexing while ia and ja values are actually used as zero-based indexing.

So adding 1 to each element of ia and ja values gave the low residual value. Please the below screenshot for more details.

And, the routine mkl_dcsrgemv() is deprecated, we recommend you to use the mkl_sparse_d_mv() for this sparse matrix-vector multiplication. For more details, please find the below link:

https://www.intel.com/content/www/us/en/docs/onemkl/developer-reference-c/2023-0/mkl-sparse-mv.html

And also, you can calculate the residual error value using loops. We have attached all the 3 methods in the attached file. Could you please try the below-attached code and let us know if you are able to run it without any errors?

Thanks & Regards,

Varsha

Novice
681 Views

Hello,

Thank you so much for your support, now it works in good way.

Best Regards,

Sal_Ahm

Moderator
659 Views

Hi,