<?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 pdpotrf() fails to identify SPD matrix in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/pdpotrf-fails-to-identify-SPD-matrix/m-p/999086#M18417</link>
    <description>&lt;P&gt;I am trying to perform a Cholesky decomposition via &lt;A href="https://software.intel.com/en-us/node/521465"&gt;pdpotrf()&lt;/A&gt; of MKL-Intel's library, which uses ScaLAPACK. I am reading the whole matrix in the master node and then distribute it like in this &lt;A href="https://andyspiros.wordpress.com/2011/07/08/an-example-of-blacs-with-c/"&gt;example&lt;/A&gt;. Everything works fine when the dimension of the SPD matrix is even. However, when it's odd, `pdpotrf()` thinks that the matrix is not positive definite.&lt;/P&gt;

&lt;P&gt;Could it be because the submatrices are not SPD? I am working with this &lt;A href="http://i.stack.imgur.com/NOzvb.gif"&gt;matrix&lt;/A&gt;&amp;nbsp;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;and the submatrices are (with 4 processes and blocks of size 2x2):&lt;/SPAN&gt;&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;    A_loc on node 0
      4   1   2
      1 0.5   0
      2   0  16
    
    nrows = 3, ncols = 2
    A_loc on node 1
      2 0.5
      0   0
      0   0
    
    nrows = 2, ncols = 3
    A_loc on node 2
      2   0   0
    0.5   0   0
    
    nrows = 2, ncols = 2
    A_loc on node 3
      3   0
      0 0.625&lt;/PRE&gt;

&lt;P&gt;Here, every submatrix is not SPD, however, the overall matrix is SPD (have checked with running with 1 process). What should I do? Or there is nothing I can do and `pdpotrf()` does not work with matrices of odd size?&lt;/P&gt;</description>
    <pubDate>Sun, 05 Jul 2015 14:51:25 GMT</pubDate>
    <dc:creator>Georgios_S_</dc:creator>
    <dc:date>2015-07-05T14:51:25Z</dc:date>
    <item>
      <title>pdpotrf() fails to identify SPD matrix</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/pdpotrf-fails-to-identify-SPD-matrix/m-p/999086#M18417</link>
      <description>&lt;P&gt;I am trying to perform a Cholesky decomposition via &lt;A href="https://software.intel.com/en-us/node/521465"&gt;pdpotrf()&lt;/A&gt; of MKL-Intel's library, which uses ScaLAPACK. I am reading the whole matrix in the master node and then distribute it like in this &lt;A href="https://andyspiros.wordpress.com/2011/07/08/an-example-of-blacs-with-c/"&gt;example&lt;/A&gt;. Everything works fine when the dimension of the SPD matrix is even. However, when it's odd, `pdpotrf()` thinks that the matrix is not positive definite.&lt;/P&gt;

&lt;P&gt;Could it be because the submatrices are not SPD? I am working with this &lt;A href="http://i.stack.imgur.com/NOzvb.gif"&gt;matrix&lt;/A&gt;&amp;nbsp;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;and the submatrices are (with 4 processes and blocks of size 2x2):&lt;/SPAN&gt;&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;    A_loc on node 0
      4   1   2
      1 0.5   0
      2   0  16
    
    nrows = 3, ncols = 2
    A_loc on node 1
      2 0.5
      0   0
      0   0
    
    nrows = 2, ncols = 3
    A_loc on node 2
      2   0   0
    0.5   0   0
    
    nrows = 2, ncols = 2
    A_loc on node 3
      3   0
      0 0.625&lt;/PRE&gt;

&lt;P&gt;Here, every submatrix is not SPD, however, the overall matrix is SPD (have checked with running with 1 process). What should I do? Or there is nothing I can do and `pdpotrf()` does not work with matrices of odd size?&lt;/P&gt;</description>
      <pubDate>Sun, 05 Jul 2015 14:51:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/pdpotrf-fails-to-identify-SPD-matrix/m-p/999086#M18417</guid>
      <dc:creator>Georgios_S_</dc:creator>
      <dc:date>2015-07-05T14:51:25Z</dc:date>
    </item>
    <item>
      <title>Hi Georgios, </title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/pdpotrf-fails-to-identify-SPD-matrix/m-p/999087#M18418</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://software.intel.com/en-us/user/1147263" style="font-size: 11px; line-height: 16.5px; background-color: rgb(238, 238, 238);"&gt;Georgios,&lt;/A&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Not sure how &amp;nbsp;the input parameters &amp;nbsp;look like. &amp;nbsp;Could you please attach the cpp code so we can see what is the problem?&amp;nbsp;&lt;/P&gt;

