<?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 Issue with dgesdd in MKL in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Issue-with-dgesdd-in-MKL/m-p/887697#M10125</link>
    <description>&lt;P&gt;Hello, &lt;BR /&gt;it happens that &lt;SPAN style="font-weight: bold;"&gt;dgesdd&lt;/SPAN&gt; returns negative singular values and "info=0". &lt;BR /&gt;&lt;BR /&gt;To be more specific : I call &lt;SPAN style="font-weight: bold;"&gt;dgesdd&lt;/SPAN&gt; in a subroutine. Here is the piece of code.&lt;/P&gt;
&lt;P&gt;
&lt;PRE&gt;[cpp]================================================         
         open(unit=12, file="c_3")
         l = 0
         do j = 1, 288
            do i = 1, 322
               l = l + 1
               read(12,'(e30.20)')rloc(l)
            enddo
         enddo
         close(12)

         ir1 = 1+322*288
         ir2 = ir1 + 322
         ir3 = ir2 + 322*322
         ir4 = ir3 + 288*288
         
         call dgesdd('A', 322, 288, rloc(1), 322,
     *        rloc(ir1),
     *        rloc(ir2), 322, rloc(ir3), 288,
     *        rloc(ir4), -1, iloc, info)

         mem = int(rloc(ir4))
         ir5 = ir4 + mem

         call dgesdd('A', 322, 288, rloc(1), 322,
     *        rloc(ir1),
     *        rloc(ir2), 322, rloc(ir3), 288,
     *        rloc(ir4), mem, iloc, info)
[/cpp]&lt;/PRE&gt;
&lt;/P&gt;
&lt;P&gt;===================================================&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;The 288 singular value which is returned is : -1, although info = 1, and no error is reported. &lt;BR /&gt; &lt;BR /&gt;&lt;SPAN style="font-style: italic;"&gt;rloc&lt;/SPAN&gt; and &lt;SPAN style="font-style: italic;"&gt;iloc&lt;/SPAN&gt; are big size arrays, respectively : 7677071 and 6335, which is far more than needed. However, even when those arrays have exactly the needed size, it behaves exactly the same. &lt;BR /&gt;&lt;BR /&gt;Of course, I  suspect an error in my code and not in &lt;SPAN style="font-weight: bold;"&gt;dgesdd&lt;/SPAN&gt; :  there must be something wrong with the rloc array. But I can not see how to track the bug. &lt;BR /&gt;Other precisions : &lt;BR /&gt;* the bug appears when I use MKL10.0, but not with a version of LAPACK 3.1.0 recompiled by myself with g77-3.3.5&lt;BR /&gt;&lt;BR /&gt;Can someone give me any advice ? Thanks for help&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 06 Dec 2008 10:34:31 GMT</pubDate>
    <dc:creator>bencteux</dc:creator>
    <dc:date>2008-12-06T10:34:31Z</dc:date>
    <item>
      <title>Issue with dgesdd in MKL</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Issue-with-dgesdd-in-MKL/m-p/887697#M10125</link>
      <description>&lt;P&gt;Hello, &lt;BR /&gt;it happens that &lt;SPAN style="font-weight: bold;"&gt;dgesdd&lt;/SPAN&gt; returns negative singular values and "info=0". &lt;BR /&gt;&lt;BR /&gt;To be more specific : I call &lt;SPAN style="font-weight: bold;"&gt;dgesdd&lt;/SPAN&gt; in a subroutine. Here is the piece of code.&lt;/P&gt;
&lt;P&gt;
&lt;PRE&gt;[cpp]================================================         
         open(unit=12, file="c_3")
         l = 0
         do j = 1, 288
            do i = 1, 322
               l = l + 1
               read(12,'(e30.20)')rloc(l)
            enddo
         enddo
         close(12)

         ir1 = 1+322*288
         ir2 = ir1 + 322
         ir3 = ir2 + 322*322
         ir4 = ir3 + 288*288
         
         call dgesdd('A', 322, 288, rloc(1), 322,
     *        rloc(ir1),
     *        rloc(ir2), 322, rloc(ir3), 288,
     *        rloc(ir4), -1, iloc, info)

         mem = int(rloc(ir4))
         ir5 = ir4 + mem

         call dgesdd('A', 322, 288, rloc(1), 322,
     *        rloc(ir1),
     *        rloc(ir2), 322, rloc(ir3), 288,
     *        rloc(ir4), mem, iloc, info)
