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

numerical integrator dodesol_mk52lfn and tolerance

$
0
0

I am using dodesol_mk52lfn as a replacement for the Gear numerical integrator in the IMSL.  dodesol_mk52lfn has a tolerance input argument, ep, which I do not understand.  dodesol_mk52lfn output matches IMSL quite well with ep on the order of 0.1 to 1.0, whereas it seems that this argument ought to be on the order of 1e-6.  For instance, the example problem in the documentation uses ep=1e-6 and says this produces accuracy of "about 5%".

ep DOUBLE PRECISION

(input) Relative error tolerance, which must be small enough. The code cannot ensure the requested accuracy for ep<1.d-9. This parameter is used to control the step size.

Thanks,

Brian Murphy


problem with LAPACKE_dstemr

$
0
0

Hello! I am trying to use the function 'LAPACKE_dstemr' with a symmetric tridiagonal matrix 'T' but my code crashes.  The  matrix T (dimxdim) in general has the following form:

        | 1.0        a         0         0         0   |
        | a           b         a         0         0   |
T =   | 0           a         b         a         0   | *tau
        | 0           0         a         b          a  |
        | 0           0         0         a         1.0|

where a = -phi1, b=(1.0 + phi1^2)

Let  for example that coefs=[phi1 tau]=[0.7 1] and  dim=200. I want to compute all the eigenvalues and eigenvectors. I cant find an example with this function, please could you tell me what I am doing wrong. My mex-code is the following. Thank you very much.

#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <mkl.h>
#include "mkl_vml.h"
#include "mex.h"
#include "matrix.h"
#include "mkl_vsl.h"
#include <string.h> /* is needed for the function 'strcmp' */

/* Auxiliary routines prototypes */
extern void print_matrix( char* desc, MKL_INT m, MKL_INT n, double* a, MKL_INT lda );
extern double sprod(int dim, double *a);

/* main fucntion */
void mexFunction(int nlhs,mxArray *plhs[],int nrhs,const mxArray *prhs[])
{
    int i,dim,info,n;
    int tryrac = true;
    double *coefs,phi1,tau,phi1square,rw2,*U,*w,*e,*d;
    
    /* make pointers to input data */
    dim = (int)mxGetScalar(prhs[0]);
    coefs = (double*)mxGetPr(prhs[1]);
    rw2 = (double)mxGetScalar(prhs[2]);
    
    /* phi1,tau */
    phi1 = coefs[0];
    phi1square = pow(phi1,2);
    tau = coefs[1];
    
    /* make pointers to output data */
    plhs[0] = mxCreateDoubleMatrix(1,dim,mxREAL);
    w = mxGetPr(plhs[0]);
    
    plhs[1] = mxCreateDoubleMatrix(dim,dim,mxREAL);
    U = mxGetPr(plhs[1]);
    
    /* Memory */
    d = (double*)mxMalloc(dim*sizeof(double));
    e = (double*)mxMalloc(dim*sizeof(double));
    
    /* e, d */
    e[0:dim:1] = -phi1*tau;
    d[0] = tau;
    d[dim-1] = tau;
    d[1:dim-2:1] = (1.0 + phi1square)*tau;
    
    print_matrix( "e", 1, dim, e, 1 );
    print_matrix( "d", 1, dim, d, 1 );
    
    /* Solve eigenproblem */
    n = dim;
    info = LAPACKE_dstemr(LAPACK_COL_MAJOR, 'V', 'A', dim,
            d, e, 0, 0, 0, 0, &n,  w, U, dim, dim, &n, &tryrac );
    
    mexPrintf( "n=%d\t dim=%d\n", n,dim );
    
    /* release memory */
    mxFree(e),mxFree(d);
    return ;
}

/* Auxiliary routine: printing a matrix */
void print_matrix( char* desc, MKL_INT m, MKL_INT n, double* a, MKL_INT lda ) {
    MKL_INT i, j;
    mexPrintf( "\n %s\n", desc );
    for( i = 0; i < m; i++ ) {
        for( j = 0; j < n; j++ ) mexPrintf( " %6.2f", a[i+j*lda] );
        mexPrintf( "\n" );
    }
}

 

