I'm using MKL10.2.5.035. The Problem occurs on ia32 as well as intel64. my OS is linux.
#include "mkl_spblas.h"
#include "mkl_types.h"
#include
using namespace std;
int main() {
int m=13;
int nz=27;
char uplo = 'l';
char transa = 'n';
char diag = 'n';
// The Matrix
int rowind[] = {0,1,1,2,2,3,3,4,4,5,5,5,6,6,6,7,8,9,9,10,10,10,11,11,11,12,12};
int colind[] = {0,0,1,1,2,1,3,1,4,2,4,5,3,4,6,7,8,4,9, 6, 9,10, 5, 9,11, 9,12};
double value[] = {1,-1,1.73205,-0.57735,1.29099,-0.57735,1.29099,-0.57735,1.91485,-0.774597,-0.522233,1.76841,
-0.774597,-0.522233,1.76841,1,1,-0.522233,1.93061,-0.56548,-0.51797,1.18825,-0.56548,-0.51797,1.18825,-0.51797,0.855399};
// The Vectors
double x[] = { 0,0,0,0,0,2,0,2,0,0,0,0,0 };
double *y = new double();
mkl_dcootrsv(&uplo,&transa,&diag,&m,value,rowind,colind,&nz,x,y);
for (int i=0;i
cout << y << " ";
cout << endl;
return 0;
}
With this program I found out that the inaccuracy results from the debugging flag.
output with debugging flag:
icpc -L${MKLPATH} ${MKLPATH}/libmkl_solver.a -Wl,--start-group -lmkl_intel -lmkl_intel_thread -lmkl_core -Wl,--end-group -openmp -lpthread matrixtest.cpp -g -o matrixtest
./matrixtest
1.3844e-312 6.19126e-313 6.19126e-313 4.17414e-313 3.94456e-313 1.13096 0 2 1.12911e-313 0.538216 2.36938e-313 6.83711e-314 0
output without debugging flag:
icpc -L${MKLPATH} ${MKLPATH}/libmkl_solver.a -Wl,--start-group -lmkl_intel -lmkl_intel_thread -lmkl_core -Wl,--end-group -openmp -lpthread matrixtest.cpp -o matrixtest
./matrixtest
0 0 0 0 0 1.13096 0 2 0 0.538216 0 0 0
What can I do to avoid this problem?
Regards,
Sren