|
|
@ -62,7 +62,7 @@ program zf_sample
|
|
|
|
|
|
|
|
|
|
|
|
! solver paramters
|
|
|
|
! solver paramters
|
|
|
|
integer :: iter, itmax, ierr, itrace, ircode, ipart,&
|
|
|
|
integer :: iter, itmax, ierr, itrace, ircode, ipart,&
|
|
|
|
& methd, istopc, iprec, ml
|
|
|
|
& methd, istopc, iprec, ml,amatsize,precsize,descsize
|
|
|
|
real(kind(1.d0)) :: err, eps
|
|
|
|
real(kind(1.d0)) :: err, eps
|
|
|
|
|
|
|
|
|
|
|
|
character(len=5) :: afmt
|
|
|
|
character(len=5) :: afmt
|
|
|
@ -99,7 +99,7 @@ program zf_sample
|
|
|
|
! get parameters
|
|
|
|
! get parameters
|
|
|
|
!
|
|
|
|
!
|
|
|
|
call get_parms(ictxt,mtrx_file,rhs_file,cmethd,&
|
|
|
|
call get_parms(ictxt,mtrx_file,rhs_file,cmethd,&
|
|
|
|
& ipart,afmt,istopc,itmax,itrace,novr,iprec,eps)
|
|
|
|
& ipart,afmt,istopc,itmax,itrace,ml,iprec,eps)
|
|
|
|
|
|
|
|
|
|
|
|
call psb_barrier(ictxt)
|
|
|
|
call psb_barrier(ictxt)
|
|
|
|
t1 = psb_wtime()
|
|
|
|
t1 = psb_wtime()
|
|
|
@ -203,13 +203,13 @@ program zf_sample
|
|
|
|
igsmth=-1
|
|
|
|
igsmth=-1
|
|
|
|
select case(iprec)
|
|
|
|
select case(iprec)
|
|
|
|
case(noprec_)
|
|
|
|
case(noprec_)
|
|
|
|
call psb_precset(pre,'noprec',info)
|
|
|
|
call psb_precinit(pre,'noprec',info)
|
|
|
|
case(diag_)
|
|
|
|
case(diag_)
|
|
|
|
call psb_precset(pre,'diag',info)
|
|
|
|
call psb_precinit(pre,'diag',info)
|
|
|
|
case(bjac_)
|
|
|
|
case(bjac_)
|
|
|
|
call psb_precset(pre,'bjac',info)
|
|
|
|
call psb_precinit(pre,'bjac',info)
|
|
|
|
case default
|
|
|
|
case default
|
|
|
|
call psb_precset(pre,'bjac',info)
|
|
|
|
call psb_precinit(pre,'bjac',info)
|
|
|
|
end select
|
|
|
|
end select
|
|
|
|
|
|
|
|
|
|
|
|
! building the preconditioner
|
|
|
|
! building the preconditioner
|
|
|
@ -242,6 +242,12 @@ program zf_sample
|
|
|
|
call psb_genrm2s(resmx,r_col,desc_a,info)
|
|
|
|
call psb_genrm2s(resmx,r_col,desc_a,info)
|
|
|
|
call psb_geamaxs(resmxp,r_col,desc_a,info)
|
|
|
|
call psb_geamaxs(resmxp,r_col,desc_a,info)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
amatsize = psb_sizeof(a)
|
|
|
|
|
|
|
|
descsize = psb_sizeof(desc_a)
|
|
|
|
|
|
|
|
precsize = psb_sizeof(pre)
|
|
|
|
|
|
|
|
call psb_sum(ictxt,amatsize)
|
|
|
|
|
|
|
|
call psb_sum(ictxt,descsize)
|
|
|
|
|
|
|
|
call psb_sum(ictxt,precsize)
|
|
|
|
if (amroot) then
|
|
|
|
if (amroot) then
|
|
|
|
call psb_prec_descr(6,pre)
|
|
|
|
call psb_prec_descr(6,pre)
|
|
|
|
write(*,'("Matrix: ",a)')mtrx_file
|
|
|
|
write(*,'("Matrix: ",a)')mtrx_file
|
|
|
@ -254,6 +260,9 @@ program zf_sample
|
|
|
|
write(*,'("Total time : ",es10.4)')t2+tprec
|
|
|
|
write(*,'("Total time : ",es10.4)')t2+tprec
|
|
|
|
write(*,'("Residual norm 2 = ",es10.4)')resmx
|
|
|
|
write(*,'("Residual norm 2 = ",es10.4)')resmx
|
|
|
|
write(*,'("Residual norm inf = ",es10.4)')resmxp
|
|
|
|
write(*,'("Residual norm inf = ",es10.4)')resmxp
|
|
|
|
|
|
|
|
write(*,'("Total memory occupation for A: ",i10)')amatsize
|
|
|
|
|
|
|
|
write(*,'("Total memory occupation for DESC_A: ",i10)')descsize
|
|
|
|
|
|
|
|
write(*,'("Total memory occupation for PRE: ",i10)')precsize
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
allocate(x_col_glob(m_problem),r_col_glob(m_problem),stat=ierr)
|
|
|
|
allocate(x_col_glob(m_problem),r_col_glob(m_problem),stat=ierr)
|
|
|
@ -271,8 +280,9 @@ program zf_sample
|
|
|
|
write(20,*) 'error indicator (infinity norm) on exit:', &
|
|
|
|
write(20,*) 'error indicator (infinity norm) on exit:', &
|
|
|
|
& ' ||r||/(||a||||x||+||b||) = ',err
|
|
|
|
& ' ||r||/(||a||||x||+||b||) = ',err
|
|
|
|
write(20,*) 'max residual = ',resmx, resmxp
|
|
|
|
write(20,*) 'max residual = ',resmx, resmxp
|
|
|
|
|
|
|
|
write(20,'(a8,4(2x,a20))') 'I','X(I)','R(I)','B(I)'
|
|
|
|
do i=1,m_problem
|
|
|
|
do i=1,m_problem
|
|
|
|
write(20,998) i,x_col_glob(i),r_col_glob(i)!,b_col_glob(i)
|
|
|
|
write(20,998) i,x_col_glob(i),r_col_glob(i),b_col_glob(i)
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|