Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

mkl_dcoomm (sparse x dense) multiplication

Dan4
Beginner
833 Views

Dear all,

I am using mkl_dcoom function for "sparse x dense" operation. The problem is that I get correct result only and only when my sparse matrix is diagonal. I am using the function as below and sparse matrix has been saved in "coordinates" fomat. I am wondering if I need to sort rows and columns coordinates when I am using "coordinate" format because it is already sorted when I have diagonal matrix. I am not sure though.

alpha=1.0;
beta=0.0;
transA='T';
m=nCells;
n=nCells;
k=nNodes;

// only first four elements of this array is used and // the rest is ignored
MATDESC[0]='G';
MATDESC[1]=0;
MATDESC[2]=0;
MATDESC[3]='C';

ldb=nCells;
ldc=nCells;

// MKL solution to calculate A=Rv'*inv(P)
mkl_dcoomm(&transA, &m, &n, &k, α, MATDESC,
MKLRv->values, MKLRv->rows,
MKLRv->cols, &MKLRv->nnz, MKLinvP, &ldb,
β, MKLtmp, &ldc);

Any tip you have?

Thanks,

D.
0 Kudos
6 Replies
Gennady_F_Intel
Moderator
833 Views
Dan,
it's not clear why mkl_dcoom produces the correct result only and only when your sparse matrix is diagonal. It's an unexpected issue.
Could you please look at the the see Sparse BLAS examples located in the following subdirectory of the Intel MKL installation directory: examples/spblas/cspblas_dcoo.c?
Will it help you?
--Gennady

0 Kudos
AndrewC
New Contributor III
833 Views
Dan,
it's not clear why mkl_dcoom produces the correct result only and only when your sparse matrix is diagonal. It's an unexpected issue.
Could you please look at the the see Sparse BLAS examples located in the following subdirectory of the Intel MKL installation directory: examples/spblas/cspblas_dcoo.c?
Will it help you?
--Gennady



Are you running MKL 10.2 prior to update 3. There are bugs in 10.2 , fixed in Update 3, that can cause mkl_dcoom to give incorrect results when using more than 1 thread.
0 Kudos
Gennady_F_Intel
Moderator
833 Views
Quoting - vasci_intel


Are you running MKL 10.2 prior to update 3. There are bugs in 10.2 , fixed in Update 3, that can cause mkl_dcoom to give incorrect results when using more than 1 thread.

Dan, as Andrew mentioned, we had the problem caused by internally threading.
The problem has been fixed in version MKL 10.2 Update3. the similar problem discussed here.
Please try to link your application with sequential libraries (e.g for win32: mkl_solver_sequential.lib mkl_intel_c.lib mkl_sequential.lib mkl_core.lib ) and check if the problem is still there and
then you can update the latest version.
Please let us know the result.
--Gennady

0 Kudos
Dan4
Beginner
833 Views
Quoting - vasci_intel


Are you running MKL 10.2 prior to update 3. There are bugs in 10.2 , fixed in Update 3, that can cause mkl_dcoom to give incorrect results when using more than 1 thread.

I ran get version example code shipped with MKL and the version is:

Intel Math Kernel Library Version 10.1.0 Product Build 081809.14 for Intel 64 architecture applications

I guess this is quite old. I tested the code by adding this line:

omp_set_num_threads(1);

and the results are still wrong. I am not sure if I have forced MKL to use only 1 processor (sequential) in a proper way or have to link it to use sequential routines instead of threaded using another way. Have I tested correctly?



0 Kudos
Gennady_F_Intel
Moderator
833 Views
Quoting - danltu.se

I ran get version example code shipped with MKL and the version is:

Intel Math Kernel Library Version 10.1.0 Product Build 081809.14 for Intel 64 architecture applications

I guess this is quite old. I tested the code by adding this line:

omp_set_num_threads(1);

and the results are still wrong. I am not sure if I have forced MKL to use only 1 processor (sequential) in a proper way or have to link it to use sequential routines instead of threaded using another way. Have I tested correctly?




Have I tested correctly? Yes, you've tested correctly.
the second way - to use sequential libraries for linking your application:
for win64: mkl_solver_lp64_sequential.lib mkl_intel_lp64.lib mkl_sequential.lib mkl_core.lib
2) if the problem is still there - how can we investigate the problem on our side?
Can you give the testcase?
--Gennady

0 Kudos
AndrewC
New Contributor III
833 Views

Have I tested correctly? Yes, you've tested correctly.
the second way - to use sequential libraries for linking your application:
for win64: mkl_solver_lp64_sequential.lib mkl_intel_lp64.lib mkl_sequential.lib mkl_core.lib
2) if the problem is still there - how can we investigate the problem on our side?
Can you give the testcase?
--Gennady


Just a FYI, The problem I was referring to only existed in 10.2 ( fixed in update 3), the 10.1 versions of mkl_dcoomm always worked fine for me.
0 Kudos
Reply