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

The unexpected result when using Pardiso solver to solve linear equations in parallel (OpenMP)

Ewigstern
Beginner
382 Views
Dear Intel Team,

I recently found a strange phenomenon
 when invoking the pardiso solver to solve a linear equation, the details are as follows:

For a linear equation with multiple right-hand sides: AX=B, where A is an nxn matrix, B is an nxm matrix, and m is the number of right-hand sides.
Ewigstern_0-1662607960389.png

When I solve the equation in the following way (pseudocode), the result is correct.

do i=1,m
   call pardiso(A,B(i),X(i))
end do
 
correct result:
Ewigstern_1-1662608075861.png

 

However, when I solve the equation in the following way (pseudocode), all or some of the threads compute the same result, i.e. all or some of the columns of X are the same. Notice:
1. I have confirmed that the B(i) entered in each loop is correct.
2. These same calculation results may be the correct result of a certain thread, or may be the initial 0 value.
3. In rare cases, all threads can get different calculation results, and the results are correct.

!$OMP Parallel Do Num_Threads(p)
do i=1,m
   call pardiso(A,B(i),X(i))
end do
!$OMP end Parallel Do
 
wrong result:
Ewigstern_2-1662608129536.png

 

Such a phenomenon is very strange, and it confuses me. I would like to know what is causing this? Is it not possible to call the pardiso solver in the OpenMP way? Or do I need to adjust the input parameters of the pardiso solver when calling the pardiso solver in OpenMP?

Best wishes,
Ewigstern
 
0 Kudos
2 Replies
VidyalathaB_Intel
Moderator
348 Views

Hi Ewigstern,


Thanks for reaching out to us.

Could you please provide us with the following details so that we could try reproducing the issue from our end?

> MKL Version being used

> Complete sample reproducer code and steps to reproduce it (commands to compile and run)

> OS environment details

> Expected results and observed results (i.e. the results that you are getting while running in parallel mode)


Regards,

Vidya.


0 Kudos
VidyalathaB_Intel
Moderator
282 Views

Hi Ewigstern,


Since this is a duplicate thread of https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/The-wrong-result-when-using-Pardiso-solver-to-solve-linear/td-p/1414332, we will no longer monitor this thread. We will continue addressing this issue in the other thread. 


Regards,

Vidya.


0 Kudos
Reply