&lt;P&gt;From document,&amp;nbsp;&lt;/P&gt;

&lt;P style="box-sizing: border-box; margin-bottom: 1em; line-height: 1.4; clear: both; max-width: 95%; width: auto; color: rgb(102, 102, 102); font-family: Arial, Tahoma, Helvetica, sans-serif; font-size: 13px;"&gt;(local)&lt;/P&gt;

&lt;P style="box-sizing: border-box; margin-bottom: 1em; line-height: 1.4; clear: both; max-width: 95%; width: auto; color: rgb(102, 102, 102); font-family: Arial, Tahoma, Helvetica, sans-serif; font-size: 13px;"&gt;&lt;SPAN class="keyword" style="box-sizing: border-box; font-family: 'Courier New', Courier, monospace;"&gt;REAL&lt;/SPAN&gt;&amp;nbsp;for&amp;nbsp;&lt;SPAN class="option" style="box-sizing: border-box; font-family: 'Courier New', Courier, monospace;"&gt;pspotrf&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="box-sizing: border-box; margin-bottom: 1em; line-height: 1.4; clear: both; max-width: 95%; width: auto; color: rgb(102, 102, 102); font-family: Arial, Tahoma, Helvetica, sans-serif; font-size: 13px;"&gt;&lt;SPAN class="keyword" style="box-sizing: border-box; font-family: 'Courier New', Courier, monospace;"&gt;DOUBLE PRECISON&lt;/SPAN&gt;&amp;nbsp;for&amp;nbsp;&lt;SPAN class="option" style="box-sizing: border-box; font-family: 'Courier New', Courier, monospace;"&gt;pdpotrf&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="box-sizing: border-box; margin-bottom: 1em; line-height: 1.4; clear: both; max-width: 95%; width: auto; color: rgb(102, 102, 102); font-family: Arial, Tahoma, Helvetica, sans-serif; font-size: 13px;"&gt;&lt;SPAN class="keyword" style="box-sizing: border-box; font-family: 'Courier New', Courier, monospace;"&gt;COMPLEX&lt;/SPAN&gt;&amp;nbsp;for&amp;nbsp;&lt;SPAN class="option" style="box-sizing: border-box; font-family: 'Courier New', Courier, monospace;"&gt;pcpotrf&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="box-sizing: border-box; margin-bottom: 1em; line-height: 1.4; clear: both; max-width: 95%; width: auto; color: rgb(102, 102, 102); font-family: Arial, Tahoma, Helvetica, sans-serif; font-size: 13px;"&gt;&lt;SPAN class="keyword" style="box-sizing: border-box; font-family: 'Courier New', Courier, monospace;"&gt;DOUBLE COMPLEX&lt;/SPAN&gt;&amp;nbsp;for&amp;nbsp;&lt;SPAN class="option" style="box-sizing: border-box; font-family: 'Courier New', Courier, monospace;"&gt;pzpotrf&lt;/SPAN&gt;.&lt;/P&gt;

&lt;P style="box-sizing: border-box; margin-bottom: 1em; line-height: 1.4; clear: both; max-width: 95%; width: auto; color: rgb(102, 102, 102); font-family: Arial, Tahoma, Helvetica, sans-serif; font-size: 13px;"&gt;Pointer into the local memory to an array of dimension&amp;nbsp;&lt;CODE style="box-sizing: border-box; font-family: 'Courier New', Courier, monospace; line-height: 1.6em;"&gt;(&lt;VAR class="varname" style="box-sizing: border-box; font-family: 'Courier New', Courier, monospace; line-height: 1.6em;"&gt;lld_a&lt;/VAR&gt;,&amp;nbsp;&lt;VAR class="varname" style="box-sizing: border-box; font-family: 'Courier New', Courier, monospace; line-height: 1.6em;"&gt;LOCc&lt;/VAR&gt;(&lt;VAR class="varname" style="box-sizing: border-box; font-family: 'Courier New', Courier, monospace; line-height: 1.6em;"&gt;ja&lt;/VAR&gt;+&lt;VAR class="varname" style="box-sizing: border-box; font-family: 'Courier New', Courier, monospace; line-height: 1.6em;"&gt;n&lt;/VAR&gt;-1))&lt;/CODE&gt;.&lt;/P&gt;

