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

Iterative Sparse Multiple RHS Solver (dcgmrhs) using with C

recage
Beginner
1,180 Views
There seems to be an inconsistency in the docs for calling 'dcgmrhs_init' from C: the PDF documentation specifies the parameter 'method' in the function call. However, this parameter does not appear in the C header file.

PDF docs: dcgmrhs_init(n, x, nrhs, b, method, RCI_request, ipar, dpar, tmp)

C header: extern void dcgmrhs_init(MKL_INT *n, double *x, MKL_INT* nRhs, double *b, MKL_INT *rci_request, MKL_INT *ipar, double *dpar, double *tmp);

I understand that 'method' doesn't have any influence on the code, since block CG solution is not yet supported.

Is there a demo code available for 'dcgmrhs' written in C? I can only find the code for Fortran.
For some reason the routine 'dcgmrhs_init' crashes on me. Some demo code would be helpful.

Best regards, Recage
0 Kudos
1 Solution
Alexander_K_Intel2
1,180 Views
Quoting - recage
Hi Alexander,
thanks for the speedy reply.
Can you please elaborate a little more on this? Apart from the little inconsistency within the documentation for the function 'dcgmrhs_init', is this function callable? In my code it crashes invariably.
Is there a workaround available for the current situation?

Best regards, Recage
Recage,
It's seems that problem is not in documentation, problem is in header file. Parameter "method" not used in that version of cgmrs, but it need to be in interface. Try to change interface on
dcgmrhs_init(MKL_INT *n, double *x, MKL_INT* nRhs, double *b,MKL_INT *method,MKL_INT *rci_request, MKL_INT *ipar, double *dpar, double *tmp);
With best regards,
Alexander Kalinkin

View solution in original post

0 Kudos
5 Replies
Alexander_K_Intel2
1,180 Views
Quoting - recage
There seems to be an inconsistency in the docs for calling 'dcgmrhs_init' from C: the PDF documentation specifies the parameter 'method' in the function call. However, this parameter does not appear in the C header file.

PDF docs: dcgmrhs_init(n, x, nrhs, b, method, RCI_request, ipar, dpar, tmp)

C header: extern void dcgmrhs_init(MKL_INT *n, double *x, MKL_INT* nRhs, double *b, MKL_INT *rci_request, MKL_INT *ipar, double *dpar, double *tmp);

I understand that 'method' doesn't have any influence on the code, since block CG solution is not yet supported.

Is there a demo code available for 'dcgmrhs' written in C? I can only find the code for Fortran.
For some reason the routine 'dcgmrhs_init' crashes on me. Some demo code would be helpful.

Best regards, Recage


Hi Recage,
We know this problem that appeared while calling cgmhr routines from c code. Itwill be fixed in one of next versions of MKL.

With best regards,

Alexander Kalinkin

0 Kudos
recage
Beginner
1,180 Views
Hi Alexander,
thanks for the speedy reply.
Can you please elaborate a little more on this? Apart from the little inconsistency within the documentation for the function 'dcgmrhs_init', is this function callable? In my code it crashes invariably.
Is there a workaround available for the current situation?

Best regards, Recage
0 Kudos
Alexander_K_Intel2
1,181 Views
Quoting - recage
Hi Alexander,
thanks for the speedy reply.
Can you please elaborate a little more on this? Apart from the little inconsistency within the documentation for the function 'dcgmrhs_init', is this function callable? In my code it crashes invariably.
Is there a workaround available for the current situation?

Best regards, Recage
Recage,
It's seems that problem is not in documentation, problem is in header file. Parameter "method" not used in that version of cgmrs, but it need to be in interface. Try to change interface on
dcgmrhs_init(MKL_INT *n, double *x, MKL_INT* nRhs, double *b,MKL_INT *method,MKL_INT *rci_request, MKL_INT *ipar, double *dpar, double *tmp);
With best regards,
Alexander Kalinkin
0 Kudos
recage
Beginner
1,180 Views
Sir, may I call you Jesus?
Changing the header file solved the problem.
Thanks a lot!!
0 Kudos
Alexander_K_Intel2
1,180 Views
Quoting - recage
Sir, may I call you Jesus?
Changing the header file solved the problem.
Thanks a lot!!
Recage,
Thanks for the good words, you are welcome :)
With best regards,
Alexander Kalinkin
0 Kudos
Reply