Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
6834 Discussions

## PARDISO much slower than DGESV and MATLAB for 6000*6000 non-symmetric sparse system, reasonable or not? Beginner
306 Views

Hi guys,

Have been looking for an efficient linear solver for middle sized (between 6000*6000 to 20000*2000) non-symmetric sparse (density between 0.6 and 0.8) system.

I have compared PARDISO, DGESV and Matlab using randomly generated 6000*6000 matrix on my Linux desktop with i7-3720QM CPU @ 2.60GHz and 8G RAM, ifort version 16.0.2.  Matlab backslash took 2.x seconds, DGESV took 5.x seconds while PARDISO took 12.x seconds. This does not seem to be reasonable to me as I am expecting PARDISO to be faster than DGESV.  Can someone share some experience/perspective on this or provide some solutions for which solver to choose for this type of problem (I am hoping to get somewhat close to MATLAB backslash if possible)?

The following is my PARDISO parameters and I also found that by manually setting mkl_set_num_threads to be 1 to 8 won't make any obvious change of the wall time? Is that reasonable or have I made something wrong?

ALLOCATE( iparm ( 64 ) )
iparm=0

iparm(1) = 1 ! no solver default
iparm(2) = 3 ! 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 compoments of x
iparm(8) = 1 ! numbers of iterative refinement steps
iparm(10) = 13 ! perturbe the pivot elements with 1E-13
iparm(11) = 1 ! use nonsymmetric permutation and scaling MPS
iparm(13) = 1 ! 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
iparm(27) = 1 ! check the integer arrays ia and ja

error  = 0 ! initialize error flag
msglvl = 0 ! print statistical information
mtype  = 11 ! real and nonsymmetric

call mkl_set_dynamic(0)

I also attached two code if someone is interested in reproducing this problem, one is a MATLAB code (MatGen.m) which generates random non-symmetric sparse matrix A, and x and calculate b=A*x. A, n and x are written into file MatInp.dat as an input for the Fortran code adapted from the example code to  check the speed and accuracy of DGESV and PARDISO.

I appreciate your interest/feedback and discussions are very welcome! Thank you!

Sincerely,

Xiang

0 Replies 