&lt;P style="box-sizing: border-box; margin-bottom: 1em; line-height: 1.4; clear: both; max-width: 95%; width: auto; color: rgb(102, 102, 102); font-family: Arial, Tahoma, Helvetica, sans-serif; font-size: 13px;"&gt;On entry, this array contains the local pieces of the&amp;nbsp;&lt;VAR class="varname" style="box-sizing: border-box; font-family: 'Courier New', Courier, monospace; line-height: 1.6em;"&gt;n&lt;/VAR&gt;-by-&lt;VAR class="varname" style="box-sizing: border-box; font-family: 'Courier New', Courier, monospace; line-height: 1.6em;"&gt;n&lt;/VAR&gt;&amp;nbsp;symmetric/Hermitian distributed matrix&amp;nbsp;&lt;CODE style="box-sizing: border-box; font-family: 'Courier New', Courier, monospace; line-height: 1.6em;"&gt;sub(&lt;VAR class="varname" style="box-sizing: border-box; font-family: 'Courier New', Courier, monospace; line-height: 1.6em;"&gt;A&lt;/VAR&gt;)&lt;/CODE&gt;&amp;nbsp;to be factored.&lt;/P&gt;

&lt;P style="box-sizing: border-box; margin-bottom: 1em; line-height: 1.4; clear: both; max-width: 95%; width: auto; color: rgb(102, 102, 102); font-family: Arial, Tahoma, Helvetica, sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;Depending on&amp;nbsp;&lt;VAR class="varname" style="box-sizing: border-box; font-family: 'Courier New', Courier, monospace; line-height: 1.6em;"&gt;uplo&lt;/VAR&gt;, the array&amp;nbsp;&lt;VAR class="varname" style="box-sizing: border-box; font-family: 'Courier New', Courier, monospace; line-height: 1.6em;"&gt;a&lt;/VAR&gt;&amp;nbsp;contains either the upper or the lower triangular part of the matrix&amp;nbsp;&lt;CODE style="box-sizing: border-box; font-family: 'Courier New', Courier, monospace; line-height: 1.6em;"&gt;sub(&lt;VAR class="varname" style="box-sizing: border-box; font-family: 'Courier New', Courier, monospace; line-height: 1.6em;"&gt;A&lt;/VAR&gt;)&lt;/CODE&gt;&amp;nbsp;(see&amp;nbsp;&lt;VAR class="varname" style="box-sizing: border-box; font-family: 'Courier New', Courier, monospace; line-height: 1.6em;"&gt;uplo&lt;/VAR&gt;). &amp;nbsp;Not the entire SPD matrix.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;

&lt;P style="box-sizing: border-box; margin-bottom: 1em; line-height: 1.4; clear: both; max-width: 95%; width: auto; color: rgb(102, 102, 102); font-family: Arial, Tahoma, Helvetica, sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;Best Regards,&lt;BR /&gt;
	Ying&amp;nbsp;&lt;/STRONG&gt;&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jul 2015 02:06:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/pdpotrf-fails-to-identify-SPD-matrix/m-p/999087#M18418</guid>
      <dc:creator>Ying_H_Intel</dc:creator>
      <dc:date>2015-07-06T02:06:10Z</dc:date>
    </item>
    <item>
      <title>Hi Ying,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/pdpotrf-fails-to-identify-SPD-matrix/m-p/999088#M18419</link>
      <description>&lt;P&gt;Hi Ying,&lt;/P&gt;

&lt;P&gt;&amp;nbsp; I tried to do so, by editing my first post. However, it required a captcha code to verify that I am a human being. I think I made a mistake at my first attempt. When I tried again for about 7 times, I am pretty sure I typed the correct symbols. However, I triggered the spam filter. I did sent a feedback, hope this will help.&lt;/P&gt;

