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

mkl_?csrmultcsr parameter help

Ian_Fraser
Beginner
1,363 Views
"This is admittedly a bit of a beginner question, but I am trying to use the ?csrmultcsr call with a fairly simple pair of matrices.

So far all I have been able to do is to get mkl to provide the following message:

"MKL ERROR: Parameter 2 was incorrect on entry to MKL_DCSRMULTCSR"

I am calling it like so:

char trans='N';
int request=1;
int sort =0;

int m = # of rows in A
int n = # cols in A
int k = # cols in B

mkl_dcsrmultcsr( &trans, &request, &sort, &m, &n,&k, a, ja, ia, b, jb, ib, c, jc, ic, &nC);

where nC is the length of std::vectors c, jc
and a, ja, ia, b, jb,ib are the input csr matrix arrays for A and B respectively.


I have no idea what could be wrong as according to the docs
http://software.intel.com/sites/products/documentation/hpc/compilerpro/en-us/cpp/win/mkl/refman/index.htm

the request parameter can be integer values of 0, 1, or 2. Incidently 0, and 2 also return the same message. Any ideas on how to get this to work would be very helpful.

Thanks in advance!

Ian
0 Kudos
1 Solution
Sergey_K_Intel1
Employee
1,363 Views
Quoting - Ian Fraser
Sergey,

Sure thing. I am still working on a test project that may or may not be helpful.

I am using WinXP 64, with VS 2005. Compiling for 64bit. I am calling from C++ using the C interface.

compiler options: /O2 /Ob1 /Oi /Ot /Oy /GL

We currently use a header to link to MKL, making #pragma calls like so:

//#pragma message( "Linking with C:/Program Files/Intel/MKL/10.2.2.025/em64t/lib/mkl_intel_thread.lib" )
//#pragma comment( lib, "C:/Progra~1/Intel/MKL/10.2.2.025/em64t/lib/mkl_intel_thread.lib" )

#pragma message( "Linking with C:/Program Files/Intel/MKL/10.2.2.025/em64t/lib/mkl_sequential.lib" )
#pragma comment( lib, "C:/Progra~1/Intel/MKL/10.2.2.025/em64t/lib/mkl_sequential.lib" )

#pragma message( "Linking with C:/Program Files/Intel/MKL/10.2.2.025/em64t/lib/mkl_core.lib" )
#pragma comment( lib, "C:/Progra~1/Intel/MKL/10.2.2.025/em64t/lib/mkl_core.lib" )

#pragma message( "Linking with C:/Program Files/Intel/MKL/10.2.2.025/em64t/lib/libguide.lib" )
#pragma comment( lib, "C:/Progra~1/Intel/MKL/10.2.2.025/em64t/lib/libguide.lib" )

#pragma message( "Linking with C:/Program Files/Intel/MKL/10.2.2.025/em64t/lib/mkl_intel_ilp64.lib" )
#pragma comment( lib, "C:/Progra~1/Intel/MKL/10.2.2.025/em64t/lib/mkl_intel_ilp64.lib" )

Hope that helps. I will try and get you the test project today if I can.

Thanks,
Ian


Dear Ian,

I might be mistaken but it looks likeyou are calling ILP64 MKL interfaces from LP64 code. Would you please replace mkl_intel_ilp64.lib with mkl_intel_lp64.lib in two last pragmas of your header file.Instead of

#pragma message( "Linking with C:/Program Files/Intel/MKL/10.2.2.025/em64t/lib/mkl_intel_ilp64.lib" )
#pragma comment( lib, "C:/Progra~1/Intel/MKL/10.2.2.025/em64t/lib/mkl_intel_ilp64.lib" )

please try to use

#pragma message( "Linking with C:/Program Files/Intel/MKL/10.2.2.025/em64t/lib/mkl_intel_lp64.lib" )
#pragma comment( lib, "C:/Progra~1/Intel/MKL/10.2.2.025/em64t/lib/mkl_intel_lp64.lib" )

Hope it helps
All the best
Sergey

View solution in original post

0 Kudos
10 Replies
Ian_Fraser
Beginner
1,363 Views
Quoting - Ian Fraser
"This is admittedly a bit of a beginner question, but I am trying to use the ?csrmultcsr call with a fairly simple pair of matrices.

So far all I have been able to do is to get mkl to provide the following message:

"MKL ERROR: Parameter 2 was incorrect on entry to MKL_DCSRMULTCSR"

I am calling it like so:

char trans='N';
int request=1;
int sort =0;

int m = # of rows in A
int n = # cols in A
int k = # cols in B

mkl_dcsrmultcsr( &trans, &request, &sort, &m, &n,&k, a, ja, ia, b, jb, ib, c, jc, ic, &nC);

where nC is the length of std::vectors c, jc
and a, ja, ia, b, jb,ib are the input csr matrix arrays for A and B respectively.


I have no idea what could be wrong as according to the docs
http://software.intel.com/sites/products/documentation/hpc/compilerpro/en-us/cpp/win/mkl/refman/index.htm

the request parameter can be integer values of 0, 1, or 2. Incidently 0, and 2 also return the same message. Any ideas on how to get this to work would be very helpful.

