<?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 Could you set MKL_VERBOSE=1 in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/floating-invalid-calling-DGEQRF-with-IFORT-and-MKL/m-p/1136190#M26003</link>
    <description>&lt;P&gt;Could you set MKL_VERBOSE=1 and give&amp;nbsp; us the log file around qr function?&lt;/P&gt;</description>
    <pubDate>Sun, 20 Jan 2019 15:39:27 GMT</pubDate>
    <dc:creator>Gennady_F_Intel</dc:creator>
    <dc:date>2019-01-20T15:39:27Z</dc:date>
    <item>
      <title>floating invalid calling DGEQRF  with IFORT and MKL</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/floating-invalid-calling-DGEQRF-with-IFORT-and-MKL/m-p/1136189#M26002</link>
      <description>&lt;P&gt;I have implemented an orthogonalization method using the &lt;A href="https://software.intel.com/en-us/mkl-developer-reference-fortran-geqrf"&gt;DGEQRF&lt;/A&gt; subroutine to compute a QR factorization. The compilation and subsequently execution works well using &lt;STRONG&gt;gfortran/MKL&lt;/STRONG&gt; but&amp;nbsp;&amp;nbsp;when I compile&amp;nbsp;and&amp;nbsp;run it with&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Ifort/MKL&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;I get the following error:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;STRONG&gt;forrtl: error (65): floating invalid&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I have checked for uninitialized variables or &lt;EM&gt;NaN&lt;/EM&gt; values, and the problem seems to be an arithmetic operation inside DGEQRF.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Issue description:&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Ifort version:&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;ifort (IFORT) 19.0.1.144 20181018&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;MKL version:&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;parallel_studio_xe_2019_update1_cluster_edition&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;The source code can be found at:&amp;nbsp;https://github.com/NLESC-JCER/Fortran_Davidson&lt;/P&gt;&lt;P&gt;Line that cause the error:&amp;nbsp;https://github.com/NLESC-JCER/Fortran_Davidson/blob/master/src/davidson.f90#L241&lt;/P&gt;&lt;P&gt;I compile the code using cmake like:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;cmake -H. -Bbuild -DCMAKE_Fortran_COMPILER=ifort&amp;nbsp;&lt;EM&gt;DCMAKE_BUILD_TYPE=Debug &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;cmake --build build&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;I run the resulting binary like:&lt;/P&gt;&lt;P&gt;./bin/main&lt;/P&gt;&lt;P&gt;Finally, The orthogonalization subroutine is&lt;/P&gt;
&lt;PRE class="brush:fortran; class-name:dark;"&gt;  subroutine lapack_qr(basis)
    !&amp;gt; Orthoghonalize the basis using the QR factorization.
    !&amp;gt; QR factorization of the M-by-N (M&amp;gt;N) matrx A=Q*R in the form where
    !&amp;gt; Q is square M-by-M matrix and R is an upper triangular M-by-N matrix.
    !&amp;gt; The equality A=Q*R can be re-written also as a product Q1*R1 where Q1
    !&amp;gt; is a rectangular M-by-N submatrix of the matrix Q and R1 is M-by-M
    !&amp;gt; submatrix of the R. Let us note that columns of Q1 are orthonormal
    !&amp;gt; (they are orthogonal to each other and have norms equal to 1).
    !&amp;gt; The equality A=Q1*R1 can be treated as every column of A is a linear
    !&amp;gt; combination of Q1 columns, i.e. they span the same linear space.
    !&amp;gt; In other words, columns of Q1 is the result of ortogonalization of columns A.
    !&amp;gt; DGEQRF does not not compute Q directly, DORGQR must be call subsequently.
    
    !&amp;gt; \param basis
    !&amp;gt; \return orthogonal basis    

    implicit none
    real(dp), dimension(:, :), intent(inout) :: basis
    real(dp), dimension(:), allocatable :: work ! workspace, see lapack documentation
    real(dp), dimension(size(basis, 2)) :: tau ! see DGEQRF documentation
    integer :: info, lwork, m, n

    ! Matrix shape
    m = size(basis, 1)
    n = size(basis, 2)

    ! 1. Call the QR decomposition
    ! 1.1 Query size of the workspace (Check lapack documentation)
    allocate(work(1))
    call DGEQRF(m, n, basis, m, tau, work, -1, info)

    ! 1.2 Allocate memory for the workspace
    lwork = max(1, int(work(1)))
    deallocate(work)
    allocate(work(lwork))

    ! 1.3 Call QR factorization
    call DGEQRF(m, n, basis, m, tau, work, lwork, info)
    deallocate(work)
    
    ! 2. Generates an orthonormal matrix
    ! 2.1 Query size of the workspace (Check lapack documentation)
    allocate(work(1))
    call DORGQR(m, n, min(m, n), basis, m, tau, work, -1, info)

    ! 2.2 Allocate memory fo the workspace
    lwork = max(1, int(work(1)))
    deallocate(work)
    allocate(work(lwork))

    ! 2.3 compute the matrix Q
    call DORGQR(m, n, min(m, n), basis, m, tau, work, lwork, info)
    
    ! release memory
    deallocate(work)
    
  end subroutine lapack_qr
