- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
when I use mkl_dcsrbsr to convert a large CSR matrix into BSR, it will give me segmentation fault. But it run correctly, when the matrix size is small.
here is my code(my icc version is 15.0.1)
//m is the dimension of CSR matrix and nnz is the number of non zero element in this matrix
double *acsr;
acsr = (double *)mkl_malloc(*nnz*sizeof(double), 64);//data in csr
int *ja, *ia;
ja = (int *)mkl_malloc(*nnz*sizeof(int), 64);//column in csr
ia = (int *)mkl_malloc((*m + 1)*sizeof(int), 64);//row in csr
acsr = (double *)mkl_malloc(*nnz*sizeof(double), 64);//data in csr
int *ja, *ia;
ja = (int *)mkl_malloc(*nnz*sizeof(int), 64);//column in csr
ia = (int *)mkl_malloc((*m + 1)*sizeof(int), 64);//row in csr
//read the CSR matrix
int *mblk,*ldabsr;
mblk = (int *)mkl_malloc(sizeof(int), 64);
ldabsr = (int *)mkl_malloc(sizeof(int), 64);
*mblk = 4; *ldabsr = 16;
ldabsr = (int *)mkl_malloc(sizeof(int), 64);
*mblk = 4; *ldabsr = 16;
double *absr;
absr = (double*)mkl_malloc(((*nnz)*(*mblk)*(*mblk))*sizeof(double *), 64);//data in bsr
int *jab, *iab;
int ld = (*m) / (*mblk) + 1;
jab = (int *)mkl_malloc(ld*ld*sizeof(int), 64);//column in bsr
iab = (int *)mkl_malloc((*m+1)*sizeof(int),64);
absr = (double*)mkl_malloc(((*nnz)*(*mblk)*(*mblk))*sizeof(double *), 64);//data in bsr
int *jab, *iab;
int ld = (*m) / (*mblk) + 1;
jab = (int *)mkl_malloc(ld*ld*sizeof(int), 64);//column in bsr
iab = (int *)mkl_malloc((*m+1)*sizeof(int),64);
int *job;
job = (int *)mkl_malloc(6 * sizeof(int), 64);
job[0] = 0; job[1] = 0; job[2] = 0; job[5] = 3;
job = (int *)mkl_malloc(6 * sizeof(int), 64);
job[0] = 0; job[1] = 0; job[2] = 0; job[5] = 3;
int *info; info = (int *)mkl_malloc(sizeof(int), 64);
mkl_dcsrbsr(job, m, mblk, ldabsr, acsr, ja, ia, absr, jab, iab, info);
I want to know what's wrong with my code or this function cannot convert big matrix?
thank you ~ :)
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please provide complete test source codes that can be compiled and run, along with matrix data files, for (i) a case where the run is correct, and (ii) a case where the program crashes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page