<?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      Here is my codes. in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dss-solver-gives-non-stable-solve/m-p/973748#M16927</link>
    <description>&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Here is my codes.&lt;/P&gt;

&lt;P&gt;Thank you so much.&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt; SUBROUTINE NFDSS_SOLVE(XDIFF,IU,JU,UM,nRow0,ITER,Idum)
      INCLUDE 'mkl_dss.f77'
      !INCLUDE 'mkl_pardiso.f77'

      INTEGER IU(*), JU(*), Idum(*), nRow0, nRow, ITER
      REAL  UM(*), XDIFF(*)
      
      INTEGER tIU(:), tJU(:)
      DOUBLE PRECISION tUM(:), tXDIFF(:), tX(:)
      ALLOCATABLE tIU, tJU, tUM, tXDIFF, tX
      
      INTEGER nNonZeros, nNonZeros0
      
      INTEGER*8 handle
      INTEGER error

      nNonZeros0=IU(nRow0+1)-1;
      
      nRow=nRow0-2;
      nNonZeros=nNonZeros0-2;
      
      ALLOCATE(tIU(nRow+1))
      ALLOCATE(tXDIFF(nRow))
      ALLOCATE(tX(nRow))
      ALLOCATE(tJU(nNonZeros))
      ALLOCATE(tUM(nNonZeros))
      
      tIU(1:nRow+1)=IU(3:nRow+3)-2
      tJU(1:nNonZeros)=JU(3:nNonZeros+2)-2
      tUM(1:nNonZeros)=UM(3:nNonZeros+2)
      tXDIFF(1:nRow)=XDIFF(3:nRow+3)

    
C---------------------------------------------------------------------------
C Initialize the solver
C---------------------------------------------------------------------------
      error = dss_create(handle, MKL_DSS_DEFAULTS+MKL_DSS_OOC_VARIABLE)
      IF (error .NE. MKL_DSS_SUCCESS ) GOTO 999
C---------------------------------------------------------------------------

C---------------------------------------------------------------------------
C Define the non-zero structure of the matrix
C---------------------------------------------------------------------------
      error = dss_define_structure( handle, MKL_DSS_NON_SYMMETRIC,
     &amp;amp; tIU, nRow, nRow, tJU, nNonZeros )
      IF (error .NE. MKL_DSS_SUCCESS ) GOTO 999
C---------------------------------------------------------------------------

C---------------------------------------------------------------------------
C Reorder the matrix
C---------------------------------------------------------------------------

      IF (ITER.EQ.1) THEN
          error = dss_reorder( handle, MKL_DSS_GET_ORDER, Idum)
          IF (error .NE. MKL_DSS_SUCCESS ) GOTO 999
      ELSE
          error = dss_reorder( handle, MKL_DSS_MY_ORDER, Idum)
          IF (error .NE. MKL_DSS_SUCCESS ) GOTO 999
      ENDIF

C---------------------------------------------------------------------------
C Factor the matrix
C---------------------------------------------------------------------------
      error = dss_factor_real( handle, MKL_DSS_DEFAULTS, tUM)
      IF (error .NE. MKL_DSS_SUCCESS ) GOTO 999
      
C---------------------------------------------------------------------------
C Get the solution vector
C---------------------------------------------------------------------------
      error = dss_solve_real( handle, MKL_DSS_DEFAULTS,
     &amp;amp; tXDIFF, 1, tX)
      IF (error .NE. MKL_DSS_SUCCESS ) GOTO 999
C---------------------------------------------------------------------------


      
C---------------------------------------------------------------------------
C Deallocate solver storage
C---------------------------------------------------------------------------
      error = dss_delete( handle, MKL_DSS_DEFAULTS )
      IF (error .NE. MKL_DSS_SUCCESS ) GOTO 999
C---------------------------------------------------------------------------
 
      GOTO 1999
  999 WRITE(*,*) "Solver returned error code ", error
      
 1999 XDIFF(3:nRow+2)= tX(1:nRow)
      
      
      DEALLOCATE(tIU,tJU,tUM,tXDIFF,tX)
      RETURN
      END&lt;/PRE&gt;

&lt;PRE class="brush:fortran;"&gt;   &amp;nbsp;&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 07 Apr 2014 17:20:34 GMT</pubDate>
    <dc:creator>Tianyu_D_</dc:creator>
    <dc:date>2014-04-07T17:20:34Z</dc:date>
    <item>
      <title>dss_solver gives non-stable solve</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dss-solver-gives-non-stable-solve/m-p/973743#M16922</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;

