<?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 Re: Question about using fgmres in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Question-about-using-fgmres/m-p/855961#M6992</link>
    <description>&lt;P&gt;Hi Bruce and all,&lt;/P&gt;
&lt;P&gt;Thanks for your kindly reply!&lt;/P&gt;
&lt;P&gt;Another question: It seems that the dynamical allocated array'tmp' is associated with maximal iteration times given by ipar(15) (default value is 150). However, for very large martrix size, the solution can't be converged even witha preconditioner after maximal iteration times. Furthermore, we wish to decrease the size of allocated array 'tmp' to save memory (so the value of ipar(15) will be modified). Basing on these considers, we need to 'restart' the GMRES, which is the great feature of FGMRES. &lt;/P&gt;
&lt;P&gt;Could any one tell me how to 'restart' the GMRES based on the example code?&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;BR /&gt;Zhanghong Tang&lt;/P&gt;</description>
    <pubDate>Mon, 25 Jun 2007 13:05:48 GMT</pubDate>
    <dc:creator>Zhanghong_T_</dc:creator>
    <dc:date>2007-06-25T13:05:48Z</dc:date>
    <item>
      <title>Question about using fgmres</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Question-about-using-fgmres/m-p/855956#M6987</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I am trying to use the fgmres function provided by Intel MKL to solve A*x=b. Since the function provided external matrix-vector operation interface and the input matrix A is not inputted into the functions related to fgmres,I can use it to solve a symmetric matrix and then theinput matrix is lower part.I have the following code:&lt;/P&gt;&lt;PRE&gt;! FGMRES.f90 &lt;BR /&gt;!&lt;BR /&gt;! FUNCTIONS:&lt;BR /&gt;! FGMRES - Entry point of console application.&lt;BR /&gt;!&lt;/PRE&gt;&lt;PRE&gt;!****************************************************************************&lt;BR /&gt;!&lt;BR /&gt;! PROGRAM: FGMRES&lt;BR /&gt;!&lt;BR /&gt;! PURPOSE: Entry point for the console application.&lt;BR /&gt;!&lt;BR /&gt;!****************************************************************************&lt;/PRE&gt;&lt;PRE&gt; program FGMRES&lt;/PRE&gt;&lt;PRE&gt; implicit none&lt;/PRE&gt;&lt;PRE&gt; ! Variables&lt;BR /&gt; integer::i,j,n,nr,nz &lt;BR /&gt; integer,allocatable::irow(:),jcol(:)&lt;BR /&gt; real*8,allocatable::x(:,:),b(:,:),s(:)&lt;BR /&gt; nr=1&lt;BR /&gt; open(1,file='s.txt')&lt;BR /&gt; read(1,*)nz&lt;BR /&gt; allocate(irow(nz),jcol(nz),s(nz))&lt;BR /&gt; do i=1,nz&lt;BR /&gt; read(1,*)irow(i),jcol(i),s(i)&lt;BR /&gt; enddo&lt;BR /&gt; close(1)&lt;BR /&gt; open(1,file='r.txt')&lt;BR /&gt; read(1,*)n&lt;BR /&gt; allocate(x(n,nr),b(n,nr))&lt;BR /&gt; do i=1,n&lt;BR /&gt; read(1,*)b(i,1)&lt;BR /&gt; x(i,1)=0.d0&lt;BR /&gt; enddo&lt;BR /&gt; close(1)&lt;BR /&gt; call gmressolverd(n,nz,nr,irow,jcol,s,x,b)&lt;BR /&gt; ! Body of FGMRES&lt;/PRE&gt;&lt;PRE&gt; end program FGMRES&lt;BR /&gt; &lt;BR /&gt; subroutine gmressolverd(n,nz,nr,irow,jcol,s,x,b)&lt;BR /&gt; implicit none&lt;BR /&gt; integer::ipar(128)&lt;BR /&gt; real*8::dpar(128)&lt;BR /&gt; integer::i,j,n,nr,nz,irow(1),jcol(1),RCI_request,ntemp,iter&lt;BR /&gt; real*8::s(1),x(n,1),b(n,1)&lt;BR /&gt; real*8,allocatable::tmp(:)&lt;BR /&gt; character(6)::mattype&lt;BR /&gt; j=0&lt;BR /&gt; do i=1,nz&lt;BR /&gt; if(irow(i)&amp;gt;jcol(i))then&lt;BR /&gt; if(j==0.or.j==2)j=j+1&lt;BR /&gt; elseif(irow(i)&lt;JCOL&gt; if(j==0.or.j==1)j=j+2&lt;BR /&gt; endif&lt;BR /&gt; if(j==3)exit&lt;BR /&gt; enddo&lt;BR /&gt; if(j==1)then&lt;BR /&gt; mattype='SUNF00'&lt;BR /&gt; elseif(j==2)then&lt;BR /&gt; mattype='SLNF00'&lt;BR /&gt; elseif(j==3)then&lt;BR /&gt; mattype='G00F00'&lt;BR /&gt; endif&lt;BR /&gt; ntemp=150 ! max iterative times&lt;BR /&gt; ntemp=((2*ntemp+1)*n+ntemp*ntemp+9)/2+1&lt;BR /&gt; ntemp=ntemp+ntemp&lt;BR /&gt; allocate(tmp(ntemp))&lt;BR /&gt; call dfgmres_init(n, x, b, RCI_request, ipar, dpar, tmp)&lt;BR /&gt; if(RCI_request/=0)goto 999&lt;BR /&gt; ipar(9)=1&lt;BR /&gt; ipar(10)=0&lt;BR /&gt; ipar(12)=1&lt;BR /&gt; dpar(1)=1.d-20&lt;BR /&gt;&amp;amp;nbs
