<?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 The ipiv array is an array in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Strange-partial-pivoting-of-LAPACKE-dgetrf/m-p/1143471#M26489</link>
    <description>&lt;P&gt;The ipiv array is an array that lists row interchanges, it is not a true pivot vector. So if you see an ipiv array for a 3x3 case that looks like [2,2,2], that means that row 1 was interchanged with row 2, then row 2 (which is the original row 1) stayed the same, then row 3 was interchanged with row 2 (which was the original row 1).&amp;nbsp;&lt;/P&gt;

&lt;P&gt;You get find more information about this in the description for ipiv in the getrf documentation &lt;SPAN style="font-size: 13.008px;"&gt;&lt;A href="https://software.intel.com/en-us/mkl-developer-reference-c-getrf" target="_blank"&gt;https://software.intel.com/en-us/mkl-developer-reference-c-getrf&lt;/A&gt;&lt;/SPAN&gt;. The routines getrs and getri are provided to work with pivot arrays of this form.&lt;/P&gt;</description>
    <pubDate>Mon, 25 Jun 2018 05:26:15 GMT</pubDate>
    <dc:creator>Kirana_B_Intel</dc:creator>
    <dc:date>2018-06-25T05:26:15Z</dc:date>
    <item>
      <title>Strange partial pivoting of LAPACKE_dgetrf</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Strange-partial-pivoting-of-LAPACKE-dgetrf/m-p/1143469#M26487</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I'm using&amp;nbsp;&lt;SPAN style="font-size: 13.008px;"&gt;LAPACKE_dgetrf to compute the LU factorization of square matrices in double precision. The matrix is in column major. Here is what I am doing. The environment is MKL 2018 Update 3 for Windows + Visual studio 2017.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px;"&gt;for(...)&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px;"&gt;lapack_int m = dim;&amp;nbsp; &amp;nbsp; //dim is around 40 to 80&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px;"&gt;double * A = (double*)mkl_malloc(m * m * sizeof(double), 64);&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px;"&gt;memcpy(A, source, m * m * sizeof(double));&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px;"&gt;lapack_int * ipiv = (lapack_int*)mkl_malloc(m * sizeof(lapack_int), 64);&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px;"&gt;lapack_int info = 0;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px;"&gt;int mat_layout = LAPACK_COL_MAJOR;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;for(int k = 0; k &amp;lt; m; k++)&amp;nbsp; &amp;nbsp; //flush ipiv before calling dgetrf&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; ipiv&lt;K&gt; = -1;&lt;/K&gt;&lt;/P&gt;

&lt;P&gt;info =&amp;nbsp;&lt;SPAN style="font-size: 13.008px;"&gt;LAPACKE_dgetrf(mat_layout, m, m, A, m, ipiv);&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px;"&gt;if(info != 0)&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px;"&gt;{&lt;/SPAN&gt;clean up memory;&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; break;}&lt;/P&gt;

&lt;P&gt;}&lt;/P&gt;

&lt;P&gt;I checked the info that was returned by&amp;nbsp;&lt;SPAN style="font-size: 13.008px;"&gt;LAPACKE_dgetrf and it was always 0. However, I found out I got duplicate items in ipiv array after each dgetrf call.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px;"&gt;I mean I got ipiv&lt;I&gt; == ipiv&lt;J&gt;&amp;nbsp; (0 &amp;lt; i , j &amp;lt; m), which doesn't make sense for partial pivoting. I also flushed the ipiv array before calling dgetrf. &lt;/J&gt;&lt;/I&gt;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px;"&gt;What is the possible reason for getting duplicate values in partial pivoting array?&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px;"&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 02:41:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Strange-partial-pivoting-of-LAPACKE-dgetrf/m-p/1143469#M26487</guid>
      <dc:creator>yang__xiaolin</dc:creator>
      <dc:date>2018-06-21T02:41:21Z</dc:date>
    </item>
    <item>
      <title> </title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Strange-partial-pivoting-of-LAPACKE-dgetrf/m-p/1143470#M26488</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Hi Xiaolin,&lt;BR /&gt;
	&lt;BR /&gt;
	could you please attach one test case to show the problem?&lt;BR /&gt;
	&lt;BR /&gt;
	​for example, below&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;stdlib.h&amp;gt;
#include &amp;lt;memory.h&amp;gt;
#include &amp;lt;mkl.h&amp;gt;

