Community
cancel
Showing results for
Did you mean:
Beginner
60 Views

## BUG: Buffer Overrun in mkl_dcsrcsc

The mkl_dcsrcsc function has a buffer overrun when used on rectangular matrices. It seems to confuse rows and columns when writing the ia / ia1 buffer. See the attached minimal test program for a demonstration of the problem.
This was verified with mkl10.2.5.0.35 and mkl 10.3.0.025.
Best regards,

Brian
This is the output I get for the test program
Input
Values: 11 12 13 14 15
colIndex: 1 2 1 2 2
colStart: 1 2 3 5
11 *
* 12
13 14
* 15
Output
Values: 11 13 12 14 15
colIndex: 1 3 2 3 4
colStart: 1 3
11 * 13 *
* 12 14 15
Out of bounds access to entry 3 of out_colStart, expected -1 but got 6
Out of bounds access to entry 4 of out_colStart, expected -1 but got 6
Employee
60 Views

Hi Brian,

Thanks a lot for the small test case! We can reproduce the problem with it. I get same result as yours.

But the result may be expected if we consider the fact of the routinetakethe sparse matrix as square matrices by default.(Thisinfo seems be missed mkldocumentation. I will ask ourdoc developer to add such claim.).
For example, the parameter m INTEGER. Dimension of the matrix A.We give it 4 as input,
as a result, it thought the sparse matrix is 4x4.Thus, theresult matrix should be

11 ** *
*12**
1314 * *
*15 * *

The colIndex: 1 32 3 4 is explained as row in CSC format ( Valume, Row, ColumnIndex)

Value: 11, 13, 12, 14, 15
The out_colStart will be explained as column Index in CSC . It is array with m+1=5 elements. Thusit is 1, 3, 6, 6, 6. according to the below definition.
ia1 INTEGER. Array of length m + 1, containing indices of elements in the array acsc, such that ia(I) is
the index in the array acsc of the first non-zero element ia1 from thecolumn I. The value of the last element ia(m + 1)
is equal to the number of non-zeros plus one.

(It is ok to explainthem as ( Value,Column,RowIndex) inCSCifthe matrix is transposed in your case)

Thanks
Ying