Quantcast
Channel: Intel® oneAPI Math Kernel Library & Intel® Math Kernel Library
Viewing all articles
Browse latest Browse all 2652

mkldcsrbsr gives core dump when trying to fill all arrays

$
0
0

Hi

 

I am using the mkldcsrbsr routine. I ma using MKL version 10.3 (i have tried with version 11.0 as well). It seems i can call the routine perfectly for the job type = -1. I get the number of blocks correctly but when i call the routine again to fill all the arrays i get a coredump.

 

Here is the code i am using

rowsAbsr = new int[N_A+1];
  job[0]=0;//CSR to BSR
  job[1]=0;// zero based CSR
  job[2]=0;//zero based bsr
  job[3]=0;
  job[4]=0;
  job[5]=-1;//
  mkl_dcsrbsr(job, &N_A, &m, &ldabsr, nnzsAcsr, colsAcsr, rowsAcsr, nnzsAbsr, colsAbsr, rowsAbsr, &info);
  cout<<"The conversion to BSR for matrix A is "<<info<<"."<<endl;
  cout<<"The request for number of blocks of BSR for matrix A is "<<rowsAbsr[0]<<"."<<endl;
  sizecolsabsr=rowsAbsr[0];
  colsAbsr = new int[rowsAbsr[0]];
  nnzsAbsr = new double[m*m*(rowsAbsr[0])];
  ldabsr=m*m*(rowsAbsr[0]);
    cout<<"ldabsr is calculated as "<<ldabsr<<"."<<endl;
    job[0]=0;//CSR to BSR
    job[1]=0;// zero based CSR
    job[2]=0;//zero based bsr
    job[5]=0;// only row and column arrays for bsr are filled
    mkl_dcsrbsr(job, &N_A, &m, &ldabsr, nnzsAcsr, colsAcsr, rowsAcsr, nnzsAbsr, colsAbsr, rowsAbsr, &info);
    cout<<"The conversion to BSR for matrix A is "<<info<<"."<<endl;
    job[0]=0;//CSR to BSR
    job[1]=0;// zero based CSR
    job[2]=0;//zero based bsr
    job[5]=1;// all arays are filled
    mkl_dcsrbsr(job, &N_A, &m, &ldabsr, nnzsAcsr, colsAcsr, rowsAcsr, nnzsAbsr, colsAbsr, rowsAbsr, &info);
    cout<<"The conversion to BSR for matrix A is "<<info<<"."<<endl;

I had my doubts on ldabsr but as per the documentation available online it seems i am doing the right thing. Could you be so kind to suggest if you spot any obvious error here?

 

with kind regards

rohit

 


Viewing all articles
Browse latest Browse all 2652

Trending Articles