<?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 Hi Jeferson,  in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Fortran-PDGETRF-PDGETRI-for-Matrix-Inversion-parameter-with-an/m-p/1069148#M22140</link>
    <description>&lt;P&gt;Hi Jeferson,&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I replied your question from your another post.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;For C sample, here is one &amp;nbsp;https://software.intel.com/en-us/articles/using-cluster-mkl-pblasscalapack-fortran-routine-in-your-c-program =&amp;gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="https://software.intel.com/sites/default/files/article/165948/pdgemv.c" target="_blank"&gt;https://software.intel.com/sites/default/files/article/165948/pdgemv.c&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;for fortran sample, you may search the scalapack function in internet.&lt;/P&gt;

&lt;P&gt;like&amp;nbsp;http://acts.nersc.gov/tau/example-pdgesv/pdgesvdriver.f90.html&lt;/P&gt;

&lt;P&gt;In the code, you need at least some MPI init or blacs init code. &amp;nbsp; for example mkl build-in example&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;*******************************************************************************
C----------------------------------------------------------------------
C Example program to show the use of the "CLUSTER_SPARSE_SOLVER" routine
C for solving symmetric linear systems
C----------------------------------------------------------------------
      program cluster_sparse_solver_sym
      implicit none
      include 'mkl_cluster_sparse_solver.f77'
      include 'mpif.h'
C.. Internal solver memory pointer for 64-bit architectures
      INTEGER*8 pt(64)
C.. All other variables
      INTEGER maxfct, mnum, mtype, phase, n, nrhs, error, msglvl
      INTEGER*4 rank, mpi_stat
      INTEGER iparm(64)
      INTEGER ia(9)
      INTEGER ja(18)
      REAL*8 a(18)
      REAL*8 b(8)
      REAL*8 bs(8)
      REAL*8 x(8)
      INTEGER i, idum(1)
      REAL*8 ddum(1)
      REAL*8 res, res0
      external mkl_dcsrsymv
C.. Fill all arrays containing matrix data. Necessary only on master process
      DATA n /8/, nrhs /1/, maxfct /1/, mnum /1/
      DATA ia /1,5,8,10,12,15,17,18,19/
      DATA ja
     1 /1,  3,    6,7,
     2    2,3,  5,
     3      3,        8,
     4        4,    7,
     5          5,6,7,
     6            6,  8,
     7              7,
     8                8/
      DATA a
     1 /7.d0,     1.d0,          2.d0,7.d0,
     2       -4.d0,8.d0,     2.d0,
     3            1.d0,                    5.d0,
     4                 7.d0,     9.d0,
     5                      5.d0,1.d0,5.d0,
     6                           -1.d0,     5.d0,
     7                                11.d0,
     8                                     5.d0/
C..
C.. Initialize MPI.
      call MPI_INIT(mpi_stat)

      call MPI_COMM_RANK(MPI_COMM_WORLD, rank, mpi_stat)
C..
&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp; call MPI_FINALIZE(mpi_stat)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; end&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Best Regards,&lt;/P&gt;

&lt;P&gt;Ying&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 25 Jul 2016 06:58:55 GMT</pubDate>
    <dc:creator>Ying_H_Intel</dc:creator>
    <dc:date>2016-07-25T06:58:55Z</dc:date>
    <item>
      <title>Fortran PDGETRF + PDGETRI for Matrix Inversion - parameter with an illegal value</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Fortran-PDGETRF-PDGETRI-for-Matrix-Inversion-parameter-with-an/m-p/1069147#M22139</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;

&lt;P&gt;This is the first time that I am using libraries. I need to calculate the inverse matrix of a square matrix.&amp;nbsp;I found the routine PDGETRF + PDGETRI&amp;nbsp;from ScaLAPACK in the MKL documentation that can solve my problem, but I'm in trouble to compile this routines.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Can anyone help me?&lt;/P&gt;

&lt;P&gt;The code I am trying to compile is:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;    program Invtest

    implicit none

    ! Variables
    integer :: i, j, info, lwork, liwork
    integer, parameter :: dlen_ = 9, ia = 1, ja = 1, m=3, n=3
    real(kind = 8), dimension(m,n) :: A, Ainv, Mf, LU
    integer, dimension(size(A,1)) :: ipiv
    integer, dimension(dlen_) :: desca
    real(kind = 8), dimension(size(A,1)) :: work, iwork
    external PDGETRF, PDGETRI

    ! Body of Invtest
    A = reshape(source = (/1, 1, 1, 0, 3, 2, 0, 1, 0/), shape = (/3, 3/))
    do i=1,m
        print *, (A(i,j), j=1,n)
    end do
    info = 0
    lwork = size(A,1)
    work = 0
    liwork = size(A,1)
    iwork = 0    

    ! PDGETRF computes an LU factorization of a general M-by-N distributed matrix.
    LU = A
    call pdgetrf(n, n, LU, ia, ja, desca, ipiv, info)

    ! PDGETRI computes the inverse of a matrix using the LU factorization computed by PDGETRF.
    Ainv = LU
    call pdgetri(n, Ainv, ia, ja, desca, ipiv, work, lwork, iwork, liwork, info)

    ! Computation of A^{-1} * A to check the inverse
    Mf = matmul(Ainv,A)

    print*,"Mf = "
    do i=1,m
        print*,Mf(i,:)
    end do

    pause

    end program Invtest&lt;/PRE&gt;