&lt;P&gt;I am using the mkl_dss.f77 to solve large sparse non-linear equations by iteratively calling the dss_solver. I just spotted that although I set the same initial values, I could not obtain a same result for every time. And I found this is due to the dss_solver gives results with slightly difference every time and the difference adds up in the iteration process which leads to a non-stable solve for the large sparse non-linear equations.&lt;/P&gt;

&lt;P&gt;How can I make the mkl_dss solver to have repetitive accuracy? Anyone could give me some advice on this subject?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Apr 2014 15:44:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dss-solver-gives-non-stable-solve/m-p/973743#M16922</guid>
      <dc:creator>Tianyu_D_</dc:creator>
      <dc:date>2014-04-07T15:44:37Z</dc:date>
    </item>
    <item>
      <title>Hi,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dss-solver-gives-non-stable-solve/m-p/973744#M16923</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;It is better to use Pardiso interface for this aim. In Pardiso interface you can use CNR mode of MKL or set iparm[33] to maximum number of threads - both approach will provide stable results from run to run.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Alex&lt;/P&gt;</description>
      <pubDate>Mon, 07 Apr 2014 16:36:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dss-solver-gives-non-stable-solve/m-p/973744#M16923</guid>
      <dc:creator>Alexander_K_Intel2</dc:creator>
      <dc:date>2014-04-07T16:36:22Z</dc:date>
    </item>
    <item>
      <title>Hi Alex,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dss-solver-gives-non-stable-solve/m-p/973745#M16924</link>
      <description>&lt;P&gt;Hi Alex,&lt;/P&gt;

&lt;P&gt;Thank you for your reply.&lt;/P&gt;

&lt;P&gt;The reason I did not use Pardiso is that DSS provides the function&amp;nbsp;dss_reorder which could help to save time since I only need to reorder once in the iteration process.&lt;/P&gt;

&lt;P&gt;So if I want to keep using DSS, any suggestion for me to make its output stable?&lt;/P&gt;

&lt;P&gt;Regards,&lt;/P&gt;

&lt;P&gt;Tianyu&lt;/P&gt;</description>
      <pubDate>Mon, 07 Apr 2014 16:55:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dss-solver-gives-non-stable-solve/m-p/973745#M16924</guid>
      <dc:creator>Tianyu_D_</dc:creator>
      <dc:date>2014-04-07T16:55:57Z</dc:date>
    </item>
    <item>
      <title>and also matrix checker</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dss-solver-gives-non-stable-solve/m-p/973746#M16925</link>
      <description>&lt;P&gt;and also matrix checker option available with Pardiso API too. see ipatr(27). This functionality is not available for DSS API.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Apr 2014 16:59:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dss-solver-gives-non-stable-solve/m-p/973746#M16925</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2014-04-07T16:59:27Z</dc:date>
    </item>
    <item>
      <title>Hi Tianyu,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dss-solver-gives-non-stable-solve/m-p/973747#M16926</link>
      <description>&lt;P&gt;Hi Tianyu,&lt;/P&gt;

&lt;P&gt;Almost all that can be done via DSS interface can be implemented via PARDISO. Reordering step DSS_reorder correspondent to pardiso call with ido=11. But it is not quite good approach to call reordering only once for all matrix except symmetric-positive define, because good reordering step for all other matrix significantly depend on matrix value. Can you provide some pseudo-code of you algorithm that we can change to show how it can be done via PARDISO interface?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Alex&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Apr 2014 17:06:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dss-solver-gives-non-stable-solve/m-p/973747#M16926</guid>
      <dc:creator>Alexander_K_Intel2</dc:creator>
      <dc:date>2014-04-07T17:06:47Z</dc:date>
    </item>
    <item>
      <title>     Here is my codes.</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dss-solver-gives-non-stable-solve/m-p/973748#M16927</link>
      <description>&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Here is my codes.&lt;/P&gt;

