Quantcast
Channel: Intel® Software - Intel® oneAPI Math Kernel Library & Intel® Math Kernel Library
Viewing all 3005 articles
Browse latest View live

Parallel Studio 2017 Update 2 breaks MKL auto linking in Studio

$
0
0

Automatic linking (in Visual Studio 2015 )of MKL is broken in Update 2.

Previously if you selected MKL in Intel Performance Libraries the linker would get the MKL libraries automatically. I now have to add mkl_rt.lib to my linker options for all projects that use MKL . Curiously IPP and TBB link properly - they are not broken.


Pardiso crashes with severe(172): Program Exception - access violation

$
0
0

I am trying to use Pardiso, but it keeps crashing with the error message "forrtl: severe(172): Program Exception - access violation" in the console and with the error message "Access violation reading location 0xffffffffffffffff" in the dialog box in Visual Studio.

This is how I use Pardiso:

      integer(4) :: pt(64) ! Solver internal data address pointer
      integer(4) :: mtype ! Matrix type
      integer(4) :: iparm(64) ! Pass information to and from Pardiso

      integer(4) :: nDimension
      integer(4), parameter :: numberOfRHS = 1 ! number of right-hand sides

      integer(4) :: maxfct, mnum, mtype, phase, error, msglvl, integerDummy

      real*8 :: doubleDummy

      do i=1,64
        pt(i) = 0
      enddo

      do i=1,64
        iparm(i) = 0
      end do

      iparm(1) = 1 ! no default values
      iparm(2) = 2 ! nested dissection algorithm from METIS package (default)
      !iparm(3) = 0 ! reserved, set to 0
      iparm(4) = 0 ! factorization is always computed as required by phase (nonzero settings for advanced users) (default)
      iparm(5) = 0 ! user permutation in perm array is ignored (default)
      iparm(6) = 0 ! array x contains solution, right-hand side vector b is kept (default)
      iparm(7) = 0 ! number of iterative refinement steps performed (output)
      iparm(8) = 0 ! maximum number of iterative refinement steps (value 0 means default=2)
      !iparm(9) = 0 ! reserved, set to 0
      iparm(10) = 8 ! perturbe the pivot elements with 1E-8 (default value for symmetric + indefinite)
      iparm(11) = 0 ! scaling vectors (default value for symmetric + indefinite)
      iparm(12) = 0 ! solve linear system AX=B (default)
      iparm(13) = 0 ! disable matching (default value for symmetric + indefinite)
      iparm(14) = 0 ! number of perturbed pivots (output)
      iparm(15) = 0 ! peak memory on symbolic factorization (output)
      iparm(16) = 0 ! permanent memory on symbolic factorization (output)
      iparm(17) = 0 ! size of factors/peak memory on numerical factorization and solution (output)
      iparm(18) = 0 ! report number of non-zero elements in factors (default=-1=enable)
      iparm(19) = 0 ! report number of floating point operations to factor matrix A (default)
      iparm(20) = 0 ! report CG/CGS diagnostics (output)
      iparm(21) = 1 ! pivoting for symmetric indefinite matrices (1x1 + 2x2 Bunch-Kaufman) (default)
      iparm(22) = 0 ! number of positive eigenvalues for symmetric indefinite matrices (output)
      iparm(23) = 0 ! number of negative eigenvalues for symmetric indefinite matrices (output)
      iparm(24) = 0 ! classic parallel factorization control (default)
      iparm(25) = 0 ! parallel forward/backward solve control (default)
      !iparm(26) = 0 ! reserved, set to 0
      iparm(27) = 0 ! no matrix representations check (default)
      iparm(28) = 0 ! double precision used in all arrays (default)
      !iparm(29) = 0 ! reserved, set to 0
      iparm(30) = 0 ! number of zero or negative pivots (output)
      iparm(31) = 0 ! no partial solve and no computing selected components (default)
      ! iparm(32:33) = 0 ! reserved, set to 0
      iparm(34) = 0 ! optimal number of OpenMP threads for CNR mode (default)
      iparm(35) = 0 ! one-based indexing (default)
      iparm(36) = 0 ! no Schur complement matrix computation control (default)
      iparm(37) = 0 ! three array variation of CSR matrix format (default)
      ! iparm(38:55) = 0 ! reserved, set to 0
      iparm(56) = 0 ! diagonal and pivoting control function turned off (default)
      !iparm(57-59) = 0 ! reserved, set to 0
      iparm(60) = 0 ! IC (In-Core) mode for Pardiso (default)
      ! iparm(61:62) = 0 ! reserved, set to 0
      iparm(63) = 0 ! size of minimum OOC memory for numerical factorization and solution (output)
      !iparm(64) = 0 ! reserved, set to 0

      mtype = -2 ! positive + indefinite

      maxfct = 1 ! maximum number of numerical factorizations
      mnum = 1 ! what factorization to use
      msglvl = 1 ! message level, 0 = no output, 1 = statistical information
      error = 0 ! error flag initialization

      call PardisoInit ( pt, mtype, iparm )

      phase = 13
      call PARDISO ( pt, maxfct, mnum, mtype, phase, nDimension, Avec, iVec, jVec,
     +               integerDummy, numberOfRHS, iParm, msglvl, Bmat, Xmat, error )

Avec(:) is real*8, iVec(:), jVec(:) are integer(4), Bmat(:,:) and Xmat(:,:) are real*8, all of them allocatable. I checked that they are initialized.

I tried setting iparm(27)=1, but this did not change anything.

I tried declaring pt as integer(8), but it did not change anything.

I tried phase = 11; the problem is the same.

Could it be that using integerDummy in the place of the argument perm is wrong? I found this to be done in several examples of calling Pardiso.

I would like to debug my application to see how the sparse solver works, so I am using Debug - x64 configuration, with the corresponding compiler setting being /Qmkl:parallel. All compiler settings are:

/nologo /debug:full /MP /Od /fixed /extend_source:132 /Qopenmp /fpscomp:general /Qdiag-disable:8290,8291,5462 /debug-parameters:all /warn:declarations /warn:truncated_source /warn:noalignments /warn:interfaces /assume:byterecl /module:"x64\Debug\\" /object:"x64\Debug\\" /Fd"x64\Debug\vc100.pdb" /traceback /check:pointer /check:uninit /check:format /check:arg_temp_created /check:stack /libs:dll /threads /dbglibs /Qmkl:parallel /c

