<?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 pardiso free() memory errors in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/pardiso-free-memory-errors/m-p/878866#M9309</link>
    <description>I am trying to use pardiso to solve a matrix inversion problem. I have made a small example to test out my calls to the solver. When I run my example I receive the following message:&lt;BR /&gt;&lt;BR /&gt;*** glibc detected *** free(): invalid next size (fast): 0x00000000009f34b0 ***&lt;BR /&gt;Abort&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The code for my example is as follows:&lt;BR /&gt; void *pt[64];&lt;BR /&gt; for(int i=0;i&amp;lt;64;i++) {pt&lt;I&gt; = 0;}&lt;BR /&gt; int maxfct = 1;&lt;BR /&gt; int mnum = 1;&lt;BR /&gt; int mtype = -2; // real symmetric positive indefinite&lt;BR /&gt; int phase = 13; // do all steps, analysis, factor, solve, refine&lt;BR /&gt; int n = 6;&lt;BR /&gt; int *perm = NULL; // pardiso does it's own permutation&lt;BR /&gt; int nrhs = 18; // number of equations = num columns of E = size of interface&lt;BR /&gt; int *iparm = NULL;&lt;BR /&gt; if(!(iparm = (int *)malloc(64*sizeof(int)))) exit(-1);&lt;BR /&gt; iparm[0] = 0; // use default values for now&lt;BR /&gt; iparm[2] = 1; // MUST be equal to num threads&lt;BR /&gt; mkl_set_num_threads(1);&lt;BR /&gt; int msglvl = 1; // print out statistics for now&lt;BR /&gt; int error = 0; &lt;BR /&gt;&lt;BR /&gt; double nzval[12] = {109.018, -12.8205, -0.0437675, -83.3333, 31.9348, -0.0437675, 12.5438, -6.25, 18.7938, 83.3333, 1, -20};&lt;BR /&gt; int colidx[12] = {0, 1, 2, 4, 1, 3, 2, 3, 3, 4, 5, 5};&lt;BR /&gt; int rowptr[7] = {0, 4, 6, 8, 9, 11, 12};&lt;BR /&gt;&lt;BR /&gt; double B[108] = {0, -12.8205, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -12.8205, 0, -6.25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -6.25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -6.25, 0, 0, -6.25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};&lt;BR /&gt; double X[108];&lt;BR /&gt;&lt;BR /&gt; cout &amp;lt;&amp;lt; "starting