Problem with apt repo (Hash Sum mismatch)

$
0
0

Ubuntu 16.04 (containerized env)

cd /tmp && wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB
apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB
wget https://apt.repos.intel.com/setup/intelproducts.list -O /etc/apt/sources.list.d/intelproducts.list
sh -c 'echo deb https://apt.repos.intel.com/mkl all main > /etc/apt/sources.list.d/intel-mkl.list'
apt-get update && DEBIAN_FRONTEND=noninteractive $APT_INSTALL intel-mkl-64bit-2018.4-057

Unexpected error output:

Hit:8 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
Get:9 https://apt.repos.intel.com/mkl all/main amd64 Packages [83.8 kB]
Err:9 https://apt.repos.intel.com/mkl all/main amd64 Packages
  Hash Sum mismatch
Get:10 https://apt.repos.intel.com/mkl all/main all Packages [23.2 kB]
Err:10 https://apt.repos.intel.com/mkl all/main all Packages

Hit:11 http://archive.ubuntu.com/ubuntu xenial-backports InRelease
Fetched 102 kB in 1s (97.7 kB/s)
Reading package lists...
E: Failed to fetch https://apt.repos.intel.com/mkl/dists/all/main/binary-amd64/Packages.gz  Hash Sum mismatch
E: Failed to fetch https://apt.repos.intel.com/mkl/dists/all/main/binary-all/Packages.gz
E: Some index files failed to download. They have been ignored, or old ones used instead.
Removing intermediate container bfa65af9736b
The command '/bin/sh -c apt-get update &&     apt-get install -y wget &&     cd /tmp && wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB &&     apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB &&     echo deb https://apt.repos.intel.com/mkl all main > /etc/apt/sources.list.d/intel-mkl.list &&     apt-get update && DEBIAN_FRONTEND=noninteractive $APT_INSTALL intel-mkl-64bit-2018.4-057' returned a non-zero code: 100

