Hi everyone
I have been doing fortran programs with intel mkl for several years, but this time I faced a runtime error as:
The ordinal 242 could not be located in the dynamic link library C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019\windows\redist\intel64\mkl\mkl_intel_thread.dll
when I was trying to test sparse matrix function MKL_SPARSE_D_MV , and the test code is exactly the one I download from Intel official site. For convenience I paste the code here, and Line 66 is the function of MKL_SPARSE_D_MV , if I comment this function it runs well.
My environment is listed as follows
Windows 10 x64, Visual Studio 2017 + Intel® Parallel Studio XE 2019 Update 3, and compiled with x64 Release version.
PROGRAM SPMV ! ***************************************************************************** ! Declaration and initialization of parameters for sparse representation of ! the matrix A in CSR format: ! ***************************************************************************** USE MKL_SPBLAS IMPLICIT NONE INTEGER M, N, NNZ, i, info ! ***************************************************************************** ! Sparse representation of the matrix A ! ***************************************************************************** INTEGER, ALLOCATABLE :: csrColInd(:), csrRowPtr(:) DOUBLE PRECISION, ALLOCATABLE :: csrVal(:) ! Matrix descriptor TYPE(MATRIX_DESCR) descrA ! Sparse matrix descriptor ! CSR matrix representation TYPE(SPARSE_MATRIX_T) csrA ! Structure with sparse matrix ! ***************************************************************************** ! Declaration of local variables: ! ***************************************************************************** DOUBLE PRECISION, ALLOCATABLE :: x(:), y(:) DOUBLE PRECISION alpha, beta M = 5 N = 5 NNZ = 13 ALLOCATE(csrColInd(NNZ)) ALLOCATE(csrRowPtr(M+1)) ALLOCATE(csrVal(NNZ)) ALLOCATE(x(M)) ALLOCATE(y(M)) csrVal = (/ 1.0,-1.0,-3.0,-2.0,5.0,4.0,6.0,4.0,-4.0,2.0,7.0,8.0,-5.0 /) csrColInd = (/ 0,1,3,0,1,2,3,4,0,2,3,1,4 /) csrRowPtr = (/ 0, 3, 5, 8, 11, 13 /) x = (/ 1.0, 5.0, 1.0, 4.0, 1.0 /) y = (/ 0.0, 0.0, 0.0, 0.0, 0.0 /) alpha = 1.0 beta = 0.0 print*,'EXAMPLE PROGRAM FOR MKL_SPARSE_D_MV' print*,'---------------------------------------------------' print*,'' print*,'INPUT DATA FOR MKL_SPARSE_D_MV' print*,'WITH GENERAL SPARSE MATRIX' print*,'ALPHA =',alpha,'BETA =',beta print*,'SPARSE_OPERATION_NON_TRANSPOSE' print*,'Input vector' do i = 1, M print*,x(i) enddo ! Create CSR matrix i = MKL_SPARSE_D_CREATE_CSR(csrA,SPARSE_INDEX_BASE_ZERO,M,N,csrRowPtr,csrRowPtr(2),csrColInd,csrVal) ! Create matrix descriptor descrA % TYPE = SPARSE_MATRIX_TYPE_GENERAL ! Analyze sparse matrix; chose proper kernels and workload balancing strategy info = MKL_SPARSE_OPTIMIZE(csrA) ! Compute y = alpha * A * x + beta * y !! ############################################################# !! error from here, but when I comment following function, it runs well; info = MKL_SPARSE_D_MV(SPARSE_OPERATION_NON_TRANSPOSE,alpha,csrA,descrA,x,beta,y) !! ############################################################# ! Release internal representation of CSR matrix info = MKL_SPARSE_DESTROY(csrA) print*,'' print*,'OUTPUT DATA FOR sparseDcsrmv' do i = 1, M print*,y(i) enddo print*,'---------------------------------------------------' END PROGRAM SPMV