<?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 Trouble using MKL DSS subroutines in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Trouble-using-MKL-DSS-subroutines/m-p/763354#M65</link>
    <description>Hi Vijay,&lt;BR /&gt;&lt;BR /&gt;The problem in this testcase is that you try to solveHermitian matrix, and itmust have real numbers on the diagonal (by the definition of Hermitian matrix), but it does contain non-zero imaginary parts on the diagonal.&lt;BR /&gt;&lt;BR /&gt;For the moment, PARDISO is not able to ignore imaginary part of diagonal elements, so you should explicitly set them to zero.&lt;BR /&gt;&lt;BR /&gt;Sorry for this inconvinience, and I hope this little change ofyour program will not be an issue for you.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Konstantin&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Fri, 02 Sep 2011 05:24:10 GMT</pubDate>
    <dc:creator>Konstantin_A_Intel</dc:creator>
    <dc:date>2011-09-02T05:24:10Z</dc:date>
    <item>
      <title>Trouble using MKL DSS subroutines</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Trouble-using-MKL-DSS-subroutines/m-p/763350#M61</link>
      <description>I am having trouble using MKL DSS subroutines to solve a symmetric 
sparse matrix in C++. I called the subroutines that intialize and 
decompose the matrix in one function say Decompose() function: 
dss_create(), dss_define_structure(), dss_reorder(), dss_factor_real(). 
Then I called the solve subroutine: dss_solve_real() in another function
 say Solve(). The handle is defined as a class variable and is 
initialized in the Decompose() function. I first execute the Decompose()
 function and then call Solve(). When the code reaches the subroutine 
dss_solve_real() it is crashing out. But if I put all the subroutines in
 one function it works ok. Am I not allowed to call these subroutines 
from different function? Is there a local memory that is destroyed when I
 leave the first function? I would greatly appreciate if somebody has 
any suggestions to fix this problem. &lt;BR /&gt;Thanks,&lt;BR /&gt;Vijay</description>
      <pubDate>Wed, 31 Aug 2011 21:24:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Trouble-using-MKL-DSS-subroutines/m-p/763350#M61</guid>
      <dc:creator>vijay1</dc:creator>
      <dc:date>2011-08-31T21:24:32Z</dc:date>
    </item>
    <item>
      <title>Trouble using MKL DSS subroutines</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Trouble-using-MKL-DSS-subroutines/m-p/763351#M62</link>
      <description>Hi Vijay,&lt;BR /&gt;&lt;BR /&gt;Could you please send us a small reproducer? You can also post some pieces of the code right here in the forum. I mostly interested in declarations of the functions, of the class which stores handle and calling program.&lt;BR /&gt;&lt;BR /&gt;As it works fine when all the calls made in one place - it seems that something wrong happened with DSS parameters between calling of 2 subroutines.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Konstantin</description>
      <pubDate>Thu, 01 Sep 2011 02:54:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Trouble-using-MKL-DSS-subroutines/m-p/763351#M62</guid>
      <dc:creator>Konstantin_A_Intel</dc:creator>
      <dc:date>2011-09-01T02:54:15Z</dc:date>
    </item>
    <item>
      <title>Trouble using MKL DSS subroutines</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Trouble-using-MKL-DSS-subroutines/m-p/763352#M63</link>
      <description>Hi Konstantin,&lt;BR /&gt;&lt;BR /&gt;Thanks for your reply. I figured out the reason for the crash. Basically I had an existing class with specific data structure to store matrix contents and for testing the MKL DSS I created a new pointer to double with values of the matrix and I was mistakenly deleting this pointer once I exist the function Decompose() (thinking that the dss handle now stores this data). I guess the dss handle stores only the pointer to these values. Do you think this makes sense?&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Vijay</description>
      <pubDate>Thu, 01 Sep 2011 15:00:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Trouble-using-MKL-DSS-subroutines/m-p/763352#M63</guid>
      <dc:creator>vijay1</dc:creator>
      <dc:date>2011-09-01T15:00:44Z</dc:date>
    </item>
    <item>
      <title>Trouble using MKL DSS subroutines</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Trouble-using-MKL-DSS-subroutines/m-p/763353#M64</link>
      <description>Hi Konstantin,&lt;BR /&gt;&lt;BR /&gt;I am now having trouble solving a complex system 