int main(void)
{

&amp;nbsp;int len = 198;
&amp;nbsp;char buf[198];
&amp;nbsp;mkl_get_version_string(buf, len);
&amp;nbsp;printf("%s\n", buf);
&amp;nbsp;printf("\n");

&amp;nbsp;lapack_int m = 3; //dim is around 40 to 80
&amp;nbsp;double&amp;nbsp; A[9] = { 0, 5, 5, 2, 9, 0,6, 8, 8 };
&amp;nbsp;//double * A = (double*)mkl_malloc(m * m * sizeof(double), 64);
&amp;nbsp;//memcpy(A, source, m * m * sizeof(double));
&amp;nbsp;lapack_int * ipiv = (lapack_int*)mkl_malloc(m * sizeof(lapack_int), 64);
&amp;nbsp;lapack_int info = 0;
&amp;nbsp;int mat_layout = LAPACK_COL_MAJOR;
&amp;nbsp;for (int k = 0; k &amp;lt; m; k++)&amp;nbsp; //flush ipiv before calling dgetrf
&amp;nbsp;&amp;nbsp;ipiv&lt;K&gt; = -1;
&amp;nbsp;info = LAPACKE_dgetrf(mat_layout, m, m, A, m, ipiv);

&amp;nbsp;if (info != 0)
&amp;nbsp;{
&amp;nbsp;&amp;nbsp;printf("info error %d", info);
&amp;nbsp;&amp;nbsp;//break;
&amp;nbsp;}

printf("\nLU_A\n");
for (int i = 0; i &amp;lt;m; i++) {
&amp;nbsp;for (int j = 0; j &amp;lt; m; j++) {
&amp;nbsp;&amp;nbsp;printf("%f ", A[i + j * 3]);
&amp;nbsp;}
&amp;nbsp;printf("\n");
}

printf("ipiv:\n");
for (int i = 0; i &amp;lt; m; i++) {
&amp;nbsp;printf("%d ", ipiv&lt;I&gt;);
}


return 0;

}
&lt;/I&gt;&lt;/K&gt;&lt;/PRE&gt;

&lt;P&gt;i did a quick test with MKL 2018 u3.&amp;nbsp; the result looks&amp;nbsp;fine with small&amp;nbsp;size input&amp;nbsp;&lt;/P&gt;

&lt;DIV&gt;Intel(R) Math Kernel Library Version 2018.0.3 Product Build 20180406 for Intel(R) 64 architecture applications&lt;/DIV&gt;

&lt;DIV&gt;&lt;BR /&gt;
	LU_A&lt;BR /&gt;
	5.000000 9.000000 8.000000&lt;BR /&gt;
	1.000000 -9.000000 0.000000&lt;BR /&gt;
	0.000000 -0.222222 6.000000&lt;BR /&gt;
	ipiv:&lt;BR /&gt;
	2 3 3 Press any key to continue . . .&lt;/DIV&gt;

&lt;P&gt;&lt;BR /&gt;
	Best Regards,&lt;BR /&gt;
	Ying&lt;BR /&gt;
	&lt;A href="https://software.intel.com/en-us/articles/intel-math-kernel-library-intel-mkl-2018-bug-fixes-list" target="_blank"&gt;https://software.intel.com/en-us/articles/intel-math-kernel-library-intel-mkl-2018-bug-fixes-list&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jun 2018 05:17:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Strange-partial-pivoting-of-LAPACKE-dgetrf/m-p/1143470#M26488</guid>
      <dc:creator>Ying_H_Intel</dc:creator>
      <dc:date>2018-06-25T05:17:52Z</dc:date>
    </item>
    <item>
      <title>The ipiv array is an array</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Strange-partial-pivoting-of-LAPACKE-dgetrf/m-p/1143471#M26489</link>
      <description>&lt;P&gt;The ipiv array is an array that lists row interchanges, it is not a true pivot vector. So if you see an ipiv array for a 3x3 case that looks like [2,2,2], that means that row 1 was interchanged with row 2, then row 2 (which is the original row 1) stayed the same, then row 3 was interchanged with row 2 (which was the original row 1).&amp;nbsp;&lt;/P&gt;

&lt;P&gt;You get find more information about this in the description for ipiv in the getrf documentation &lt;SPAN style="font-size: 13.008px;"&gt;&lt;A href="https://software.intel.com/en-us/mkl-developer-reference-c-getrf" target="_blank"&gt;https://software.intel.com/en-us/mkl-developer-reference-c-getrf&lt;/A&gt;&lt;/SPAN&gt;. The routines getrs and getri are provided to work with pivot arrays of this form.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jun 2018 05:26:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Strange-partial-pivoting-of-LAPACKE-dgetrf/m-p/1143471#M26489</guid>
      <dc:creator>Kirana_B_Intel</dc:creator>
      <dc:date>2018-06-25T05:26:15Z</dc:date>
    </item>
    <item>
      <title>Thank you.</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Strange-partial-pivoting-of-LAPACKE-dgetrf/m-p/1143472#M26490</link>
      <description>&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jun 2018 23:00:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Strange-partial-pivoting-of-LAPACKE-dgetrf/m-p/1143472#M26490</guid>
      <dc:creator>yang__xiaolin</dc:creator>
      <dc:date>2018-06-25T23:00:33Z</dc:date>
    </item>
  </channel>
</rss>