Thanks in advance!

Ian

I should have mentioned that I am using 10.2.2.025
0 Kudos
jaewonj
Novice
1,363 Views
Quoting - Ian Fraser

You may want to try mkl_dcsrmultcsr with info.

MKL_INT info;
mkl_dcsrmultcsr( &trans, &request, &sort, &m, &n,&k, a, ja, ia, b, jb, ib, c, jc, ic, &nC, &info);
0 Kudos
Ian_Fraser
Beginner
1,363 Views
Quoting - jaewonj
Quoting - Ian Fraser

You may want to try mkl_dcsrmultcsr with info.

MKL_INT info;
mkl_dcsrmultcsr( &trans, &request, &sort, &m, &n,&k, a, ja, ia, b, jb, ib, c, jc, ic, &nC, &info);

Jaewonj - Thanks for the tip.

I double checked my call. I was passing in an int for info. Same result.

MKL ERROR: Parameter 2 was incorrect on entry to MKL_DCSRMULTCSR

I checked the output and it looks like the function call does not change the value either. I passed in both int info = 0; and int info=-1 and after the call the value for info remains unchanged.

Could this just be a bug?





0 Kudos
jaewonj
Novice
1,363 Views
Quoting - Ian Fraser

Jaewonj - Thanks for the tip.

I double checked my call. I was passing in an int for info. Same result.

MKL ERROR: Parameter 2 was incorrect on entry to MKL_DCSRMULTCSR

I checked the output and it looks like the function call does not change the value either. I passed in both int info = 0; and int info=-1 and after the call the value for info remains unchanged.

Could this just be a bug?


Sorry. I thought you were getting an error at compilation time.

I have never seen this error before, so I'm not completely sure but I suspect this may be library link issue.

Can you go to the following link and make sure your link line is ok?

http://software.intel.com/en-us/articles/intel-mkl-link-line-advisor/






0 Kudos
Gennady_F_Intel
Moderator
1,363 Views
Quoting - jaewonj
Sorry. I thought you were getting an error at compilation time.

I have never seen this error before, so I'm not completely sure but I suspect this may be library link issue.

Can you go to the following link and make sure your link line is ok?

http://software.intel.com/en-us/articles/intel-mkl-link-line-advisor/






Jaewonj, no i don't think it will help.
Ian, at the first glance all is ok with calling of this routine. Can you get us the test for checking the problem?
--Gennady
0 Kudos
Ian_Fraser
Beginner
1,363 Views
Jaewonj, no i don't think it will help.
Ian, at the first glance all is ok with calling of this routine. Can you get us the test for checking the problem?
--Gennady
Yup I can do that. I should be able to get to it today. Thanks!
0 Kudos
Sergey_K_Intel1
Employee
1,363 Views
Quoting - Ian Fraser
"This is admittedly a bit of a beginner question, but I am trying to use the ?csrmultcsr call with a fairly simple pair of matrices.

So far all I have been able to do is to get mkl to provide the following message:

"MKL ERROR: Parameter 2 was incorrect on entry to MKL_DCSRMULTCSR"

I am calling it like so:

char trans='N';
int request=1;
int sort =0;

int m = # of rows in A
int n = # cols in A
int k = # cols in B

mkl_dcsrmultcsr( &trans, &request, &sort, &m, &n,&k, a, ja, ia, b, jb, ib, c, jc, ic, &nC);

where nC is the length of std::vectors c, jc
and a, ja, ia, b, jb,ib are the input csr matrix arrays for A and B respectively.


I have no idea what could be wrong as according to the docs
http://software.intel.com/sites/products/documentation/hpc/compilerpro/en-us/cpp/win/mkl/refman/index.htm

the request parameter can be integer values of 0, 1, or 2. Incidently 0, and 2 also return the same message. Any ideas on how to get this to work would be very helpful.

Thanks in advance!

Ian

Dear Ian,

Would you please provide more details about compiler, OS, compiler options and linking sequence?

Usually the diagnostics likeyou saw happen when ILP64 MKL bits are linked to LP64 code orcdecl MKL libraries are linked toa code expecting stdcall MKL interfaces.

Thanks in advance
All the best
Sergey
0 Kudos
Ian_Fraser
Beginner
1,363 Views

Dear Ian,

Would you please provide more details about compiler, OS, compiler options and linking sequence?

Usually the diagnostics likeyou saw happen when ILP64 MKL bits are linked to LP64 code orcdecl MKL libraries are linked toa code expecting stdcall MKL interfaces.

Thanks in advance
All the best
Sergey
Sergey,

Sure thing. I am still working on a test project that may or may not be helpful.

I am using WinXP 64, with VS 2005. Compiling for 64bit. I am calling from C++ using the C interface.

compiler options: /O2 /Ob1 /Oi /Ot /Oy /GL

We currently use a header to link to MKL, making #pragma calls like so:

//#pragma message( "Linking with C:/Program Files/Intel/MKL/10.2.2.025/em64t/lib/mkl_intel_thread.lib" )
//#pragma comment( lib, "C:/Progra~1/Intel/MKL/10.2.2.025/em64t/lib/mkl_intel_thread.lib" )