of equations using MKL DSS. The solution I obtain from these subroutines
 is completely wrong. Could you please advise as to what I could be 
doing wrong here? Below is my code for your reference:&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Vijay&lt;BR /&gt;&lt;BR /&gt;#include&lt;STDIO.H&gt;&lt;BR /&gt;#include&lt;STDLIB.H&gt;&lt;BR /&gt;#include &lt;IOSTREAM&gt;&lt;BR /&gt;#include&lt;MATH.H&gt;&lt;BR /&gt;#include &lt;COMPLEX&gt;&lt;BR /&gt;using namespace std;&lt;BR /&gt;#include "mkl_dss.h"&lt;BR /&gt;#include "mkl_dss.h"&lt;BR /&gt;#include "mkl_types.h"&lt;BR /&gt;&lt;BR /&gt;/*&lt;BR /&gt;** Define the array and rhs vectors&lt;BR /&gt;*/&lt;BR /&gt;#define NROWS   5&lt;BR /&gt;#define NCOLS   5&lt;BR /&gt;#define NNONZEROS  9&lt;BR /&gt;#define NRHS   1&lt;BR /&gt;int ROWINDEX[NROWS+1] = { 1, 6, 7, 8, 9, 10 };&lt;BR /&gt;int COLUMNS[NNONZEROS] = { 1, 2, 3, 4, 5, 2, 3, 4, 5 };&lt;BR /&gt;//double VALUES[NNONZEROS] = { 9, 1.5, 6, .75, 3, 0.5, 12, .625, 16 };&lt;BR /&gt;complex
 &lt;DOUBLE&gt; VALUES[NNONZEROS] = {complex &lt;DOUBLE&gt;(9,3), 
complex &lt;DOUBLE&gt;(1.5,1), complex &lt;DOUBLE&gt;(6,2), complex 
&lt;DOUBLE&gt;(0.75,1), complex &lt;DOUBLE&gt;(3,1.2), complex 
&lt;DOUBLE&gt;(0.5,0.5), complex &lt;DOUBLE&gt;(12,9), complex 
&lt;DOUBLE&gt;(0.625,1), complex &lt;DOUBLE&gt;(16,7)};&lt;BR /&gt;//double RHS[NCOLS] = { 1, 2, 3, 4, 5 };&lt;BR /&gt;complex
 &lt;DOUBLE&gt; RHS[NCOLS] = {complex &lt;DOUBLE&gt;(1,1), complex 
&lt;DOUBLE&gt;(2,2), complex &lt;DOUBLE&gt;(3,1.5), complex 
&lt;DOUBLE&gt;(4,1), complex &lt;DOUBLE&gt;(5,1.2)};&lt;BR /&gt;&lt;BR /&gt;class SymmSquareMatrix{&lt;BR /&gt;public:&lt;BR /&gt; int nRows;&lt;BR /&gt; int nCols;&lt;BR /&gt; int nNonZeros;&lt;BR /&gt; //complex &lt;DOUBLE&gt;* values;&lt;BR /&gt; _DOUBLE_COMPLEX_t *values;&lt;BR /&gt; int* rowIndex;&lt;BR /&gt; int* columns; &lt;BR /&gt; _MKL_DSS_HANDLE_t handle; &lt;BR /&gt; bool Decompose();&lt;BR /&gt; bool Solve();&lt;BR /&gt; SymmSquareMatrix();&lt;BR /&gt; virtual ~SymmSquareMatrix();&lt;BR /&gt;};&lt;BR /&gt;&lt;BR /&gt;SymmSquareMatrix::SymmSquareMatrix(){&lt;BR /&gt; //define the matrix here!&lt;BR /&gt; nRows=NROWS;&lt;BR /&gt; nCols=NCOLS;&lt;BR /&gt; nNonZeros=NNONZEROS;&lt;BR /&gt; //values=new complex &lt;DOUBLE&gt;[nNonZeros];&lt;BR /&gt; values=new _DOUBLE_COMPLEX_t[nNonZeros];&lt;BR /&gt; {for(int i=0; i&lt;NNONZEROS&gt;&lt;/NNONZEROS&gt; values&lt;I&gt;.r=real(VALUES&lt;I&gt;);&lt;BR /&gt; values&lt;I&gt;.i=imag(VALUES&lt;I&gt;);&lt;BR /&gt; cout &amp;lt;&amp;lt; " values: i=" &amp;lt;&amp;lt; i &amp;lt;&amp;lt; ", " &amp;lt;&amp;lt; values&lt;I&gt;.r &amp;lt;&amp;lt; ", " &amp;lt;&amp;lt; values&lt;I&gt;.i &amp;lt;&amp;lt; endl;&lt;BR /&gt; }}&lt;BR /&gt; rowIndex=new int[nRows+1];&lt;BR /&gt; {for(int i=0; i&lt;NROWS&gt;&lt;/NROWS&gt; rowIndex&lt;I&gt;=ROWINDEX&lt;I&gt;;&lt;BR /&gt; }}&lt;BR /&gt; columns=new int[nNonZeros];&lt;BR /&gt; {for(int i=0; i&lt;NNONZEROS&gt;&lt;/NNONZEROS&gt; columns&lt;I&gt;=COLUMNS&lt;I&gt;;&lt;BR /&gt; }}&lt;BR /&gt;}&lt;BR /&gt;SymmSquareMatrix::~SymmSquareMatrix(){&lt;BR /&gt; delete [] columns;&lt;BR /&gt; delete [] rowIndex;&lt;BR /&gt; delete [] values;&lt;BR /&gt;}&lt;BR /&gt;bool SymmSquareMatrix::Decompose(){&lt;BR /&gt; _INTEGER_t error;&lt;BR /&gt; MKL_INT opt = MKL_DSS_DEFAULTS;&lt;BR /&gt; MKL_INT sym = MKL_DSS_SYMMETRIC_COMPLEX;&lt;BR /&gt; MKL_INT type = MKL_DSS_HERMITIAN_INDEFINITE;&lt;BR /&gt; {for(int k=0; k&lt;NROWS&gt;&lt;/NROWS&gt; cout &amp;lt;&amp;lt; "k: " &amp;lt;&amp;lt; k &amp;lt;&amp;lt; "\t" &amp;lt;&amp;lt; rowIndex&lt;K&gt; &amp;lt;&amp;lt; endl;&lt;BR /&gt; }}&lt;BR /&gt; {for(int k=0; k&lt;NNONZEROS&gt;&lt;/NNONZEROS&gt; cout &amp;lt;&amp;lt; "icol: " &amp;lt;&amp;lt; k &amp;lt;&amp;lt; "\t" &amp;lt;&amp;lt; columns&lt;K&gt; &amp;lt;&amp;lt; endl;&lt;BR /&gt; }}&lt;BR /&gt; //&lt;BR /&gt; // Initialize the solver &lt;BR /&gt; //&lt;BR /&gt; error = dss_create(handle, opt );&lt;BR /&gt; if ( error != MKL_DSS_SUCCESS ) {&lt;BR /&gt; return false;&lt;BR /&gt; }&lt;BR /&gt; //&lt;BR /&gt; // Define the non-zero structure of the matrix &lt;BR /&gt; //&lt;BR /&gt; error = dss_define_structure(&lt;BR /&gt; handle, sym, reinterpret_cast&amp;lt;_INTEGER_t*&amp;gt;(rowIndex), nRows, nCols,&lt;BR /&gt; reinterpret_cast&amp;lt;_INTEGER_t*&amp;gt;(columns), nNonZeros );&lt;BR /&gt; if ( error != MKL_DSS_SUCCESS ) {&lt;BR /&gt; return false;&lt;BR /&gt; }&lt;BR /&gt; //&lt;BR /&gt; // Reorder the matrix &lt;BR /&gt; // &lt;BR /&gt; error = dss_reorder(handle, opt, 0);&lt;BR /&gt; if ( error != MKL_DSS_SUCCESS ) {&lt;BR /&gt; return false;&lt;BR /&gt; }&lt;BR /&gt; //&lt;BR /&gt; // Factor the matrix &lt;BR /&gt; //&lt;BR /&gt; //error = dss_factor_complex(handle, type, reinterpret_cast&amp;lt;_DOUBLE_COMPLEX_t*&amp;gt;(values) );&lt;BR /&gt; error = dss_factor_complex(handle, type, values );&lt;BR /&gt; if ( error != MKL_DSS_SUCCESS ) {&lt;BR /&gt; return false;&lt;BR /&gt; }&lt;BR /&gt; return true;&lt;BR /&gt;}&lt;BR /&gt;bool SymmSquareMatrix::Solve(){&lt;BR /&gt; //complex &lt;DOUBLE&gt;* rhs=new complex &lt;DOUBLE&gt;[nCols];&lt;BR /&gt; //complex &lt;DOUBLE&gt;* soln=new complex &lt;DOUBLE&gt;[nCols];&lt;BR /&gt; _DOUBLE_COMPLEX_t* rhs=new _DOUBLE_COMPLEX_t[nCols];&lt;BR /&gt; _DOUBLE_COMPLEX_t* soln=new _DOUBLE_COMPLEX_t[nCols];&lt;BR /&gt; {for(int i=0; i&lt;NCOLS&gt;&lt;/NCOLS&gt; rhs&lt;I&gt;.r=real(RHS&lt;I&gt;);&lt;BR /&gt; rhs&lt;I&gt;.i=imag(RHS&lt;I&gt;);&lt;BR /&gt; cout &amp;lt;&amp;lt; " rhs: i=" &amp;lt;&amp;lt; i &amp;lt;&amp;lt; ", " &amp;lt;&amp;lt; rhs&lt;I&gt;.r &amp;lt;&amp;lt; ", " &amp;lt;&amp;lt; rhs&lt;I&gt;.i &amp;lt;&amp;lt; endl;&lt;BR /&gt; }}&lt;BR /&gt; _INTEGER_t error;&lt;BR /&gt; MKL_INT opt = MKL_DSS_DEFAULTS;&lt;BR /&gt; MKL_INT sym = MKL_DSS_SYMMETRIC_COMPLEX;&lt;BR /&gt; MKL_INT type = MKL_DSS_HERMITIAN_INDEFINITE;&lt;BR /&gt; _INTEGER_t nRhs=1;&lt;BR /&gt; //&lt;BR /&gt; // Solve &lt;BR /&gt; //&lt;BR /&gt; //error = dss_solve_complex(handle, opt, reinterpret_cast&amp;lt;_DOUBLE_COMPLEX_t*&amp;gt;(rhs), nRhs, soln );&lt;BR /&gt; error = dss_solve_complex(handle, opt, rhs, nRhs, soln );&lt;BR /&gt; if ( error != MKL_DSS_SUCCESS ) {&lt;BR /&gt; return false;&lt;BR /&gt; }&lt;BR /&gt; {for(int i=0; i&lt;NCOLS&gt;&lt;/NCOLS&gt; cout &amp;lt;&amp;lt; " soln: i = " &amp;lt;&amp;lt; i &amp;lt;&amp;lt; ", " &amp;lt;&amp;lt; soln&lt;I&gt;.r &amp;lt;&amp;lt; ", " &amp;lt;&amp;lt; soln&lt;I&gt;.i &amp;lt;&amp;lt; endl;&lt;BR /&gt; }}&lt;BR /&gt; delete [] soln;&lt;BR /&gt; delete [] rhs;&lt;BR /&gt; return true;&lt;BR /&gt;}&lt;BR /&gt;int main(){&lt;BR /&gt; SymmSquareMatrix SymmMat;&lt;BR /&gt; bool isOK=false;&lt;BR /&gt; isOK=SymmMat.Decompose();&lt;BR /&gt; if(!isOK){&lt;BR /&gt; return 1;&lt;BR /&gt; }&lt;BR /&gt; isOK=SymmMat.Solve();&lt;BR /&gt; if(!isOK){&lt;BR /&gt; return 1;&lt;BR /&gt; }&lt;BR /&gt; return 0;&lt;BR /&gt;}&lt;BR /&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/DOUBLE&gt;&lt;/DOUBLE&gt;&lt;/DOUBLE&gt;&lt;/DOUBLE&gt;&lt;/K&gt;&lt;/K&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/DOUBLE&gt;&lt;/DOUBLE&gt;&lt;/DOUBLE&gt;&lt;/DOUBLE&gt;&lt;/DOUBLE&gt;&lt;/DOUBLE&gt;&lt;/DOUBLE&gt;&lt;/DOUBLE&gt;&lt;/DOUBLE&gt;&lt;/DOUBLE&gt;&lt;/DOUBLE&gt;&lt;/DOUBLE&gt;&lt;/DOUBLE&gt;&lt;/DOUBLE&gt;&lt;/DOUBLE&gt;&lt;/DOUBLE&gt;&lt;/DOUBLE&gt;&lt;/DOUBLE&gt;&lt;/COMPLEX&gt;&lt;/MATH.H&gt;&lt;/IOSTREAM&gt;&lt;/STDLIB.H&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Thu, 01 Sep 2011 21:11:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Trouble-using-MKL-DSS-subroutines/m-p/763353#M64</guid>
      <dc:creator>vijay1</dc:creator>
      <dc:date>2011-09-01T21:11:58Z</dc:date>
    </item>
    <item>
      <title>Trouble using MKL DSS subroutines</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Trouble-using-MKL-DSS-subroutines/m-p/763354#M65</link>
      <description>Hi Vijay,&lt;BR /&gt;&lt;BR /&gt;The problem in this testcase is that you try to solveHermitian matrix, and itmust have real numbers on the diagonal (by the definition of Hermitian matrix), but it does contain non-zero imaginary parts on the diagonal.&lt;BR /&gt;&lt;BR /&gt;For the moment, PARDISO is not able to ignore imaginary part of diagonal elements, so you should explicitly set them to zero.&lt;BR /&gt;&lt;BR /&gt;Sorry for this inconvinience, and I hope this little change ofyour program will not be an issue for you.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Konstantin&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 02 Sep 2011 05:24:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Trouble-using-MKL-DSS-subroutines/m-p/763354#M65</guid>
      <dc:creator>Konstantin_A_Intel</dc:creator>
      <dc:date>2011-09-02T05:24:10Z</dc:date>
    </item>
    <item>
      <title>Trouble using MKL DSS subroutines</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Trouble-using-MKL-DSS-subroutines/m-p/763355#M66</link>
      <description>Hi Konstantin,&lt;BR /&gt;&lt;BR /&gt;Thanks for the reply. The matrices I solve are typically complex and symmetric (not hermitian, though). So I just changed the MKL DSS options in the earlier code (keeping the rest of the code the same) to the following. Now I get the correct results. Thanks again for your help.&lt;BR /&gt;&lt;BR /&gt;MKL_INT opt = MKL_DSS_DEFAULTS;&lt;BR /&gt;MKL_INT sym = MKL_DSS_SYMMETRIC;&lt;BR /&gt;MKL_INT type = MKL_DSS_INDEFINITE;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Vijay</description>
      <pubDate>Fri, 02 Sep 2011 18:18:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Trouble-using-MKL-DSS-subroutines/m-p/763355#M66</guid>
      <dc:creator>vijay1</dc:creator>
      <dc:date>2011-09-02T18:18:54Z</dc:date>
    </item>
    <item>
      <title>Trouble using MKL DSS subroutines</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Trouble-using-MKL-DSS-subroutines/m-p/763356#M67</link>
      <description>Hi Vijay,&lt;BR /&gt;&lt;BR /&gt;Very good news! Feel free to askhelp in case of any new questions.&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Konstantin</description>
      <pubDate>Mon, 05 Sep 2011 03:01:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Trouble-using-MKL-DSS-subroutines/m-p/763356#M67</guid>
      <dc:creator>Konstantin_A_Intel</dc:creator>
      <dc:date>2011-09-05T03:01:25Z</dc:date>
    </item>
  </channel>
</rss>

