<?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 What version of mkl do you in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/PSGESVD-Illegal-parameter-19/m-p/1127154#M25331</link>
    <description>&lt;P&gt;What version of mkl do you use? We have fixed the very similar issue in mkl version 2018 u2.&lt;/P&gt;</description>
    <pubDate>Sun, 20 May 2018 13:16:49 GMT</pubDate>
    <dc:creator>Gennady_F_Intel</dc:creator>
    <dc:date>2018-05-20T13:16:49Z</dc:date>
    <item>
      <title>PSGESVD: Illegal parameter 19</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/PSGESVD-Illegal-parameter-19/m-p/1127153#M25330</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I want to perform SVD on a matrix in parallel(C). But I am facing issues in psgesvd. When I try to perform svd of a matrix of size 4750*4750, I get an error saying that:&lt;/P&gt;

&lt;P&gt;"{&amp;nbsp;&amp;nbsp;&amp;nbsp; 0,&amp;nbsp;&amp;nbsp;&amp;nbsp; 0}:&amp;nbsp; On entry to&lt;BR /&gt;
	PSGESVD parameter number&amp;nbsp;&amp;nbsp; 19 had an illegal value"&lt;/P&gt;

&lt;P&gt;Parameter 19 is 'lwork' for which a make a query first which returns the minimum size of 'work' array required. The svd works fine for smaller matrices but big matrices give an error. Can anyone please help me with this as to what is the reason for this error. The value of lwork in this case is 45362800.&lt;/P&gt;

&lt;P&gt;When I use serial "sgesvd" I don't get any such issue and the results are perfectly correct. But I am not sure what is causing an issue in this case.&lt;/P&gt;

&lt;P&gt;Thanks in advance!&lt;/P&gt;

&lt;P&gt;-Shailesh Tripathi&lt;/P&gt;</description>
      <pubDate>Sun, 20 May 2018 10:16:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/PSGESVD-Illegal-parameter-19/m-p/1127153#M25330</guid>
      <dc:creator>Tripathi__Shailesh</dc:creator>
      <dc:date>2018-05-20T10:16:02Z</dc:date>
    </item>
    <item>
      <title>What version of mkl do you</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/PSGESVD-Illegal-parameter-19/m-p/1127154#M25331</link>
      <description>&lt;P&gt;What version of mkl do you use? We have fixed the very similar issue in mkl version 2018 u2.&lt;/P&gt;</description>
      <pubDate>Sun, 20 May 2018 13:16:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/PSGESVD-Illegal-parameter-19/m-p/1127154#M25331</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2018-05-20T13:16:49Z</dc:date>
    </item>
    <item>
      <title>Hello,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/PSGESVD-Illegal-parameter-19/m-p/1127155#M25332</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;Thank you for your response. My ICC version is 13.0.1.117 and I know it is quite outdated. But is it just a bug in the compiler or is it some mistake I am doing? If the first is true, I can upgrade to the latest version.&lt;/P&gt;

&lt;P&gt;Also, what was the issue exactly that you fixed in the 2018 u2?&lt;/P&gt;

&lt;P&gt;Thanks for your help!&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
	Shailesh&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 May 2018 02:37:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/PSGESVD-Illegal-parameter-19/m-p/1127155#M25332</guid>
      <dc:creator>Tripathi__Shailesh</dc:creator>
      <dc:date>2018-05-21T02:37:26Z</dc:date>
    </item>
    <item>
      <title>https://software.intel.com/en</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/PSGESVD-Illegal-parameter-19/m-p/1127156#M25333</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 13.008px;"&gt;&lt;A href="https://software.intel.com/en-us/articles/intel-math-kernel-library-intel-mkl-2018-bug-fixes-list&amp;nbsp;" target="_blank"&gt;https://software.intel.com/en-us/articles/intel-math-kernel-library-intel-mkl-2018-bug-fixes-list&amp;nbsp;&lt;/A&gt;; --&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: rgb(83, 86, 90); font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 15px;"&gt;MKLD-3350&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;FONT color="#53565a" face="Helvetica Neue, Helvetica, Arial, sans-serif"&gt;&lt;SPAN style="font-size: 15px;"&gt;You may also give us reproducer which we may check on our side with the latest versions/updates.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 May 2018 05:59:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/PSGESVD-Illegal-parameter-19/m-p/1127156#M25333</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2018-05-21T05:59:10Z</dc:date>
    </item>
    <item>
      <title>Hello,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/PSGESVD-Illegal-parameter-19/m-p/1127157#M25334</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;
	I am ataching my reproducer code. I made some simplifications for 1 process execution. When the matrix size is large the same error shows up.&lt;/P&gt;