cgelss parameter error

$
0
0

Hi,

I am using cgelss() in a C++ program I am working on. Ever so often, the function prints out this error: "Intel MKL ERROR: Parameter 6 was incorrect on entry to CGELSS." Can someone explain to me what conditions would cause CGELSS to throw this error?

Thank you,

Treph

Thread Topic: 

Help Me

Access violation for phase -1 of Pardiso

$
0
0

I am using Pardiso and everything works well except one thing. I noticed that my application keeps increasing the memory usage when Pardiso is repeatedly called. I found in the documentation that I should use the phase -1 to release all internal memory. I am trying to do so, but I am getting a "forrtl: severe(157): Program Exception - access violation" error.

I use the same call to Pardiso, just phase is changed to -1; is this wrong?

 integer(4) :: pt(64) ! Solver internal data address pointer
 integer(4) :: mtype ! Matrix type
 integer(4) :: iparm(64) ! Pass information to and from Pardiso

 integer(4) :: nDimension
 integer(4), parameter :: numberOfRHS = 1 ! number of right-hand sides

 integer(4) :: maxfct, mnum, mtype, phase, error, msglvl


 do i=1,64
   pt(i) = 0
 enddo

 do i=1,64
   iparm(i) = 0
 end do

 mtype = 11 ! real + nonsymmetric

 maxfct = 1 ! maximum number of numerical factorizations
 mnum = 1 ! what factorization to use
 msglvl = 0 ! message level, 0 = no output, 1 = statistical information
 error = 0 ! error flag initialization

 call PardisoInit ( pt, mtype, iparm )

 phase = 13
 call PARDISO ( pt, maxfct, mnum, mtype, phase, nDimension, Avec, iVec, jVec,
+               perm, numberOfRHS, iParm, msglvl, Bmat, Xmat, error )

 phase = -1
 call PARDISO ( pt, maxfct, mnum, mtype, phase, nDimension, Avec, iVec, jVec,
+               perm, numberOfRHS, iParm, msglvl, Bmat, Xmat, error )

Avec(:) is real*8, iVec(:), jVec(:), perm(:) are integer(4), Bmat(:,:) and Xmat(:,:) are real*8, all of them allocatable. I checked that they are initialized. 

Question 1: Any ideas why phase -1 crashes with the access violation error?

Question 2: The first call to Pardiso yield error = 0, so I hope there is nothing wrong about data passed to it. I noticed some people use dummy integers and doubles in places of those arguments that are not needed in particular Pardiso phases; is this acceptable/supported ?

I tried checking MKL cookbook samples, but the example for Pardiso is for C, not Fortran.

 

Numerical Integration Routines

$
0
0

Hello,

Is there any MKL routine for numerical integration?

We are interesting in numerical integration in a semiinfinite region and our integrand is oscillating but it decay quikly to zero (like a Lipschitz function exp(-ax)*Jo(bx)).

 

Thank you very much

Gianluca

 

pardiso access violation problem

$
0
0

I am running a program which is basically an example code of pasdiso in mkl. The program successfully solved the example equations in my computer. When I added a line to make a file connection without any other modifications in the program:

open(5,file='c:\cyhouwork\3d_elastic\ia.txt',status='unknown')

The program worked good. Then a second file connection, without other modifications

open(6,file='c:\cyhouwork\3d_elastic\ja.txt',status='unknown')

Everything went fine. But when I add a third file connection without any other modifications

open(8,file='c:\cyhouwork\3d_elastic\sparse.txt',status='unknown') 

The 'access violation' (157) message showed up.

Anyone knows how to solve the problem? Thanks!! The code is shown below:

 

PROGRAM pardiso_sym_f90
USE mkl_pardiso
IMPLICIT NONE
INTEGER, PARAMETER :: dp = KIND(1.0D0)
!.. Internal solver memory pointer 
TYPE(MKL_PARDISO_HANDLE), ALLOCATABLE  :: pt(:)
!.. All other variables
INTEGER maxfct, mnum, mtype, phase, n, nrhs, error, msglvl, nnz
INTEGER error1,j
INTEGER, ALLOCATABLE :: iparm( : )
INTEGER, ALLOCATABLE :: ia( : )
INTEGER, ALLOCATABLE :: ja( : )
REAL(KIND=DP), ALLOCATABLE :: a( : )
REAL(KIND=DP), ALLOCATABLE :: b( : )
REAL(KIND=DP), ALLOCATABLE :: x( : )
INTEGER i, idum(1)
REAL(KIND=DP) ddum(1)
!.. Fill all arrays containing matrix data.
open(5,file='c:\cyhouwork\3d_elastic\ia.txt',status='unknown')    <---- 
open(6,file='c:\cyhouwork\3d_elastic\ja.txt',status='unknown')    <----  These are the lines causing the problem
open(8,file='c:\cyhouwork\3d_elastic\sparse.txt',status='unknown')   <----

n =  9   
nnz = 20 
nrhs = 1
maxfct = 1 
mnum = 1
msglvl=1
ALLOCATE(ia(n + 1))
ia = (/ 1, 5, 8, 10, 12, 15, 17, 18, 20, 21 /)
ALLOCATE(ja(nnz))
ja = (/ 1,    3,       6, 7,       &
           2, 3,    5,             &
              3,             8,    & 
                 4,       7,       & 
                    5, 6, 7,       &
                       6,    8,    &
                          7,       &
                             8, 9, &
                                9  /)
ALLOCATE(a(nnz))
a = (/ 7.d0,        1.d0,             2.d0, 7.d0,             &
             -4.d0, 8.d0,       2.d0,                         &
                    1.d0,                         5.d0,       &
                          7.d0,             9.d0,             &
                                5.d0, 1.d0, 5.d0,             &
                                     -1.d0,       5.d0,       &
                                           11.d0,             &
                                                  5.d0,   3.d0&
                                                         -2.d0/)
ALLOCATE(b(n))
ALLOCATE(x(n))
!..
!.. Set up PARDISO control parameter
!..
ALLOCATE(iparm(64))

DO i = 1, 64
   iparm(i) = 0
END DO