[/cpp]&lt;/PRE&gt;
&lt;/P&gt;
&lt;P&gt;===================================================&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;The 288 singular value which is returned is : -1, although info = 1, and no error is reported. &lt;BR /&gt; &lt;BR /&gt;&lt;SPAN style="font-style: italic;"&gt;rloc&lt;/SPAN&gt; and &lt;SPAN style="font-style: italic;"&gt;iloc&lt;/SPAN&gt; are big size arrays, respectively : 7677071 and 6335, which is far more than needed. However, even when those arrays have exactly the needed size, it behaves exactly the same. &lt;BR /&gt;&lt;BR /&gt;Of course, I  suspect an error in my code and not in &lt;SPAN style="font-weight: bold;"&gt;dgesdd&lt;/SPAN&gt; :  there must be something wrong with the rloc array. But I can not see how to track the bug. &lt;BR /&gt;Other precisions : &lt;BR /&gt;* the bug appears when I use MKL10.0, but not with a version of LAPACK 3.1.0 recompiled by myself with g77-3.3.5&lt;BR /&gt;&lt;BR /&gt;Can someone give me any advice ? Thanks for help&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Dec 2008 10:34:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Issue-with-dgesdd-in-MKL/m-p/887697#M10125</guid>
      <dc:creator>bencteux</dc:creator>
      <dc:date>2008-12-06T10:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with dgesdd in MKL</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Issue-with-dgesdd-in-MKL/m-p/887698#M10126</link>
      <description>&lt;DIV style="margin: 0px; height: auto;"&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;BR /&gt;Hello,&lt;/P&gt;