Problem may be related to 2018 topic (#779730) i've found googling fingerprint

Using MKL to Multiply Non-consecutive columns by a mtrix

$
0
0

Hi

I am trying to use MKL to do some matrix multiplications. However I need to multiply specific columns in one matrix to another matrix. The problem is that cblac_dgemm takes successive columns, so how can I do this and only multiply certain columns knowing the starting pointer of each of course ?? I tried using a for loop to multiply each column by the matrix but the execution time is much larger than taking successive columns all at once I also don't want to copy the columns to a new variable to but them in a successive order because this also takes long time.

I tried using pthreads to do it in a more paralleled way however still no much improvement.

How does MKL handle parallelization and make it much better than OpenMP and pthreads?

Thanks in advance

Ahmed

Does the custom MKL dll include fortran runtime?

Which function could solve linear least square with inequality constraints?

$
0
0

I want to solve X in a linear system A*X=B with constraints that all elements in X are non-negative. It is a Non-negative Least Squares (NNLS) problem. Do you know which function can be used for it? I tried the function trnlspbc_solve (nonlinear least squares problem with linear constraints), but it does not work well for this linear least square problem. Any ideas? 

Which function could solve linear least square with inequality constraints?

$
0
0

I want to solve X in a linear system A*X=B with a constraint that all elements in X are non-negative. It is a Non-negative Least Squares (NNLS) problem. Do you know which function in the MKL library for this problem? I tried to use trnlspbc_solve(), the Nonlinear Least Squares Problem with Linear Constraints, but it doesn't work well. Any ideas? 

Anaconda MKL and threading on macOS

$
0
0

Hi,

I am not sure if this is the correct forum for this, so bear with me!

I am using MKL (2019.1) installed via Miniconda (4.6.8) on macOS (10.14.2). The open source code I develop (gprMax - https://github.com/gprMax/gprMax) is written in Python, uses NumPy, and has modules that are Cythonized and use OpenMP. The conda environment that I use is relatively simple - https://github.com/gprMax/gprMax/blob/master/conda_env.yml On Linux and Windows the simulation software behaves normally, however, on macOS the simulations become unstable. This has only started happening recently when I updated the conda environment. Interestingly, if I set the simulation to use a single thread on macOS it behaves normally and is stable. Also if I use OpenBLAS instead of MKL, by specifying blas=*=openblas in my conda environment file, I have no problems with stability and using multiple threads.

I am interested to know if anyone else has experience similar problems, and also how I might further debug the issue.

Kind regards,

Craig


Compiling program, linking mkl/lapack/blas

$
0
0

Hi. I am trying to compile a program(COIN OR CBC and its dependencies) using intel compilers and mkl to get best possible performance.

The program and its dependencies can be compiled using:  ./configure -> make -> make install

Before I used the flags: --enable-blas="-lrefblas" and --enable-lapack="-llapack"

So I want to ensure that the intel mkl blas/lapack libraries are used.
How do I make sure of this?
Also, I want to ensure that the mkl library is used for math operations (instead of the regular -lm).Is this the default when using intel compiler, or do I need to specify this in a way?

FFTW2

$
0
0

I use vs2013+ivf2013 program my fortran code, The FFTW2 wrappers to Intel MKL provide the following subroutines for calling from Fortran:
call fftw_f77_create_plan(plan, n, dir, flags)
call fftw_f77(plan, howmany, in, istride, idist, out, ostride, odist)
call fftw_f77_one(plan, in, out)
call fftw_f77_threads(nthreads, plan, howmany, in, istride, idist, out, ostride, odist)
call fftw_f77_threads_one(nthreads, plan, in, out)
call fftw_f77_destroy_plan(plan)
call fftwnd_f77_create_plan(plan, rank, n, dir, flags)
call fftw2d_f77_create_plan(plan, nx, ny, dir, flags)
call fftw3d_f77_create_plan(plan, nx, ny, nz, dir, flags)
call fftwnd_f77(plan, howmany, in, istride, idist, out, ostride, odist)
call fftwnd_f77_one(plan, in, out)
call fftwnd_f77_threads(nthreads, plan, howmany, in, istride, idist, out, ostride,odist)
call fftwnd_f77_threads_one(nthreads, plan, in, out)

According to the 'FFTW Interface to Intel® Math Kernel Library', just provide the method in Linux like this:make libintel64,,,Any one know how to do in windows?   Anyone could tell me the  detials of using above subroutines?

MKL - General Polynomial Fitting function?

$
0
0

The General Polynomial Fitting Function in MKL

Hi,

I’m looking for a general Polynomial Fitting function in MKL, which is similar to Polyfit function from Matlab, OptiVec and Armadillo.  This function uses two set of input data X and Y to determine the coefficients ai of a polynomial:

P= a0 + a1Xi + a2Xi2 ... anXin

Where,

χ2 = sum( 1/σi2 * (Pi - Yi));

Is minimized.

I have searched MKL Data Fitting Library and found that all of routines are Spline-based.  In MKL LAPACK library, I found some routines the Least Squares ones.

I understand that,

  1. as the order of the polynomial increases, Spline-based methods are preferable over polynomial interpolation because its interpolation error increases
  2. when the size of X and Y > the order of the polynomial increases, the Least Squares fit will be used

What I need, however,  is a general Polynomial Fitting function described above.  Is there such function and where can I find it in MKL (or IPP)?

MKL 2019 installed but not showing Windows 10 Installed Programs

$
0
0

I installed MKL 2019 update 3 under Windows 10 64 bit, trying to use it with Visual Studio C++ 2017.

Initially the install went ok, and Intel Performace Libraries showed up under Configuration in VS2017.

But after uninstalling MKL 2019, and VS2017, and reinstalling, Performance Libraries is not showing up under Configuration, even though MKL install says it finds and integrates with VS2017.

There seems to be a problem with cleaning up the registry after uninstall of MKL 2019. Windows still thinks it is installed, and won't properly install again.

I install MKL 2018, and it seemed to integrate with VS2017, and show up under configuration. But there are strange issues that seem to result from Windows not uninstalling MKL 2019 properly.

How can I clean up the mess that MKL 2019 made in the registry, and reinstall it so that it works with VS2017 like it did originally?

This is extremely frustrating as I've spent 5 hours uninstalling and installing Visual Studio and different MKLs.

Please provide a working MKL 2019 uninstaller for Windows. I need to use MKL with Visual Studio, and the broken installer is making it impossible to proceed.

Thank you,
Jason

Pardiso with MPICH2 generates a program exception

$
0
0

Hello,

I'm using visual studio 2017 and parallel studio XE 2018 cluster edition.

I've tried to execute my code with PARDISO solver using MPICH2. However, it triggers an "Program exception - exception code = 0x7e (126)".

I wonder if I should use cluster version of PARSISO in case of using MPICH2. Otherwise, what should I do to treat this error?

Thanks.

 

 

 

LAPACK_zheev with matrix_layout=LAPACK_ROW_MAJOR

$
0
0

There seems to be a bug in the routine LAPACK_zheev in MKL 2019 update 3 version. This routine is used for finding eigenvectors and eigenvalues of a Hermitian matrix 'a'. Its syntax is:

lapack_int LAPACKE_zheev ( int matrix_layout , char jobz , char uplo , lapack_int n , lapack_complex_double* a , lapack_int lda , double* w );

The problem seems to occur for only "matrix_layout = LAPACK_ROW_MAJOR" argument with jobz = 'V'. The eigenvectors are outputted in 'a' by rewriting it. However, the routine rewrites only upper triangular portion of 'a' and the rest of the matrix is unchanged.

For example, the following code calculates the eigenvectors of the 2x2 Pauli matrix sigma_x.

filename: lapack_zheev

#include <iostream>
#include <complex>
#define MKL_Complex16 std::complex<double>
#include "mkl.h"
#include "mkl_types.h"

using namespace std;

int main() {
    complex<double> a[4];
    a[0] = 0;
    a[1] = 1;
    a[2] = 1;
    a[3] = 0;

    double eigs[2];

    int info = LAPACKE_zheev(LAPACK_ROW_MAJOR, 'V', 'U', 2, a, 2, eigs);

    cout << "Info = "<< info << endl;
    cout << a[0] << ""<< a[1] << endl;
    cout << a[2] << ""<< a[3] << endl;
}

I compile it with:

icpc -std=c++14 -qopenmp -DMKL_ILP64 -m64 -I${MKLROOT}/include -O3 -DNDEBUG -ansi-alias -o lapack_zheev.out lapack_zheev.cpp -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_ilp64.a ${MKLROOT}/lib/intel64/libmkl_intel_thread.a ${MKLROOT}/lib/intel64/libmkl_core.a -Wl,--end-group -liomp5 -lpthread -lm -ldl

./lapack_zheev.out

The output is:

Info = 0
(-0.707107,0) (0.707107,0)
(1,0) (0.707107,0)

while it is supposed to be:

Info = 0
(-0.707107,0)   (0.707107,0)
(0.707107,0)   (0.707107,0)

Replacing LAPACK_ROW_MAJOR by LAPACK_COL_MAJOR produces the correct output.

Question about matrix storage in Zheevd

$
0
0

There are two choices for the argument uplo.

uplo
Must be 'U' or 'L' .
If uplo = 'U' , a stores the upper triangular part of A.
If uplo = 'L' , a stores the lower triangular part of A.

Is it still rightful if the matrix holds all the elements (both upper and lower parts)?

The matrix is overwritten by the eigenvectors on exit. I am not sure if the upper or lower triangular part is not initialized to zeros, the output eigenvectors are still correct.

 


MKL Memory Management

$
0
0

I am trying to use a custom memory manager for my project. I looked at the example code given in "i_malloc.h" but this seems to not working for me. 

Here is a snippet of what I have. I am only replacing malloc here as example, but I am replacing all four in my actual code. 

   #include <i_malloc.h>

   void * my_malloc(size_t size){
     printf("Testing my_malloc\n");
     return malloc(size);
   }

   int main( int argc, int argv )
   {
       // override normal pointers
       i_malloc = my_malloc;

       // Some MKL calls that involves malloc inside the library calls
   }

 

It looks like the code is not using my_malloc for allocation. Any idea what I am missing?

 

Thanks,

Samee

Linker Problem with MKL Fast Poisson solver

$
0
0

Hello all,

I have written a code in C++ for fluid dynamics simulations. I develop it in Qt Creator (4.2.1, based on Qt 5.8.0 (MSVC 2015, 32 bit)) on Windows10 and mingw32.

Part of the code requires the fast poisson solver (#include "mkl_poisson.h") and the corresponding cartesian routines of mkl.

The code compiles however whenever I try to call a function from the library I get the dreaded

---Intel MKL FATAL ERROR: Cannot load mkl_intel_thread.dll.----

error message. This appears to be a common issue, especially for some Python libraries.

I have a brand new copy of the MKL libraries (2019.3.203) and have tried:

1) Including libraries (IntelSWTools\compilers_and_libraries_2019.3.203\windows\redist\ia32_win\mkl) and compiler libs (IntelSWTools\compilers_and_libraries_2019.3.203\windows\redist\ia32_win\compiler) into my path, and separately (after removing paths)

2) Linking directly to the necessary libraries in the build tree

LIBS += -lmkl_rt, LIBS += -lmkl_intel_thread etc.

But I still get the problem. The issue does not seem to happen on my work PC, so I figured it must be some dependency issue, which is why I downloaded the new MKL libraries to trial method 1) above. Unfortunately the same error occurs.

 