iparm(1) = 1 ! no solver default
iparm(2) = 2 ! fill-in reordering from METIS
iparm(4) = 0 ! no iterative-direct algorithm
iparm(5) = 0 ! no user fill-in reducing permutation
iparm(6) = 0 ! =0 solution on the first n components of x
iparm(8) = 2 ! numbers of iterative refinement steps
iparm(10) = 13 ! perturb the pivot elements with 1E-13
iparm(11) = 1 ! use nonsymmetric permutation and scaling MPS
iparm(13) = 0 ! maximum weighted matching algorithm is switched-off (default for symmetric). Try iparm(13) = 1 in case of inappropriate accuracy
iparm(14) = 0 ! Output: number of perturbed pivots
iparm(18) = -1 ! Output: number of nonzeros in the factor LU
iparm(19) = -1 ! Output: Mflops for LU factorization
iparm(20) = 0 ! Output: Numbers of CG Iterations

error  = 0 ! initialize error flag
msglvl = 0 ! print statistical information
mtype  = -2 ! symmetric, indefinite

!.. Initialize the internal solver memory pointer. This is only
! necessary for the FIRST call of the PARDISO solver.

ALLOCATE (pt(64))
DO i = 1, 64
!   pt(i)%DUMMY =  0 
END DO

!.. Reordering and Symbolic Factorization, This step also allocates
! all memory that is necessary for the factorization

!phase = 11 ! only reordering and symbolic factorization

!CALL pardiso (pt, maxfct, mnum, mtype, phase, n, a, ia, ja, &
!              idum, nrhs, iparm, msglvl, ddum, ddum, error)
    
!WRITE(*,*) 'Reordering completed ... '
!IF (error /= 0) THEN
!   WRITE(*,*) 'The following ERROR was detected: ', error
!   GOTO 1000
!    END IF
!WRITE(*,*) 'Number of nonzeros in factors = ',iparm(18)
!WRITE(*,*) 'Number of factorization MFLOPS = ',iparm(19)

!.. Factorization.
!phase = 22 ! only factorization
!CALL pardiso (pt, maxfct, mnum, mtype, phase, n, a, ia, ja, &
!              idum, nrhs, iparm, msglvl, ddum, ddum, error)
!WRITE(*,*) 'Factorization completed ... '
!IF (error /= 0) THEN
!   WRITE(*,*) 'The following ERROR was detected: ', error
!   GOTO 1000
!ENDIF

!.. Back substitution and iterative refinement
iparm(8) = 2 ! max numbers of iterative refinement steps
phase = 13 ! only solving
!do j=1,10
DO i = 1, n
   b(i) = 1.d0
END DO
print *,'*****'
CALL pardiso (pt, maxfct, mnum, mtype, phase, n, a, ia, ja, &
              idum, nrhs, iparm, msglvl, b, x, error)

print *,'*****'

!WRITE(*,*) 'Solve completed ... '
IF (error /= 0) THEN
   WRITE(*,*) 'The following ERROR was detected: ', error
   GOTO 1000
ENDIF
!WRITE(*,*) 'The solution of the system is '

DO i = 1, n
   WRITE(*,*) ' x(',i,') = ', x(i)
END DO
!end do
      
1000 CONTINUE

    
!.. Termination and release of memory
phase = -1 ! release internal memory
CALL pardiso (pt, maxfct, mnum, mtype, phase, n, ddum, idum, idum, &
              idum, nrhs, iparm, msglvl, ddum, ddum, error1)
IF (ALLOCATED(ia))      DEALLOCATE(ia)
IF (ALLOCATED(ja))      DEALLOCATE(ja)
IF (ALLOCATED(a))       DEALLOCATE(a)
IF (ALLOCATED(b))       DEALLOCATE(b)
IF (ALLOCATED(x))       DEALLOCATE(x)
IF (ALLOCATED(iparm))   DEALLOCATE(iparm)
IF (error1 /= 0) THEN
   WRITE(*,*) 'The following ERROR on release stage was detected: ', error1
   STOP 1
ENDIF

IF (error /= 0) STOP 1

END PROGRAM pardiso_sym_f90

 

 

pardiso_getdiag problem

$
0
0

Hello everyone!

I am using pardiso to solve nonsymmetric system, but i don't get result that i expect. Today i tried pardiso_getdiag to understand what is going on with diagonal after factorization and i noticed that pardiso thinks that i have zero elements on diagonal which is not true. And if size of the matrix rises i get more zeros. Matrix_checkers returns MKL_SPARSE_CHECKER_SUCCESS. How can i solve this problem? I attached my matrix in csr format. Indexing starts from zero.

Thank you.

AttachmentSize
Downloadtext/plaina.txt779 bytes
Downloadtext/plainia.txt218 bytes
Downloadtext/plainja.txt595 bytes

failure pardiso with CBWR

$
0
0

Hello everyone.

I am using pardiso to solve unsymmetric system with CBWR(Conditional Bitwise Reproducibility) , but some special case it didn't work in symbolic factorize.

The test matrix is simple 3x3 matrix.

May I check what is the problem ?

I am using test library which is located in "compilers_and_libraries_2017.2.187". It may be "Intel Math Kernel Library 2017 Update 2".

Thank you for advance.

// SimpleCrashTest.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

/*******************************************************************************
* Copyright 2004-2016 Intel Corporation All Rights Reserved.
*
* The source code,  information  and material  ("Material") contained  herein is
* owned by Intel Corporation or its  suppliers or licensors,  and  title to such
* Material remains with Intel  Corporation or its  suppliers or  licensors.  The
* Material  contains  proprietary  information  of  Intel or  its suppliers  and
* licensors.  The Material is protected by  worldwide copyright  laws and treaty
* provisions.  No part  of  the  Material   may  be  used,  copied,  reproduced,
* modified, published,  uploaded, posted, transmitted,  distributed or disclosed
* in any way without Intel's prior express written permission.  No license under
* any patent,  copyright or other  intellectual property rights  in the Material
* is granted to  or  conferred  upon  you,  either   expressly,  by implication,
* inducement,  estoppel  or  otherwise.  Any  license   under such  intellectual
* property rights must be express and approved by Intel in writing.
*
* Unless otherwise agreed by Intel in writing,  you may not remove or alter this
* notice or  any  other  notice   embedded  in  Materials  by  Intel  or Intel's
* suppliers or licensors in any way.
*******************************************************************************/

