<?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 Feast with g++ in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Feast-with-g/m-p/1132420#M25723</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am thinking of using&amp;nbsp;feast to get a small set (around 300 lowest) of eigenvectors of a huge sparse matrix (more than a 10 million basis functions) in my c++ code. As a first step towards that I was trying to make the example code "dexample_sparse_c.c" work for me&amp;nbsp; and here is the issue that I am facing:&lt;/P&gt;&lt;P&gt;When I am compiling the code with gcc everything is fine. I use the following command to compile it:&lt;/P&gt;
&lt;PRE class="brush:bash; class-name:dark;"&gt; gcc dexample_sparse_c.c -DMKL_ILP64 -m64 -I${MKLROOT}/include -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_cdft_core.a ${MKLROOT}/lib/intel64/libmkl_intel_ilp64.a ${MKLROOT}/lib/intel64/libmkl_sequential.a ${MKLROOT}/lib/intel64/libmkl_core.a  -Wl,--end-group -lpthread -lm -ldl&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But when I try to compile it with g++ i am getting an error&lt;/P&gt;

&lt;PRE class="brush:bash; class-name:dark;"&gt;dexample_sparse_c.c: In function ‘int main()’:
dexample_sparse_c.c:239:42: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=]
     printf("FEAST OUTPUT INFO %d \n",info);
                                          ^
dexample_sparse_c.c:248:50: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=]
     printf("Number of eigenvalues found %d \n", M);
                                                  ^
dexample_sparse_c.c:280:9: error: ‘dgemm’ was not declared in this scope
         );
         ^
dexample_sparse_c.c:292:50: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=]
     printf("#mode found/subspace %d %d \n", M, M0);
                                                  ^
dexample_sparse_c.c:292:50: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘long long int’ [-Wformat=]
dexample_sparse_c.c:293:37: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=]
     printf("#iterations %d \n", loop);
                                     ^
dexample_sparse_c.c:304:55: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=]
         printf("   %d  %.15e %.15e \n",i, E&lt;I&gt;, res&lt;I&gt;);
                                                       ^
dexample_sparse_c.c:356:43: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=]
     printf("FEAST OUTPUT INFO %d \n" ,info);
                                           ^
dexample_sparse_c.c:365:50: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=]
     printf("Number of eigenvalues found %d \n", M);
                                                  ^
dexample_sparse_c.c:418:49: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=]
     printf("# mode found/subspace %d %d \n",M,M0);
                                                 ^
dexample_sparse_c.c:418:49: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘long long int’ [-Wformat=]
dexample_sparse_c.c:419:37: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=]
     printf("# iterations %d \n",loop);
                                     ^
dexample_sparse_c.c:431:56: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=]
         printf("   %d  %.15e %.15e \n", i, E&lt;I&gt;, res&lt;I&gt;);&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am using the following command to compile with g++, which is exactly the same as above but with g++ instead of gcc:&lt;/P&gt;

&lt;PRE class="brush:bash; class-name:dark;"&gt;g++ dexample_sparse_c.c -DMKL_ILP64 -m64 -I${MKLROOT}/include -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_cdft_core.a ${MKLROOT}/lib/intel64/libmkl_intel_ilp64.a ${MKLROOT}/lib/intel6
4/libmkl_sequential.a ${MKLROOT}/lib/intel64/libmkl_core.a  -Wl,--end-group -lpthread -lm -ldl&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, as a completely separate question, we&amp;nbsp;have been using Lanczos algorithm uptil now to achieve the same objective (although I didn't write that code, but an earlier postdoc in my group did). If someone has experience/knows about this, what are the advantages of feast over lanczos or vice versa?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 21 Apr 2019 23:10:12 GMT</pubDate>
    <dc:creator>Sharma__Ketan</dc:creator>
    <dc:date>2019-04-21T23:10:12Z</dc:date>
    <item>
      <title>Feast with g++</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Feast-with-g/m-p/1132420#M25723</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am thinking of using&amp;nbsp;feast to get a small set (around 300 lowest) of eigenvectors of a huge sparse matrix (more than a 10 million basis functions) in my c++ code. As a first step towards that I was trying to make the example code "dexample_sparse_c.c" work for me&amp;nbsp; and here is the issue that I am facing:&lt;/P&gt;&lt;P&gt;When I am compiling the code with gcc everything is fine. I use the following command to compile it:&lt;/P&gt;
&lt;PRE class="brush:bash; class-name:dark;"&gt; gcc dexample_sparse_c.c -DMKL_ILP64 -m64 -I${MKLROOT}/include -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_cdft_core.a ${MKLROOT}/lib/intel64/libmkl_intel_ilp64.a ${MKLROOT}/lib/intel64/libmkl_sequential.a ${MKLROOT}/lib/intel64/libmkl_core.a  -Wl,--end-group -lpthread -lm -ldl&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But when I try to compile it with g++ i am getting an error&lt;/P&gt;

&lt;PRE class="brush:bash; class-name:dark;"&gt;dexample_sparse_c.c: In function ‘int main()’:
dexample_sparse_c.c:239:42: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=]
     printf("FEAST OUTPUT INFO %d \n",info);
                                          ^
