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
800 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
728 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
744 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
729 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
720 Views

Hello,

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

Best Regards,

Sal_Ahm

Moderator
698 Views

Hi,

Glad to know that your issue is resolved. Thanks for accepting our solution. This thread will no longer be monitored by Intel. If you need additional information, please start a new thread.

Thanks & Regards,

Varsha