<?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 The 3 X 3 matrix that you in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Pardiso-in-Fortran-MKL-giving-incorrect-answers/m-p/1123505#M25096</link>
    <description>&lt;P&gt;The 3 X 3 matrix that you chose is singular -- the arithmetic mean of rows 1 and 3 equals row 2.&lt;/P&gt;</description>
    <pubDate>Tue, 12 Jul 2016 22:12:27 GMT</pubDate>
    <dc:creator>mecej4</dc:creator>
    <dc:date>2016-07-12T22:12:27Z</dc:date>
    <item>
      <title>Pardiso in Fortran MKL giving incorrect answers</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Pardiso-in-Fortran-MKL-giving-incorrect-answers/m-p/1123504#M25095</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I am trying to understand how the Intel MKL works and so i created a small test code that I have cobbled together from the internet to teach myself how the libraries behave so that I can implement the capability in other projects. My code compiles, runs and reports to zero errors but returns the wrong answer for my system. I have to be doing something wrong but I have no idea what that thing is. My test code is below.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;PROGRAM PardisoTest&lt;/P&gt;

&lt;P&gt;use MKL_PARDISO&lt;/P&gt;

&lt;P&gt;IMPLICIT NONE&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp;TYPE(MKL_PARDISO_HANDLE), ALLOCATABLE, DIMENSION(:) :: PT&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;INTEGER, ALLOCATABLE, DIMENSION(:) :: idum&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;INTEGER, ALLOCATABLE, DIMENSION(:) :: ivect&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;INTEGER, ALLOCATABLE, DIMENSION(:) :: jvect&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;REAL, ALLOCATABLE, DIMENSION(:) :: b&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;REAL, ALLOCATABLE, DIMENSION(:) :: a&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;REAL, ALLOCATABLE, DIMENSION(:) :: x&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;REAL, ALLOCATABLE, DIMENSION(:) :: solution&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;REAL, ALLOCATABLE, DIMENSION(:) :: error&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;REAL, ALLOCATABLE, DIMENSION(:) :: ddum&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;INTEGER :: maxfct, mnum, mtype, phase, nrhs, ierr, msglvl, i, nnz, nequations&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;INTEGER, DIMENSION(64) :: iparm&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp;nrhs =1&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;maxfct = 1&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;mnum = 1&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp;nnz = 9&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;nequations = 3&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp;do i = 1, 64&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; iparm(i) = 0&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;end do&lt;BR /&gt;
	!&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;iparm(1) = 0 ! solver default&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;error = 0 ! initialize error flag&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;msglvl = 1 ! print statistical information&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;mtype = 11 ! real unsymmetric --&amp;gt; as an example&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp;ALLOCATE(PT(64))&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;ALLOCATE(idum(0))&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;ALLOCATE(ddum(0))&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;ALLOCATE(b(nEquations))&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;ALLOCATE(x(nEquations))&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;ALLOCATE(a(nnz))&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;ALLOCATE(ivect(nequations+1))&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;ALLOCATE(jvect(nnz))&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;ALLOCATE(error(nEquations))&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp;do i = 1, 64&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; PT(i)%DUMMY = 0&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;end do&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp;a=(/1,2,3,4,5,6,7,8,9/)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;b=(/14,32,50/)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;solution = (/1.0, 2.0, 3.0/)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;jvect = (/1,2,3,1,2,3,1,2,3/)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;ivect = (/1,4,7,10/)&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;phase = 11&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;CALL pardiso (PT, maxfct, mnum, mtype, phase, nequations, a, ivect, jvect, idum, nrhs, iparm, msglvl, ddum, ddum, ierr)&lt;BR /&gt;
	!&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;phase = 22&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;CALL pardiso (PT, maxfct, mnum, mtype, phase, nequations, a, ivect, jvect, idum, nrhs, iparm, msglvl, ddum, ddum, ierr)&lt;BR /&gt;
	!&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;phase = 33&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;CALL pardiso (PT, maxfct, mnum, mtype, phase, nequations, a, ivect, jvect, idum, nrhs, iparm, msglvl, b, x, ierr)&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp;error = solution - x&lt;/P&gt;

&lt;P&gt;END PROGRAM PardisoTest&lt;/P&gt;

&lt;P&gt;Any help that someone could provide would be greatly appreciated.&lt;/P&gt;

&lt;P&gt;Matt&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2016 20:55:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Pardiso-in-Fortran-MKL-giving-incorrect-answers/m-p/1123504#M25095</guid>
      <dc:creator>matthew_bernardnrc_g</dc:creator>
      <dc:date>2016-07-12T20:55:12Z</dc:date>
    </item>
    <item>
      <title>The 3 X 3 matrix that you</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Pardiso-in-Fortran-MKL-giving-incorrect-answers/m-p/1123505#M25096</link>
      <description>&lt;P&gt;The 3 X 3 matrix that you chose is singular -- the arithmetic mean of rows 1 and 3 equals row 2.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2016 22:12:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Pardiso-in-Fortran-MKL-giving-incorrect-answers/m-p/1123505#M25096</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2016-07-12T22:12:27Z</dc:date>
    </item>
    <item>
      <title>Geez, that was an</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Pardiso-in-Fortran-MKL-giving-incorrect-answers/m-p/1123506#M25097</link>
      <description>&lt;P&gt;Geez, that was an embarrassing mistake. I made a change to my system so that a(3,3,)&amp;nbsp;= 10 instead of 9 and b(3) = 53. instead of 50. This fixes the linear dependence of my system and maintains the solution vector for this trivial system. Unfortunately, now my solution vector is just b = (/0.0, Nan, 0.0/). Is there anything else I need to change?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2016 12:48:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Pardiso-in-Fortran-MKL-giving-incorrect-answers/m-p/1123506#M25097</guid>
      <dc:creator>matthew_bernardnrc_g</dc:creator>
      <dc:date>2016-07-13T12:48:42Z</dc:date>
    </item>
    <item>
      <title>I wanted to report that I got</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Pardiso-in-Fortran-MKL-giving-incorrect-answers/m-p/1123507#M25098</link>
      <description>&lt;P&gt;I wanted to report that I got my program to work. It appears that the pardiso subroutine requires double precision vectors for the a, b, and x variables. I tested this by declaring an arbitrary type parameter and specifying different precisions for the variables. While it does surprise me that this is a requirement of the capability, it is not something that will affect its use in my other projects. I was not able to find any simple examples using the pardiso interface in fortran 90 so I am pasting my working code below. Thank you again for your help.&lt;/P&gt;