/*
*   Content : Intel(R) MKL PARDISO C example
*
********************************************************************************
*/
/* -------------------------------------------------------------------- */
/* Example program to show the use of the "PARDISO" routine */
/* on unsymmetric linear systems */
/* -------------------------------------------------------------------- */
/* This program can be downloaded from the following site: */
/* www.pardiso-project.org */
/* */
/* (C) Olaf Schenk, Department of Computer Science, */
/* University of Basel, Switzerland. */
/* Email: olaf.schenk@unibas.ch */
/* -------------------------------------------------------------------- */
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

#include "mkl_pardiso.h"
#include "mkl_types.h"
#include "mkl_service.h"

//#define Diagonal
MKL_INT main(void)
{
   int my_cbwr_branch = 0;
   my_cbwr_branch = mkl_cbwr_get_auto_branch();
   mkl_cbwr_set(my_cbwr_branch);
   /* Matrix data. */
   MKL_INT n = 3;
#ifdef Diagonal
   MKL_INT ia[4] = { 1, 2, 3, 4 };
   MKL_INT ja[3] =
   { 1,
       2,
         3
   };
   double a[3] =
   { 43.157629078689801,
     53947.036348362199,
     1601061.7235612301
   };
#else
   MKL_INT ia[4] = { 1, 3, 5, 6 };
   MKL_INT ja[5] =
   { 1, 2,
      1, 2,
      3
   };
   double a[5] =
   { 43.157629078689801, 0.0000000000000000,
      0.000000000000000, 53947.036348362199,
      1601061.7235612301
   };
#endif // Diagonal

   MKL_INT mtype = 11;       /* Real unsymmetric matrix */
                             /* RHS and solution vectors. */
   double b[3], x[3];
   MKL_INT nrhs = 1;     /* Number of right hand sides. */
                         /* Internal solver memory pointer pt, */
                         /* 32-bit: int pt[64]; 64-bit: long int pt[64] */
                         /* or void *pt[64] should be OK on both architectures */
   void *pt[64];
   /* Pardiso control parameters. */
   MKL_INT iparm[64];
   MKL_INT maxfct, mnum, phase, error, msglvl;
   /* Auxiliary variables. */
   MKL_INT i, j;
   double ddum;          /* Double dummy */
   MKL_INT idum;         /* Integer dummy. */
   char *uplo;
   /* -------------------------------------------------------------------- */
   /* .. Setup Pardiso control parameters. */
   /* -------------------------------------------------------------------- */
   for (i = 0; i < 64; i++)
   {
      iparm[i] = 0;
   }
   iparm[0] = 1;         /* No solver default */
   iparm[1] = 2;         /* Fill-in reordering from METIS */
   iparm[3] = 0;         /* No iterative-direct algorithm */
   iparm[4] = 0;         /* No user fill-in reducing permutation */
   iparm[5] = 0;         /* Write solution into x */
   iparm[6] = 0;         /* Not in use */
   iparm[7] = 2;         /* Max numbers of iterative refinement steps */
   iparm[8] = 0;         /* Not in use */
   iparm[9] = 13;        /* Perturb the pivot elements with 1E-13 */
   iparm[10] = 1;        /* Use nonsymmetric permutation and scaling MPS */
   iparm[11] = 0;        /* Conjugate transposed/transpose solve */
   iparm[12] = 1;        /* Maximum weighted matching algorithm is switched-on (default for non-symmetric) */
   iparm[13] = 0;        /* Output: Number of perturbed pivots */
   iparm[14] = 0;        /* Not in use */
   iparm[15] = 0;        /* Not in use */
   iparm[16] = 0;        /* Not in use */
   iparm[17] = -1;       /* Output: Number of nonzeros in the factor LU */
   iparm[18] = -1;       /* Output: Mflops for LU factorization */
   iparm[19] = 0;        /* Output: Numbers of CG Iterations */
   maxfct = 1;           /* Maximum number of numerical factorizations. */
   mnum = 1;         /* Which factorization to use. */
   msglvl = 1;           /* Print statistical information in file */
   error = 0;            /* Initialize error flag */
                         /* -------------------------------------------------------------------- */
                         /* .. Initialize the internal solver memory pointer. This is only */
                         /* necessary for the FIRST call of the PARDISO solver. */
                         /* -------------------------------------------------------------------- */
   for (i = 0; i < 64; i++)
   {
      pt[i] = 0;
   }
   /* -------------------------------------------------------------------- */
   /* .. Reordering and Symbolic Factorization. This step also allocates */
   /* all memory that is necessary for the factorization. */
   /* -------------------------------------------------------------------- */
   phase = 11;
   PARDISO(pt, &maxfct, &mnum, &mtype, &phase,&n, a, ia, ja, &idum, &nrhs, iparm, &msglvl, &ddum, &ddum, &error);
   if (error != 0)
   {
      printf("\nERROR during symbolic factorization: %d", error);
      exit(1);
   }
   printf("\nReordering completed ... ");
   printf("\nNumber of nonzeros in factors = %d", iparm[17]);
   printf("\nNumber of factorization MFLOPS = %d", iparm[18]);
   /* -------------------------------------------------------------------- */
   /* .. Numerical factorization. */
   /* -------------------------------------------------------------------- */
   phase = 22;
   PARDISO(pt, &maxfct, &mnum, &mtype, &phase,&n, a, ia, ja, &idum, &nrhs, iparm, &msglvl, &ddum, &ddum, &error);
   if (error != 0)
   {
      printf("\nERROR during numerical factorization: %d", error);
      exit(2);
   }
   printf("\nFactorization completed ... ");
   /* -------------------------------------------------------------------- */
   /* .. Back substitution and iterative refinement. */
   /* -------------------------------------------------------------------- */
   phase = 33;
   /* Set right hand side to one. */
   for (i = 0; i < n; i++)
   {
      b[i] = 1;
   }
   //  Loop over 3 solving steps: Ax=b, AHx=b and ATx=b
   for (i = 0; i < 3; i++)
   {
      iparm[11] = i;        /* Conjugate transposed/transpose solve */
      if (i == 0)
         uplo = "non-transposed";
      else if (i == 1)
         uplo = "conjugate transposed";
      else
         uplo = "transposed";

      printf("\n\nSolving %s system...\n", uplo);
      PARDISO(pt, &maxfct, &mnum, &mtype, &phase,&n, a, ia, ja, &idum, &nrhs, iparm, &msglvl, b, x, &error);
      if (error != 0)
      {
         printf("\nERROR during solution: %d", error);
         exit(3);
      }

      printf("\nThe solution of the system is: ");
      for (j = 0; j < n; j++)
      {
         printf("\n x [%d] = % f", j, x[j]);
      }
      printf("\n");
      //// Compute residual
      //mkl_dcsrgemv(uplo, &n, a, ia, ja, x, bs);
      //res = 0.0;
      //res0 = 0.0;
      //for (j = 1; j <= n; j++)
      //{
      //   res += (bs[j - 1] - b[j - 1]) * (bs[j - 1] - b[j - 1]);
      //   res0 += b[j - 1] * b[j - 1];
      //}
      //res = sqrt(res) / sqrt(res0);
      //printf("\nRelative residual = %e", res);
      //// Check residual
      //if (res > 1e-10)
      //{
      //   printf("Error: residual is too high!\n");
      //   exit(10 + i);
      //}
   }

   /* -------------------------------------------------------------------- */
   /* .. Termination and release of memory. */
   /* -------------------------------------------------------------------- */
   phase = -1;           /* Release internal memory. */
   PARDISO(pt, &maxfct, &mnum, &mtype, &phase,&n, &ddum, ia, ja, &idum, &nrhs,
      iparm, &msglvl, &ddum, &ddum, &error);
   return 0;
}

 