&lt;P&gt;&amp;nbsp; I did make a &lt;A href="http://stackoverflow.com/questions/31231428/cholesky-with-scalapack"&gt;minor example&lt;/A&gt;, which behaves similarly to my real code. I have posted it at Stackoverflow. If needed, I can post the code here as well.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;George&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jul 2015 11:13:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/pdpotrf-fails-to-identify-SPD-matrix/m-p/999088#M18419</guid>
      <dc:creator>Georgios_S_</dc:creator>
      <dc:date>2015-07-06T11:13:03Z</dc:date>
    </item>
    <item>
      <title>Hi George, </title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/pdpotrf-fails-to-identify-SPD-matrix/m-p/999089#M18420</link>
      <description>&lt;P&gt;Hi George,&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I modify the code and &amp;nbsp;add the call of pdoptrf. It looks similiar as yours, please try it and let us know if any findings.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Best Regards,&lt;/P&gt;

&lt;P&gt;Ying&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Here is the compile command and run result.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;[yhu5@prc-mic01 scalapack]$ mpiicc -o pdpotrf pdpotrf.cpp -I. -I/opt/intel/mkl/include &amp;nbsp;/opt/intel/mkl/lib/intel64/libmkl_scalapack_lp64.a -L/opt/intel/mkl/lib/intel64 -Wl,--start-group /opt/intel/mkl/lib/intel64/libmkl_intel_lp64.a /opt/intel/mkl/lib/intel64/libmkl_core.a /opt/intel/mkl/lib/intel64/libmkl_sequential.a /opt/intel/mkl/lib/intel64/libmkl_blacs_intelmpi_lp64.a -Wl,--end-group -lpthread -lm -ldl&lt;BR /&gt;
	[yhu5@prc-mic01 scalapack]$ mpirun -n 4 ./pdpotrf a.txt 5 5 2 2&lt;BR /&gt;
	Matrix A:&lt;BR /&gt;
	&amp;nbsp; 4 &amp;nbsp; 1 &amp;nbsp; 2 0.5 &amp;nbsp; 2&lt;BR /&gt;
	&amp;nbsp; 1 0.5 &amp;nbsp; 0 &amp;nbsp; 0 &amp;nbsp; 0&lt;BR /&gt;
	&amp;nbsp; 2 &amp;nbsp; 0 &amp;nbsp; 3 &amp;nbsp; 0 &amp;nbsp; 0&lt;BR /&gt;
	0.5 &amp;nbsp; 0 &amp;nbsp; 0 0.625 &amp;nbsp; 0&lt;BR /&gt;
	&amp;nbsp; 2 &amp;nbsp; 0 &amp;nbsp; 0 &amp;nbsp; 0 &amp;nbsp;16&lt;/P&gt;

&lt;P&gt;Processes grid pattern:&lt;BR /&gt;
	0 1&lt;BR /&gt;
	2 3&lt;BR /&gt;
	A_loc on node 0&lt;BR /&gt;
	&amp;nbsp; 4 &amp;nbsp; 1 &amp;nbsp; 2&lt;BR /&gt;
	&amp;nbsp; 1 0.5 &amp;nbsp; 0&lt;BR /&gt;
	&amp;nbsp; 2 &amp;nbsp; 0 &amp;nbsp;16&lt;/P&gt;

&lt;P&gt;A_loc on node 1&lt;BR /&gt;
	&amp;nbsp; 2 0.5&lt;BR /&gt;
	&amp;nbsp; 0 &amp;nbsp; 0&lt;BR /&gt;
	&amp;nbsp; 0 &amp;nbsp; 0&lt;/P&gt;

&lt;P&gt;A_loc on node 2&lt;BR /&gt;
	&amp;nbsp; 2 &amp;nbsp; 0 &amp;nbsp; 0&lt;BR /&gt;
	0.5 &amp;nbsp; 0 &amp;nbsp; 0&lt;/P&gt;

&lt;P&gt;A_loc on node 3&lt;BR /&gt;
	&amp;nbsp; 3 &amp;nbsp; 0&lt;BR /&gt;
	&amp;nbsp; 0 0.625&lt;/P&gt;

