|
|
@ -95,6 +95,7 @@ module mld_c_prec_type
|
|
|
|
! 3. min_cr_ratio = 1.5
|
|
|
|
! 3. min_cr_ratio = 1.5
|
|
|
|
real(psb_spk_) :: min_cr_ratio = 1.5_psb_spk_
|
|
|
|
real(psb_spk_) :: min_cr_ratio = 1.5_psb_spk_
|
|
|
|
real(psb_spk_) :: op_complexity = szero
|
|
|
|
real(psb_spk_) :: op_complexity = szero
|
|
|
|
|
|
|
|
real(psb_spk_) :: avg_cr = szero
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! Number of outer sweeps. Sometimes 2 V-cycles may be better than 1 W-cycle.
|
|
|
|
! Number of outer sweeps. Sometimes 2 V-cycles may be better than 1 W-cycle.
|
|
|
|
!
|
|
|
|
!
|
|
|
@ -122,6 +123,8 @@ module mld_c_prec_type
|
|
|
|
procedure, pass(prec) :: free_wrk => mld_c_free_wrk
|
|
|
|
procedure, pass(prec) :: free_wrk => mld_c_free_wrk
|
|
|
|
procedure, pass(prec) :: get_complexity => mld_c_get_compl
|
|
|
|
procedure, pass(prec) :: get_complexity => mld_c_get_compl
|
|
|
|
procedure, pass(prec) :: cmp_complexity => mld_c_cmp_compl
|
|
|
|
procedure, pass(prec) :: cmp_complexity => mld_c_cmp_compl
|
|
|
|
|
|
|
|
procedure, pass(prec) :: get_avg_cr => mld_c_get_avg_cr
|
|
|
|
|
|
|
|
procedure, pass(prec) :: cmp_avg_cr => mld_c_cmp_avg_cr
|
|
|
|
procedure, pass(prec) :: get_nlevs => mld_c_get_nlevs
|
|
|
|
procedure, pass(prec) :: get_nlevs => mld_c_get_nlevs
|
|
|
|
procedure, pass(prec) :: get_nzeros => mld_c_get_nzeros
|
|
|
|
procedure, pass(prec) :: get_nzeros => mld_c_get_nzeros
|
|
|
|
procedure, pass(prec) :: sizeof => mld_cprec_sizeof
|
|
|
|
procedure, pass(prec) :: sizeof => mld_cprec_sizeof
|
|
|
@ -143,7 +146,8 @@ module mld_c_prec_type
|
|
|
|
end type mld_cprec_type
|
|
|
|
end type mld_cprec_type
|
|
|
|
|
|
|
|
|
|
|
|
private :: mld_c_dump, mld_c_get_compl, mld_c_cmp_compl,&
|
|
|
|
private :: mld_c_dump, mld_c_get_compl, mld_c_cmp_compl,&
|
|
|
|
& mld_c_get_nzeros, mld_c_get_nlevs, c_prec_move_alloc
|
|
|
|
& mld_c_get_avg_cr, mld_c_cmp_avg_cr,&
|
|
|
|
|
|
|
|
& mld_c_get_nzeros, mld_c_get_nlevs, c_prec_move_alloc
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
!
|
|
|
@ -476,6 +480,43 @@ contains
|
|
|
|
prec%op_complexity = num/den
|
|
|
|
prec%op_complexity = num/den
|
|
|
|
end subroutine mld_c_cmp_compl
|
|
|
|
end subroutine mld_c_cmp_compl
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
! Average coarsening ratio
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function mld_c_get_avg_cr(prec) result(val)
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
class(mld_cprec_type), intent(in) :: prec
|
|
|
|
|
|
|
|
complex(psb_spk_) :: val
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
val = prec%avg_cr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end function mld_c_get_avg_cr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
subroutine mld_c_cmp_avg_cr(prec)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
class(mld_cprec_type), intent(inout) :: prec
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
real(psb_spk_) :: avgcr
|
|
|
|
|
|
|
|
integer(psb_ipk_) :: ictxt
|
|
|
|
|
|
|
|
integer(psb_ipk_) :: il, nl, iam, np
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
avgcr = szero
|
|
|
|
|
|
|
|
ictxt = prec%ictxt
|
|
|
|
|
|
|
|
call psb_info(ictxt,iam,np)
|
|
|
|
|
|
|
|
if (allocated(prec%precv)) then
|
|
|
|
|
|
|
|
nl = size(prec%precv)
|
|
|
|
|
|
|
|
do il=2,nl
|
|
|
|
|
|
|
|
avgcr = avgcr + max(szero,prec%precv(il)%szratio)
|
|
|
|
|
|
|
|
end do
|
|
|
|
|
|
|
|
avgcr = avgcr / (nl-1)
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
call psb_sum(ictxt,avgcr)
|
|
|
|
|
|
|
|
prec%avg_cr = avgcr/np
|
|
|
|
|
|
|
|
end subroutine mld_c_cmp_avg_cr
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! Subroutines: mld_Tprec_free
|
|
|
|
! Subroutines: mld_Tprec_free
|
|
|
|
! Version: complex
|
|
|
|
! Version: complex
|
|
|
@ -740,6 +781,7 @@ contains
|
|
|
|
pout%min_cr_ratio = prec%min_cr_ratio
|
|
|
|
pout%min_cr_ratio = prec%min_cr_ratio
|
|
|
|
pout%outer_sweeps = prec%outer_sweeps
|
|
|
|
pout%outer_sweeps = prec%outer_sweeps
|
|
|
|
pout%op_complexity = prec%op_complexity
|
|
|
|
pout%op_complexity = prec%op_complexity
|
|
|
|
|
|
|
|
pout%avg_cr = prec%avg_cr
|
|
|
|
if (allocated(prec%precv)) then
|
|
|
|
if (allocated(prec%precv)) then
|
|
|
|
ln = size(prec%precv)
|
|
|
|
ln = size(prec%precv)
|
|
|
|
allocate(pout%precv(ln),stat=info)
|
|
|
|
allocate(pout%precv(ln),stat=info)
|
|
|
|