&lt;P&gt;Here is the code:&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;#include &amp;lt;iostream&amp;gt;
#include &amp;lt;mpi.h&amp;gt;
#include &amp;lt;stdlib.h&amp;gt;
#include "mkl_scalapack.h"
#include "mkl_blacs.h"

typedef MKL_INT MDESC[ 9 ];

void allocate(float **array, int size) {
    if (!(*array) &amp;amp;&amp;amp; *array == NULL) {
        *array = (float*) malloc (size * sizeof(float));
        if (!(*array)) {
            std::cout &amp;lt;&amp;lt; "FAILED TO ALLOCATE MEMORY" &amp;lt;&amp;lt; std::endl;
        }
    }
}

void svd(float *A, int&amp;amp; m, int&amp;amp; n) {

    // SVD of A to get U, Vt and S
    float zero = 0.0e+0, one = 1.0e+0;
    MKL_INT i_zero = 0, i_one = 1, i_negone = -1;

    MDESC descA, descU, descVt, descpinvA;

    MKL_INT iam, nprocs, ictxt, myrow, mycol, nprow, npcol;
    MKL_INT mb, nb, mp, nq, mq, kr;
    MKL_INT info, lld, lwork = -1;
    char jobu = 'V', jobvt = 'V';
    float *work, *S = NULL, *U = NULL, *Vt = NULL;
    float workpt;
    int k;
    int i,j; 

    blacs_pinfo_( &amp;amp;iam, &amp;amp;nprocs );
    nprow = 1;
    npcol = 1;

    blacs_get_( &amp;amp;i_negone, &amp;amp;i_zero, &amp;amp;ictxt );
    blacs_gridinit_( &amp;amp;ictxt, "R", &amp;amp;nprow, &amp;amp;npcol );
    blacs_gridinfo_( &amp;amp;ictxt, &amp;amp;nprow, &amp;amp;npcol, &amp;amp;myrow, &amp;amp;mycol );

    mb = 1;
    nb = 1;
    k = std::min(m, n);

    mp = m;
    nq = n;
    kr = k;

    allocate(&amp;amp;S, k);
    allocate(&amp;amp;U, m * kr);
    allocate(&amp;amp;Vt, kr * n);

    descinit_( descA, &amp;amp;m, &amp;amp;n, &amp;amp;nb, &amp;amp;nb, &amp;amp;i_zero, &amp;amp;i_zero, &amp;amp;ictxt, &amp;amp;m, &amp;amp;info );
    descinit_( descU, &amp;amp;m, &amp;amp;k, &amp;amp;nb, &amp;amp;nb, &amp;amp;i_zero, &amp;amp;i_zero, &amp;amp;ictxt, &amp;amp;m, &amp;amp;info );
    descinit_( descVt, &amp;amp;k, &amp;amp;n, &amp;amp;nb, &amp;amp;nb, &amp;amp;i_zero, &amp;amp;i_zero, &amp;amp;ictxt, &amp;amp;k, &amp;amp;info );

    psgesvd(&amp;amp;jobu, &amp;amp;jobvt, &amp;amp;m, &amp;amp;n, A, &amp;amp;i_one, &amp;amp;i_one, descA, S, U, &amp;amp;i_one, &amp;amp;i_one, descU, Vt, &amp;amp;i_one, &amp;amp;i_one, descVt, &amp;amp;workpt, &amp;amp;lwork, &amp;amp;info);

    lwork = (MKL_INT)workpt;

    work = (float*) calloc(lwork, sizeof( float ));
	
    psgesvd(&amp;amp;jobu, &amp;amp;jobvt, &amp;amp;m, &amp;amp;n, A, &amp;amp;i_one, &amp;amp;i_one, descA, S, U, &amp;amp;i_one, &amp;amp;i_one, descU, Vt, &amp;amp;i_one, &amp;amp;i_one, descVt, work, &amp;amp;lwork, &amp;amp;info);

    free(work);
    free(S);
    free(U);
    free(Vt);

    // Destroy temporary process grid
    blacs_gridexit_( &amp;amp;ictxt );
}


