Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
7234 Discussions

mkldcsrbsr gives core dump when trying to fill all arrays

itabhiyanta
Beginner
592 Views

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

 

0 Kudos
1 Reply
Sergey_P_Intel2
Employee
592 Views

Hi,

Leading dimension ldabsr should be equal to  m*m in your case: in fact, it should describe the length between first elements of two consecutive blocks. 

Regards, Sergey

0 Kudos
Reply