<?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: Calling Iterative Sparse Solver from C++, Preconditioning P in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-Iterative-Sparse-Solver-from-C-Preconditioning-Problems/m-p/879845#M9401</link>
    <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/452920"&gt;recage&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;DIV&gt;&lt;SPAN style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;STRONG&gt;Problem:&lt;/STRONG&gt; when solving a MRHS problem with the iterative sparse solver (called from C++), it does not seem to put the current residual in the right place, so that it can be utilized by the preconditioner&lt;SPAN style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt; (i.e. when RCI_Request==3).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;BR /&gt;For a &lt;STRONG&gt;single RHS&lt;/STRONG&gt; problems&lt;STRONG&gt; &lt;/STRONG&gt;the function 'dcg' puts the current residual into the array tmp(:,3), which can be used by the preconditioner. That's fine.&lt;BR /&gt;However, for &lt;STRONG&gt;multiple RHS&lt;/STRONG&gt; problems the function 'dcgmrhs' is supposed to put the residual into tmp(:,3+ipar(3)), but this doesn't seem to be true. Hence, the preconditioner can not proceed with its job. How can I instruct 'dcgmrhs' to store the residuals in tmp(:,3+ipar(3))?&lt;BR /&gt;Or is there a misunderstanding on my side?&lt;BR /&gt;&lt;BR /&gt;I have observed this behavior when calling the functions from C++.&lt;BR /&gt;&lt;BR /&gt;Best regards, Recage&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
Hi Recage,
&lt;DIV&gt;To more deep understanding situation could you send example of your code? The cause of my misunderstanding is that you wrote about C++ program but use Fortran definition.&lt;/DIV&gt;
&lt;DIV&gt;With best regards,&lt;/DIV&gt;
&lt;DIV&gt;Alexander Kalinkin&lt;/DIV&gt;</description>
    <pubDate>Sat, 21 Nov 2009 10:20:07 GMT</pubDate>
    <dc:creator>Alexander_K_Intel2</dc:creator>
    <dc:date>2009-11-21T10:20:07Z</dc:date>
    <item>
      <title>Calling Iterative Sparse Solver from C++, Preconditioning Problems, Multiple Right Hand Side,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-Iterative-Sparse-Solver-from-C-Preconditioning-Problems/m-p/879844#M9400</link>
      <description>&lt;DIV&gt;&lt;SPAN style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;B&gt;Problem:&lt;/B&gt; when solving a MRHS problem with the iterative sparse solver (called from C++), it does not seem to put the current residual in the right place, so that it can be utilized by the preconditioner&lt;SPAN style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt; (i.e. when RCI_Request==3).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;BR /&gt;For a &lt;B&gt;single RHS&lt;/B&gt; problems&lt;B&gt; &lt;/B&gt;the function 'dcg' puts the current residual into the array tmp(:,3), which can be used by the preconditioner. That's fine.&lt;BR /&gt;However, for &lt;B&gt;multiple RHS&lt;/B&gt; problems the function 'dcgmrhs' is supposed to put the residual into tmp(:,3+ipar(3)), but this doesn't seem to be true. Hence, the preconditioner can not proceed with its job. How can I instruct 'dcgmrhs' to store the residuals in tmp(:,3+ipar(3))?&lt;BR /&gt;Or is there a misunderstanding on my side?&lt;BR /&gt;&lt;BR /&gt;I have observed this behavior when calling the functions from C++.&lt;BR /&gt;&lt;BR /&gt;Best regards, Recage</description>
      <pubDate>Fri, 20 Nov 2009 19:20:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-Iterative-Sparse-Solver-from-C-Preconditioning-Problems/m-p/879844#M9400</guid>
      <dc:creator>recage</dc:creator>
      <dc:date>2009-11-20T19:20:48Z</dc:date>
    </item>
    <item>
      <title>Re: Calling Iterative Sparse Solver from C++, Preconditioning P</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-Iterative-Sparse-Solver-from-C-Preconditioning-Problems/m-p/879845#M9401</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/452920"&gt;recage&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;DIV&gt;&lt;SPAN style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;STRONG&gt;Problem:&lt;/STRONG&gt; when solving a MRHS problem with the iterative sparse solver (called from C++), it does not seem to put the current residual in the right place, so that it can be utilized by the preconditioner&lt;SPAN style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt; (i.e. when RCI_Request==3).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;BR /&gt;For a &lt;STRONG&gt;single RHS&lt;/STRONG&gt; problems&lt;STRONG&gt; &lt;/STRONG&gt;the function 'dcg' puts the current residual into the array tmp(:,3), which can be used by the preconditioner. That's fine.&lt;BR /&gt;However, for &lt;STRONG&gt;multiple RHS&lt;/STRONG&gt; problems the function 'dcgmrhs' is supposed to put the residual into tmp(:,3+ipar(3)), but this doesn't seem to be true. Hence, the preconditioner can not proceed with its job. How can I instruct 'dcgmrhs' to store the residuals in tmp(:,3+ipar(3))?&lt;BR /&gt;Or is there a misunderstanding on my side?&lt;BR /&gt;&lt;BR /&gt;I have observed this behavior when calling the functions from C++.&lt;BR /&gt;&lt;BR /&gt;Best regards, Recage&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