&lt;/PRE&gt;

&lt;P&gt;I really appreciate any help you can provide.&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;Felipe Z.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Jan 2019 12:29:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/floating-invalid-calling-DGEQRF-with-IFORT-and-MKL/m-p/1136189#M26002</guid>
      <dc:creator>Zapata__Felipe</dc:creator>
      <dc:date>2019-01-18T12:29:42Z</dc:date>
    </item>
    <item>
      <title>Could you set MKL_VERBOSE=1</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/floating-invalid-calling-DGEQRF-with-IFORT-and-MKL/m-p/1136190#M26003</link>
      <description>&lt;P&gt;Could you set MKL_VERBOSE=1 and give&amp;nbsp; us the log file around qr function?&lt;/P&gt;</description>
      <pubDate>Sun, 20 Jan 2019 15:39:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/floating-invalid-calling-DGEQRF-with-IFORT-and-MKL/m-p/1136190#M26003</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2019-01-20T15:39:27Z</dc:date>
    </item>
    <item>
      <title>I think that in situations</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/floating-invalid-calling-DGEQRF-with-IFORT-and-MKL/m-p/1136191#M26004</link>
      <description>&lt;P&gt;I think that in situations such as this, it is largely up to the original poster to isolate one call (or a small number of calls)&amp;nbsp; to MKL routines and provide a description of why it is thought that the MKL routine(s) are not working correctly. In particular, it should be checked whether the arguments to the MKL routine have reasonable and meaningful values.&lt;/P&gt;&lt;P&gt;I printed the profile of the 50 X 8 matrix BASIS being passed to DGEQRF in file davidson.f90. Here is the pattern of zero/non-zero values:&lt;/P&gt;
&lt;PRE class="brush:bash; class-name:dark;"&gt;Row 1            X000XXXX
Row 2            0X00XXXX
Row 3            00X0XXXX
Row 4            000XXXXX
Rows 5 to 50     0000XXXX
&lt;/PRE&gt;