&lt;P&gt;Thank you so much.&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt; SUBROUTINE NFDSS_SOLVE(XDIFF,IU,JU,UM,nRow0,ITER,Idum)
      INCLUDE 'mkl_dss.f77'
      !INCLUDE 'mkl_pardiso.f77'

      INTEGER IU(*), JU(*), Idum(*), nRow0, nRow, ITER
      REAL  UM(*), XDIFF(*)
      
      INTEGER tIU(:), tJU(:)
      DOUBLE PRECISION tUM(:), tXDIFF(:), tX(:)
      ALLOCATABLE tIU, tJU, tUM, tXDIFF, tX
      
      INTEGER nNonZeros, nNonZeros0
      
      INTEGER*8 handle
      INTEGER error

      nNonZeros0=IU(nRow0+1)-1;
      
      nRow=nRow0-2;
      nNonZeros=nNonZeros0-2;
      
      ALLOCATE(tIU(nRow+1))
      ALLOCATE(tXDIFF(nRow))
      ALLOCATE(tX(nRow))
      ALLOCATE(tJU(nNonZeros))
      ALLOCATE(tUM(nNonZeros))
      
      tIU(1:nRow+1)=IU(3:nRow+3)-2
      tJU(1:nNonZeros)=JU(3:nNonZeros+2)-2
      tUM(1:nNonZeros)=UM(3:nNonZeros+2)
      tXDIFF(1:nRow)=XDIFF(3:nRow+3)

    
C---------------------------------------------------------------------------
C Initialize the solver
C---------------------------------------------------------------------------
      error = dss_create(handle, MKL_DSS_DEFAULTS+MKL_DSS_OOC_VARIABLE)
      IF (error .NE. MKL_DSS_SUCCESS ) GOTO 999
C---------------------------------------------------------------------------

C---------------------------------------------------------------------------
C Define the non-zero structure of the matrix
C---------------------------------------------------------------------------
      error = dss_define_structure( handle, MKL_DSS_NON_SYMMETRIC,
     &amp;amp; tIU, nRow, nRow, tJU, nNonZeros )
      IF (error .NE. MKL_DSS_SUCCESS ) GOTO 999
C---------------------------------------------------------------------------

C---------------------------------------------------------------------------
C Reorder the matrix
C---------------------------------------------------------------------------

      IF (ITER.EQ.1) THEN
          error = dss_reorder( handle, MKL_DSS_GET_ORDER, Idum)
          IF (error .NE. MKL_DSS_SUCCESS ) GOTO 999
      ELSE
          error = dss_reorder( handle, MKL_DSS_MY_ORDER, Idum)
          IF (error .NE. MKL_DSS_SUCCESS ) GOTO 999
      ENDIF

C---------------------------------------------------------------------------
C Factor the matrix
C---------------------------------------------------------------------------
      error = dss_factor_real( handle, MKL_DSS_DEFAULTS, tUM)
      IF (error .NE. MKL_DSS_SUCCESS ) GOTO 999
      
C---------------------------------------------------------------------------
C Get the solution vector
C---------------------------------------------------------------------------
      error = dss_solve_real( handle, MKL_DSS_DEFAULTS,
     &amp;amp; tXDIFF, 1, tX)
      IF (error .NE. MKL_DSS_SUCCESS ) GOTO 999
C---------------------------------------------------------------------------


      
C---------------------------------------------------------------------------
C Deallocate solver storage
C---------------------------------------------------------------------------
      error = dss_delete( handle, MKL_DSS_DEFAULTS )
      IF (error .NE. MKL_DSS_SUCCESS ) GOTO 999
C---------------------------------------------------------------------------
 
      GOTO 1999
  999 WRITE(*,*) "Solver returned error code ", error
      
 1999 XDIFF(3:nRow+2)= tX(1:nRow)
      
      
      DEALLOCATE(tIU,tJU,tUM,tXDIFF,tX)
      RETURN
      END&lt;/PRE&gt;

&lt;PRE class="brush:fortran;"&gt;   &amp;nbsp;&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Apr 2014 17:20:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dss-solver-gives-non-stable-solve/m-p/973748#M16927</guid>
      <dc:creator>Tianyu_D_</dc:creator>
      <dc:date>2014-04-07T17:20:34Z</dc:date>
    </item>
    <item>
      <title>Hi Alex,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dss-solver-gives-non-stable-solve/m-p/973749#M16928</link>
      <description>&lt;P&gt;Hi Alex,&lt;/P&gt;

&lt;P&gt;The attached is my code.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Apr 2014 17:27:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dss-solver-gives-non-stable-solve/m-p/973749#M16928</guid>
      <dc:creator>Tianyu_D_</dc:creator>
      <dc:date>2014-04-07T17:27:03Z</dc:date>
    </item>
  </channel>
</rss>