Hi Recage,
&lt;DIV&gt;To more deep understanding situation could you send example of your code? The cause of my misunderstanding is that you wrote about C++ program but use Fortran definition.&lt;/DIV&gt;
&lt;DIV&gt;With best regards,&lt;/DIV&gt;
&lt;DIV&gt;Alexander Kalinkin&lt;/DIV&gt;</description>
      <pubDate>Sat, 21 Nov 2009 10:20:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-Iterative-Sparse-Solver-from-C-Preconditioning-Problems/m-p/879845#M9401</guid>
      <dc:creator>Alexander_K_Intel2</dc:creator>
      <dc:date>2009-11-21T10:20:07Z</dc:date>
    </item>
    <item>
      <title>Re: Calling Iterative Sparse Solver from C++, Preconditioning P</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-Iterative-Sparse-Solver-from-C-Preconditioning-Problems/m-p/879846#M9402</link>
      <description>Dear Alexander, thanks for replying again.&lt;BR /&gt;&lt;BR /&gt;Here ist the code segment for the preconditioning. The full source of the function is in the attachments.&lt;BR /&gt;&lt;BR /&gt;
&lt;PRE&gt;[cpp]/*---------------------------------------------------------------------------*/
	/* If rci_request=3, then compute apply the preconditioner matrix C_inverse  */
	/* on vector tmp(:,3+ipar(3)) and put the result in vector tmp(:,3)          */
	/* (Fortran notation)                                                        */
	/*---------------------------------------------------------------------------*/
	if (rci_request==3)
	{
		mkl_dcsrsv(&amp;amp;matdes[2], &amp;amp;n, &amp;amp;one, matdes, a, ja, ia, &amp;amp;ia[1], &amp;amp;tmp[(3+ipar[2]-1)*n], &amp;amp;tmp[2*n]);
		goto rci;
	}[/cpp]&lt;/PRE&gt;
Best regards, &lt;BR /&gt;Recage&lt;BR /&gt;</description>
      <pubDate>Sat, 21 Nov 2009 12:41:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-Iterative-Sparse-Solver-from-C-Preconditioning-Problems/m-p/879846#M9402</guid>
      <dc:creator>recage</dc:creator>
      <dc:date>2009-11-21T12:41:38Z</dc:date>
    </item>
    <item>
      <title>Re: Calling Iterative Sparse Solver from C++, Preconditioning P</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-Iterative-Sparse-Solver-from-C-Preconditioning-Problems/m-p/879847#M9403</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/452920"&gt;recage&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;Dear Alexander, thanks for replying again.&lt;BR /&gt;&lt;BR /&gt;Here ist the code segment for the preconditioning. The full source of the function is in the attachments.&lt;BR /&gt;&lt;BR /&gt;
