7 include
'mkl_pardiso.f90'
23 logical,
save :: INITIALIZED = .false.
25 type(MKL_PARDISO_HANDLE) :: pt(64)
27 integer maxfct, mnum, mtype, nrhs, msglvl
29 data nrhs /1/, maxfct /1/, mnum /1/
31 integer,
save :: iparm(64)
37 type (sparse_matrix),
intent(inout) :: spmat
38 integer(kind=kint),
intent(in) :: phase_start
39 integer(kind=kint),
intent(out) :: istat
40 real(kind=
kreal),
pointer,
intent(inout) :: solx(:)
42 integer(kind=kint) ::
myrank, phase
43 real(kind=
kreal) :: t2,t3,t4,t5
49 if (.not. initialized)
then
66 if ( phase_start == 1 )
then
68 call pardiso(pt, maxfct, mnum, mtype, phase, spmat%N, spmat%A, spmat%IRN, spmat%JCN, idum, &
69 nrhs, iparm, msglvl, spmat%RHS, solx, istat)
71 write(*,*)
'ERROR: MKL returned with error', istat
87 call pardiso(pt, maxfct, mnum, mtype, phase, spmat%N, spmat%A, spmat%IRN, spmat%JCN, idum, &
88 nrhs, iparm, msglvl, spmat%RHS, solx, istat)
90 write(*,*)
'ERROR: MKL returned with error', istat
95 if (
myrank==0 .and. (spmat%iterlog > 0 .or. spmat%timelog > 0)) &
96 write(*,
'(A,f10.3)')
' [Pardiso]: Analysis completed. time(sec)=',t3-t2
100 if ( phase_start .le. 2 )
then
104 call pardiso(pt, maxfct, mnum, mtype, phase, spmat%N, spmat%A, spmat%IRN, spmat%JCN, idum, &
105 nrhs, iparm, msglvl, spmat%RHS, solx, istat)
107 write(*,*)
'ERROR: MKL returned with error', istat
112 if (
myrank==0 .and. (spmat%iterlog > 0 .or. spmat%timelog > 0)) &
113 write(*,
'(A,f10.3)')
' [Pardiso]: Factorization completed. time(sec)=',t4-t3
119 call pardiso(pt, maxfct, mnum, mtype, phase, spmat%N, spmat%A, spmat%IRN, spmat%JCN, idum, &
120 nrhs, iparm, msglvl, spmat%RHS, solx, istat)
122 write(*,*)
'ERROR: MKL returned with error', istat
127 if (
myrank==0 .and. (spmat%iterlog > 0 .or. spmat%timelog > 0)) &
128 write(*,
'(A,f10.3)')
' [Pardiso]: Solution completed. time(sec)=',t5-t4
131 stop
"MKL Pardiso not available"