&lt;P&gt;When I compile this code I get the following error message:&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;{   -1,   -1}:  On entry to
PDGETRF parameter number  602 had an illegal value
{   -1,   -1}:  On entry to
PDGETRI parameter number  502 had an illegal value&lt;/PRE&gt;

&lt;P&gt;The university computer that I am using has installed Microsoft Visual Studio Professional 2013 Update 3, Intel Parallel Studio XE 2016 Update 2 Cluster Edition for Windows with Intel Math Kernel Library 11.3.&lt;/P&gt;

&lt;P&gt;Thanks for the attention.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2016 02:25:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Fortran-PDGETRF-PDGETRI-for-Matrix-Inversion-parameter-with-an/m-p/1069147#M22139</guid>
      <dc:creator>Jeferson_Vanderlinde</dc:creator>
      <dc:date>2016-07-22T02:25:16Z</dc:date>
    </item>
    <item>
      <title>Hi Jeferson, </title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Fortran-PDGETRF-PDGETRI-for-Matrix-Inversion-parameter-with-an/m-p/1069148#M22140</link>
      <description>&lt;P&gt;Hi Jeferson,&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I replied your question from your another post.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;For C sample, here is one &amp;nbsp;https://software.intel.com/en-us/articles/using-cluster-mkl-pblasscalapack-fortran-routine-in-your-c-program =&amp;gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="https://software.intel.com/sites/default/files/article/165948/pdgemv.c" target="_blank"&gt;https://software.intel.com/sites/default/files/article/165948/pdgemv.c&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;for fortran sample, you may search the scalapack function in internet.&lt;/P&gt;

&lt;P&gt;like&amp;nbsp;http://acts.nersc.gov/tau/example-pdgesv/pdgesvdriver.f90.html&lt;/P&gt;

&lt;P&gt;In the code, you need at least some MPI init or blacs init code. &amp;nbsp; for example mkl build-in example&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;*******************************************************************************
C----------------------------------------------------------------------
C Example program to show the use of the "CLUSTER_SPARSE_SOLVER" routine
C for solving symmetric linear systems
C----------------------------------------------------------------------
      program cluster_sparse_solver_sym
      implicit none
      include 'mkl_cluster_sparse_solver.f77'
      include 'mpif.h'
C.. Internal solver memory pointer for 64-bit architectures
      INTEGER*8 pt(64)
C.. All other variables
      INTEGER maxfct, mnum, mtype, phase, n, nrhs, error, msglvl
      INTEGER*4 rank, mpi_stat
      INTEGER iparm(64)
      INTEGER ia(9)
      INTEGER ja(18)
      REAL*8 a(18)
      REAL*8 b(8)
      REAL*8 bs(8)
      REAL*8 x(8)
      INTEGER i, idum(1)
      REAL*8 ddum(1)
      REAL*8 res, res0
      external mkl_dcsrsymv
C.. Fill all arrays containing matrix data. Necessary only on master process
      DATA n /8/, nrhs /1/, maxfct /1/, mnum /1/
      DATA ia /1,5,8,10,12,15,17,18,19/
      DATA ja
     1 /1,  3,    6,7,
     2    2,3,  5,
     3      3,        8,
     4        4,    7,
     5          5,6,7,
     6            6,  8,
     7              7,
     8                8/
      DATA a
     1 /7.d0,     1.d0,          2.d0,7.d0,
     2       -4.d0,8.d0,     2.d0,
     3            1.d0,                    5.d0,
     4                 7.d0,     9.d0,
     5                      5.d0,1.d0,5.d0,
     6                           -1.d0,     5.d0,
     7                                11.d0,
     8                                     5.d0/
C..
C.. Initialize MPI.
      call MPI_INIT(mpi_stat)

      call MPI_COMM_RANK(MPI_COMM_WORLD, rank, mpi_stat)
C..
&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp; call MPI_FINALIZE(mpi_stat)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; end&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Best Regards,&lt;/P&gt;

&lt;P&gt;Ying&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2016 06:58:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Fortran-PDGETRF-PDGETRI-for-Matrix-Inversion-parameter-with-an/m-p/1069148#M22140</guid>
      <dc:creator>Ying_H_Intel</dc:creator>
      <dc:date>2016-07-25T06:58:55Z</dc:date>
    </item>
  </channel>
</rss>

