- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi everyone.
As a very simple example, I have a 2x2 matrix equation with a diagonal coefficient matrix.
Fortran wrapper of PARDISO is used for both single and double precision versions.
The difference between the double-precision and single-precision subroutine is minimal. Except for the number formats and the value of iparam(28), everything else is the same.
The double-precision subroutine gives correct result but the result of the single-version subroutine is basically meaningless.
I have never used the single-precision version of PARDISO, so I am not sure of my settings.
Would you please point at what I may be missing?
The subroutines and the relevant outputs are attached.
Thank you.
Hassan Ebrahimi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I installed the 2022 version and it still gave the same wrong result.
However the issue was solved by setting iparam(1) =1
I post my single example here for those who may face the same issue.
subroutine pardiso_single()
INTEGER*8 pt(64)
INTEGER maxfct, mnum, mtype, phase, neq, nrhs, error, msglvl
INTEGER iparm(64)
INTEGER ia(2)
INTEGER ja(3)
real *4 a(2)
real *4 b(2)
real *4 x(2)
INTEGER i, j, idum,asym
INTEGER perm(30)
real*4 ddum
character*198 buf
WRITE(*,*) '********** Single precision PARDISO **************'
call mkl_get_version_string(buf)
write(*,'(a)') buf
maxfct=1
nrhs=1
mnum=1
do i=1,64
pt(i)=0
enddo
neq=2
a(1)=4.0
a(2)=4.0
b(1)=1.0
b(2)=1.0
x(1)=0.0
x(2)=0.0
ja(1)=1
ja(2)=2
ja(3)=3
ia(1)=1
ia(2)=2
iparm(1)=1 ! without this setting PARDISO gives wrong result!
iparm(28)=1
error = 0 ! initialize error flag
msglvl = 1 ! print statistical information
mtype = -2 ! real symmetric
phase = 11 ! only reordering and symbolic factorization
C.. Reordering
CALL pardiso (pt, maxfct, mnum, mtype, phase, neq, a, ja, ia,
1 perm, nrhs, iparm, msglvl, b, x, error)
C.. Factorization.
phase = 22 ! only factorization
CALL pardiso (pt, maxfct, mnum, mtype, phase, neq, a, ja, ia,
1 perm, nrhs, iparm, msglvl, ddum, ddum, error)
!WRITE(*,*) 'Factorization completed ... '
IF (error .NE. 0) THEN
WRITE(*,*) 'The following ERROR was detected: ', error
STOP 1
ENDIF
C.. Back substitution and iterative refinement
phase = 33 ! solving
CALL pardiso (pt, maxfct, mnum, mtype, phase, neq, a, ja, ia,
1 perm, nrhs, iparm, msglvl, b, x, error)
do i=1,neq
WRITE(*,*) 'i, x(i) ',i, x(i)
enddo
C.. Releasing memory
phase = -1 ! release internal memory
CALL pardiso (pt, maxfct, mnum, mtype, phase, neq,
1 ddum, idum, idum,
2 idum, nrhs, iparm, msglvl, ddum, ddum, error)
END
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hassan,
Which version of MKL did you use with this case?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The mkl version is:
Intel(R) Math Kernel Library Version 2017.0.4 Product Build 20170811 for Intel(R) 64 architecture applications
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I suggest you try the current version of MKL ( 2022) as a similar problem has been fixed in one of the versions in the past.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I installed the 2022 version and it still gave the same wrong result.
However the issue was solved by setting iparam(1) =1
I post my single example here for those who may face the same issue.
subroutine pardiso_single()
INTEGER*8 pt(64)
INTEGER maxfct, mnum, mtype, phase, neq, nrhs, error, msglvl
INTEGER iparm(64)
INTEGER ia(2)
INTEGER ja(3)
real *4 a(2)
real *4 b(2)
real *4 x(2)
INTEGER i, j, idum,asym
INTEGER perm(30)
real*4 ddum
character*198 buf
WRITE(*,*) '********** Single precision PARDISO **************'
call mkl_get_version_string(buf)
write(*,'(a)') buf
maxfct=1
nrhs=1
mnum=1
do i=1,64
pt(i)=0
enddo
neq=2
a(1)=4.0
a(2)=4.0
b(1)=1.0
b(2)=1.0
x(1)=0.0
x(2)=0.0
ja(1)=1
ja(2)=2
ja(3)=3
ia(1)=1
ia(2)=2
iparm(1)=1 ! without this setting PARDISO gives wrong result!
iparm(28)=1
error = 0 ! initialize error flag
msglvl = 1 ! print statistical information
mtype = -2 ! real symmetric
phase = 11 ! only reordering and symbolic factorization
C.. Reordering
CALL pardiso (pt, maxfct, mnum, mtype, phase, neq, a, ja, ia,
1 perm, nrhs, iparm, msglvl, b, x, error)
C.. Factorization.
phase = 22 ! only factorization
CALL pardiso (pt, maxfct, mnum, mtype, phase, neq, a, ja, ia,
1 perm, nrhs, iparm, msglvl, ddum, ddum, error)
!WRITE(*,*) 'Factorization completed ... '
IF (error .NE. 0) THEN
WRITE(*,*) 'The following ERROR was detected: ', error
STOP 1
ENDIF
C.. Back substitution and iterative refinement
phase = 33 ! solving
CALL pardiso (pt, maxfct, mnum, mtype, phase, neq, a, ja, ia,
1 perm, nrhs, iparm, msglvl, b, x, error)
do i=1,neq
WRITE(*,*) 'i, x(i) ',i, x(i)
enddo
C.. Releasing memory
phase = -1 ! release internal memory
CALL pardiso (pt, maxfct, mnum, mtype, phase, neq,
1 ddum, idum, idum,
2 idum, nrhs, iparm, msglvl, ddum, ddum, error)
END
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the update.
The issue(thread) is closing and we will no longer respond to this thread. If you require additional assistance from Intel, please start a new thread. Any further interaction in this thread will be considered community only.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page