&lt;P&gt;Matt&lt;/P&gt;

&lt;P&gt;PROGRAM PardisoTest&lt;/P&gt;

&lt;P&gt;use MKL_PARDISO&lt;/P&gt;

&lt;P&gt;IMPLICIT NONE&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp;INTEGER, PARAMETER :: sdk = SELECTED_REAL_KIND(13, 307)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;INTEGER, PARAMETER :: sik = KIND(10000000)&lt;BR /&gt;
	!&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;TYPE(MKL_PARDISO_HANDLE), ALLOCATABLE, DIMENSION(:) :: PT&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;INTEGER(sik), ALLOCATABLE, DIMENSION(:) :: idum&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;INTEGER(sik), ALLOCATABLE, DIMENSION(:) :: ivect&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;INTEGER(sik), ALLOCATABLE, DIMENSION(:) :: jvect&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;REAL(sdk), ALLOCATABLE, DIMENSION(:) :: b&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;REAL(sdk), ALLOCATABLE, DIMENSION(:) :: a&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;REAL(sdk), ALLOCATABLE, DIMENSION(:) :: x&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;REAL(sdk), ALLOCATABLE, DIMENSION(:) :: solution&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;REAL(sdk), ALLOCATABLE, DIMENSION(:) :: error&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;REAL(sdk), ALLOCATABLE, DIMENSION(:) :: ddum&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;INTEGER(sik) :: maxfct, mnum, mtype, phase, nrhs, ierr, msglvl, i, nnz, nequations&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;INTEGER(sik), DIMENSION(64) :: iparm&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp;nrhs =1&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;maxfct = 1&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;mnum = 1&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp;nnz = 9&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;nequations = 3&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp;do i = 1, 64&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; iparm(i) = 0&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;end do&lt;BR /&gt;
	!&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;iparm(1) = 0 ! solver default&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;error = 0 ! initialize error flag&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;msglvl = 1 ! print statistical information&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;mtype = 11 ! real unsymmetric --&amp;gt; as an example&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp;ALLOCATE(PT(64))&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;ALLOCATE(idum(0))&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;ALLOCATE(ddum(0))&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;ALLOCATE(b(nEquations))&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;ALLOCATE(x(nEquations))&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;ALLOCATE(a(nnz))&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;ALLOCATE(ivect(nequations+1))&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;ALLOCATE(jvect(nnz))&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;ALLOCATE(error(nEquations))&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;ALLOCATE(solution(nEquations))&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp;do i = 1, 64&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; PT(i)%DUMMY = 0&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;end do&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp;a=(/1.0_sdk,2.0_sdk,3.0_sdk,4.0_sdk,5.0_sdk,6.0_sdk,7.0_sdk,8.0_sdk,10.0_sdk/)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;b=(/14.0_sdk,32.0_sdk,53.0_sdk/)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;solution = (/1.0, 2.0, 3.0/)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;jvect = (/1,2,3,1,2,3,1,2,3/)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;ivect = (/1,4,7,10/)&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;phase = 11&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;CALL pardiso (PT, maxfct, mnum, mtype, phase, nequations, a, ivect, jvect, idum, nrhs, iparm, msglvl, ddum, ddum, ierr)&lt;BR /&gt;
	!&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;phase = 22&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;CALL pardiso (PT, maxfct, mnum, mtype, phase, nequations, a, ivect, jvect, idum, nrhs, iparm, msglvl, ddum, ddum, ierr)&lt;BR /&gt;
	!&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;phase = 33&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;CALL pardiso (PT, maxfct, mnum, mtype, phase, nequations, a, ivect, jvect, idum, nrhs, iparm, msglvl, b, x, ierr)&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp;error = solution - x&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp;phase = -1&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;CALL pardiso (PT, maxfct, mnum, mtype, phase, nequations, a, ivect, jvect, idum, nrhs, iparm, msglvl, ddum, ddum, ierr)&lt;/P&gt;

&lt;P&gt;END PROGRAM PardisoTest&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2016 13:58:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Pardiso-in-Fortran-MKL-giving-incorrect-answers/m-p/1123507#M25098</guid>
      <dc:creator>matthew_bernardnrc_g</dc:creator>
      <dc:date>2016-07-13T13:58:00Z</dc:date>
    </item>
    <item>
      <title>There is no separate F95</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Pardiso-in-Fortran-MKL-giving-incorrect-answers/m-p/1123508#M25099</link>
      <description>&lt;P&gt;There is no separate F95 interface to Pardiso. Secondly, to use non-default type matrices, you have to set IPARM() accordingly. For example, iparm(28) = 1 is needed if you want to use matrices whose elements are 32-bit reals. The calling sequence of Pardiso is rather complex, and there are a large number of options to understand and to pass correct values for.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2016 14:17:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Pardiso-in-Fortran-MKL-giving-incorrect-answers/m-p/1123508#M25099</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2016-07-13T14:17:05Z</dc:date>
    </item>
  </channel>
</rss>