";&lt;BR /&gt; pardiso_(pt, &amp;amp;maxfct, &amp;amp;mnum, &amp;amp;mtype, &amp;amp;phase, &amp;amp;n, nzval, rowptr, colidx, perm, &amp;amp;nrhs, iparm, &amp;amp;msglvl, B, X, &amp;amp;error);&lt;BR /&gt;&lt;BR /&gt;I am using C++ code with the gcc compiler and am statically linking with the libmkl_solver_lp64.a library. The compilation and linking steps produce no errors or warnings.&lt;BR /&gt;&lt;BR /&gt;Any clues why this does not work?&lt;BR /&gt;&lt;BR /&gt;Also, is B expected in row-major or column-major order?&lt;BR /&gt;For example, if b(i) = i; Then the matrix B should be:&lt;BR /&gt;1 2 3&lt;BR /&gt;4 5 6&lt;BR /&gt;7 8 9 = row-major&lt;BR /&gt;or&lt;BR /&gt;1 4 7&lt;BR /&gt;2 5 8&lt;BR /&gt;3 6 9 = col-major&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;-Michael-&lt;BR /&gt;&lt;/I&gt;</description>
    <pubDate>Mon, 02 Jun 2008 21:42:47 GMT</pubDate>
    <dc:creator>mbhealy</dc:creator>
    <dc:date>2008-06-02T21:42:47Z</dc:date>
    <item>
      <title>pardiso free() memory errors</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/pardiso-free-memory-errors/m-p/878866#M9309</link>
      <description>I am trying to use pardiso to solve a matrix inversion problem. I have made a small example to test out my calls to the solver. When I run my example I receive the following message:&lt;BR /&gt;&lt;BR /&gt;*** glibc detected *** free(): invalid next size (fast): 0x00000000009f34b0 ***&lt;BR /&gt;Abort&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The code for my example is as follows:&lt;BR /&gt; void *pt[64];&lt;BR /&gt; for(int i=0;i&amp;lt;64;i++) {pt&lt;I&gt; = 0;}&lt;BR /&gt; int maxfct = 1;&lt;BR /&gt; int mnum = 1;&lt;BR /&gt; int mtype = -2; // real symmetric positive indefinite&lt;BR /&gt; int phase = 13; // do all steps, analysis, factor, solve, refine&lt;BR /&gt; int n = 6;&lt;BR /&gt; int *perm = NULL; // pardiso does it's own permutation&lt;BR /&gt; int nrhs = 18; // number of equations = num columns of E = size of interface&lt;BR /&gt; int *iparm = NULL;&lt;BR /&gt; if(!(iparm = (int *)malloc(64*sizeof(int)))) exit(-1);&lt;BR /&gt; iparm[0] = 0; // use default values for now&lt;BR /&gt; iparm[2] = 1; // MUST be equal to num threads&lt;BR /&gt; mkl_set_num_threads(1);&lt;BR /&gt; int msglvl = 1; // print out statistics for now&lt;BR /&gt; int error = 0; &lt;BR /&gt;&lt;BR /&gt; double nzval[12] = {109.018, -12.8205, -0.0437675, -83.3333, 31.9348, -0.0437675, 12.5438, -6.25, 18.7938, 83.3333, 1, -20};&lt;BR /&gt; int colidx[12] = {0, 1, 2, 4, 1, 3, 2, 3, 3, 4, 5, 5};&lt;BR /&gt; int rowptr[7] = {0, 4, 6, 8, 9, 11, 12};&lt;BR /&gt;&lt;BR /&gt; double B[108] = {0, -12.8205, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -12.8205, 0, -6.25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -6.25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -6.25, 0, 0, -6.25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};&lt;BR /&gt; double X[108];&lt;BR /&gt;&lt;BR /&gt; cout &amp;lt;&amp;lt; "starting
";&lt;BR /&gt; pardiso_(pt, &amp;amp;maxfct, &amp;amp;mnum, &amp;amp;mtype, &amp;amp;phase, &amp;amp;n, nzval, rowptr, colidx, perm, &amp;amp;nrhs, iparm, &amp;amp;msglvl, B, X, &amp;amp;error);&lt;BR /&gt;&lt;BR /&gt;I am using C++ code with the gcc compiler and am statically linking with the libmkl_solver_lp64.a library. The compilation and linking steps produce no errors or warnings.&lt;BR /&gt;&lt;BR /&gt;Any clues why this does not work?&lt;BR /&gt;&lt;BR /&gt;Also, is B expected in row-major or column-major order?&lt;BR /&gt;For example, if b(i) = i; Then the matrix B should be:&lt;BR /&gt;1 2 3&lt;BR /&gt;4 5 6&lt;BR /&gt;7 8 9 = row-major&lt;BR /&gt;or&lt;BR /&gt;1 4 7&lt;BR /&gt;2 5 8&lt;BR /&gt;3 6 9 = col-major&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;-Michael-&lt;BR /&gt;&lt;/I&gt;</description>
      <pubDate>Mon, 02 Jun 2008 21:42:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/pardiso-free-memory-errors/m-p/878866#M9309</guid>
      <dc:creator>mbhealy</dc:creator>
      <dc:date>2008-06-02T21:42:47Z</dc:date>
    </item>
    <item>
      <title>Re: pardiso free() memory errors</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/pardiso-free-memory-errors/m-p/878867#M9310</link>
      <description>I may have missed this somewhere in the documentation, but apparently even the C version of Pardiso expects 1 based indexing.&lt;BR /&gt;&lt;BR /&gt;The code above provides correct results when you increment every element of the colidx and rowptr arrays (corresponding to ja and ia in the documentation).&lt;BR /&gt;</description>
      <pubDate>Tue, 03 Jun 2008 15:58:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/pardiso-free-memory-errors/m-p/878867#M9310</guid>
      <dc:creator>mbhealy</dc:creator>
      <dc:date>2008-06-03T15:58:34Z</dc:date>
    </item>
  </channel>
</rss>