int main(int argc, char** argv)
{
	MPI_Init(&amp;amp;argc, &amp;amp;argv);
	
	float *A=NULL;
	int i,j;
	int m= 4760,n=4760 ;
	allocate(&amp;amp;A,m*n);
	
	for(i=0; i &amp;lt; m ; i++)
	{
		for(j=0 ; j&amp;lt;n ; j++)
			A[j*m + i]=rand() / RAND_MAX*10;
	}

	svd(A,m,n);
	MPI_Finalize();
	return 0;
}&lt;/PRE&gt;

&lt;P&gt;This code breaks even with a single process.&lt;BR /&gt;
	Thanks in advance!&lt;/P&gt;

&lt;P&gt;-Shailesh&lt;/P&gt;</description>
      <pubDate>Sun, 27 May 2018 06:48:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/PSGESVD-Illegal-parameter-19/m-p/1127157#M25334</guid>
      <dc:creator>Tripathi__Shailesh</dc:creator>
      <dc:date>2018-05-27T06:48:03Z</dc:date>
    </item>
    <item>
      <title>yes, we sees the same</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/PSGESVD-Illegal-parameter-19/m-p/1127158#M25335</link>
      <description>&lt;P&gt;yes, we sees the same behavior with the latest 2018 u2. We will investigate the cause of the problem and keep you in the loop with results.&lt;/P&gt;</description>
      <pubDate>Mon, 28 May 2018 05:18:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/PSGESVD-Illegal-parameter-19/m-p/1127158#M25335</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2018-05-28T05:18:08Z</dc:date>
    </item>
    <item>
      <title>Hi Shailesh,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/PSGESVD-Illegal-parameter-19/m-p/1127159#M25336</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN style="font-size: 12px;"&gt;Shailesh,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Thank you for reporting the problem! Fortunately, we've already fixed it. The fix will be available into&amp;nbsp;next MKL releases: MKL 2018 Update 4 and MKL 2019.&lt;/P&gt;

&lt;P&gt;As you know, when workspace amount is requested in LAPACK and ScaLAPACK (via LWORK=-1), it's returned into WORK(1). For single precision it means "int -&amp;gt; float" conversion. Unfortunately, for numbers more than 2^24 this conversion can lead to losing some low digits (because the integer number will be represented by a closest float number). As a result, users may get an integer number less than it was initially calculated into MKL. To avoid this problem, we now adjust integer numbers appropriately so that they can be represented without loss of precision as float, and then we assign this number to WORK(1).&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;As a workaround, you can adjust your number into the program as follows:&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px;"&gt;(*((MKL_INT*)&amp;amp;workpt))++;&amp;nbsp; // this line does the trick - it adds 1 to workpt represented as integer. In floating point representation it means you increase your number to the next representable fp number. It's enough to be on the safe side.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px;"&gt;&amp;nbsp;lwork = (MKL_INT)workpt;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px;"&gt;Sorry for inconvinience!&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Konstantin&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 17:38:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/PSGESVD-Illegal-parameter-19/m-p/1127159#M25336</guid>
      <dc:creator>Konstantin_A_Intel</dc:creator>
      <dc:date>2018-05-29T17:38:00Z</dc:date>
    </item>
    <item>
      <title>It works perfectly fine!</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/PSGESVD-Illegal-parameter-19/m-p/1127160#M25337</link>
      <description>&lt;P&gt;It works perfectly fine!&lt;BR /&gt;
	Thank you for your help!&lt;/P&gt;

&lt;P&gt;-Shailesh&lt;/P&gt;</description>
      <pubDate>Wed, 30 May 2018 07:20:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/PSGESVD-Illegal-parameter-19/m-p/1127160#M25337</guid>
      <dc:creator>Tripathi__Shailesh</dc:creator>
      <dc:date>2018-05-30T07:20:14Z</dc:date>
    </item>
  </channel>
</rss>

