<?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 Hi, in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Sparse-index-base-for-export-csr/m-p/1068599#M22089</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;In current version of MKL you need to sort csr format to garantee correctness of input pardiso data&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Alex&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 20 Jan 2017 00:58:49 GMT</pubDate>
    <dc:creator>Alexander_K_Intel2</dc:creator>
    <dc:date>2017-01-20T00:58:49Z</dc:date>
    <item>
      <title>Sparse index base for export csr</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Sparse-index-base-for-export-csr/m-p/1068594#M22084</link>
      <description>&lt;P&gt;I do not understand how is working the sparse_index_base in mkl_sparse_d_export_csr. It looks to me that the exported arrays are independant of what is chosen for sparse_index_base parameter. To explain, I am generating two csr sparse matrices using base one indexing. When I am exporting the csr arrays for one matrix the result always corresponds to one indexing independently of the parameter used for&amp;nbsp;&lt;SPAN style="font-size: 13.008px;"&gt;mkl_sparse_d_export_csr (SPARSE_INDEX_BASE_ZERO or SPARSE_INDEX_BASE_ONE). I am multiplying my two matrices using&amp;nbsp;&lt;/SPAN&gt;mkl_sparse_spmm. It looks the result of the multiplication is always in index base 0 independently of the parameter for the exporting function.&lt;/P&gt;

&lt;P&gt;These are my results. The product is always in base 0 and the original matrix is exported in the same base it was generated. Can you please clarify, This is confusing. I am also attaching my code.&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Marc&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;RESULTS:&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;PRODUCT&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;row_start&amp;nbsp;&amp;nbsp; &amp;nbsp;0 3 7 12 17 22 27 32 37 41&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp;row_end &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;3 7 12 17 22 27 32 37 41 44&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp;col_indx &amp;nbsp;&amp;nbsp; &amp;nbsp;0 1 2 0 1 2 3 0 1 2 3 4 1 2 3 4 5 2 3 4 5 6 3 4 5 6 7 4 5 6 7 8 5 6 7 8 9 6 7 8 9 7 8 9&amp;nbsp;&lt;/P&gt;

&lt;P&gt;MATRIX2&lt;BR /&gt;
	&amp;nbsp;row_start&amp;nbsp;&amp;nbsp; &amp;nbsp;1 4 8 13 18 23 28 33 38 42&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp;row_end &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;4 8 13 18 23 28 33 38 42 45&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp;col_indx &amp;nbsp;&amp;nbsp; &amp;nbsp;1 2 3 1 2 3 4 1 2 3 4 5 2 3 4 5 6 3 4 5 6 7 4 5 6 7 8 5 6 7 8 9 6 7 8 9 10 7 8 9 10 8 9 10&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;#include &amp;lt;iostream&amp;gt;