#pragma message( "Linking with C:/Program Files/Intel/MKL/10.2.2.025/em64t/lib/mkl_sequential.lib" )
#pragma comment( lib, "C:/Progra~1/Intel/MKL/10.2.2.025/em64t/lib/mkl_sequential.lib" )

#pragma message( "Linking with C:/Program Files/Intel/MKL/10.2.2.025/em64t/lib/mkl_core.lib" )
#pragma comment( lib, "C:/Progra~1/Intel/MKL/10.2.2.025/em64t/lib/mkl_core.lib" )

#pragma message( "Linking with C:/Program Files/Intel/MKL/10.2.2.025/em64t/lib/libguide.lib" )
#pragma comment( lib, "C:/Progra~1/Intel/MKL/10.2.2.025/em64t/lib/libguide.lib" )

#pragma message( "Linking with C:/Program Files/Intel/MKL/10.2.2.025/em64t/lib/mkl_intel_ilp64.lib" )
#pragma comment( lib, "C:/Progra~1/Intel/MKL/10.2.2.025/em64t/lib/mkl_intel_ilp64.lib" )

Hope that helps. I will try and get you the test project today if I can.

Thanks,
Ian

0 Kudos
Sergey_K_Intel1
Employee
1,364 Views
Quoting - Ian Fraser
Sergey,

Sure thing. I am still working on a test project that may or may not be helpful.

I am using WinXP 64, with VS 2005. Compiling for 64bit. I am calling from C++ using the C interface.

compiler options: /O2 /Ob1 /Oi /Ot /Oy /GL

We currently use a header to link to MKL, making #pragma calls like so:

//#pragma message( "Linking with C:/Program Files/Intel/MKL/10.2.2.025/em64t/lib/mkl_intel_thread.lib" )
//#pragma comment( lib, "C:/Progra~1/Intel/MKL/10.2.2.025/em64t/lib/mkl_intel_thread.lib" )

#pragma message( "Linking with C:/Program Files/Intel/MKL/10.2.2.025/em64t/lib/mkl_sequential.lib" )
#pragma comment( lib, "C:/Progra~1/Intel/MKL/10.2.2.025/em64t/lib/mkl_sequential.lib" )

#pragma message( "Linking with C:/Program Files/Intel/MKL/10.2.2.025/em64t/lib/mkl_core.lib" )
#pragma comment( lib, "C:/Progra~1/Intel/MKL/10.2.2.025/em64t/lib/mkl_core.lib" )

#pragma message( "Linking with C:/Program Files/Intel/MKL/10.2.2.025/em64t/lib/libguide.lib" )
#pragma comment( lib, "C:/Progra~1/Intel/MKL/10.2.2.025/em64t/lib/libguide.lib" )

#pragma message( "Linking with C:/Program Files/Intel/MKL/10.2.2.025/em64t/lib/mkl_intel_ilp64.lib" )
#pragma comment( lib, "C:/Progra~1/Intel/MKL/10.2.2.025/em64t/lib/mkl_intel_ilp64.lib" )

Hope that helps. I will try and get you the test project today if I can.

Thanks,
Ian


Dear Ian,

I might be mistaken but it looks likeyou are calling ILP64 MKL interfaces from LP64 code. Would you please replace mkl_intel_ilp64.lib with mkl_intel_lp64.lib in two last pragmas of your header file.Instead of

#pragma message( "Linking with C:/Program Files/Intel/MKL/10.2.2.025/em64t/lib/mkl_intel_ilp64.lib" )
#pragma comment( lib, "C:/Progra~1/Intel/MKL/10.2.2.025/em64t/lib/mkl_intel_ilp64.lib" )

please try to use

#pragma message( "Linking with C:/Program Files/Intel/MKL/10.2.2.025/em64t/lib/mkl_intel_lp64.lib" )
#pragma comment( lib, "C:/Progra~1/Intel/MKL/10.2.2.025/em64t/lib/mkl_intel_lp64.lib" )

Hope it helps
All the best
Sergey
0 Kudos
Ian_Fraser
Beginner
1,363 Views

Dear Ian,

I might be mistaken but it looks likeyou are calling ILP64 MKL interfaces from LP64 code. Would you please replace mkl_intel_ilp64.lib with mkl_intel_lp64.lib in two last pragmas of your header file.Instead of

#pragma message( "Linking with C:/Program Files/Intel/MKL/10.2.2.025/em64t/lib/mkl_intel_ilp64.lib" )
#pragma comment( lib, "C:/Progra~1/Intel/MKL/10.2.2.025/em64t/lib/mkl_intel_ilp64.lib" )

please try to use

#pragma message( "Linking with C:/Program Files/Intel/MKL/10.2.2.025/em64t/lib/mkl_intel_lp64.lib" )
#pragma comment( lib, "C:/Progra~1/Intel/MKL/10.2.2.025/em64t/lib/mkl_intel_lp64.lib" )

Hope it helps
All the best
Sergey

Sergey, that's got it. Your hunch was right. Thanks for all the help!
0 Kudos
Reply