&lt;P&gt;Is this correct?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 20 Jan 2019 15:50:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/floating-invalid-calling-DGEQRF-with-IFORT-and-MKL/m-p/1136191#M26004</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2019-01-20T15:50:00Z</dc:date>
    </item>
    <item>
      <title>The following is the output</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/floating-invalid-calling-DGEQRF-with-IFORT-and-MKL/m-p/1136192#M26005</link>
      <description>&lt;P&gt;The following is the output of MKL_VERBOSE when calling the qr&amp;nbsp; subroutine:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;MKL_VERBOSE DPOSV(U,50,1,0x7ffce57b0290,50,0x7ffce57b50b0,50,1) 428ns CNR:OFF Dyn:1 FastMM:1 TID:0 &amp;nbsp;NThr:1&lt;BR /&gt;MKL_VERBOSE DGEQRF(50,32,0x2e18640,50,0x7ffce57c60f0,0x2de6e40,-1,0) 432ns CNR:OFF Dyn:1 FastMM:1 TID:0 &amp;nbsp;NThr:1&lt;BR /&gt;forrtl: error (65): floating invalid&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;For some reason that I need to investigate further, the linear system in the previous step calling the&amp;nbsp;&amp;nbsp;"DPOSV" subroutine failed. I need to figure up why it works when the program is compiled with gfortran.&lt;/P&gt;&lt;P&gt;Also, the pattern of zeros/non-zeros value that is passed to the&amp;nbsp;DGEQRF should correspond roughly to a&amp;nbsp;basis for a given subspace used to compute the eigenvalue/eigenvector pair of&amp;nbsp;a given matrix. In the example, I am trying to compute the lowest 3 eigenvalues of a 50 x 50 matrix using an initial subspace of dimension 4, using the Davidson method (http://www.netlib.org/utk/people/JackDongarra/etemplates/node402.html)&lt;/P&gt;&lt;P&gt;Thank you for your time&lt;/P&gt;</description>
      <pubDate>Sun, 20 Jan 2019 20:28:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/floating-invalid-calling-DGEQRF-with-IFORT-and-MKL/m-p/1136192#M26005</guid>
      <dc:creator>Zapata__Felipe</dc:creator>
      <dc:date>2019-01-20T20:28:00Z</dc:date>
    </item>
    <item>
      <title>The code in davidson.f90 in</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/floating-invalid-calling-DGEQRF-with-IFORT-and-MKL/m-p/1136193#M26006</link>
      <description>&lt;P&gt;The code in davidson.f90 in your Github repository ignores the values of the status variable info after calls to Lapack routines such as DGEQRF, DPOSV, etc. This is acceptable only if (based on experience or previous tests) you are confident that info = 0. For the test case that is first run, I find that after the first call to DPOSV we get info=4 and&amp;nbsp;for the next few subsequent calls, info=1. This (i.e., info &amp;gt; 0) implies that the matrix is not positive definite, because of which the factorization/solution failed.&lt;/P&gt;&lt;P&gt;When such a situation is encountered, the calculation should be stopped or some appropriate correction made before continuing. To continue the execution of the program despite the failed solution may invite&amp;nbsp;further errors of an unpredictable nature, and no conclusions should be drawn as to which compiler+library "works" and which does not.&lt;/P&gt;</description>
      <pubDate>Sun, 20 Jan 2019 23:19:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/floating-invalid-calling-DGEQRF-with-IFORT-and-MKL/m-p/1136193#M26006</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2019-01-20T23:19:58Z</dc:date>
    </item>
    <item>
      <title>+ our two cents : in the case</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/floating-invalid-calling-DGEQRF-with-IFORT-and-MKL/m-p/1136194#M26007</link>
      <description>&lt;P&gt;+ our two cents : in the case if info == 0 and you continue to see the runtime failure, please give us the reproducer which will greatly reduce the investigation time from our side. thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jan 2019 03:06:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/floating-invalid-calling-DGEQRF-with-IFORT-and-MKL/m-p/1136194#M26007</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2019-01-21T03:06:30Z</dc:date>
    </item>
    <item>
      <title>Thank you for your kind</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/floating-invalid-calling-DGEQRF-with-IFORT-and-MKL/m-p/1136195#M26008</link>
      <description>&lt;P&gt;I have wrongly assumed that the matrix that I passed to the &lt;STRONG&gt;&lt;EM&gt;qr&lt;/EM&gt;&lt;/STRONG&gt; subroutine is positive&amp;nbsp;define.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your kind advice!&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jan 2019 08:42:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/floating-invalid-calling-DGEQRF-with-IFORT-and-MKL/m-p/1136195#M26008</guid>
      <dc:creator>Zapata__Felipe</dc:creator>
      <dc:date>2019-01-21T08:42:00Z</dc:date>
    </item>
  </channel>
</rss>

