As I see, you handled the input parameters and matrixstorage formatproperly. The key problem is that the mkl_ddiasv and mkl_dcsrsvis for triangular sparse matrix.while thematrix C fromhttp://software.intel.com/sites/products/documentation/hpc/mkl/mklman/index.htmis not a triangular matrx.
See the mkl manual:
The mkl_?csrsv routine solves a system of linear equations with matrix-vector operations for a sparse matrix in the CSR format:
y := alpha*inv(A)*x
y := alpha*inv(A')*x,
alpha is scalar, x and y are vectors, A is a sparse upper or lower triangular matrix with unit or non-unit main diagonal, A' is the transpose of A.
So the output arealways not correct. You may try lapack's function orSparse Solver Routines like pardiso/dss to solve the sparse linear system of equations.
For the function mkl_ddiasv and mkl_dcsrsvthemselves, you may testthe mkl example codes likecspblas_dcsr.c,which be default are in in