using namespace std;
#include "mkl.h"
int main() {
	MKL_INT nRows=10;
	MKL_INT* rows=new MKL_INT[nRows];
	MKL_INT* cols=new MKL_INT [nRows];
//	MKL_Complex16* permutData=new MKL_Complex16[nRows];
	double *permutData=new double[nRows];
	for (int i=0;i&amp;lt;nRows;i++){
		rows&lt;I&gt;=i+1;
		cols&lt;I&gt;=i+1;
		permutData&lt;I&gt;=1.0;
	}

	sparse_matrix_t MATRIX1;
	sparse_status_t ok=mkl_sparse_d_create_coo (&amp;amp;MATRIX1,SPARSE_INDEX_BASE_ONE,nRows,nRows, nRows, rows,cols,permutData);
	if (ok==SPARSE_STATUS_SUCCESS){
		cout&amp;lt;&amp;lt;"Matrix done\n";
		cout.flush();
	}
	else{
		cout&amp;lt;&amp;lt;"Problem in handle creation";
		cout.flush();
	}

	MKL_INT* rows2=new MKL_INT[5*nRows];
	MKL_INT* cols2=new MKL_INT [5*nRows];
	double *Data=new double[5*nRows];
	MKL_INT nnz=0;
	for (int i=0;i&amp;lt;10;i++){
		for (int j=0;j&amp;lt;10;j++){
			if (abs(i-j)&amp;lt;=2){
				rows2[nnz]=i+1;
				cols2[nnz]=j+1;
				Data[nnz]=i-j;
				nnz++;
			}
		}
	}
	cout&amp;lt;&amp;lt;"nnz :"&amp;lt;&amp;lt;nnz&amp;lt;&amp;lt;'\n';
	sparse_matrix_t MATRIX2;
	ok=mkl_sparse_d_create_coo (&amp;amp;MATRIX2,SPARSE_INDEX_BASE_ONE,nRows,nRows, nnz, rows2,cols2,Data);
	if (ok==SPARSE_STATUS_SUCCESS){
		cout&amp;lt;&amp;lt;"Matrix done\n";
		cout.flush();
	}
	else{
		cout&amp;lt;&amp;lt;"Problem in handle creation";
		cout.flush();
	}
	sparse_matrix_t MATRIX1CSR;
	ok=mkl_sparse_convert_csr(MATRIX1,SPARSE_OPERATION_NON_TRANSPOSE,&amp;amp;MATRIX1CSR);
	if (ok!=SPARSE_STATUS_SUCCESS){
		cout&amp;lt;&amp;lt;"Problem in conversion\n";
		cout.flush();
	}
	sparse_matrix_t MATRIX2CSR;
	ok=mkl_sparse_convert_csr(MATRIX2,SPARSE_OPERATION_NON_TRANSPOSE,&amp;amp;MATRIX2CSR);
	if (ok!=SPARSE_STATUS_SUCCESS){
		cout&amp;lt;&amp;lt;"Problem in conversion\n";
		cout.flush();
	}
	sparse_matrix_t PRODUCT;
	ok= mkl_sparse_spmm(SPARSE_OPERATION_NON_TRANSPOSE,MATRIX1CSR,MATRIX2CSR,&amp;amp;PRODUCT);
	if (ok!=SPARSE_STATUS_SUCCESS){
		cout&amp;lt;&amp;lt;"Problem in matrix export\n";
		cout.flush();
	}
	MKL_INT nRowsPROD,nColsPROD;
	MKL_INT* rows_start;
	MKL_INT* rows_end;
	MKL_INT* col_indx;
	double* values;
	sparse_index_base_t indexing=SPARSE_INDEX_BASE_ONE;
	ok=mkl_sparse_d_export_csr(PRODUCT,&amp;amp;indexing,&amp;amp;nRowsPROD,&amp;amp;nColsPROD,&amp;amp;rows_start,&amp;amp;rows_end,&amp;amp;col_indx,&amp;amp;values);
	cout&amp;lt;&amp;lt;"\nPRODUCT";
	cout&amp;lt;&amp;lt;"\n row_start\t";
	for (int i=0;i&amp;lt;nRowsPROD;i++){
		cout&amp;lt;&amp;lt;rows_start&lt;I&gt;&amp;lt;&amp;lt;" ";
	}
	cout&amp;lt;&amp;lt;"\n row_end  \t";
	for (int i=0;i&amp;lt;nRowsPROD;i++){
		cout&amp;lt;&amp;lt;rows_end&lt;I&gt;&amp;lt;&amp;lt;" ";
	}
	cout&amp;lt;&amp;lt;"\n col_indx \t";
	for (int i=0;i&amp;lt;nnz;i++){
		cout&amp;lt;&amp;lt;col_indx&lt;I&gt;&amp;lt;&amp;lt;" ";
	}

	cout&amp;lt;&amp;lt;'\n';

	MKL_INT nRows2,nCols2;
	MKL_INT* rows_start2;
	MKL_INT* rows_end2;
	MKL_INT* col_indx2;
	double* values2;
	sparse_index_base_t indexing2=SPARSE_INDEX_BASE_ZERO;
	ok=mkl_sparse_d_export_csr(MATRIX2CSR,&amp;amp;indexing2,&amp;amp;nRows2,&amp;amp;nCols2,&amp;amp;rows_start2,&amp;amp;rows_end2,&amp;amp;col_indx2,&amp;amp;values2);
	cout&amp;lt;&amp;lt;"\nMATRIX2";
	cout&amp;lt;&amp;lt;"\n row_start\t";
	for (int i=0;i&amp;lt;nRows2;i++){
		cout&amp;lt;&amp;lt;rows_start2&lt;I&gt;&amp;lt;&amp;lt;" ";
	}
	cout&amp;lt;&amp;lt;"\n row_end  \t";
	for (int i=0;i&amp;lt;nRows2;i++){
		cout&amp;lt;&amp;lt;rows_end2&lt;I&gt;&amp;lt;&amp;lt;" ";
	}
	cout&amp;lt;&amp;lt;"\n col_indx \t";
	for (int i=0;i&amp;lt;nnz;i++){
		cout&amp;lt;&amp;lt;col_indx2&lt;I&gt;&amp;lt;&amp;lt;" ";
	}
	cout&amp;lt;&amp;lt;'\n';
	return 0;
}&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;/PRE&gt;</description>
      <pubDate>Thu, 12 Jan 2017 19:00:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Sparse-index-base-for-export-csr/m-p/1068594#M22084</guid>
      <dc:creator>marcsolal</dc:creator>
      <dc:date>2017-01-12T19:00:39Z</dc:date>
    </item>
    <item>
      <title>Hello,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Sparse-index-base-for-export-csr/m-p/1068595#M22085</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;Thanks for the report. It is real good question.&amp;nbsp;&amp;nbsp;the parameter indexing in the function mkl_sparse_d_export_csr was output parameter, not a&amp;nbsp;input parameter. so it seems the function always return 0 based csr matrix.&amp;nbsp; We will check in detail&amp;nbsp;and get back to&amp;nbsp;you&amp;nbsp;later.&lt;/P&gt;

