<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Thank you for the reply. in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Help-on-running-GMRES-with-MKL-in-C/m-p/1182648#M29416</link>
    <description>&lt;P&gt;Thank you for the reply.&lt;/P&gt;&lt;P&gt;As I mentioned, I am new to using MKL. there was no special requirement for using 64bit integer data types, I have simply followed the provided example files and the user manual ( Intel Math Kernel Library reference guide.pdf - 2019, page 1812).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;previously included code is a small section of large flow code and I have included the function containing gmres&amp;nbsp;call, attaching the entire code is not possible therefore I have attached a relevant section of the source code ("gmres.h") and also the example ( "fgmres_st_criterion_c.c"&amp;nbsp; ) since it was mentioned.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It will be a great help if someone can provide some documentation or example how to use these sparse solvers&amp;nbsp;in C++ environment.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you&lt;/P&gt;&lt;P&gt;Dilshan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 28 Dec 2018 03:54:40 GMT</pubDate>
    <dc:creator>Dilshan_Sithira_Priy</dc:creator>
    <dc:date>2018-12-28T03:54:40Z</dc:date>
    <item>
      <title>Help on running GMRES with MKL in C++</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Help-on-running-GMRES-with-MKL-in-C/m-p/1182645#M29413</link>
      <description>&lt;P style="margin-left:0in; margin-right:0in"&gt;Hi,&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;I am new to MKL library. I tried to use to use it to solve a sparse system matrix using “GMRES” functions in MKL library.&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;I tried the steps in the given in examples which come with the MKL library ( “fgmres_st_criterion_c.c”). I was able to compile and run the example with ICC v19.0 ( I am using Windows 10 64bit with Intel Parallel studio 2019. I have a student license). The problem is when I ported the code into my C++ program, nothing seems to be working.&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;My code is written in C++ and I am using template classes. I am not sure whether this is possible or not. I have included my code until gmres solver is initialized. The initialization fails and the error code is not listed in the documentation (“RCI_request =-3689348814741910324” ). “ipar” variable has wrong values.&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;Additionally, I notice something strange. Let's say if I am to set “RCI_request =0” (which is not needed) before calling “dfgmres_init”. Then “dfgmres_init” will simply return RCI_request =0. But still, the “ipar” variable values are wrong. I notice the same behavior with the Conjugate Gradient method.&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;I have 16k elements in my problem but it will be much larger when the mesh is refined. ( n = 16000).&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;Thank you all in advance&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;Dilshan&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;template&amp;lt;class T&amp;gt;&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;void SPMV&amp;lt;T&amp;gt;::call_gmres_solver_mkl(const vector&amp;lt;T&amp;gt;&amp;amp; coefNeigbor, const vector&amp;lt;T&amp;gt;&amp;amp; RHS,&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vector&amp;lt;T&amp;gt;&amp;amp; phi, vector&amp;lt;T&amp;gt;&amp;amp; phiOld) {&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;if (sizeof(T) == sizeof(float)) {&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cout &amp;lt;&amp;lt; "currently this program is written for double floatting point numbers only.\nplease update the source code and recompiler" &amp;lt;&amp;lt; endl;&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cout &amp;lt;&amp;lt; "Program will terminate now" &amp;lt;&amp;lt; endl;&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cin.get();&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exit(0);&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MKL_INT n = nFl;// number of unknows&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MKL_INT nEle = (nFl + (nFl*nface) - (nTtl - nFl));&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (nEle &amp;lt;= 0) {&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cout &amp;lt;&amp;lt; "The number of interfaces must be greater than zero. current value =" &amp;lt;&amp;lt; n &amp;lt;&amp;lt; endl;&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cout &amp;lt;&amp;lt; "Program will exit now" &amp;lt;&amp;lt; endl;&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cin.get();&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exit(0);&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;MKL_INT RCI_request, itercount, expected_itercount = 8;//&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; double *A = (double*)malloc(nEle * sizeof(double));&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; double *residual = (double*)malloc(n * sizeof(double));&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int id = 0;&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ia[0] = 0;&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int n0 = n * (2 * n + 1) + (n * (n + 9)) / 2 + 1;&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; double *tmp = (double *)malloc(n0 * sizeof(double));&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; double *rhs = (double *)malloc(n * sizeof(double));&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; double *solution = (double *)malloc(n * sizeof(double));&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;MKL_INT ipar[128];&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; double dpar[128];&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;// At first run phiOld = 0&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;for (int i = 0; i &amp;lt; n; i++) {&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; solution&lt;I&gt; = phiOld&lt;I&gt;;&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rhs&lt;I&gt; = RHS&lt;I&gt;;&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;dfgmres_init(&amp;amp;n, solution, rhs, &amp;amp;RCI_request, ipar, dpar, tmp);&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;if (RCI_request != 0) {&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;cout &amp;lt;&amp;lt; "Some error occured during the gmres initialisation phase. Error code =" &amp;lt;&amp;lt; RCI_request &amp;lt;&amp;lt; endl;&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; goto FAILED;&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;}&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;// rest of the code&lt;/P&gt;&lt;P style="margin-left:0in; margin-right:0in"&gt;}&lt;/P&gt;</description>
      <pubDate>Thu, 27 Dec 2018 17:07:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Help-on-running-GMRES-with-MKL-in-C/m-p/1182645#M29413</guid>
      <dc:creator>Dilshan_Sithira_Priy</dc:creator>
      <dc:date>2018-12-27T17:07:53Z</dc:date>
    </item>
    <item>
      <title>Decimal ‭-3689348814741910324</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Help-on-running-GMRES-with-MKL-in-C/m-p/1182646#M29414</link>
      <description>&lt;P&gt;Decimal ‭-3689348814741910324 is 0xCCCCCCCCCCCCCCCC‬, so I suspect that your code is not calling the MKL routine(s) with the correct ABI. You seem to be passing integer arguments to MKL as 64-bit integers; was that your intention?&lt;/P&gt;&lt;P&gt;MKL is intended to be called from Fortran, C, and anything else that makes C-like calls. It is up to you to make sure that your C++ code calls MKL in a compatible manner.&lt;/P&gt;&lt;P&gt;If you want more help with this problem, please post the full source code, rather than snippets.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Dec 2018 03:19:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Help-on-running-GMRES-with-MKL-in-C/m-p/1182646#M29414</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2018-12-28T03:19:00Z</dc:date>
    </item>
    <item>
      <title>and show how do you link this</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Help-on-running-GMRES-with-MKL-in-C/m-p/1182647#M29415</link>
      <description>&lt;P&gt;and show how do you link this example&lt;/P&gt;</description>
      <pubDate>Fri, 28 Dec 2018 03:26:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Help-on-running-GMRES-with-MKL-in-C/m-p/1182647#M29415</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2018-12-28T03:26:03Z</dc:date>
    </item>
    <item>
      <title>Thank you for the reply.</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Help-on-running-GMRES-with-MKL-in-C/m-p/1182648#M29416</link>
      <description>&lt;P&gt;Thank you for the reply.&lt;/P&gt;&lt;P&gt;As I mentioned, I am new to using MKL. there was no special requirement for using 64bit integer data types, I have simply followed the provided example files and the user manual ( Intel Math Kernel Library reference guide.pdf - 2019, page 1812).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;previously included code is a small section of large flow code and I have included the function containing gmres&amp;nbsp;call, attaching the entire code is not possible therefore I have attached a relevant section of the source code ("gmres.h") and also the example ( "fgmres_st_criterion_c.c"&amp;nbsp; ) since it was mentioned.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It will be a great help if someone can provide some documentation or example how to use these sparse solvers&amp;nbsp;in C++ environment.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you&lt;/P&gt;&lt;P&gt;Dilshan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Dec 2018 03:54:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Help-on-running-GMRES-with-MKL-in-C/m-p/1182648#M29416</guid>
      <dc:creator>Dilshan_Sithira_Priy</dc:creator>
      <dc:date>2018-12-28T03:54:40Z</dc:date>
    </item>
    <item>
      <title>Please provide the answer to</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Help-on-running-GMRES-with-MKL-in-C/m-p/1182649#M29417</link>
      <description>&lt;P&gt;Please provide the answer to Gennady's question. I suspect that you have changed MKL_INT without choosing the corresponding proper settings to use ILP64 libraries instead of LP64 libraries. You may find it useful to print (with printf() or cout) the value of sizeof(RCI_request) just before the call to dfgmres_init().&lt;/P&gt;</description>
      <pubDate>Fri, 28 Dec 2018 09:17:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Help-on-running-GMRES-with-MKL-in-C/m-p/1182649#M29417</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2018-12-28T09:17:37Z</dc:date>
    </item>
    <item>
      <title>thank you mecej4, for the tip</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Help-on-running-GMRES-with-MKL-in-C/m-p/1182650#M29418</link>
      <description>&lt;P&gt;thank you&amp;nbsp;mecej4, for the tip. you are right, I was not using the correct ILP64 setting. Any guess why it was&amp;nbsp;possible for me to run "fgmres_st_criterion_c.c" file without using the correct setting? by the way, previously I did not understand what&amp;nbsp;Gennady asked. sorry for that.&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you very much&amp;nbsp;for your time.&lt;/P&gt;&lt;P&gt;Dilshan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Dec 2018 15:08:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Help-on-running-GMRES-with-MKL-in-C/m-p/1182650#M29418</guid>
      <dc:creator>Dilshan_Sithira_Priy</dc:creator>
      <dc:date>2018-12-28T15:08:17Z</dc:date>
    </item>
    <item>
      <title>Re: thank you mecej4, for the tip</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Help-on-running-GMRES-with-MKL-in-C/m-p/1624056#M36330</link>
      <description>&lt;P&gt;I have the same problem with you, and I would like to ask how to use ILP64 correctly.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;my way using&amp;nbsp;ILP64 is:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#define MKL_ILP64&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;and my problem is call&amp;nbsp;&lt;SPAN&gt;dfgmres_init(),&amp;nbsp;RCI_request=‭-3689348814741910324.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you very much&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Aug 2024 03:00:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Help-on-running-GMRES-with-MKL-in-C/m-p/1624056#M36330</guid>
      <dc:creator>houjy</dc:creator>
      <dc:date>2024-08-19T03:00:29Z</dc:date>
    </item>
  </channel>
</rss>