&lt;P&gt;pdpotrf 00&lt;BR /&gt;
	pdpotrf 20&lt;BR /&gt;
	pdpotrf 10&lt;BR /&gt;
	pdpotrf 30&lt;BR /&gt;
	Matrix A test:&lt;BR /&gt;
	&amp;nbsp; 2 &amp;nbsp; 1 &amp;nbsp; 2 0.5 &amp;nbsp; 2&lt;BR /&gt;
	0.5 0.5 &amp;nbsp; 0 &amp;nbsp; 0 &amp;nbsp; 0&lt;BR /&gt;
	&amp;nbsp; 1 &amp;nbsp;-1 &amp;nbsp; 1 &amp;nbsp; 0 &amp;nbsp; 0&lt;BR /&gt;
	0.25 -0.25 -0.5 0.5 &amp;nbsp; 0&lt;BR /&gt;
	&amp;nbsp; 1 &amp;nbsp;-1 &amp;nbsp;-2 &amp;nbsp;-3 &amp;nbsp; 1&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jul 2015 01:58:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/pdpotrf-fails-to-identify-SPD-matrix/m-p/999089#M18420</guid>
      <dc:creator>Ying_H_Intel</dc:creator>
      <dc:date>2015-07-07T01:58:58Z</dc:date>
    </item>
    <item>
      <title>Hi Ying,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/pdpotrf-fails-to-identify-SPD-matrix/m-p/999090#M18421</link>
      <description>&lt;P&gt;Hi Ying,&lt;/P&gt;

&lt;P&gt;&amp;nbsp;this seems to be OK. I commented #include &amp;lt;pblas_examples.h&amp;gt;, since it produced a fattal error and moreover seems non-needed. Moreover, I can see that you are based on the example, rather than the minor example, which is OK. However, the example has the values of procrows and proccols hardcoded. I did this dynamic, by letting the user set a value, just like for N, M, Nb and Mb. Is that OK, or you think I am on the wrong track? Recall that procrows * proccols = number of processes (they are the dimensions of the grid of processes in other words).&lt;/P&gt;

&lt;P&gt;&amp;nbsp; As stated &lt;A href="http://stackoverflow.com/questions/31231428/cholesky-with-scalapack"&gt;here&lt;/A&gt;, the problem came from this line:&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;MPI_Bcast(&amp;amp;lda, 1, MPI_INT, 0, MPI_COMM_WORLD);&lt;/PRE&gt;

&lt;P&gt;, where lda is the leading dimension of the local matrix. I thought lda was the leading dimension of the global matrix.&lt;/P&gt;

&lt;P&gt;&amp;nbsp; Oh, also notice that in your example, you use two global matrices. I had done some experiments and did check that it will work fine with one global matrix as well. So, is it just the 2 global matrices leftovers from the example you were based or is there any particular reason you did so?&lt;/P&gt;

&lt;P&gt;Sorry for my wrong understanding of the parameter,&lt;/P&gt;

&lt;P&gt;George&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jul 2015 11:06:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/pdpotrf-fails-to-identify-SPD-matrix/m-p/999090#M18421</guid>
      <dc:creator>Georgios_S_</dc:creator>
      <dc:date>2015-07-08T11:06:00Z</dc:date>
    </item>
    <item>
      <title>Hi George, </title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/pdpotrf-fails-to-identify-SPD-matrix/m-p/999091#M18422</link>
      <description>&lt;P&gt;Hi George,&amp;nbsp;&lt;/P&gt;

&lt;P&gt;You are right, the problem in your code is&amp;nbsp;&lt;SPAN style="color: rgb(0, 0, 0); font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; font-size: 13.0080003738403px; line-height: 14.3088006973267px;"&gt;MPI_Bcast(&amp;amp;lda, 1, MPI_INT, 0, MPI_COMM_WORLD); &amp;nbsp;After remove, you will see it works.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;I just quick modify the code&amp;nbsp;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;in&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://andyspiros.wordpress.com/2011/07/08/an-example-of-blacs-with-c/" rel="nofollow" style="font-size: 12px; line-height: 18px;"&gt;example&lt;/A&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;. &amp;nbsp;So keep the original code, the 2 Global matrix is not needed, just for test. &amp;nbsp;An d &amp;nbsp;Yes, it is ok for you to &amp;nbsp;letting the user set a value for all kind of parameters. &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Best Regards,&lt;BR /&gt;
	Ying&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2015 04:21:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/pdpotrf-fails-to-identify-SPD-matrix/m-p/999091#M18422</guid>
      <dc:creator>Ying_H_Intel</dc:creator>
      <dc:date>2015-07-09T04:21:44Z</dc:date>
    </item>
  </channel>
</rss>