AttachmentSize
Downloadtext/x-c++srcSimpleCrashTest.cpp8.97 KB

Intel Dfti equivalent to FFTW "fftw_plan_many_dft"

$
0
0

I am using the Intel Fortran compiler for Windows, Composer XE 2013 SP1.  I am trying to convert my FORTRAN code to use the MKL FFT's, i.e., Dfti library.  I could not find any reference or examples on the FFTW plan, "fftw_plan_many_dft".  Can this be done using the Intel FFT's?  Would it be possible for someone to show me the syntax of how this is done or point me to a reference where it is done?

Thank you very much for your help!

Sincerely,

David

Thread Topic: 

How-To

MKL licence for cloud machines?

$
0
0

We are a small company that has recently moved to using MKL for some of our core technologies. We use Amazon EC2 for both deployment and testing. We understand that the MKL licence is per-user and each machine using the licence should be registered with a maximum of 3. How does the licencing work  when we want to use MKL in the cloud when every 'virtual' machine is potentially a different physical machine?

Many thanks

Thread Topic: 

Question

how to include intel math kernel library in abaqus subroutine

$
0
0

I am trying to include the in-build subroutines of intel math kernel library in ABAQUS UMAT. I included 'mkl.fi' but it is showing the error as shown below (It is ABAQUS generated job file):

-------------------------------------------------------------------------------------------------------------------------------------------------------

 

Abaqus JOB Job-1 Abaqus 6.13-1

Begin Compiling Abaqus/Standard User Subroutines

3/8/2017 6:14:23 PM

Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 17.0.1.143 Build 20161005

Copyright (C) 1985-2016 Intel Corporation. All rights reserved.

C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(29): error #5082: Syntax error, found '&' when expecting one of: * SUBROUTINE CGEJSV( JOBA, JOBU, JOBV, JOBR, JOBT, JOBP, & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(30): error #5082: Syntax error, found '&' when expecting one of: * & M, N, A, LDA, SVA, U, LDU, V, LDV, & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(34): error #5082: Syntax error, found '&' when expecting one of: %FILL COMPLEX A( LDA, * ), U( LDU, * ), V( LDV, * ), & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(43): error #5082: Syntax error, found '&' when expecting one of: * SUBROUTINE ZGEJSV( JOBA, JOBU, JOBV, JOBR, JOBT, JOBP, & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(44): error #5082: Syntax error, found '&' when expecting one of: * & M, N, A, LDA, SVA, U, LDU, V, LDV, & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(48): error #5082: Syntax error, found '&' when expecting one of: %FILL DOUBLE COMPLEX A( LDA, * ), U( LDU, * ), V( LDV, * ), & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(57): error #5082: Syntax error, found '&' when expecting one of: * SUBROUTINE DGESVDX( JOBU, JOBVT, RANGE, M, N, A, LDA, VL, VU, & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(58): error #5082: Syntax error, found '&' when expecting one of: * & IL, IU, NS, S, U, LDU, VT, LDVT, WORK, & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(64): error #5082: Syntax error, found '&' when expecting one of: %FILL DOUBLE PRECISION A( LDA, * ), S( * ), U( LDU, * ), & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(70): error #5082: Syntax error, found '&' when expecting one of: * SUBROUTINE SGESVDX( JOBU, JOBVT, RANGE, M, N, A, LDA, VL, VU, & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(71): error #5082: Syntax error, found '&' when expecting one of: * & IL, IU, NS, S, U, LDU, VT, LDVT, WORK, & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(77): error #5082: Syntax error, found '&' when expecting one of: %FILL REAL A( LDA, * ), S( * ), U( LDU, * ), & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(83): error #5082: Syntax error, found '&' when expecting one of: * SUBROUTINE CGESVDX( JOBU, JOBVT, RANGE, M, N, A, LDA, VL, VU, & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(84): error #5082: Syntax error, found '&' when expecting one of: * & IL, IU, NS, S, U, LDU, VT, LDVT, WORK, & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(91): error #5082: Syntax error, found '&' when expecting one of: %FILL COMPLEX A( LDA, * ), U( LDU, * ), VT( LDVT, * ), & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(97): error #5082: Syntax error, found '&' when expecting one of: * SUBROUTINE ZGESVDX( JOBU, JOBVT, RANGE, M, N, A, LDA, VL, VU, & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(98): error #5082: Syntax error, found '&' when expecting one of: * & IL, IU, NS, S, U, LDU, VT, LDVT, WORK, & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(105): error #5082: Syntax error, found '&' when expecting one of: %FILL COMPLEX*16 A( LDA, * ), U( LDU, * ), VT( LDVT, * ), & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(111): error #5082: Syntax error, found '&' when expecting one of: * SUBROUTINE CGESVJ( JOBA, JOBU, JOBV, M, N, A, LDA, SVA, MV, V, & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(121): error #5082: Syntax error, found '&' when expecting one of: * SUBROUTINE ZGESVJ( JOBA, JOBU, JOBV, M, N, A, LDA, SVA, MV, V, & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(131): error #5082: Syntax error, found '&' when expecting one of: * SUBROUTINE DGGSVD3( JOBU, JOBV, JOBQ, M, N, P, K, L, A, LDA, B, & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(132): error #5082: Syntax error, found '&' when expecting one of: * & LDB, ALPHA, BETA, U, LDU, V, LDV, Q, LDQ, WORK,& ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(135): error #5082: Syntax error, found '&' when expecting one of: %FILL INTEGER INFO, K, L, LDA, LDB, LDQ, LDU, LDV, M, N, P, & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(138): error #5082: Syntax error, found '&' when expecting one of: %FILL DOUBLE PRECISION A( LDA, * ), ALPHA( * ), B( LDB, * ), & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(139): error #5082: Syntax error, found '&' when expecting one of: %FILL & BETA( * ), Q( LDQ, * ), U( LDU, * ), & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(145): error #5082: Syntax error, found '&' when expecting one of: * SUBROUTINE SGGSVD3( JOBU, JOBV, JOBQ, M, N, P, K, L, A, LDA, B, & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(146): error #5082: Syntax error, found '&' when expecting one of: * & LDB, ALPHA, BETA, U, LDU, V, LDV, Q, LDQ, WORK,& ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(149): error #5082: Syntax error, found '&' when expecting one of: %FILL INTEGER INFO, K, L, LDA, LDB, LDQ, LDU, LDV, M, N, P, & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(152): error #5082: Syntax error, found '&' when expecting one of: %FILL REAL A( LDA, * ), ALPHA( * ), B( LDB, * ), & ------------------------------------------------------------------------^ C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(153): error #5082: Syntax error, found '&' when expecting one of: %FILL & BETA( * ), Q( LDQ, * ), U( LDU, * ), & ------------------------------------------------------------------------^ AFEM.for(170): catastrophic error: Too many errors, exiting compilation aborted for AFEM.for (code 1) Abaqus Error: Problem during compilation - D:\Google Drive\Friday_May_27_2016\Mtech Thesis Job\All new work\TA\AFEM.for Abaqus/Analysis exited with errors