p; call dfgmres_check(n, x(:,1), b(:,1), RCI_request, ipar, dpar, tmp)&lt;BR /&gt; if(RCI_request/=0)goto 999&lt;BR /&gt; j=0&lt;BR /&gt; do&lt;BR /&gt; j=j+1&lt;BR /&gt; write(*,*)'iter=',j&lt;BR /&gt; call dfgmres(n,x(:,1),b(:,1),RCI_request,ipar,dpar,tmp)&lt;BR /&gt; if(RCI_request==0)then&lt;BR /&gt; exit&lt;BR /&gt; elseif(RCI_request==1)then&lt;BR /&gt; call mkl_dcoomv('n',n,n,1.d0,mattype,s,irow,jcol,nz,tmp(ipar(22)),0.d0,tmp(ipar(23)))&lt;BR /&gt; cycle&lt;BR /&gt; else&lt;BR /&gt; goto 999&lt;BR /&gt; endif&lt;BR /&gt; enddo&lt;BR /&gt; call dfgmres_get(n,x(:,1),b(:,1),RCI_request,ipar,dpar,tmp,iter)&lt;BR /&gt; return&lt;BR /&gt;999 &amp;amp; &lt;BR /&gt; write(*,*)'the solver has returned the error code:',RCI_request&lt;BR /&gt; call dfgmres_get(n,x,b,RCI_request,ipar,dpar,tmp,iter)&lt;BR /&gt; end subroutine&lt;/JCOL&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;/PRE&gt;
&lt;P&gt;However, the result is not correct. Could anyone point out the errors of my code?&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Zhanghong Tang&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2007 09:30:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Question-about-using-fgmres/m-p/855956#M6987</guid>
      <dc:creator>Zhanghong_T_</dc:creator>
      <dc:date>2007-06-11T09:30:53Z</dc:date>
    </item>
    <item>
      <title>Re: Question about using fgmres</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Question-about-using-fgmres/m-p/855957#M6988</link>
      <description>&lt;P&gt;Zhanghong,&lt;/P&gt;
&lt;P&gt;Did you look at the FGMRES examples that comewith MKL? They may be of help to you. At least that is the intention for developing them and providing them with the library.&lt;/P&gt;
&lt;P&gt;Bruce&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2007 20:54:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Question-about-using-fgmres/m-p/855957#M6988</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2007-06-11T20:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: Question about using fgmres</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Question-about-using-fgmres/m-p/855958#M6989</link>
      <description>&lt;P&gt;Hi Bruce,&lt;/P&gt;
&lt;P&gt;Thank you very much for your kindly reply. That code is just from the example, except that I change the matrix-vector product function from 'MKL_DCSRGEMV' to 'mkl_dcoomv', since the input matrix is coordinate format. Could you please help me to locate the problem? I have already attached an input matrix. The 'fgmres' function is a black box for me so I have no idea to check it.&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Zhanghong Tang&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jun 2007 00:37:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Question-about-using-fgmres/m-p/855958#M6989</guid>
      <dc:creator>Zhanghong_T_</dc:creator>
      <dc:date>2007-06-12T00:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: Question about using fgmres</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Question-about-using-fgmres/m-p/855959#M6990</link>
      <description>&lt;P&gt;Hi Bruce,&lt;/P&gt;
&lt;P&gt;Thank you very much! I have found the problem and the code can run well now.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Zhanghong Tang&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jun 2007 01:17:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Question-about-using-fgmres/m-p/855959#M6990</guid>
      <dc:creator>Zhanghong_T_</dc:creator>
      <dc:date>2007-06-12T01:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: Question about using fgmres</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Question-about-using-fgmres/m-p/855960#M6991</link>
      <description>&lt;P&gt;Glad to hear that things are running correctly for you now. Wish I could say that I had been a major help here, but in honesty I can't &lt;IMG src="https://community.intel.com/file/6746" alt="smiley [:-)]" /&gt;. &lt;/P&gt;
&lt;P&gt;Bruce&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2007 15:25:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Question-about-using-fgmres/m-p/855960#M6991</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2007-06-18T15:25:00Z</dc:date>
    </item>
    <item>
      <title>Re: Question about using fgmres</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Question-about-using-fgmres/m-p/855961#M6992</link>
      <description>&lt;P&gt;Hi Bruce and all,&lt;/P&gt;
&lt;P&gt;Thanks for your kindly reply!&lt;/P&gt;
&lt;P&gt;Another question: It seems that the dynamical allocated array'tmp' is associated with maximal iteration times given by ipar(15) (default value is 150). However, for very large martrix size, the solution can't be converged even witha preconditioner after maximal iteration times. Furthermore, we wish to decrease the size of allocated array 'tmp' to save memory (so the value of ipar(15) will be modified). Basing on these considers, we need to 'restart' the GMRES, which is the great feature of FGMRES. &lt;/P&gt;
&lt;P&gt;Could any one tell me how to 'restart' the GMRES based on the example code?&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;BR /&gt;Zhanghong Tang&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jun 2007 13:05:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Question-about-using-fgmres/m-p/855961#M6992</guid>
      <dc:creator>Zhanghong_T_</dc:creator>
      <dc:date>2007-06-25T13:05:48Z</dc:date>
    </item>
  </channel>
</rss>

