<?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 MKL-DSS-DSS-Error, reordering problem in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-DSS-DSS-Error-reordering-problem/m-p/1004255#M18784</link>
    <description>&lt;P&gt;I am trying to solve a sparse system of equations but I am getting this error "MKL-DSS-DSS-Error, reordering problem" without any more specifics on what the error is. This is what my code looks like:&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;#include "mkl_dss.h"&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;#include "mkl_types.h"&lt;BR /&gt;
	/*&lt;BR /&gt;
	** Define the array and rhs vectors&lt;BR /&gt;
	*/&lt;BR /&gt;
	//#define NROWS &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;5&lt;BR /&gt;
	//#define NCOLS &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;5&lt;BR /&gt;
	//#define NNONZEROS &amp;nbsp;&amp;nbsp; &amp;nbsp;9&lt;BR /&gt;
	//#define NRHS &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;1&lt;BR /&gt;
	#if defined(MKL_ILP64)&lt;BR /&gt;
	#define MKL_INT long long&lt;BR /&gt;
	#else&lt;BR /&gt;
	#define MKL_INT int&lt;BR /&gt;
	#endif&lt;BR /&gt;
	//static const MKL_INT nRows = &amp;nbsp; &amp;nbsp; NROWS &amp;nbsp;&amp;nbsp; &amp;nbsp;;&lt;BR /&gt;
	//static const MKL_INT nCols = &amp;nbsp; &amp;nbsp; NCOLS &amp;nbsp;&amp;nbsp; &amp;nbsp;;&lt;BR /&gt;
	//static const MKL_INT nNonZeros = NNONZEROS &amp;nbsp;;&lt;BR /&gt;
	//static const MKL_INT nRhs = &amp;nbsp; &amp;nbsp; &amp;nbsp;NRHS &amp;nbsp;&amp;nbsp; &amp;nbsp;;&lt;BR /&gt;
	//static _INTEGER_t rowIndex[NROWS+1] = { 1, 6, 7, 8, 9, 10 };&lt;BR /&gt;
	//static _INTEGER_t columns[NNONZEROS] = { 1, 2, 3, 4, 5, 2, 3, 4, 5 };&lt;BR /&gt;
	//static _DOUBLE_PRECISION_t values[NNONZEROS] = { 9, 1.5, 6, .75, 3, 0.5, 12, .625, 16 };&lt;BR /&gt;
	//static _DOUBLE_PRECISION_t rhs[NCOLS] = { 1, 2, 3, 4, 5 };&lt;/P&gt;