--------------------------------------------------------------------------------------------------------------------------------------------------

In case when mkl library is not included, job file shows the following errors:

--------------------------------------------------------------------------------------------------------------------------------------------------

Abaqus JOB Job-1

Abaqus 6.13-1

Abaqus License Manager checked out the following licenses:

Begin Compiling Abaqus/Standard User Subroutines 3/8/2017 6:18:48 PM

Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 17.0.1.143 Build 20161005

Copyright (C) 1985-2016 Intel Corporation. All rights reserved.

End Compiling Abaqus/Standard User Subroutines

Begin Linking Abaqus/Standard User Subroutines

Creating library standardU.lib and object standardU.exp

AFEM.obj : error LNK2019: unresolved external symbol dgemm referenced in function umat.R

standardU.dll : fatal error LNK1120: 1 unresolved externals

Abaqus Error: Problem during linking - Abaqus/Standard User Subroutines.

This error may be due to a mismatch in the Abaqus user subroutine arguments.

These arguments sometimes change from release to release, so user subroutines used with a previous release of Abaqus may need to be adjusted.

Abaqus/Analysis exited with errors

-------------------------------------------------------------------------------------------------------------------------------------------------------

The source code, when compiled outside ABAQUS, works fine with no errors. If I am not able to include this lapack library in ABAQUS UMAT subroutine, I may have to append lapack source code in my code itself. That may invite other problems.

So is there any way to compile these lapack subroutines in ABAQUS successfully. Note that ABAQUS User subroutine (UMAT) is written in '.for' format. I have included the UMAT (ABAQUS subroutine) for reference. It has 'mul_big_mat' (that stands for multiplying big matrices) subroutine that uses lapack 'dgemm' subroutine.

------------------------------------------------------------------------------------------------------------------------------------------------------

C================================================================

          SUBROUTINE UMAT(STRESS,STATEV,DDSDDE,SSE,SPD,SCD,
         1RPL,DDSDDT,DRPLDE,DRPLDT,STRAN,DSTRAN,
         2TIME,DTIME,TEMP,DTEMP,PREDEF,DPRED,MATERL,NDI,NSHR,NTENS,
         3NSTATV,PROPS,NPROPS,COORDS,DROT,PNEWDT,CELENT,
         4DFGRD0,DFGRD1,NOEL,NPT,KSLAY,KSPT,KSTEP,KINC)
    C
          INCLUDE 'ABA_PARAM.INC'
    C
          CHARACTER*80 MATERL
          DIMENSION STRESS(NTENS),STATEV(NSTATV),
         1DDSDDE(NTENS,NTENS),DDSDDT(NTENS),DRPLDE(NTENS),
         2STRAN(NTENS),DSTRAN(NTENS),TIME(2),PREDEF(1),DPRED(1),
         3PROPS(NPROPS),COORDS(3),DROT(3,3),
         4DFGRD0(3,3),DFGRD1(3,3)
    C
          DIMENSION EELAS(6),EPLAS(6),FLOW(6)
          PARAMETER (ONE=1.0D0,TWO=2.0D0,THREE=3.0D0,SIX=6.0D0)
          DATA NEWTON,TOLER/10,1.D-6/
    C
    C ============================================================================
    C     UMAT FOR 1D BAR
    C

    ============================================================================
        C     Note :- This UMAT can only be used by 1D elements
        C
        C     Number of material properties, nprops = 1
        C     props(1)         Young's modulus in x direction
        C ---------------------------------------------------------------------
        C
              ! --- local variables
              DOUBLE PRECISION E
              DOUBLE PRECISION C(ntens, ntens)
              integer z
        !***********************************************************************

        ! *** Get Elastic properties
              E = props(1)
              write(*,*)''
              write(*,*) z
              write(*,*)''
        ! *** Elastic stiffness Cijkl *** !
              C(1,1) = E
              !call hello_world3
              CALL mul_big_mat

        ! *** calculate the stress *** !
              stress(1) = C(1,1)*(stran(1) + dstran(1))

        !     Updating Jacobian matrix
              ddsdde(1,1) = C(1,1)
              return
              END

              subroutine hello_world3
              implicit none
              character*32 text
        c
              write(*,*)'Hello World'
        c
              END

              subroutine mul_big_mat
        c
        c
              integer m, n, k, i, j
              parameter (m=100,  k= 200, n=100)
              double precision a(m,k), b(k,n), c(m,n), alpha, beta
              alpha=1.0
              beta=0.0
        c      matrix a declaration
              do i=1,m
                  do j=1,k
                      a(i,j)=i+j
                  enddo
              enddo
              write(*,*) a(100,200)
        c      matrix b declaration
              do i=1,k
                  do j=1,n
                      b(i,j)=i-j
                  enddo
              enddo
              write(*,*) b(200,100)
        c      matrix c declaration
              do i=1,m
                  do j=1,n
                      c(i,j)=0.0
                  enddo
              enddo
              call dgemm('n','n',m,n,k,alpha,a,m,b,k,beta,c,m)