Any help would be appreciated.

Linker Problem with MKL Fast Poisson solver

$
0
0

Hi all,

I am writing a small library for fluid dynamic simulations. I use Qt Creator ( 4.2.1, Based on Qt 5.8.0 (MSVC 2015, 32 bit)) and am compiling with mingw32 on Windows 10. I require the mkl fast poisson library for my solver. I dynamically link the library, and the source compiles, however as soon as I try to call the library I receive the dreaded:

"Intel MKL FATAL ERROR: Cannot load mkl_intel_thread.dll."

error. Apparently this happens a lot with python libraries and appears to generally be an issue with the libraries not being on the PATH. After downloading the newest IntelMKL release (219.3.203) I have already tried the following:

1) Path Variables: ...IntelSWTools\compilers_and_libraries_2019.3.203\windows\redist\ia32_win\mkl and

...IntelSWTools\compilers_and_libraries_2019.3.203\windows\redist\ia32_win\compiler in PATH. No dice, also:

2) Not in Path: I dynamically link and include the following libraries (some perhaps unnecessary) (mkl_rt, mkl_intel_thread, mkl_core)

Regardless of these two approaches, I always get the error. None of the topics I have thus far found appear to help my case.

Help!

Cannot link to MKL from a Fortran program

$
0
0

I just installed your latest version of MKL, 2019 version 3, and I get this error massege:

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

I am using VISUAL STUDIO 2015, and it did say it integrated it to VS2015.

also, I did say "use MKL" in the Fortran part of the BUILD options,

so I was wondering if if have to say that somewhere else ?

Under the LINKER part of the build menu, it does not mention the MKL anywhere.     

Is there a way to check if it was properly installed ?

did anyone TEST this for Fortran users ?  

illegal value in DESCINIT and PSGESV

$
0
0

I am new to scaLapack and I am trying to execute the program ex1.c in this link:

http://geco.mines.edu/software/mkl/index.shtml

when I run it, these two messages are printed: "DESCINIT parameter number 9 had an illegal value", "and PSGESV parameter number 1 had an illegal value". 
I don't see why those values are illegal, can someone help? Thanks.

Viewing all 2652 articles
Browse latest View live


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