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?

SAL_AHM
Novice
716 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

0 Kudos
1 Solution
VarshaS_Intel
Moderator
644 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.

VarshaS_Intel_0-1682677177602.png

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

 

 

View solution in original post

0 Kudos
4 Replies
VarshaS_Intel
Moderator
660 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


0 Kudos
VarshaS_Intel
Moderator
645 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.

VarshaS_Intel_0-1682677177602.png

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

 

 

0 Kudos
SAL_AHM
Novice
636 Views

Hello,

 

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

 

Best Regards,

Sal_Ahm

0 Kudos
VarshaS_Intel
Moderator
614 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


0 Kudos
Reply