! THIS IS THE SUBROUTINE I WANT TO USE FROM INTEL MKL LIBRARY
! I COULD USE MATMUL (AND THAT WORKS FINE), BUT ITS JUST AN EXAMPLE
! I HAVE TO USE 'DGETRI' AND MANY MORE
              write(*,*) c(1,1)
              do i=1,m
                  do j=1,n
                      write(*,*) ''
                      write(*,*) c(i,j)
                  enddo
              enddo
              END

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

thanks

Zone: 

Thread Topic: 

How-To

Linpack: Why do we run with LDA greater than the problem size N?

$
0
0

I am new to running Linpack.  From the extended help, I see:

The leading dimension must be no less than the number of equations. Experience has shown that the best performance for a given problem size is obtained when the leading dimension is set to the nearest odd multiple of 8 (16 for Intel(R) Itanium(R) 2 processors) equal to or larger than the number of equations (divisible by 8 but not by 16, or divisible by 16 but not 32 for Intel(R) Itanium(R) 2 processors).

Can someone explain to me why this is the case?  Thanks!

Zone: 

Can LINPACK be run on NUMA-enabled memory configurations?

$
0
0

I see in the documentation that LINPACK is run on SMP modes.

Can LINPACK also be run on NUMA-enabled memory configurations?

Any advantages or disadvantages?

Thanks!

Zone: 

How to activate MKL after installing via yum or apt

$
0
0

If one installs MKL via yum [1] or apt [2] how should one activate the product?

When installing manually, by following the installation guide [3], one needs to either enter a serial number, to have the product activated online automatically, or provide a license file. This does not appear to be necessary when installing via the yum or apt repositories.

Thanks,

Daniel Renshaw

[1] https://software.intel.com/en-us/articles/installing-intel-free-libs-and...

[2] https://software.intel.com/en-us/articles/installing-intel-free-libs-and...

[3] https://software.intel.com/en-us/parallel-studio-xe-2017-install-guide-l...

Thread Topic: 

How-To

Problem with Pardiso and indefinite matrix

$
0
0

Hello,

I am using Pardiso to solve linear equations with an symmetric indefinite matrix (saddle-point structure). Usually this works quite good, however sometimes the solver teminates with the error "*** error PARDISO: iterative refinement contraction rate is greater than 0.9, interrupt".

Attached you find the csr representation of my matrix (symmetric indefinite so only the upper right triangle is represented). Matlab tells me that the condition of the matrix is 4.596e+05 and is able to solve the equation. Below you find the settings I used for the Pardiso call. In particular I am using METIS.

After some searching I stumbled upon a post with a similar problem where it was proposed to try a different reordering strategy for badly conditioned matrices. Switching to the minimum degree algorithm helped for this matrix. However I find it strange that METIS has a problem with this matrix since the condition is not too bad. Are the rest of my parameter choices sensible?

Help is greatly appreciated!

Best Moritz

 

    MKL_INT mtype = -2;           
    MKL_INT nrhs = 1;     
    void *pt[64];
    /* Pardiso control parameters. */
    MKL_INT iparm[64];
    MKL_INT maxfct, mnum, phase, error, msglvl;
    char *uplo;
    
    /* -------------------------------------------------------------------- */
    /* .. Setup Pardiso control parameters. */
    /* -------------------------------------------------------------------- */
    for (i = 0; i < 64; i++)
    {
        iparm[i] = 0;
    }
    iparm[0] = 1;         
    iparm[1] = 2;         
    iparm[3] = 0;         
    iparm[4] = 0;         
    iparm[5] = 0;        
    iparm[6] = 0;         
    iparm[7] = 10;         
    iparm[8] = 0;         
    iparm[9] = 8;        
    iparm[10] = 1;       
    iparm[11] = 0;       
    iparm[12] = 1;        
    iparm[13] = 0;        
    iparm[14] = 0;        
    iparm[15] = 0;
    iparm[16] = 0;
    iparm[17] = 0;
    iparm[18] = 0;
    iparm[19] = 0;
    iparm[20] = 1;

    iparm[24] = 1;
    iparm[26] = 1;

    iparm[34] = 0;
    maxfct = 1;    
    mnum = 1;      
    msglvl = 1;    
    error = 0;     
    uplo = "non-transposed";

 

 

 

AttachmentSize
Downloadtext/plaincsrMatrix.txt7.48 KB

provide integer type BLAS routines?

$
0
0

Hi,

Is there any plan to provide BLAS routines for integer types in MKL?  GEMM is the prime example I'm thinking of.

There is a small but growing literature in deep learning on the use of reduced precision (relative to float32) to speed up these computations.  A few manual implementations have been published using Intel vectorized integer math instructions and have demonstrated good computation speedup (which to me is the important part, rather than the memory savings).  This seems like an excellent opportunity for Intel-MKL to lead. :)  Would gladly use float16 if that was an option, but 8 bit values are likely to be useful as well, at least for fast inference.  

Perhaps the main difficulty relative to floating point GEMM is handling overflow?  Prior deep learning work has sorted out at least one reasonable solution which is to accumulate the answer in extended precision (e.g. int8 -> int16) and then let the user decide how to round back to the input precision, if desired.  The risk of saturation in intermediate computation might just have to be accepted by the user?

