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

How should I distribute memory for parallel direct sparse solver for cluster?

$
0
0

Hi,

I'm trying to use parallel direct sparse solver for cluster. So, altering sample code (cl_solver_sym_distr_f.f), I made the parallelized code for solving large numbers of linear equations.

I hypothesize the number of process is n and the number of equations is n*k. In my code, m-th process (m:1,2,...,n) has the following information: the i-th component of right hand vector ((m-1)*k+1 <= i <= m*k) and the (a,b) component of matrix (((m-1)*k+1 <= a <= m*k, 1 <= b <= n*k).

The difference from sample code is that we distribute memory without overlap and that the size of equations is very big.

our obtained result is like this.

The number of equations is 800,000. The number of nonzero components  is 15,000,000. I do not use OpenMP. So, I set OMP_NUM_THREADS=1.

The calculation time with 1 processor is 36 s.

The calculation time with 2 processor is 17 s.

The calculation time with 4 processor is 13 s.

The calculation time with 8 processor is 12 s.

Like this, I could not obtain good efficiency.

I suppose the way of distributing memory is not proper in my code. How should I distribute memory to processors?

Best,

Shigeki


Deadlock Problem when using the Cluster FFT

$
0
0

Hello,

I have run a massive simulation using MPI on distributed memory supercomputers
(FUJITSU Server PRIMERGY CX2550 M4 × 880)
and compiled with the intel/2018.2.046 Fortran compiler.

I have deadlock problems when using the Cluster FFT and the Available Auxiliary Functions
(MKL_CDFT_ScatterData and MKL_CDFT_GatherData) and the performance of the simulation is too slow.

The simulation is for solving Navier–Stokes equations and
3D(X, Y, and Z) arrays necessary to solve the equations.
Since in the simulation boundary conditions of the Y and Z directions are periodic,
I applied 2D Cluster FFT in the two directions and iterated the calculation along the other direction X as below.

==============================================
STATUS = DftiCreateDescriptorDM(MKL_COMM,DESC,DFTI_DOUBLE,DFTI_COMPLEX,2,LENGTHS)

STATUS = DftiGetValueDM(DESC,CDFT_LOCAL_SIZE,SIZE)
STATUS = DftiGetValueDM(DESC,CDFT_LOCAL_NX,NXX)
STATUS = DftiGetValueDM(DESC,CDFT_LOCAL_X_START,START_X)
STATUS = DftiGetValueDM(DESC,CDFT_LOCAL_OUT_NX,NX_OUT)
STATUS = DftiGetValueDM(DESC,CDFT_LOCAL_OUT_X_START,START_X_OUT)
ALLOCATE(LOCAL(SIZE), WORK(SIZE), STAT=STATUS)
STATUS = DftiSetValueDM(DESC,DFTI_PLACEMENT,DFTI_NOT_INPLACE)

DO I = 1, Nx-1

 ALLOCATE(X_IN(M,N))
 
 DO K = 1, N
  DO J = 1, M
  X_IN(J,K) = DCMPLX(A(I,J,K),0d0)
  END DO
 END DO

 STATUS = DftiCommitDescriptorDM(DESC)
 STATUS = MKL_CDFT_SCATTERDATA_D(COMM,ROOTRANK,ELEMENTSIZE,2,LENGTHS,X_IN,NXX,START_X,LOCAL) 
 STATUS = DftiComputeForwardDM(DESC,LOCAL,WORK)
 STATUS = MKL_CDFT_GATHERDATA_D(COMM,ROOTRANK,ELEMENTSIZE,2,LENGTHS,X_IN,NXX,START_X,WORK)

 DO K = 1, N
  DO J = 1, M
  T_F1(I,J,K) = X_IN(J,K)
  END DO
 END DO
 
 DEALLOCATE(X_IN)

END DO

DEALLOCATE(LOCAL, WORK)

~~~~~~~~~~~~~~~~~~~
<SOME CALCULATIONS>
~~~~~~~~~~~~~~~~~~~

STATUS = DftiGetValueDM(DESC,CDFT_LOCAL_SIZE,SIZE)
STATUS = DftiGetValueDM(DESC,CDFT_LOCAL_NX,NX_OUT)
STATUS = DftiGetValueDM(DESC,CDFT_LOCAL_X_START,START_X_OUT)
STATUS = DftiGetValueDM(DESC,CDFT_LOCAL_OUT_NX,NXX)
STATUS = DftiGetValueDM(DESC,CDFT_LOCAL_OUT_X_START,START_X)
ALLOCATE(LOCAL(SIZE), WORK(SIZE), STAT=STATUS)
SCALE = 1.0_8/(N*M)
STATUS = DftiSetValueDM(DESC,DFTI_BACKWARD_SCALE,SCALE)

DO I = 1, Nx-1

 ALLOCATE(X_IN(M,N))
 
 DO K = 1, N
  DO J = 1, M
  X_IN(J,K) = A(I,J,K)
  END DO
 END DO
 
 STATUS = DftiCommitDescriptorDM(DESC)
 STATUS = MKL_CDFT_SCATTERDATA_D(COMM,ROOTRANK,ELEMENTSIZE,2,LENGTHS,X_IN,NXX,START_X,WORK)
 STATUS = DftiComputeBackwardDM(DESC,WORK,LOCAL)
 STATUS = MKL_CDFT_GATHERDATA_D(COMM,ROOTRANK,ELEMENTSIZE,2,LENGTHS,X_IN,NXX,START_X,LOCAL)
 
 DO K = 1, N
  DO J = 1, M
  P(I,J,K) = REAL(X_IN(J,K))
  END DO
 END DO 
 
 DEALLOCATE(X_IN)

END DO

DEALLOCATE(LOCAL, WORK)

STATUS = DftiFreeDescriptorDM(DESC)
==============================================

I programed this simulation based on the 'cdft_example_support' and 'dm_complex_2d_double_ex2' provided by the Intel MKL.
After using -check_mpi, I've got the following errors when calculating the first Do loop.

==============================================
[0] ERROR: no progress observed in any process for over 11:12 minutes, aborting application
[0] WARNING: starting premature shutdown

[0] ERROR: GLOBAL:DEADLOCK:HARD: fatal error
[0] ERROR:    Application aborted because no progress was observed for over 11:12 minutes,
[0] ERROR:    check for real deadlock (cycle of processes waiting for data) or
[0] ERROR:    potential deadlock (processes sending data to each other and getting blocked
[0] ERROR:    because the MPI might wait for the corresponding receive).
[0] ERROR:    [0] no progress observed for over 11:12 minutes, process is currently in MPI call:
[0] ERROR:       mpi_gather_(*sendbuf=0x762610, sendcount=2, sendtype=MPI_INTEGER, *recvbuf=0x2b9c9acc4b80, recvcount=2, recvtype=MPI_INTEGER, root=0, comm=MPI_COMM_WORLD, *ierr=0x7fffca56ca50)
[0] ERROR:       module_mpi_mp_mkl_cdft_scatterdata_d_ (/home/~)
[0] ERROR:       press_ffttdma_ (/home/~)
[0] ERROR:       rk3_uvwpc_ (/home/~)
[0] ERROR:       MAIN__ (/home/~)
[0] ERROR:       main (/home/~)
[0] ERROR:       __libc_start_main (/usr/lib64/libc-2.17.so)
[0] ERROR:       (/home/~)
.
.
.
[0] INFO: GLOBAL:DEADLOCK:HARD: found 1 time (1 error + 0 warnings), 0 reports were suppressed
[0] INFO: Found 1 problem (1 error + 0 warnings), 0 reports were suppressed.
==============================================

I have tried to solve this deadlock and being slow problems for several weeks but I can't fix it.
I would greatly appreciate any help or some insight on this problems.

Best regards

YU,

CPU Execution Time

$
0
0

I am using mkl_get_cpu_clocks() function to measure the CPU execution time of LAPACKE_dgesv. My code is like:

unsigned MKL_INT64 t1,t2;
mkl_get_cpu_clocks(&t1);
run LAPACKE_dgesv()
mkl_get_cpu_clocks(&t2);
printf("Elapsed MKL: %lf  \n", (double)(t2-t1)/1000000000);

However, the returned elapsed time is not even close to the execution time. The actual execution time is about 27 seconds while the returned time is about 64 seconds!

I checked the Intel MKL manual and unfortunately there is not enough discussion about mkl_get_cpu_clocks. Can you please help? Thank you.

 

-Afshin

Which SVD driver routine is most efficient?

$
0
0

There are many a SVD driver routines in MKL (see page 986 of MKL reference manual). I checked LAPACK Users' Guide but obviously it's behind the tide because it only mentioned the divide and conquer method in addition to the traditional algorithm. So, among these candidate SVD driver routines, which one is most efficient? The platform being considered is the regular Windows 10 Core i5. Thanks.

Matrix Power

$
0
0

Hello,

I found this function: v?Powx, in order to compute the Matrix power with very high exponents.

But maybe it works only with vectors, because when I tested it for example with power of 2 I found different results compared with a simple multiplication A*A.

Is there any othe functions for my aims?

thankyou very much
Gianluca

complex FFT in 2 dimensions

$
0
0

Hello,

I am trying compute a complex to complex FFT in 2 dimensions but the values I obtain are not correct (only the first 2 are). This is not a normalisation issue. The transform I obtain is not simply proportional to the correct one.

I have made a minimal example that reproduces the problem. The signal corresponds to a square whose corners are set to 1+i while the remaining values are set to 0. I have also tried with an out-of-place transform but the same problem occurs. You will find the source code below.

I suppose I have made some silly mistake somewhere (I am a beginner with the MKL) but I can't figure out where.

Thank you!

#include <mkl_dfti.h>
#include <iostream>

int main(){

  long int n[2]={8, 8};
 
  double signal[128]={1,1, 1,1, 0,0, 0,0, 0,0, 0,0, 1,1, 1,1,
              1,1, 1,1, 0,0, 0,0, 0,0, 0,0, 1,1, 1,1,
              0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0,
              0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0,
              0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0,
              0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0,
              1,1, 1,1, 0,0, 0,0, 0,0, 0,0, 1,1, 1,1,
              1,1, 1,1, 0,0, 0,0, 0,0, 0,0, 1,1, 1,1};
 
  DFTI_DESCRIPTOR_HANDLE descriptor_handle;
  DftiCreateDescriptor(&descriptor_handle, DFTI_DOUBLE, DFTI_COMPLEX, 2, n);
  DftiErrorMessage(DftiCommitDescriptor(descriptor_handle));

  DftiComputeForward(descriptor_handle, signal);

  for(int i=0; i<64; ++i){
    std::cout << signal[2*i] << ""<< signal[2*i+1] << "\n";
  }

  DftiFreeDescriptor(&descriptor_handle);
 
 
  return 0;
}

 

 

 

 

PARDISO and Nonlinear Systems

$
0
0

Hi,

I have been experimenting with the PARDISO solver, solving a system of linear equations

Ax=b

The example file 'pardiso_unsym_c.c' contains the variables

double *a : corresponds to the matrix A in the equation above
double *b : corresponds to the vector b in the equation above
double *x: corresponds to the vector x in the equation above

It has proven to be very fast for my purposes. I've also noticed a nonlinear example case 'pardiso_nonlinear.c' which contains an "Example of solving nonlinear problem using PARDISO and Sparse BLAS". Is there an expression of the specific nonlinear problem being tackled in the example? I would like to adapt the example to solve a system of semilinear equations I have (Ax=b, where b is a function of x). But I am unsure of what the variables pertain to. Specifically, the variables

double *a
double *f
double *u

Any help/documentation would be appreciated.

Shipping fortran dll with MKL routines.

$
0
0

Dear all,

I develop a program using Intel® Parallel Studio XE 2015 Composer Edition for Fortran Windows. I am tying to run the program on a different pc. All of the dlls are loaded successfully except one. In this particular dll there is a call to MKL subroutine, namely pardiso solver. If I comment out this call dll is loaded otherwise not. Any help is highly appreciated. 

Thank you for your time in advance,

Baset regards,

Irhan.


strange behavior of the cluster_sparse_solver

$
0
0

Dear experts,
    I'm trying to use INTEL cluster sparse solver to solve a big size of symmetric complex number equations. I found that my code has strange behavior,  it gives the correct solution or crashes as the number of the cluster processes is changed.
    My cluster consists of two nodes, each node has Intel i7-5820k CPU with 6 cores, 128GB memory. The OS is OpenSUSE Leap version 42.3. The compiler is Intel Parallel Studio Cluster version, 2018.3.222.
    Based on the hardware configuration, I am able to run the code with the number of processes from 1 to 12.
    When running the code with 1 process, the code gives the correct solution.
    When 2 to 8 processes are used, the code is crashed, shown the following error messages.
    
***** < mpirun -n 2 ./test_psolver_v1.a > <Error Message>*****    
Fatal error in PMPI_Allgather: Message truncated, error stack:
PMPI_Allgather(1093)....................: MPI_Allgather(sbuf=0x7ffc336490e4, scount=1, MPI_INT, rbuf=0x8afcb80, rcount=1, MPI_INT, MPI_COMM_WORLD) failed
MPIR_Allgather_impl(908)................: fail failed
MPIR_Allgather(861).....................: fail failed
MPIR_Allgather_intra(681)...............: fail failed
MPIDI_CH3_PktHandler_EagerShortSend(457): Message from rank 0 and tag 7 truncated; 8 bytes received but buffer size is 4

    
***** < mpirun -n 3 ./test_psolver_v1.a > <Error Message>*****    
Fatal error in PMPI_Allgather: Invalid count, error stack:
PMPI_Allgather(1093).....: MPI_Allgather(sbuf=0x8b53ea0, scount=1, MPI_LONG_LONG_INT, rbuf=0x8b54300, rcount=1, MPI_LONG_LONG_INT, MPI_COMM_WORLD) failed
MPIR_Allgather_impl(908).: fail failed
MPIR_Allgather(861)......: fail failed
MPIR_Allgather_intra(332): fail failed
MPIC_Send(335)...........: Negative count, value is -32766
Fatal error in PMPI_Allgather: Message truncated, error stack:
PMPI_Allgather(1093)....................: MPI_Allgather(sbuf=0x7ffd59422ee4, scount=1, MPI_INT, rbuf=0x9cf6e00, rcount=1, MPI_INT, MPI_COMM_WORLD) failed
MPIR_Allgather_impl(908)................: fail failed
MPIR_Allgather(861).....................: fail failed
MPIR_Allgather_intra(267)...............: fail failed
MPIDI_CH3_PktHandler_EagerShortSend(457): Message from rank 0 and tag 7 truncated; 16 bytes received but buffer size is 12

***** < mpirun -n 7 ./test_psolver_v1.a > <Error Message>*****    
Fatal error in PMPI_Allgather: Invalid count, error stack:
PMPI_Allgather(1093).....: MPI_Allgather(sbuf=0xa4781a0, scount=1, MPI_LONG_LONG_INT, rbuf=0xa476580, rcount=1, MPI_LONG_LONG_INT, MPI_COMM_WORLD) failed
MPIR_Allgather_impl(908).: fail failed
MPIR_Allgather(861)......: fail failed
MPIR_Allgather_intra(332): fail failed
MPIC_Send(335)...........: Negative count, value is -32766
MPIR_Allgather_intra(267): fail failed
MPIC_Sendrecv(547).......: Negative count, value is -32764
Fatal error in PMPI_Allgather: Message truncated, error stack:
PMPI_Allgather(1093)....................: MPI_Allgather(sbuf=0x7fff02c0b5e4, scount=1, MPI_INT, rbuf=0x86c7600, rcount=1, MPI_INT, MPI_COMM_WORLD) failed
MPIR_Allgather_impl(908)................: fail failed
MPIR_Allgather(861).....................: fail failed
MPIR_Allgather_intra(267)...............: fail failed
MPIDI_CH3_PktHandler_EagerShortSend(457): Message from rank 4 and tag 7 truncated; 16 bytes received but buffer size is 12
MPIR_Allgather_intra(267)...............: fail failed
MPIDI_CH3U_Receive_data_found(131)......: Message from rank 2 and tag 7 truncated; 32 bytes received but buffer size is 28
    

    When running the code with 9 to 12 processes, the code gives the correct solution again.
    I searched the Internet, but I don't get any useful information to solve it. Is this MKL problem or I did something wrong? Can you help me?

    The following are my code and test input files.

    Thank you very much.

    Dan   

Problem with mkl_blas.fi

$
0
0

Last week I renewed my license for Intel Parallel Studio XE Composer Edition for Fortran Windows.  Intel no longer offers a license package for Fortran with IMSL, which is what I've had in the past.  Accordingly, I am considering converting my developmental code to use MKL vice IMSL.  On including "mkl.fi" in my main program, but without attempting to call any MKL routines, I get 30 error messages #5082 referencing line numbers between 620 and 1274 inclusive of mkl_blas.fi.  Looking at this file, all these lines appear to contain an ampersand in column 73, as well as in column 6 of the following line.  It looks like someone is attempting to follow both the Fortran 77 and Fortran 90 continuation conventions.

My command line is:  /nologo /debug:full /Od /extend_source:132 /warn:truncated_source /warn:interfaces /real_size:64 /fpe:1 /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc120.pdb" /list:"Debug\COGNIT_N.lst" /traceback /check:bounds /libs:static /threads /dbglibs /Qmkl:parallel /c

My guess is that "/extend_source:132" is the culprit, since if the source line were limited to 72 characters, the & in column 73 would be treated as a comment and no error would occur.  However, I have KLOCs, perhaps tens of KLOCs, with line lengths > 72.  I have attempted editing the &  out of column 73 and saving the file, but get "access denied," even after changing USER permission to RWE.

Many of the MKL routines I would like to use are mkl_blas.fi routines, so just including non-blas mkl_?.fi's doesn't look like a good work-around.

Any assistance would be gratefully appreciated.

Mahalo (Hawaiian for "thank you"),

Mike

 

 

Increase in .exe file size from version 16.3 to 18.3 due to IMKL

$
0
0

Hi

I originally posted this in the Intel visual fortran compiler for windows forum, but was redirected here (sorry for the double post).

We have seen an increase in the file size of an executable of almost a factor of two (from 18Mb to 36Mb), when changing from the intel visual fortran compiler version 16.3 to 18.3.

My suspicion is the embedded library IMKL library. We include the MKL library but try to limit it to only the double precision versions by this:

USE MKL_DFTI, FORGET=>DFTI_SINGLE, DFTI_SINGLE=>DFTI_SINGLE_R

As recommended in the documentation.

When compiling with 16.3 the size is 18.8Mb/31.6Mb (with/without the FORGET part).

When compiling with 18.3 the size is 36.0Mb/38.4Mb (with/without the FORGET part). 

Is this expected behavior?

Brgds

Lars

How to create C project with mkl.h

$
0
0

I'm new to intel system studio 2019, so i don't know how to use mkl.h library function in my c program.

Can anyone tell me procedure to create C project creation with mkl.h? and what are the configurations need to change?

How to find inverse of a sparse matrix using pardiso?

$
0
0

I have a sparse matrix of A 17000 x 17000 (real data). Need to find the inverse of A, I am new to intel math library.

Anyone could help me to solve this problem by using pardiso?, pardiso has take 16 variables but I have only a single matrix and if use pardiso where will get the corresponding result?

My system configuration are as follows,

Architecture : x86_64

CPUs : 12

Model : Intel(R) Core(TM) i7-3960x CPU @ 3.30Ghz

RAM : 16 Gb

ISS: Intel system studio 2019.

 

Thanks in advance.

Result inconsistency in MKL svd

$
0
0

I'm using the following MKL product:

Major: 2017

Minor: 0

Update: 2

on an Intel(R) 64 architecture.

I get inconsistencies in the results from the function LAPACKE_dgesvd. When I input the function with slightly different input matrices I get different V* outputs. These are not the expected inconsistencies due to the non-uniqueness of svd. In my case the input matrix represents a scatter of coordinates in 2D. So the matrix has two columns. The output from svd for the matrix V* should be the rotation matrix to the principal directions. However, in some of the cases I get a sign flipped version of the principal direction angle. This is not a rotation of 90 or 180 deg. compared to the correct principal direction, but rather a simple flipping of sign (23deg. instead of -23deg., i.e.). 

I'm using 'O' and 'S' for the second and third arguments, respectively. 

 

 

Compile MKL 10 With VS2013

$
0
0

Hello, 

How to compile MKL version 10 with Visual Studio 2013 ?

Is it possible ?  

Thank you,

Christophe, 

 


How to achieve Parallel back substitution when using Pardiso?

$
0
0

I want to speed up the procedure of back substitution, but I did not figure out what should I do.

I used to use OpenMp simply, but the reason differs.

!$OMP parallel do
        do j = 1,sub(i)%Nob    
            call Inver(par,pa(j)%Righthand,pa(j)%solt,2)
        end do

 !$OMP end parallel do

where par is pardiso_par_t type as follows

type pardiso_par_t
        type(mkl_pardiso_handle),dimension(64) :: pt
    integer :: maxfct,mnum,mtype,phase,n,nrhs,error,msglvl
    integer,dimension(64) :: iparm
    integer,allocatable,dimension(:) :: ia,ja
    complex(kind=8),allocatable,dimension(:) :: a
    integer,dimension(1) :: idum
    complex(kind=8),dimension(1) :: ddum
    end type pardiso_par_t

and subroutine INVER is

subroutine Inver(left,right,solution,info)
    use MKL_PARDISO
    use MeshDefMod
    implicit none
!------------------------------------------
    type(pardiso_par_t),intent(inout) :: left

!righthand
    complex(kind=8),allocatable,dimension(:),intent(inout) :: right

!solution
    complex(kind=8),allocatable,dimension(:),intent(inout) :: solution
    integer(kind=4),intent(in) :: info
!------------------------------------------
    if(info == 1) then
!Reordering and Symbolic Factorization,this step also allocates
!all memory that is necessary for the factorization
        left%phase = 11  !only reordering and symbolic factorization
        call pardiso (left%pt, left%maxfct, left%mnum, left%mtype, left%phase, &
            left%n, left%a, left%ia, left%ja,left%idum, left%nrhs, left%iparm,&
            left%msglvl, left%ddum, left%ddum, left%error)
        write(*,*) 'Reordering completed...'
        if(left%error /= 0) then
            write(*,*) 'The following ERROR was detected :',left%error
            !stop 1
        end if
        write(*,*) 'Number of Nonzeros in factors = ', left%iparm(18)
        write(*,*) 'Number of factorization MFLOPS = ',left%iparm(19)
!Factorization
        left%phase = 22  !only factorizatin
        call pardiso (left%pt, left%maxfct, left%mnum, left%mtype, left%phase,&
            left%n, left%a, left%ia, left%ja,left%idum, left%nrhs, left%iparm,&
            left%msglvl, left%ddum, left%ddum, left%error)
        write(*,*) 'Factorization completed...'
        if(left%error /= 0) then
            write(*,*) 'The following ERROR was detected :',left%error
            stop 
        end if
    else if(info == 2) then
        !left%phase = 33 !only factorization
        !left%iparm(8) =0 !max number of iterative refinement steps
        call pardiso (left%pt, left%maxfct, left%mnum, left%mtype, left%phase,&
            left%n, left%a, left%ia, left%ja,left%idum, left%nrhs, left%iparm,&
            left%msglvl, right, solution, left%error)
        !write(*,*) 'Solve completed...'
    else if(info == 3) then
        !Termination and release of memory
        left%phase = -1
        call pardiso (left%pt, left%maxfct, left%mnum, left%mtype, left%phase,&
            left%n, left%a, left%ia, left%ja,left%idum, left%nrhs, left%iparm,&
            left%msglvl, left%ddum, left%ddum, left%error)
    end if
    end subroutine Inver

 

MKL and gcc: Correct linking?

$
0
0

Hi,

I am attemting to compile the example file pardiso_unsym_c.c with gcc. I have successfully done so on linux with the library flags
 

-Wl,--start-group $(MKL_PATH)/libmkl_intel_lp64.a $(MKL_PATH)/libmkl_sequential.a $(MKL_PATH)/libmkl_core.a -Wl,--end-group -lpthread -lm -ldl

I've tried to adapt this to windows (I use gcc supplied by mingw) and use the flags

-Wl,--start-group "C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.1.144\windows\mkl\lib\intel64_win\mkl_intel_ilp64.lib""C:\Program Files (x86)\IntelSWTools\compilers_
and_libraries_2019.1.144\windows\mkl\lib\intel64_win\mkl_sequential.lib""C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.1.144\windows\mkl\lib\intel64_win\mkl_core.lib" -Wl,--end-group -lm

But this leads to the error "Undefined reference to PARDISO"

Could someone let me know if my windows flags above are either wrong, or should work (meaning the error is elsewhere). Unfortunately link line advisor ( https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor/ ) doesn't have a GNU option for windows (likely because GNU on windows is an edge case).
 

example files fail when compiled on windows

$
0
0

Hi,

I've recently compiled mkl example files like pardiso_unsym_c.c and others on windows using pgi compilers. Specifically, I use the lines

set "MKL_ROOT=C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.1.144\windows\mkl"

set "MKL_LIBS=%MKL_ROOT%\lib\intel64_win"

pgcc -DMKL_ILP64 -I"%MKL_ROOT%\include" -c pardiso_unsym_c.c

pgcc pardiso_unsym_c.obj -L"%MKL_LIBS%" mkl_intel_ilp64.lib mkl_sequential.lib mkl_core.lib

It compiles without error. However, when I attempt to run the resultant .exe file, I get the error message

Error during symbolic factorisation: -1

The pardiso error codes (listed here) say this means there is "input inconsistency". As the error implies, this happens during the symbolic phase (line 121 in pardiso_unsym_c.c).

 

Question about ldb in mkl_?omatcopy for transpose of column-major matrices

$
0
0

Dear all,

I need to do out-of-place transpose of the matrix (actually I have plenty of them if various sizes/shapes). I have a question about ldb parameter in mkl_?omatcopy. Documentation says that if a matrix is in column major format and I am doing transpose, then ldb must be at least equal to number of columns in B. Is it indeed the case or it’s just a typo?

My matrices are stored with minimum leading dimension — number of rows for column major format. So that means I am out of luck using this function if number of columns in B is more than number of rows? That is unfortunate as I would expect this function to handle such cases internally in the best possible way.

Denis.

How to find out inverse of a binary matrix by using mkl functions?

$
0
0

I'm trying to find out inverse of the following binary matrix by using following functions,

lapack_int LAPACKE_dgetrf (int matrix_layout , lapack_int m , lapack_int n , double * a , lapack_int lda , lapack_int * ipiv );

lapack_int LAPACKE_dgetri (int matrix_layout , lapack_int n , double * a , lapack_int lda , const lapack_int * ipiv );

But expected outputs are not achieved (Expected output is given below, which is found out by matlab inv(D).)

My_code.c

#define N 84

int main()
{

int i,j,m=N,n=N,lda=84,ipiv[N]

double D[N*N]={            //84 x 84 (Input matrix)
                    0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,1,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,
                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,
                    1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,
                    0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,
                    0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,
                    0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,
                    0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,
                    0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,
                    0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,
                    1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,
                    0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,
                    0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1};

printf("LU info:%d\n",LAPACKE_dgetrf(LAPACK_ROW_MAJOR,m,n,D,lda,ipiv));

printf("Inverse Info:%d\n",LAPACKE_dgetri (LAPACK_ROW_MAJOR,N,D,lda,ipiv));

return 0;

}

Expected Output (by matlab inv(D) function):

First two rows of the inverse output is given here.

Row_1:

1    0    -1    0    1    0    -1    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0

Row_2:

4.44089209850063e-16    1.00000000000000    -2.49800180540660e-16    -1.00000000000000    2.49800180540660e-16    1.00000000000000    -2.22044604925031e-16    -1.00000000000000    0    0    0    0    0    0    0    1.85037170770859e-17    0    0    0    0    2.0    0    0    0    0    0    0    0    1.85037170770859e-17    0    -2.12792746386488e-16    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    2.46519032881566e-32    0    0    0    0    0    0    0    0

My_code output:

My code also gives same result wherever e^ values are not there, but e^ places are zero.

Could anyone help me to achieve expected output, please?

 

Viewing all 3005 articles
Browse latest View live


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