&lt;P&gt;Best Regards,&lt;/P&gt;

&lt;P&gt;Ying&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2017 02:43:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Sparse-index-base-for-export-csr/m-p/1068595#M22085</guid>
      <dc:creator>Ying_H_Intel</dc:creator>
      <dc:date>2017-01-13T02:43:00Z</dc:date>
    </item>
    <item>
      <title>Hi,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Sparse-index-base-for-export-csr/m-p/1068596#M22086</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Ying is correct, indexing in export routines is output parameter so it filled after export execution it correspond to indexing that used for internal data&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Alex&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2017 03:26:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Sparse-index-base-for-export-csr/m-p/1068596#M22086</guid>
      <dc:creator>Alexander_K_Intel2</dc:creator>
      <dc:date>2017-01-13T03:26:23Z</dc:date>
    </item>
    <item>
      <title>I did not see it. It was</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Sparse-index-base-for-export-csr/m-p/1068597#M22087</link>
      <description>&lt;P&gt;I did not see it. It was obvious to me it had to be an input parameter to let me decide the indexing I like. It appears that he indexing is changed to 1 based when multiplying two sparse matrices. I will add a test inside my code.&lt;/P&gt;

&lt;P&gt;Thanks a lot,&lt;/P&gt;

&lt;P&gt;Marc&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2017 14:40:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Sparse-index-base-for-export-csr/m-p/1068597#M22087</guid>
      <dc:creator>marcsolal</dc:creator>
      <dc:date>2017-01-13T14:40:43Z</dc:date>
    </item>
    <item>
      <title> Another question on the same</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Sparse-index-base-for-export-csr/m-p/1068598#M22088</link>
      <description>&lt;P&gt;&amp;nbsp;Another question on the same topic. I am exporting csr to use my matrix in PARDISO. Is there a way to make sure the column indexes are sorted or do I need to sort it myself after exporting.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2017 15:20:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Sparse-index-base-for-export-csr/m-p/1068598#M22088</guid>
      <dc:creator>marcsolal</dc:creator>
      <dc:date>2017-01-19T15:20:25Z</dc:date>
    </item>
    <item>
      <title>Hi,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Sparse-index-base-for-export-csr/m-p/1068599#M22089</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;In current version of MKL you need to sort csr format to garantee correctness of input pardiso data&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Alex&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2017 00:58:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Sparse-index-base-for-export-csr/m-p/1068599#M22089</guid>
      <dc:creator>Alexander_K_Intel2</dc:creator>
      <dc:date>2017-01-20T00:58:49Z</dc:date>
    </item>
    <item>
      <title>I understand that. Is there</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Sparse-index-base-for-export-csr/m-p/1068600#M22090</link>
      <description>&lt;P&gt;I understand that. Is there any way to do this sorting inspector executor interface to sparse blas routines? I see that many regular sparse blas routines have sorting options. It would be nice to have something similar when using inspector executor.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Marc&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2017 14:38:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Sparse-index-base-for-export-csr/m-p/1068600#M22090</guid>
      <dc:creator>marcsolal</dc:creator>
      <dc:date>2017-01-20T14:38:31Z</dc:date>
    </item>
  </channel>
</rss>