Seems like otherwise the blocking and cache management would be the same as existing GEMM.  But I'm no expert...is there something more fundamental which makes this a bad idea or rather difficult to implement relative to floating point?

Thoughts?  

(I could re-post in MKL-DNN git?  But since GEMM is proprietary in MKL I would imagine that so would integer GEMM.)

Thank you,

Adam 

Order of the columns of a sparse matrix (CSR) times a vector

$
0
0

Dear,

I need to multiply a symmetric sparse matrix by a vector and I would like to use the subroutine mkl_dcsrsymv . The upper triangle of the sparse matrix is stored in a CSR format (row major, 3 arrays). However, the elements in the array columns (ja) are not placed in the order in which the associated values occur in the row. 
I know that the order is required for MKL Pardiso, but is it also the case for the subroutine mkl_dcsrsymv? Are unordered columns within a row allowed? What are the consequences?

In advance thank you.

Jeremie

Intel® Parallel Studio XE Cluster Edition fortran build error

$
0
0

Hi everyone!!

I recently started using Parallel studio cluster edition on my windows 64 bit system. I am using visual studio 2015 edition for it. I am running already built fortran console application using user provided library in resources. When i try to build the project, it gives me following error:

fatal error LNK1104: cannot open file 'mkl_solver_lp64.lib'

I tried the option to 'use Intel Math Kernel Library' but the error still remained.

Please help.Thanks

Zone: 

Thread Topic: 

Help Me

Installing MKL cluster support for Parallel studio 2017 on a linux Cluster

$
0
0

Hi, we have an install of Fortran Parallel Studio 2017 XE Composer edition (Update 2) on a Centos 6 Linux Cluster, but it happens to be missing the MKL cluster support. So in particular, the mkl/lib/intel64/libmkl_blacs_openmpi_lp64.a library, needed by the cluster_sparse_solver is missing.

We have tried to modify the install from the command window installer provided by intel, but we can't find the cluster support option. Could you please walk us through on adding MKL cluster support on our install? Do we need to uninstall the current parallel studio 2017 first?

Thank you,

Marcos

 

Thread Topic: 

Question

MKL library (Data Fitting Component)- substitute of P-chip function in MKL library

$
0
0

Dear Experts,

I want to implement the p-chip MATLAB function using the Intel MKL library. The details of the pchip function can be found at :https://in.mathworks.com/help/matlab/ref/pchip.html

I tried using the Hermite Cubic Spline but it returns zero values in the interpolated function. Why does it return zero values.

Can someone point to such an implementation, if you have tried previously ?

 

The Code 

// This is the main DLL file.

#include <algorithm>
#include <iostream>

#include "mkl_df.h"

#include "MKLWrapper64.h"
#include "Utils.h"

using namespace MKLWrapper64;

/// Performs interpolation of up to order 3,
/// with free-end boundary condition (i.e. second derivative of both ends = 0)
/// INPUT PARAMETER RESTRICTIONS:
/// --> x[] must be in ascending order
/// --> r[] must be of the format {lowerBound,upperBound} if isUniform
///            or contain outsize number of x-values if !isUniform
/// --> order should be within the range [1, 3]
/// OUTPUT PARAMETERS:
/// --> out[] contains output interpolated y-values
/// --> return int signifies no error (0) or error (non-zero status number)

int Interpolator::Interpolate(int nx, array<float>^ x, array<float>^ y,

    array<float>^ r, int outsize, array<float>^ out, int order, bool isUniform)
{
    int status;
    int ny = 1; // y-axis is 1 dimensional
    DFTaskPtr taskPtr;
    pin_ptr<float> xPtr = &x[0];
    pin_ptr<float> yPtr = &y[0];
    pin_ptr<float> interpolationRange = &r[0];

    // create new data fitting task
    status = dfsNewTask1D(&taskPtr, nx, xPtr, DF_UNIFORM_PARTITION, ny, yPtr, DF_NO_HINT);
    if (Utils::checkError(status, "dfsNewTask1D") != 0) return status;

    // specify type of spline
    int splineOrder;
    switch (order) {
    case 1:  splineOrder = DF_PP_LINEAR;    break;
    case 2:  splineOrder = DF_PP_QUADRATIC; break;
    case 3:  splineOrder = DF_PP_CUBIC;        break;
    default: splineOrder = DF_PP_CUBIC;        break;
    }

    int sorder = DF_PP_CUBIC;
    int stype = DF_PP_HERMITE;
    int bc_type = DF_BC_1ST_LEFT_DER | DF_BC_1ST_RIGHT_DER;
    int ic_type = DF_IC_1ST_DER;

    float* splineCoeff = new float[ny*splineOrder*(nx - 1)];
    status = dfsEditPPSpline1D(taskPtr, sorder, stype,
        bc_type, NULL, ic_type, NULL, splineCoeff, DF_NO_HINT);
    if (Utils::checkError(status, "dfsEditPPSpline1D") != 0) return status;

    // construct spline
    status = dfsConstruct1D(taskPtr, DF_PP_SPLINE, DF_METHOD_STD);
    if (Utils::checkError(status, "dfsConstruct1D") != 0) return status;

    // interpolate
    int intUniform = isUniform ? DF_UNIFORM_PARTITION : DF_NON_UNIFORM_PARTITION;
    MKL_INT evalOrder = DF_PP_STD + 1; // evaluate 0th derivative of spline (i.e. spline value itself)
    MKL_INT* dataOrder = new MKL_INT[outsize]; // instructs dfdInterpolate1D to evaluate 0th derivative at all points
    std::fill_n(dataOrder, outsize, evalOrder);
    float* resultArr = new float[outsize];
    status = dfsInterpolate1D(taskPtr, DF_INTERP, DF_METHOD_PP, outsize, interpolationRange,
        intUniform, evalOrder, dataOrder, nullptr, resultArr, DF_MATRIX_STORAGE_ROWS, NULL);
    if (Utils::checkError(status, "dfsInterpolate1D") != 0) return status;

    // delete data fitting task
    status = dfDeleteTask(&taskPtr);
    if (Utils::checkError(status, "dfDeleteTask") != 0) return status;

    for (int i = 0; i < outsize; i++)
        out[i] = resultArr[i];
    return 0;
}

Zone: 

Thread Topic: 

How-To
Viewing all 3005 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>