<?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 Thank you very much for help. in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dss-reorder-gives-access-violation-error/m-p/1075135#M22535</link>
    <description>&lt;P&gt;Thank you very much for help.&lt;/P&gt;

&lt;P&gt;I use&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;    MKL_INT info;
    MKL_INT job[8] = { 1, // COO to CSR  // Need 2 here to get correct conversion
        1, // 1 based indexing in CSR rows
        1, // 1 based indexing in CSR cols
        0, // 
        nnz, // number of the non-zero elements
        0, // job indicator
        0,
        0
    };

    mkl_dcsrcoo(job, &amp;amp;m, a_csr, j_csr, i_csr, &amp;amp;nnz,  acoo, rowind, colind, &amp;amp;info);&lt;/PRE&gt;

&lt;P&gt;to convert matrix to CSR format.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;When changed job[0] to 2 error was resolved.&lt;/P&gt;</description>
    <pubDate>Wed, 05 Apr 2017 20:20:19 GMT</pubDate>
    <dc:creator>andrey_s_</dc:creator>
    <dc:date>2017-04-05T20:20:19Z</dc:date>
    <item>
      <title>dss_reorder gives access violation error.</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dss-reorder-gives-access-violation-error/m-p/1075132#M22532</link>
      <description>&lt;P&gt;I'm trying to solve sparse symmetric system:&lt;/P&gt;

&lt;P&gt;Matrix A looks like this (I set unly one half, like in example code &amp;nbsp;dss_sym_c.c ):&lt;/P&gt;

&lt;PRE class="brush:;"&gt;[[  1.17  -0.08   0.    -0.09   0.     0.     0.     0.     0.  ]
 [  0.     6.98  -1.73   0.    -4.16   0.     0.     0.     0.  ]
 [  0.     0.    10.5    0.     0.    -7.77   0.     0.     0.  ]
 [  0.     0.     0.     3.68  -0.86   0.    -1.73   0.     0.  ]
 [  0.     0.     0.     0.    13.55  -2.14   0.    -5.37   0.  ]
 [  0.     0.     0.     0.     0.    19.9    0.     0.    -8.97]
 [  0.     0.     0.     0.     0.     0.     4.04  -1.3    0.  ]
 [  0.     0.     0.     0.     0.     0.     0.    10.23  -2.55]
 [  0.     0.     0.     0.     0.     0.     0.     0.    12.53]]&lt;/PRE&gt;

&lt;P&gt;And RHS:&lt;/P&gt;

&lt;PRE class="brush:;"&gt;[1,2,3,4,5,6,7,8,9]&lt;/PRE&gt;

&lt;P&gt;The sample code after substitution of my data:&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;#include&amp;lt;stdio.h&amp;gt;
#include&amp;lt;stdlib.h&amp;gt;
#include&amp;lt;math.h&amp;gt;
#include "mkl_dss.h"
#include "mkl_types.h"
/*
** Define the array and rhs vectors
*/
#define NROWS       9
#define NCOLS       9
#define NNONZEROS   23
#define NRHS        1
static const MKL_INT nRows = NROWS;
static const MKL_INT nCols = NCOLS;
static const MKL_INT nNonZeros = NNONZEROS;
static const MKL_INT nRhs = NRHS;

static _INTEGER_t rowIndex[NROWS + 1] = { 1,4,7,10,13,16,19,21,23,24 };
static _INTEGER_t columns[NNONZEROS] = { 4, 2, 1, 5, 3, 2, 6, 4, 3, 7, 5, 4, 8, 6, 5, 9, 7, 6, 8, 7, 9, 8, 9 };
static _DOUBLE_PRECISION_t values[NNONZEROS] = { -0.09,-0.08,1.17,-4.16,-1.73,6.98,-7.77,0,10.5,-1.73,-0.86,3.68,-5.37,-2.14,13.55,-8.97,0,19.90,-1.30,4.04,-2.55,10.23,12.53 };
static _DOUBLE_PRECISION_t rhs[NCOLS] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };

int main()
{

    /* Allocate storage for the solver handle and the right-hand side. */
    _DOUBLE_PRECISION_t solValues[NROWS];
    _MKL_DSS_HANDLE_t handle;
    _INTEGER_t error;
    MKL_INT opt = MKL_DSS_DEFAULTS;
    MKL_INT sym = MKL_DSS_NON_SYMMETRIC;
    MKL_INT type = MKL_DSS_POSITIVE_DEFINITE;
    /* --------------------- */
    /* Initialize the solver */
    /* --------------------- */
    error = dss_create(handle, opt);
    if (error != MKL_DSS_SUCCESS)
        goto printError;
    /* ------------------------------------------- */
    /* Define the non-zero structure of the matrix */
    /* ------------------------------------------- */
    error = dss_define_structure(handle, sym, rowIndex, nRows, nCols, columns, nNonZeros);
    if (error != MKL_DSS_SUCCESS)
        goto printError;
    /* ------------------ */
    /* Reorder the matrix */
    /* ------------------ */
    error = dss_reorder(handle, opt, 0); // &amp;lt;&amp;lt;&amp;lt;&amp;lt; --------- This line gives access violation error. 
    if (error != MKL_DSS_SUCCESS)
        goto printError;
    /* ------------------ */
    /* Factor the matrix  */
    /* ------------------ */
    error = dss_factor_real(handle, type, values);
    if (error != MKL_DSS_SUCCESS)
        goto printError;
    /* ------------------------ */
    /* Get the solution vector  */
    /* ------------------------ */
    error = dss_solve_real(handle, opt, rhs, nRhs, solValues);
    if (error != MKL_DSS_SUCCESS)
        goto printError;

    /* -------------------------- */
    /* Deallocate solver storage  */
    /* -------------------------- */
    error = dss_delete(handle, opt);
    if (error != MKL_DSS_SUCCESS)
        goto printError;
    /* ---------------------- */
    /* Print solution vector  */
    /* ---------------------- */
    printf(" Solution array: ");
    for (int i = 0; i &amp;lt; nCols; i++)
        printf(" %g", solValues&lt;I&gt;);
    printf("\n");

    getchar();

    exit(0);
printError:
    printf("Solver returned error code %d\n", error);
    exit(1);
}
&lt;/I&gt;&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;The python code I checked my matrix:&lt;/P&gt;

&lt;PRE class="brush:python;"&gt;import numpy as np
from scipy.sparse import csr_matrix

indptr = np.array([1,4,7,10,13,16,19,21,23,24])
indices = np.array([4,2,1,5,3,2,6,4,3,7,5,4,8,6,5,9,7,6,8,7,9,8,9])

indptr-=1;
indices-=1;

data = np.array([-0.09,-0.08,1.17,-4.16,-1.73,6.98,-7.77,0,10.5,-1.73,-0.86,3.68,-5.37,-2.14,13.55,-8.97,0,19.90,-1.30,4.04,-2.55,10.23,12.53 ])

print(csr_matrix( (data,indices,indptr), shape=(9,9) ).todense())&lt;/PRE&gt;

&lt;P&gt;Can you help me please ? What I made wrong ?&lt;/P&gt;</description>
      <pubDate>Wed, 05 Apr 2017 16:34:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dss-reorder-gives-access-violation-error/m-p/1075132#M22532</guid>
      <dc:creator>andrey_s_</dc:creator>
      <dc:date>2017-04-05T16:34:39Z</dc:date>
    </item>
    <item>
      <title>what version of mkl do you</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dss-reorder-gives-access-violation-error/m-p/1075133#M22533</link>
      <description>&lt;P&gt;what version of mkl do you use? we had some problem on the reordering stage with MKL 2017 beta. DSS API doesn't contains matrix checker option. You may try to use check if the input matrix is valid by using Pardiso API and set iparm[26]=1.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Apr 2017 20:01:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dss-reorder-gives-access-violation-error/m-p/1075133#M22533</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2017-04-05T20:01:52Z</dc:date>
    </item>
    <item>
      <title>You have to provide the</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dss-reorder-gives-access-violation-error/m-p/1075134#M22534</link>
      <description>&lt;P&gt;You have to provide the columns of the nonzero elements in each row in increasing order -- {{1,2,4}, {2,3,5},...}. Similarly for the data values array. See the DSS section of the MKL documentation for details.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Apr 2017 20:05:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dss-reorder-gives-access-violation-error/m-p/1075134#M22534</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2017-04-05T20:05:23Z</dc:date>
    </item>
    <item>
      <title>Thank you very much for help.</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dss-reorder-gives-access-violation-error/m-p/1075135#M22535</link>
      <description>&lt;P&gt;Thank you very much for help.&lt;/P&gt;

&lt;P&gt;I use&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;    MKL_INT info;
    MKL_INT job[8] = { 1, // COO to CSR  // Need 2 here to get correct conversion
        1, // 1 based indexing in CSR rows
        1, // 1 based indexing in CSR cols
        0, // 
        nnz, // number of the non-zero elements
        0, // job indicator
        0,
        0
    };

    mkl_dcsrcoo(job, &amp;amp;m, a_csr, j_csr, i_csr, &amp;amp;nnz,  acoo, rowind, colind, &amp;amp;info);&lt;/PRE&gt;

&lt;P&gt;to convert matrix to CSR format.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;When changed job[0] to 2 error was resolved.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Apr 2017 20:20:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dss-reorder-gives-access-violation-error/m-p/1075135#M22535</guid>
      <dc:creator>andrey_s_</dc:creator>
      <dc:date>2017-04-05T20:20:19Z</dc:date>
    </item>
  </channel>
</rss>