&lt;P&gt;void mkl_dss(double* K, int* col_ind, int* row_ptr, double* F, int nn, int nnz) {&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;MKL_INT nRows = 2*nn;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;MKL_INT nCols = 2*nn;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;MKL_INT nNonZeros = nnz;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;MKL_INT nRhs = 1;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;MKL_INT i;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;_INTEGER_t *rowIndex, *columns;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;_DOUBLE_PRECISION_t *values, *rhs, *solValues;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;rowIndex = new _INTEGER_t[nRows + 1];&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;columns = new _INTEGER_t[nnz];&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;values = new _DOUBLE_PRECISION_t[nnz];&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;rhs = new _DOUBLE_PRECISION_t[nCols];&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;solValues = new _DOUBLE_PRECISION_t[nCols];&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;for(i = 0; i &amp;lt; nnz; i++){&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;values&lt;I&gt; = K&lt;I&gt;;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;columns&lt;I&gt; = col_ind&lt;I&gt;;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;for(i = 0; i &amp;lt; nRows + 1; i++)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;rowIndex&lt;I&gt; = row_ptr&lt;I&gt;;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;for(i = 0; i &amp;lt; nCols; i++){&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;rhs&lt;I&gt; = F&lt;I&gt;;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;solValues&lt;I&gt; = 0.0;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;/* Allocate storage for the solver handle and the right-hand side. */&lt;BR /&gt;
	//&amp;nbsp;&amp;nbsp; &amp;nbsp;_DOUBLE_PRECISION_t solValues[NROWS];&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;_MKL_DSS_HANDLE_t handle;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;_INTEGER_t error;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;_CHARACTER_t statIn[] = "determinant";&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;_DOUBLE_PRECISION_t statOut[5];&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;MKL_INT opt = MKL_DSS_DEFAULTS;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;MKL_INT sym = MKL_DSS_SYMMETRIC;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;MKL_INT type = MKL_DSS_POSITIVE_DEFINITE;&lt;BR /&gt;
	/* --------------------- */&lt;BR /&gt;
	/* Initialize the solver */&lt;BR /&gt;
	/* --------------------- */&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;error = dss_create(handle, opt );&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;if ( error != MKL_DSS_SUCCESS ) goto printError;&lt;BR /&gt;
	/* ------------------------------------------- */&lt;BR /&gt;
	/* Define the non-zero structure of the matrix */&lt;BR /&gt;
	/* ------------------------------------------- */&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;error = dss_define_structure(&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;handle, sym, rowIndex, nRows, nCols,&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;columns, nNonZeros );&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;if ( error != MKL_DSS_SUCCESS ) goto printError;&lt;BR /&gt;
	/* ------------------ */&lt;BR /&gt;
	/* Reorder the matrix */&lt;BR /&gt;
	/* ------------------ */&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;error = dss_reorder( handle, opt, 0);&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;if ( error != MKL_DSS_SUCCESS ) goto printError;&lt;BR /&gt;
	/* ------------------ */&lt;BR /&gt;
	/* Factor the matrix */&lt;BR /&gt;
	/* ------------------ */&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;error = dss_factor_real( handle, type, values );&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;if ( error != MKL_DSS_SUCCESS ) goto printError;&lt;BR /&gt;
	/* ------------------------ */&lt;BR /&gt;
	/* Get the solution vector */&lt;BR /&gt;
	/* ------------------------ */&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;error = dss_solve_real( handle, opt, rhs, nRhs, solValues );&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;if ( error != MKL_DSS_SUCCESS ) goto printError;&lt;BR /&gt;
	/* ------------------------ */&lt;BR /&gt;
	/* Get the determinant (not for a diagonal matrix) */&lt;BR /&gt;
	/*--------------------------*/&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;if ( nRows &amp;lt; nNonZeros ) {&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;error = dss_statistics(handle, opt, statIn, statOut);&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if ( error != MKL_DSS_SUCCESS ) goto printError;&lt;BR /&gt;
	/*-------------------------*/&lt;BR /&gt;
	/* print determinant */&lt;BR /&gt;
	/*-------------------------*/&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;printf(" determinant power is %g \n", statOut[0]);&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;printf(" determinant base is %g \n", statOut[1]);&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;printf(" Determinant is %g \n", (pow(10.0,statOut[0]))*statOut[1]);&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt;
	/* -------------------------- */&lt;BR /&gt;
	/* Deallocate solver storage */&lt;BR /&gt;
	/* -------------------------- */&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;error = dss_delete( handle, opt );&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;if ( error != MKL_DSS_SUCCESS ) goto printError;&lt;BR /&gt;
	/* ---------------------- */&lt;BR /&gt;
	/* Print solution vector */&lt;BR /&gt;
	/* ---------------------- */&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;printf(" Solution array: ");&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;for(i = 0; i&amp;lt; nCols; i++)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;printf(" %g", solValues&lt;I&gt; );&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;printf("\n");&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;
	printError:&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;printf("Solver returned error code %d\n", error);&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;for(i = 0; i &amp;lt; nCols; i++)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;F&lt;I&gt; = solValues&lt;I&gt;;&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;delete[] rowIndex;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;delete[] columns;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;delete[] values;&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;delete[] rhs;&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;delete[] solValues;&lt;BR /&gt;
	}&lt;/P&gt;

&lt;P&gt;The same piece of code worked for the default example problem, so I know the sparse solver compiles and links correctly. But it does not work when I use my own set of arrays. I have a hunch that opt = MKL_DSS_DEFAULTS is not working as it should. Should I be using something different ? I have used Fortran style indexing (starting from 1) for the columns and row index vectors. I have also tried zero based indexing and set the &lt;SPAN style="color: rgb(102, 102, 102); font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px;"&gt;opt = MKL_DSS_MSG_LVL_WARNING + MKL_DSS_TERM_LVL_ERROR+MKL_DSS_ZERO_BASED_INDEXING which also did not work.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 29 Aug 2015 14:23:12 GMT</pubDate>
    <dc:creator>Naveen_P_</dc:creator>
    <dc:date>2015-08-29T14:23:12Z</dc:date>
    <item>
      <title>MKL-DSS-DSS-Error, reordering problem</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-DSS-DSS-Error-reordering-problem/m-p/1004255#M18784</link>
      <description>&lt;P&gt;I am trying to solve a sparse system of equations but I am getting this error "MKL-DSS-DSS-Error, reordering problem" without any more specifics on what the error is. This is what my code looks like:&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;#include "mkl_dss.h"&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;#include "mkl_types.h"&lt;BR /&gt;
	/*&lt;BR /&gt;
	** Define the array and rhs vectors&lt;BR /&gt;
	*/&lt;BR /&gt;
	//#define NROWS &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;5&lt;BR /&gt;
	//#define NCOLS &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;5&lt;BR /&gt;
	//#define NNONZEROS &amp;nbsp;&amp;nbsp; &amp;nbsp;9&lt;BR /&gt;
	//#define NRHS &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;1&lt;BR /&gt;
	#if defined(MKL_ILP64)&lt;BR /&gt;
	#define MKL_INT long long&lt;BR /&gt;
	#else&lt;BR /&gt;
	#define MKL_INT int&lt;BR /&gt;
	#endif&lt;BR /&gt;
	//static const MKL_INT nRows = &amp;nbsp; &amp;nbsp; NROWS &amp;nbsp;&amp;nbsp; &amp;nbsp;;&lt;BR /&gt;
	//static const MKL_INT nCols = &amp;nbsp; &amp;nbsp; NCOLS &amp;nbsp;&amp;nbsp; &amp;nbsp;;&lt;BR /&gt;
	//static const MKL_INT nNonZeros = NNONZEROS &amp;nbsp;;&lt;BR /&gt;
	//static const MKL_INT nRhs = &amp;nbsp; &amp;nbsp; &amp;nbsp;NRHS &amp;nbsp;&amp;nbsp; &amp;nbsp;;&lt;BR /&gt;
	//static _INTEGER_t rowIndex[NROWS+1] = { 1, 6, 7, 8, 9, 10 };&lt;BR /&gt;
	//static _INTEGER_t columns[NNONZEROS] = { 1, 2, 3, 4, 5, 2, 3, 4, 5 };&lt;BR /&gt;
	//static _DOUBLE_PRECISION_t values[NNONZEROS] = { 9, 1.5, 6, .75, 3, 0.5, 12, .625, 16 };&lt;BR /&gt;
	//static _DOUBLE_PRECISION_t rhs[NCOLS] = { 1, 2, 3, 4, 5 };&lt;/P&gt;

&lt;P&gt;void mkl_dss(double* K, int* col_ind, int* row_ptr, double* F, int nn, int nnz) {&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;MKL_INT nRows = 2*nn;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;MKL_INT nCols = 2*nn;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;MKL_INT nNonZeros = nnz;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;MKL_INT nRhs = 1;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;MKL_INT i;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;_INTEGER_t *rowIndex, *columns;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;_DOUBLE_PRECISION_t *values, *rhs, *solValues;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;rowIndex = new _INTEGER_t[nRows + 1];&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;columns = new _INTEGER_t[nnz];&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;values = new _DOUBLE_PRECISION_t[nnz];&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;rhs = new _DOUBLE_PRECISION_t[nCols];&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;solValues = new _DOUBLE_PRECISION_t[nCols];&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;for(i = 0; i &amp;lt; nnz; i++){&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;values&lt;I&gt; = K&lt;I&gt;;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;columns&lt;I&gt; = col_ind&lt;I&gt;;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;for(i = 0; i &amp;lt; nRows + 1; i++)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;rowIndex&lt;I&gt; = row_ptr&lt;I&gt;;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;for(i = 0; i &amp;lt; nCols; i++){&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;rhs&lt;I&gt; = F&lt;I&gt;;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;solValues&lt;I&gt; = 0.0;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;/* Allocate storage for the solver handle and the right-hand side. */&lt;BR /&gt;
	//&amp;nbsp;&amp;nbsp; &amp;nbsp;_DOUBLE_PRECISION_t solValues[NROWS];&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;_MKL_DSS_HANDLE_t handle;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;_INTEGER_t error;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;_CHARACTER_t statIn[] = "determinant";&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;_DOUBLE_PRECISION_t statOut[5];&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;MKL_INT opt = MKL_DSS_DEFAULTS;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;MKL_INT sym = MKL_DSS_SYMMETRIC;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;MKL_INT type = MKL_DSS_POSITIVE_DEFINITE;&lt;BR /&gt;
	/* --------------------- */&lt;BR /&gt;
	/* Initialize the solver */&lt;BR /&gt;
	/* --------------------- */&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;error = dss_create(handle, opt );&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;if ( error != MKL_DSS_SUCCESS ) goto printError;&lt;BR /&gt;
	/* ------------------------------------------- */&lt;BR /&gt;
	/* Define the non-zero structure of the matrix */&lt;BR /&gt;
	/* ------------------------------------------- */&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;error = dss_define_structure(&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;handle, sym, rowIndex, nRows, nCols,&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;columns, nNonZeros );&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;if ( error != MKL_DSS_SUCCESS ) goto printError;&lt;BR /&gt;
	/* ------------------ */&lt;BR /&gt;
	/* Reorder the matrix */&lt;BR /&gt;
	/* ------------------ */&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;error = dss_reorder( handle, opt, 0);&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;if ( error != MKL_DSS_SUCCESS ) goto printError;&lt;BR /&gt;
	/* ------------------ */&lt;BR /&gt;
	/* Factor the matrix */&lt;BR /&gt;
	/* ------------------ */&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;error = dss_factor_real( handle, type, values );&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;if ( error != MKL_DSS_SUCCESS ) goto printError;&lt;BR /&gt;
	/* ------------------------ */&lt;BR /&gt;
	/* Get the solution vector */&lt;BR /&gt;
	/* ------------------------ */&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;error = dss_solve_real( handle, opt, rhs, nRhs, solValues );&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;if ( error != MKL_DSS_SUCCESS ) goto printError;&lt;BR /&gt;
	/* ------------------------ */&lt;BR /&gt;
	/* Get the determinant (not for a diagonal matrix) */&lt;BR /&gt;
	/*--------------------------*/&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;if ( nRows &amp;lt; nNonZeros ) {&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;error = dss_statistics(handle, opt, statIn, statOut);&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if ( error != MKL_DSS_SUCCESS ) goto printError;&lt;BR /&gt;
	/*-------------------------*/&lt;BR /&gt;
	/* print determinant */&lt;BR /&gt;
	/*-------------------------*/&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;printf(" determinant power is %g \n", statOut[0]);&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;printf(" determinant base is %g \n", statOut[1]);&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;printf(" Determinant is %g \n", (pow(10.0,statOut[0]))*statOut[1]);&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt;
	/* -------------------------- */&lt;BR /&gt;
	/* Deallocate solver storage */&lt;BR /&gt;
	/* -------------------------- */&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;error = dss_delete( handle, opt );&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;if ( error != MKL_DSS_SUCCESS ) goto printError;&lt;BR /&gt;
	/* ---------------------- */&lt;BR /&gt;
	/* Print solution vector */&lt;BR /&gt;
	/* ---------------------- */&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;printf(" Solution array: ");&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;for(i = 0; i&amp;lt; nCols; i++)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;printf(" %g", solValues&lt;I&gt; );&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;printf("\n");&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;
	printError:&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;printf("Solver returned error code %d\n", error);&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;for(i = 0; i &amp;lt; nCols; i++)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;F&lt;I&gt; = solValues&lt;I&gt;;&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;delete[] rowIndex;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;delete[] columns;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;delete[] values;&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;delete[] rhs;&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;delete[] solValues;&lt;BR /&gt;
	}&lt;/P&gt;

&lt;P&gt;The same piece of code worked for the default example problem, so I know the sparse solver compiles and links correctly. But it does not work when I use my own set of arrays. I have a hunch that opt = MKL_DSS_DEFAULTS is not working as it should. Should I be using something different ? I have used Fortran style indexing (starting from 1) for the columns and row index vectors. I have also tried zero based indexing and set the &lt;SPAN style="color: rgb(102, 102, 102); font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px;"&gt;opt = MKL_DSS_MSG_LVL_WARNING + MKL_DSS_TERM_LVL_ERROR+MKL_DSS_ZERO_BASED_INDEXING which also did not work.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 29 Aug 2015 14:23:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-DSS-DSS-Error-reordering-problem/m-p/1004255#M18784</guid>
      <dc:creator>Naveen_P_</dc:creator>
      <dc:date>2015-08-29T14:23:12Z</dc:date>
    </item>
    <item>
      <title>If you write program based on</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-DSS-DSS-Error-reordering-problem/m-p/1004256#M18785</link>
      <description>&lt;P&gt;If you write program based on a set of assumptions, and then run it with a new set data which may not satisfy the assumptions, what can you expect?&lt;/P&gt;

&lt;P&gt;The example problem in&amp;nbsp;dss_sym_c.c is positive-definite, and this can be verified. Is your K matrix known to be positive definite? Did you correctly fill in the arrays of K in the CSR representation? If not, blindly changing options and index conventions in an attempt to fix undiagnosed errors is probably going to fail.&lt;/P&gt;</description>
      <pubDate>Sat, 29 Aug 2015 16:02:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-DSS-DSS-Error-reordering-problem/m-p/1004256#M18785</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2015-08-29T16:02:30Z</dc:date>
    </item>
    <item>
      <title>Quote:mecej4 wrote:</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-DSS-DSS-Error-reordering-problem/m-p/1004257#M18786</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;mecej4 wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;If you write program based on a set of assumptions, and then run it with a new set data which may not satisfy the assumptions, what can you expect?&lt;/P&gt;

&lt;P&gt;The example problem in&amp;nbsp;dss_sym_c.c is positive-definite, and this can be verified. Is your K matrix known to be positive definite? Did you correctly fill in the arrays of K in the CSR representation? If not, blindly changing options and index conventions in an attempt to fix undiagnosed errors is probably going to fail.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Yes I checked everything you mentioned before I posted this. My matrix is symmetric positive definite and I checked my CSR representation. I also noticed that the example problem is 1 - indexed which is why my row index and column index vectors are also 1 - indexed.&lt;/P&gt;</description>
      <pubDate>Sat, 29 Aug 2015 16:25:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-DSS-DSS-Error-reordering-problem/m-p/1004257#M18786</guid>
      <dc:creator>Naveen_P_</dc:creator>
      <dc:date>2015-08-29T16:25:28Z</dc:date>
    </item>
    <item>
      <title>Some MKL routines can work</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-DSS-DSS-Error-reordering-problem/m-p/1004258#M18787</link>
      <description>&lt;P&gt;Some MKL routines can work with 0-based &lt;STRONG&gt;and &lt;/STRONG&gt;1-based array indices. Some work &lt;STRONG&gt;only&lt;/STRONG&gt; with 1-based indices, and these can be noted by the absence of a subroutine argument to convey the indexing option that is desired.&lt;/P&gt;

&lt;P&gt;You should perhaps put together a "reproducer" and post it here.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 29 Aug 2015 16:37:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-DSS-DSS-Error-reordering-problem/m-p/1004258#M18787</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2015-08-29T16:37:34Z</dc:date>
    </item>
    <item>
      <title>This is the 4x4 matrix I used</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-DSS-DSS-Error-reordering-problem/m-p/1004259#M18788</link>
      <description>&lt;P&gt;This is the 4x4 matrix I used as an example:&lt;/P&gt;

&lt;P&gt;10000 4.69541 -4.69541 -4.69541 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; 4.69541 10000 &amp;nbsp; -4.69541 -4.69541 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; -4.69541 -4.69541 10000 4.69541 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; -4.69541 &amp;nbsp;-4.69541 4.69541 &amp;nbsp;4.69541&lt;/P&gt;

&lt;P&gt;The Rhs is Transpose{0 0 0 1000}&lt;/P&gt;

&lt;P&gt;The arrays I used as entry into mkl_dss are:&lt;/P&gt;

&lt;P&gt;K &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Columns&lt;/P&gt;

&lt;P&gt;10000 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;BR /&gt;
	4.69541 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;BR /&gt;
	-4.69541 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;BR /&gt;
	-4.69541 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4&lt;BR /&gt;
	4.69541 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;BR /&gt;
	10000 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;BR /&gt;
	-4.69541 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;BR /&gt;
	-4.69541 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4&lt;BR /&gt;
	-4.69541 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;BR /&gt;
	-4.69541 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;BR /&gt;
	10000 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;BR /&gt;
	4.69541 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4&lt;BR /&gt;
	-4.69541 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;BR /&gt;
	-4.69541 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;BR /&gt;
	4.69541 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3&lt;BR /&gt;
	4.69541 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4&lt;/P&gt;

&lt;P&gt;Row Index:&lt;/P&gt;

&lt;P&gt;1&lt;BR /&gt;
	5&lt;BR /&gt;
	9&lt;BR /&gt;
	13&lt;BR /&gt;
	17&lt;/P&gt;

&lt;P&gt;Number of non - zeros = 16&lt;/P&gt;

&lt;P&gt;And it's easy to verify that K is positive definite and symmetric and not singular.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 29 Aug 2015 18:22:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-DSS-DSS-Error-reordering-problem/m-p/1004259#M18788</guid>
      <dc:creator>Naveen_P_</dc:creator>
      <dc:date>2015-08-29T18:22:49Z</dc:date>
    </item>
    <item>
      <title>Since you did not show the</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-DSS-DSS-Error-reordering-problem/m-p/1004260#M18789</link>
      <description>&lt;P&gt;Since you did not show the code, #5 is not yet a "reproducer", but I can see a hint of the problem. The MKL Reference Manual says, in the section &lt;EM&gt;Storage Formats for the Direct Sparse Solvers&lt;/EM&gt;:&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;For symmetric matrices, it is necessary to store only the upper triangular half of the matrix (upper triangular format) or the lower triangular half of the matrix (lower triangular format).&lt;P&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="color: rgb(102, 102, 102); font-family: Arial, Tahoma, Helvetica, sans-serif; font-size: 13px; line-height: 12.1333341598511px;"&gt;The Intel MKL direct sparse solvers use a row-major upper triangular storage format: the matrix is compressed row-by-row and for symmetric matrices only non-zero elements in the upper triangular half of the matrix are stored.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;See, for instance,&amp;nbsp;https://software.intel.com/en-us/node/471374#9874F00E-C273-4838-AA94-7882DE6D749A .&lt;/P&gt;

&lt;P&gt;You seem to be entering the full matrix, instead -- this I gather from your setting nnz=16 instead of 10, and the values that you displayed for the index and value arrays.&lt;/P&gt;

&lt;P&gt;Please retry, with only the elements in the upper triangle of the symmetric matrix entered.&lt;/P&gt;</description>
      <pubDate>Sat, 29 Aug 2015 20:06:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-DSS-DSS-Error-reordering-problem/m-p/1004260#M18789</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2015-08-29T20:06:00Z</dc:date>
    </item>
    <item>
      <title>It seems that what you are</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-DSS-DSS-Error-reordering-problem/m-p/1004261#M18790</link>
      <description>&lt;P&gt;It seems that what you are referring to is the problem. When I select the matrix type to be non - symmetric, it is generating the correct solution. Thanks.&lt;/P&gt;</description>
      <pubDate>Sat, 29 Aug 2015 21:16:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-DSS-DSS-Error-reordering-problem/m-p/1004261#M18790</guid>
      <dc:creator>Naveen_P_</dc:creator>
      <dc:date>2015-08-29T21:16:08Z</dc:date>
    </item>
    <item>
      <title>Whether you (i) select</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-DSS-DSS-Error-reordering-problem/m-p/1004262#M18791</link>
      <description>&lt;P&gt;Whether you (i) select "symmetric" and provide the upper triangle, or (ii) select "unsymmetric" and provide the full matrix, you should expect the same solution. However, the latter choice may double the run time, so it is worth making sure to select the former if running speed is important (particularly if the equation set will be solved many times in a single run of your program).&lt;/P&gt;</description>
      <pubDate>Sat, 29 Aug 2015 21:37:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-DSS-DSS-Error-reordering-problem/m-p/1004262#M18791</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2015-08-29T21:37:30Z</dc:date>
    </item>
  </channel>
</rss>

