<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re:Pardiso fails with high residual in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Pardiso-fails-with-high-residual/m-p/1557879#M35677</link>
    <description>&lt;P&gt;Hi Danesh,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Some updates here. I reduced the sparsity of my matrix which ended up in better condition number and then Pardiso started to give reliable results with low residual&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt; Thanks for letting us know.  We are looking into your issue. We will get back to you soon with an update.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Shanmukh.SS&lt;/P&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 27 Dec 2023 16:32:43 GMT</pubDate>
    <dc:creator>ShanmukhS_Intel</dc:creator>
    <dc:date>2023-12-27T16:32:43Z</dc:date>
    <item>
      <title>Pardiso fails with high residual</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Pardiso-fails-with-high-residual/m-p/1554684#M35620</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have a EM simulation tool that solved Maxwell equations in integral form. The matrices are ill-conditioned but sparse under specific circumstances. I have used MUMPS sparse direct solver and it worked very well but since we use Intel MKL for all other operations in our simulator, I decided to move to Pardiso. The problem is that when I use Pardiso the residual is very high and the solution is not correct at all. I have tried to re-produce the error using a small 6x6 sparse matrix which is attached. I have not been able to find the root cause but is there anyone that can help me with this issues? My original matrix is in COO format and I use MKL auxiliary routines to convert COO to CSR which is understandable by Pardiso. The coefficient matrix in my equation is unsymmetric and complex. I compile the code as below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$ icpx pardiso_fail.cc -lmkl_core -lmkl_intel_ilp64 -lmkl_intel_thread -liomp5 -DMKL_ILP64&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have compiled the example that is with MKL and it works correctly with very low residual.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is highly appreciated.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Dec 2023 12:21:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Pardiso-fails-with-high-residual/m-p/1554684#M35620</guid>
      <dc:creator>Dan78</dc:creator>
      <dc:date>2023-12-16T12:21:30Z</dc:date>
    </item>
    <item>
      <title>Re: Pardiso fails with high residual</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Pardiso-fails-with-high-residual/m-p/1554710#M35621</link>
      <description>&lt;P&gt;Something is wrong with your example matrix. You wrote that the matrix is 6 X 6, but you set n = 8 in the code.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Dec 2023 15:40:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Pardiso-fails-with-high-residual/m-p/1554710#M35621</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2023-12-16T15:40:38Z</dc:date>
    </item>
    <item>
      <title>Re: Pardiso fails with high residual</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Pardiso-fails-with-high-residual/m-p/1554727#M35622</link>
      <description>&lt;P&gt;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/41971"&gt;@mecej4&lt;/a&gt;Thanks for pointing this out. I had missed to update this from the example that is included with MKL. I updated the code to have correct values and the result is still unreliable. I have attached the corrected code and now the result is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Reordering completed ...&lt;BR /&gt;Number of nonzeros in factors = 28&lt;BR /&gt;Number of factorization MFLOPS = 0&lt;BR /&gt;Factorization completed ...&lt;BR /&gt;Solving system with iparm[11] = 0&lt;BR /&gt;The solution of the system is:&lt;BR /&gt;6.01275e+06,6.01276e+06&lt;BR /&gt;6.01275e+06,6.01275e+06&lt;BR /&gt;6.01275e+06,6.01276e+06&lt;BR /&gt;6.01275e+06,6.01275e+06&lt;BR /&gt;1,1&lt;BR /&gt;1,1&lt;/P&gt;&lt;P&gt;Relative residual = 1.1547&lt;BR /&gt;Error: residual is too high!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please find the correct code attached.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Dec 2023 19:03:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Pardiso-fails-with-high-residual/m-p/1554727#M35622</guid>
      <dc:creator>Dan78</dc:creator>
      <dc:date>2023-12-16T19:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: Pardiso fails with high residual</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Pardiso-fails-with-high-residual/m-p/1554728#M35623</link>
      <description>&lt;P&gt;Sorry I could not attached the corrected source code. Here it is attached. I got error when I tried to attach the file so I changed the extension from ".cpp" to ".c". If you want to compile it please rename it to "pardiso_fail.cpp".&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Dec 2023 19:09:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Pardiso-fails-with-high-residual/m-p/1554728#M35623</guid>
      <dc:creator>Dan78</dc:creator>
      <dc:date>2023-12-16T19:09:28Z</dc:date>
    </item>
    <item>
      <title>Re: Pardiso fails with high residual</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Pardiso-fails-with-high-residual/m-p/1555174#M35629</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;Some updates here. I reduced the sparsity of my matrix which ended up in better condition number and then Pardiso started to give reliable results with low residual. I am suspecting that Pardiso is not able to solve equations when coefficient matrices are kind of ill-posed, highly indefinite and the condition number is high. Like I mentioned before, MUMPS has been able so solve such equations. I think Pardiso internally uses METIS for reordering like MUMPS does. MUMPS also supports Scotch which might perform better in some cases. I remember that I experienced similar problems in accuracy when I used Pardiso long time ago (Not MKL's version but the one that was implemented by Olaf Schenk). If any adjustment in the parameters would make the solution reliable, I would be more than happy to know about it.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2023 17:32:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Pardiso-fails-with-high-residual/m-p/1555174#M35629</guid>
      <dc:creator>Dan78</dc:creator>
      <dc:date>2023-12-18T17:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: Pardiso fails with high residual</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Pardiso-fails-with-high-residual/m-p/1555361#M35634</link>
      <description>&lt;P&gt;I don't know what to make of your equations.&lt;/P&gt;&lt;P&gt;The first eq. is x_5 = 1 + i, the second is&amp;nbsp; - x_5 = 1 + i. Similarly, the third and fourth equations are inconsistent. In other words, the matrix is rank-deficient, and the MKL Pardiso solver is not an appropriate tool.&lt;/P&gt;&lt;P&gt;Perhaps the small test problem matrix is not representative of the matrices that your large application generates. Otherwise, you have to rethink what "obtaining a solution" means, such as "least squares", i.e., norm(A.x - b), in the case of over-determined equation sets, or "least norm solution", i.e., norm(x) for under-determined equation sets. Pardiso (Intel's or Panua's) does not cover such problems.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Dec 2023 14:19:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Pardiso-fails-with-high-residual/m-p/1555361#M35634</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2023-12-19T14:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: Pardiso fails with high residual</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Pardiso-fails-with-high-residual/m-p/1555682#M35638</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/41971"&gt;@mecej4&lt;/a&gt;&lt;/P&gt;&lt;P&gt;Yes I get your point. This small matrix is probably ill-posed. I have some regularization techniques for such matrices but I didn't applied because I wanted to know whether Pardiso can be an option for us or not. I did some more tests and this time with larger matrices i.e., ~41000 x 41000 which are ~99% sparse. This time Pardiso failed like before with very large residual values but MUMPS solved exactly same equation with very good accuracy. I didn't calculate residual for MUMPS but when I plotted the results in MATLAB the results from Pardiso are very off while MUMPS are quite close to the solution for dense matrices using LU dense solver.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use latest version of MUMPS i.e., 5.6.2 and compiled it with SCOTCH as reordering package and using ifx and icx compiler with MKL. I think Pardiso uses METIS for reordering.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Conclusion is that while Pardiso is a bit faster than MUMPS, but the results from MUMPS are very accurate. Again, I remember that I had done similar tests with Pardiso long time ago and got inaccurate results. I know the matrices that I use are ill-conditioned since they are coming from integral equations so this might be challenging for some solvers.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Dec 2023 20:40:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Pardiso-fails-with-high-residual/m-p/1555682#M35638</guid>
      <dc:creator>Dan78</dc:creator>
      <dc:date>2023-12-19T20:40:23Z</dc:date>
    </item>
    <item>
      <title>Re:Pardiso fails with high residual</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Pardiso-fails-with-high-residual/m-p/1557879#M35677</link>
      <description>&lt;P&gt;Hi Danesh,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Some updates here. I reduced the sparsity of my matrix which ended up in better condition number and then Pardiso started to give reliable results with low residual&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt; Thanks for letting us know.  We are looking into your issue. We will get back to you soon with an update.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Shanmukh.SS&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Dec 2023 16:32:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Pardiso-fails-with-high-residual/m-p/1557879#M35677</guid>
      <dc:creator>ShanmukhS_Intel</dc:creator>
      <dc:date>2023-12-27T16:32:43Z</dc:date>
    </item>
    <item>
      <title>Re: Re:Pardiso fails with high residual</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Pardiso-fails-with-high-residual/m-p/1557886#M35678</link>
      <description>&lt;P&gt;Hi&amp;nbsp; &lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/170714"&gt;@ShanmukhS_Intel&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Thanks for the update. Well, the challenge if to solve ill-conditioned coefficient matrices with a sparse direct solver with low residual. Otherwise, for a well-conditioned, or relatively ill-conditioned where you can find an efficient pre-conditioner, an iterative solver with lower cost could be used.&lt;/P&gt;&lt;P&gt;I have completely moved to MUMPS and now the solutions I get with exactly same matrices is very accurate. MUMPS calculates residual and backward error as a part of calculations, if the flag is set (Pardiso doesn't support this features I guess) and my residual and backward error is less than 1e-9. Also, when I plot the results, the difference is very low comparing to exact solution. MUMPS never failed even when I sparsified my matrix up to 99% and the error was still very low. I used SCOTCH for reordering and 3-steps if iterative refinement.&lt;/P&gt;&lt;P&gt;It would be good if MKL could also support MUMPS since this would be appropriate for the cases with large condition number of the cases that the equation is ill-posed. &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2023 16:44:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Pardiso-fails-with-high-residual/m-p/1557886#M35678</guid>
      <dc:creator>Dan78</dc:creator>
      <dc:date>2023-12-27T16:44:20Z</dc:date>
    </item>
  </channel>
</rss>