dexample_sparse_c.c:248:50: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=]
     printf("Number of eigenvalues found %d \n", M);
                                                  ^
dexample_sparse_c.c:280:9: error: ‘dgemm’ was not declared in this scope
         );
         ^
dexample_sparse_c.c:292:50: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=]
     printf("#mode found/subspace %d %d \n", M, M0);
                                                  ^
dexample_sparse_c.c:292:50: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘long long int’ [-Wformat=]
dexample_sparse_c.c:293:37: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=]
     printf("#iterations %d \n", loop);
                                     ^
dexample_sparse_c.c:304:55: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=]
         printf("   %d  %.15e %.15e \n",i, E&lt;I&gt;, res&lt;I&gt;);
                                                       ^
dexample_sparse_c.c:356:43: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=]
     printf("FEAST OUTPUT INFO %d \n" ,info);
                                           ^
dexample_sparse_c.c:365:50: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=]
     printf("Number of eigenvalues found %d \n", M);
                                                  ^
dexample_sparse_c.c:418:49: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=]
     printf("# mode found/subspace %d %d \n",M,M0);
                                                 ^
dexample_sparse_c.c:418:49: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘long long int’ [-Wformat=]
dexample_sparse_c.c:419:37: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=]
     printf("# iterations %d \n",loop);
                                     ^
dexample_sparse_c.c:431:56: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=]
         printf("   %d  %.15e %.15e \n", i, E&lt;I&gt;, res&lt;I&gt;);&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am using the following command to compile with g++, which is exactly the same as above but with g++ instead of gcc:&lt;/P&gt;

&lt;PRE class="brush:bash; class-name:dark;"&gt;g++ dexample_sparse_c.c -DMKL_ILP64 -m64 -I${MKLROOT}/include -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_cdft_core.a ${MKLROOT}/lib/intel64/libmkl_intel_ilp64.a ${MKLROOT}/lib/intel6
4/libmkl_sequential.a ${MKLROOT}/lib/intel64/libmkl_core.a  -Wl,--end-group -lpthread -lm -ldl&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, as a completely separate question, we&amp;nbsp;have been using Lanczos algorithm uptil now to achieve the same objective (although I didn't write that code, but an earlier postdoc in my group did). If someone has experience/knows about this, what are the advantages of feast over lanczos or vice versa?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Apr 2019 23:10:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Feast-with-g/m-p/1132420#M25723</guid>
      <dc:creator>Sharma__Ketan</dc:creator>
      <dc:date>2019-04-21T23:10:12Z</dc:date>
    </item>
    <item>
      <title>There are several issues with</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Feast-with-g/m-p/1132421#M25724</link>
      <description>&lt;P&gt;There are several issues with the example code. Most of the error messages that you received are related to using ILP64 and an example in which many variables are MKL_INT, which becomes a 64-bit int when ILP64 is being used. As long as the 64-bit integer variables have values that do not need more than 32 bits to represent, these mismatches may be benign. You may need to change the %d formats in your printf() calls to formats more appropriate to the corresponding integers. You may also use a compiler options that allows the compiler to overlook benign mismatches.&lt;/P&gt;&lt;P&gt;You need to include mkl_blas.h for the prototype of dgemm().&lt;/P&gt;&lt;P&gt;I do not have an opinion regarding your question regarding the Lanczos versus the Feast algorithms.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2019 08:42:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Feast-with-g/m-p/1132421#M25724</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2019-04-25T08:42:18Z</dc:date>
    </item>
  </channel>
</rss>