&lt;P&gt;I now have more details about this issue, but I am still puzzled with the behavior of dgesdd in MKL10.0. I would really appreciate some explanations.&lt;/P&gt;
&lt;P&gt;Here are the new facts. I have made a very simple program : main program is in C. It allocates two arrays : a double array and a int array, then calls a fortran program. This one calls a subroutine that calls dgesdd, using a sub-portion of the double array. The complete code is reproduced at the end of the post. You can find the data file I use for "c_3" at  : &lt;A href="http://cermics.enpc.fr/~bencteux/c_3" target="_blank"&gt;http://cermics.enpc.fr/~bencteux/c_3&lt;/A&gt; .&lt;/P&gt;
&lt;P&gt;Depending  on the fact that the sub-array degins at a odd or an even integer (the variable "begin"), I get right or wrong singular values. By wrong singular values, I mean that one of the singular value is equal to -1 !!!&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;If I make all the program in fortran, it is just the other way around : I get wrong singular values when "begin" is even, and right ones when "begin" is odd !!&lt;/P&gt;
&lt;P&gt;Does it mean dgesdd is not safe ? or MKL10.0 ? or both ?&lt;/P&gt;
&lt;P&gt;Thanks for help,&lt;/P&gt;
&lt;P&gt;Guy&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;================================&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="text-decoration: underline;"&gt;Code 1 :&lt;/SPAN&gt; main program in C, calling fortran&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;#include &lt;STDLIB.H&gt;&lt;BR /&gt;#include &lt;STRING.H&gt;&lt;BR /&gt;#include &lt;MATH.H&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;void debugdgesdd_(double* rloc, int* nrloc, int* iloc, int* niloc); &lt;BR /&gt;&lt;BR /&gt;int main(int argc, char * argv[]) {               &lt;BR /&gt; double *rloc = 0; &lt;BR /&gt; int nrloc = 8432937, niloc = 2304, *iloc = 0; &lt;BR /&gt;&lt;BR /&gt; rloc = (double*) calloc(nrloc, sizeof(double));&lt;BR /&gt; iloc = (int*) calloc(niloc, sizeof(int));&lt;BR /&gt; if (rloc == NULL || iloc == NULL) {&lt;BR /&gt; printf("Erreur a la creation du tableau rloc n");&lt;BR /&gt; exit (EXIT_FAILURE); &lt;BR /&gt; } &lt;BR /&gt; debugdgesdd_(rloc, &amp;amp;nrloc, iloc, &amp;amp;niloc);&lt;BR /&gt;}&lt;/MATH.H&gt;&lt;/STRING.H&gt;&lt;/STDLIB.H&gt;&lt;/STDIO.H&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="text-decoration: underline;"&gt;Code 1 :&lt;/SPAN&gt; the fortran part :&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;subroutine debugdgesdd(rloc, nrloc, iloc, niloc)&lt;BR /&gt; implicit none&lt;BR /&gt; integer nrloc, niloc, iloc(niloc)&lt;BR /&gt; double precision rloc(nrloc)&lt;BR /&gt; integer begin&lt;BR /&gt;c&lt;BR /&gt; begin = 2&lt;BR /&gt; call calcul(rloc(begin), 530501, iloc, niloc)&lt;BR /&gt; return&lt;BR /&gt; end&lt;BR /&gt;&lt;BR /&gt;ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc&lt;BR /&gt;&lt;BR /&gt; subroutine calcul(rloc, nrloc, iloc, niloc)&lt;BR /&gt; implicit none&lt;BR /&gt; integer nrloc, niloc, iloc(niloc)&lt;BR /&gt; double precision rloc(nrloc)&lt;BR /&gt;c&lt;BR /&gt; integer l, i, j, ir1, ir2, ir3, ir4, ir5, mem, info&lt;BR /&gt;c&lt;BR /&gt; open(unit=12, file="c_3")&lt;BR /&gt; l = 0&lt;BR /&gt; do j = 1, 288&lt;BR /&gt; do i = 1, 322&lt;BR /&gt; l = l + 1&lt;BR /&gt; read(12,'(e30.20)')rloc(l)&lt;BR /&gt; enddo&lt;BR /&gt; enddo&lt;BR /&gt; close(12)&lt;BR /&gt; write(2,*) "Fichier c_3 relu. "&lt;BR /&gt; ir1 = 1+322*288&lt;BR /&gt; ir2 = ir1 + 288&lt;BR /&gt; ir3 = ir2 + 322*322&lt;BR /&gt; ir4 = ir3 + 288*288&lt;BR /&gt; &lt;BR /&gt; call dgesdd('A', 322, 288, rloc(1), 322, &lt;BR /&gt; *        rloc(ir1),&lt;BR /&gt; *        rloc(ir2), 322, rloc(ir3), 288, &lt;BR /&gt; *        rloc(ir4), -1, iloc, info)&lt;BR /&gt;&lt;BR /&gt; mem = int(rloc(ir4))&lt;BR /&gt; ir5 = ir4 + mem&lt;BR /&gt;&lt;BR /&gt; call dgesdd('A', 322, 288, rloc(1), 322, &lt;BR /&gt; *        rloc(ir1),&lt;BR /&gt; *        rloc(ir2), 322, rloc(ir3), 288, &lt;BR /&gt; *        rloc(ir4), mem, iloc, info)&lt;BR /&gt;&lt;BR /&gt; do i = 1, 288&lt;BR /&gt; write(2,'(i5,2x,e30.20)')i, rloc(ir1-1+i)&lt;BR /&gt; enddo&lt;BR /&gt; write(2,*) info, mem&lt;BR /&gt; write(2,*)"ir1, ir2, ir3, ir4, ir5, nrloc ",&lt;BR /&gt; *        ir1, ir2, ir3, ir4, ir5, nrloc&lt;BR /&gt;&lt;BR /&gt; return&lt;BR /&gt; end&lt;BR /&gt;&lt;BR /&gt;=================================================&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;Code 2 : all in fortran&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;program debug_dgesdd&lt;BR /&gt; implicit none&lt;BR /&gt; integer nrloc, niloc&lt;BR /&gt; parameter(nrloc = 8432937, niloc = 2304)&lt;BR /&gt; integer iloc(niloc)&lt;BR /&gt; double precision rloc(nrloc)&lt;BR /&gt;c&lt;BR /&gt; call debugdgesdd(rloc, nrloc, iloc, niloc)&lt;BR /&gt;c&lt;BR /&gt; return&lt;BR /&gt; end&lt;/P&gt;
&lt;P&gt;subroutine debugdgesdd(rloc, nrloc, iloc, niloc)&lt;BR /&gt; implicit none&lt;BR /&gt; integer nrloc, niloc, iloc(niloc)&lt;BR /&gt; double precision rloc(nrloc)&lt;BR /&gt; integer begin&lt;BR /&gt; c&lt;BR /&gt; begin = 2&lt;BR /&gt; call calcul(rloc(begin), 530501, iloc, niloc)&lt;BR /&gt; return&lt;BR /&gt; end&lt;BR /&gt; &lt;BR /&gt; ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc&lt;BR /&gt; &lt;BR /&gt; subroutine calcul(rloc, nrloc, iloc, niloc)&lt;BR /&gt; implicit none&lt;BR /&gt; integer nrloc, niloc, iloc(niloc)&lt;BR /&gt; double precision rloc(nrloc)&lt;BR /&gt; c&lt;BR /&gt; integer l, i, j, ir1, ir2, ir3, ir4, ir5, mem, info&lt;BR /&gt; c&lt;BR /&gt; open(unit=12, file="c_3")&lt;BR /&gt; l = 0&lt;BR /&gt; do j = 1, 288&lt;BR /&gt; do i = 1, 322&lt;BR /&gt; l = l + 1&lt;BR /&gt; read(12,'(e30.20)')rloc(l)&lt;BR /&gt; enddo&lt;BR /&gt; enddo&lt;BR /&gt; close(12)&lt;BR /&gt; write(2,*) "Fichier c_3 relu. "&lt;BR /&gt; ir1 = 1+322*288&lt;BR /&gt; ir2 = ir1 + 288&lt;BR /&gt; ir3 = ir2 + 322*322&lt;BR /&gt; ir4 = ir3 + 288*288&lt;BR /&gt; &lt;BR /&gt; call dgesdd('A', 322, 288, rloc(1), 322, &lt;BR /&gt; *        rloc(ir1),&lt;BR /&gt; *        rloc(ir2), 322, rloc(ir3), 288, &lt;BR /&gt; *        rloc(ir4), -1, iloc, info)&lt;BR /&gt; &lt;BR /&gt; mem = int(rloc(ir4))&lt;BR /&gt; ir5 = ir4 + mem&lt;BR /&gt; &lt;BR /&gt; call dgesdd('A', 322, 288, rloc(1), 322, &lt;BR /&gt; *        rloc(ir1),&lt;BR /&gt; *        rloc(ir2), 322, rloc(ir3), 288, &lt;BR /&gt; *        rloc(ir4), mem, iloc, info)&lt;BR /&gt; &lt;BR /&gt; do i = 1, 288&lt;BR /&gt; write(2,'(i5,2x,e30.20)')i, rloc(ir1-1+i)&lt;BR /&gt; enddo&lt;BR /&gt; write(2,*) info, mem&lt;BR /&gt; write(2,*)"ir1, ir2, ir3, ir4, ir5, nrloc ",&lt;BR /&gt; *        ir1, ir2, ir3, ir4, ir5, nrloc&lt;BR /&gt; &lt;BR /&gt; return&lt;BR /&gt; end&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 07 Dec 2008 09:42:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Issue-with-dgesdd-in-MKL/m-p/887698#M10126</guid>
      <dc:creator>bencteux</dc:creator>
      <dc:date>2008-12-07T09:42:55Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with dgesdd in MKL</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Issue-with-dgesdd-in-MKL/m-p/887699#M10127</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;BR /&gt;Hello,&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;the good idea is to submit an issue against dgesdd via Intel Premier Support.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Michael.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Dec 2008 17:08:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Issue-with-dgesdd-in-MKL/m-p/887699#M10127</guid>
      <dc:creator>Michael_C_Intel4</dc:creator>
      <dc:date>2008-12-11T17:08:11Z</dc:date>
    </item>
  </channel>
</rss>