&lt;/EM&gt;&lt;PRE&gt;&lt;EM&gt;[cpp]/*---------------------------------------------------------------------------*/
	/* If rci_request=3, then compute apply the preconditioner matrix C_inverse  */
	/* on vector tmp(:,3+ipar(3)) and put the result in vector tmp(:,3)          */
	/* (Fortran notation)                                                        */
	/*---------------------------------------------------------------------------*/
	if (rci_request==3)
	{
		mkl_dcsrsv(&amp;amp;matdes[2], &amp;amp;n, &amp;amp;one, matdes, a, ja, ia, &amp;amp;ia[1], &amp;amp;tmp[(3+ipar[2]-1)*n], &amp;amp;tmp[2*n]);
		goto rci;
	}[/cpp]&lt;/EM&gt;&lt;/PRE&gt;
Best regards, &lt;BR /&gt;Recage&lt;BR /&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
Recage,
&lt;DIV&gt;&lt;SPAN style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;First of all, what is not good in such precondition... CG and CGMHRS work with symmetric positive define system, thats mean that precondition must be symmetric positive define! If it's not nobody can guarantee the right solution of your system by CGMHRS. If you interested how construct precondition based on inversion L and U parts of initial matrix, you can look incg_ssor_precon_c.c in MKL examples. In that example precondition named SSOR construct.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;With best regards,&lt;/DIV&gt;
&lt;DIV&gt;Alexander Kalinkin&lt;/DIV&gt;</description>
      <pubDate>Sat, 21 Nov 2009 15:15:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-Iterative-Sparse-Solver-from-C-Preconditioning-Problems/m-p/879847#M9403</guid>
      <dc:creator>Alexander_K_Intel2</dc:creator>
      <dc:date>2009-11-21T15:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: Calling Iterative Sparse Solver from C++, Preconditioning P</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-Iterative-Sparse-Solver-from-C-Preconditioning-Problems/m-p/879848#M9404</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/421788"&gt;Alexander Kalinkin (Intel)&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
Recage,
&lt;DIV&gt;&lt;SPAN style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;First of all, what is not good in such precondition... CG and CGMHRS work with symmetric positive define system, thats mean that precondition must be symmetric positive define! If it's not nobody can guarantee the right solution of your system by CGMHRS. If you interested how construct precondition based on inversion L and U parts of initial matrix, you can look incg_ssor_precon_c.c in MKL examples. In that example precondition named SSOR construct.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;With best regards,&lt;/DIV&gt;
&lt;DIV&gt;Alexander Kalinkin&lt;/DIV&gt;
&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Thanks Alexander. Based on your hints I have successfully implemented a preconditioner for CGMRHS.&lt;BR /&gt;&lt;BR /&gt;Best regards, Recage&lt;BR /&gt;</description>
      <pubDate>Wed, 09 Dec 2009 09:01:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-Iterative-Sparse-Solver-from-C-Preconditioning-Problems/m-p/879848#M9404</guid>
      <dc:creator>recage</dc:creator>
      <dc:date>2009-12-09T09:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: Calling Iterative Sparse Solver from C++, Preconditioning P</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-Iterative-Sparse-Solver-from-C-Preconditioning-Problems/m-p/879849#M9405</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/452920"&gt;recage&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;Thanks Alexander. Based on your hints I have successfully implemented a preconditioner for CGMRHS.&lt;BR /&gt;&lt;BR /&gt;Best regards, Recage&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Recage,&lt;BR /&gt;You are welcome, fill free to ask more :)&lt;BR /&gt;With best regards,&lt;BR /&gt;Alexander Kalinkin</description>
      <pubDate>Wed, 09 Dec 2009 09:04:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-Iterative-Sparse-Solver-from-C-Preconditioning-Problems/m-p/879849#M9405</guid>
      <dc:creator>Alexander_K_Intel2</dc:creator>
      <dc:date>2009-12-09T09:04:58Z</dc:date>
    </item>
  </channel>
</rss>

