Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Dmitri_Gribenko
Beginner
79 Views

Convert a sparse matrix to BSR with mkl_dcsrbsr, JOB(6) = -1

Hello,


I want to use mkl_dcsrbsr to convert a sparse matrix from CSR to BSR. I don't know the number of nnz blocks in advance, so I set job(6)=-1. Unfortunately, mkl_dcsrbsr says that job parameter is wrong and I don't see why.


Here's a small testcase:

[cpp]// Matrix is:
//
//      1 2 0 0
// A =  3 4 0 0
//      0 0 5 6
//      0 0 7 8

#include 
#include "mkl_spblas.h"

int main(int argc, char *argv[] )
{
  int m = 4;
  int mblk = 2;
  double acsr[8] = { 1., 2., 3., 4., 5., 6., 7., 8. };
  int ja[8] = { 1, 2, 1, 2, 3, 4, 3, 4 };
  int ia[5] = { 1, 3, 5, 7, 9 };
  int job[8] = { 0, 1, 1, 0, 0, -1, 0, 0 };
  int nnzblocks = -1;
  int info;

  mkl_dcsrbsr(job, &m, &mblk, NULL, acsr, ja, ia, NULL, NULL, &nnzblocks, &info);

  printf("info = %d, nnzblocks = %d\n", info, nnzblocks);
  return 0;
}
[/cpp]

Here's the output:

$ ./test

MKL ERROR: Parameter 1 was incorrect on entry to MKL_DCSRBSR
info = 32692, nnzblocks = -1

ICC and MKL installation directory is called composerxe-2011.3.174, so I guess I'm using MKL 10.3. (How can I find out?)

0 Kudos
6 Replies
Gennady_F_Intel
Moderator
79 Views

interesting.. job array initialized correctly.
it's pretty difficult to understand the reason of such behaviour without compilation the example. would e the result the same if you allocate the array for elements of non-zero blocks of the matrix A?
Gennady_F_Intel
Moderator
79 Views

quote "ICC and MKL installation directory is called composerxe-2011.3.174, so I guess I'm using MKL 10.3. (How can I find out?)". see which version of the Intel IPP, Intel MKL and Intel TBB Libraries are Included in the Intel Composer Bundles into this article
Dmitri_Gribenko
Beginner
79 Views

If I replace NULLs with pointers to some int [10] arrays, I get the same error.


Thank you for the link, I've got MKL 10.3.3 installed.

Gennady_F_Intel
Moderator
79 Views

Dmitri, thaks for the issue. This is the unknown bug. We will fix the issue asap and I will let you know any update.
--Gennady
Gennady_F_Intel
Moderator
79 Views

Hi Dima,
would you check the fix of the problem with the latest update (Intel MKL v.10.3.5)?
--Gennady
Dmitri_Gribenko
Beginner
79 Views

Thank you, example from the first post works now (but I had to replace NULLs with pointers to valid memory -- no idea why MKL wants them, it is not supposed to read or write there).
Reply