|
|
@ -58,17 +58,26 @@
|
|
|
|
! The id of the process printing the message; -1 acts as a wildcard.
|
|
|
|
! The id of the process printing the message; -1 acts as a wildcard.
|
|
|
|
! Default is psb_root_
|
|
|
|
! Default is psb_root_
|
|
|
|
!
|
|
|
|
!
|
|
|
|
subroutine amg_cfile_prec_descr(prec,iout,root)
|
|
|
|
!
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
! verbosity:
|
|
|
|
|
|
|
|
! <0: suppress all messages
|
|
|
|
|
|
|
|
! 0: normal
|
|
|
|
|
|
|
|
! >1: increased details
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
subroutine amg_cfile_prec_descr(prec,iout,root, verbosity)
|
|
|
|
use psb_base_mod
|
|
|
|
use psb_base_mod
|
|
|
|
use amg_c_prec_mod, amg_protect_name => amg_cfile_prec_descr
|
|
|
|
use amg_c_prec_mod, amg_protect_name => amg_cfile_prec_descr
|
|
|
|
use amg_c_inner_mod
|
|
|
|
use amg_c_inner_mod
|
|
|
|
use amg_c_gs_solver
|
|
|
|
use amg_c_gs_solver
|
|
|
|
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
implicit none
|
|
|
|
! Arguments
|
|
|
|
! Arguments
|
|
|
|
class(amg_cprec_type), intent(in) :: prec
|
|
|
|
class(amg_cprec_type), intent(in) :: prec
|
|
|
|
integer(psb_ipk_), intent(in), optional :: iout
|
|
|
|
integer(psb_ipk_), intent(in), optional :: iout
|
|
|
|
integer(psb_ipk_), intent(in), optional :: root
|
|
|
|
integer(psb_ipk_), intent(in), optional :: root
|
|
|
|
|
|
|
|
integer(psb_ipk_), intent(in), optional :: verbosity
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
! Local variables
|
|
|
|
! Local variables
|
|
|
|
integer(psb_ipk_) :: ilev, nlev, ilmin, info, nswps
|
|
|
|
integer(psb_ipk_) :: ilev, nlev, ilmin, info, nswps
|
|
|
@ -76,8 +85,7 @@ subroutine amg_cfile_prec_descr(prec,iout,root)
|
|
|
|
integer(psb_ipk_) :: me, np
|
|
|
|
integer(psb_ipk_) :: me, np
|
|
|
|
logical :: is_symgs
|
|
|
|
logical :: is_symgs
|
|
|
|
character(len=20), parameter :: name='amg_file_prec_descr'
|
|
|
|
character(len=20), parameter :: name='amg_file_prec_descr'
|
|
|
|
integer(psb_ipk_) :: iout_
|
|
|
|
integer(psb_ipk_) :: iout_, root_, verbosity_
|
|
|
|
integer(psb_ipk_) :: root_
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
info = psb_success_
|
|
|
|
info = psb_success_
|
|
|
|
if (present(iout)) then
|
|
|
|
if (present(iout)) then
|
|
|
@ -86,6 +94,12 @@ subroutine amg_cfile_prec_descr(prec,iout,root)
|
|
|
|
iout_ = psb_out_unit
|
|
|
|
iout_ = psb_out_unit
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
if (iout_ < 0) iout_ = psb_out_unit
|
|
|
|
if (iout_ < 0) iout_ = psb_out_unit
|
|
|
|
|
|
|
|
if (present(verbosity)) then
|
|
|
|
|
|
|
|
verbosity_ = verbosity
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
verbosity_ = 0
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
if (verbosity_ < 0) goto 9998
|
|
|
|
|
|
|
|
|
|
|
|
ctxt = prec%ctxt
|
|
|
|
ctxt = prec%ctxt
|
|
|
|
|
|
|
|
|
|
|
@ -99,102 +113,104 @@ subroutine amg_cfile_prec_descr(prec,iout,root)
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
if (root_ == -1) root_ = me
|
|
|
|
if (root_ == -1) root_ = me
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
if (verbosity_ >=0) then
|
|
|
|
! The preconditioner description is printed by processor psb_root_.
|
|
|
|
!
|
|
|
|
! This agrees with the fact that all the parameters defining the
|
|
|
|
! The preconditioner description is printed by processor psb_root_.
|
|
|
|
! preconditioner have the same values on all the procs (this is
|
|
|
|
! This agrees with the fact that all the parameters defining the
|
|
|
|
! ensured by amg_precbld).
|
|
|
|
! preconditioner have the same values on all the procs (this is
|
|
|
|
!
|
|
|
|
! ensured by amg_precbld).
|
|
|
|
if (me == root_) then
|
|
|
|
!
|
|
|
|
nlev = size(prec%precv)
|
|
|
|
if (me == root_) then
|
|
|
|
do ilev = 1, nlev
|
|
|
|
nlev = size(prec%precv)
|
|
|
|
if (.not.allocated(prec%precv(ilev)%sm)) then
|
|
|
|
do ilev = 1, nlev
|
|
|
|
info = 3111
|
|
|
|
if (.not.allocated(prec%precv(ilev)%sm)) then
|
|
|
|
write(iout_,*) ' ',name,&
|
|
|
|
info = 3111
|
|
|
|
& ': error: inconsistent MLPREC part, should call amg_PRECINIT'
|
|
|
|
write(iout_,*) ' ',name,&
|
|
|
|
return
|
|
|
|
& ': error: inconsistent MLPREC part, should call amg_PRECINIT'
|
|
|
|
endif
|
|
|
|
return
|
|
|
|
end do
|
|
|
|
endif
|
|
|
|
|
|
|
|
end do
|
|
|
|
|
|
|
|
|
|
|
|
write(iout_,*)
|
|
|
|
write(iout_,*)
|
|
|
|
write(iout_,'(a)') 'Preconditioner description'
|
|
|
|
write(iout_,'(a)') 'Preconditioner description'
|
|
|
|
|
|
|
|
|
|
|
|
if (nlev == 1) then
|
|
|
|
if (nlev == 1) then
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! Here we have a gigantic kludge just to handle Symmetrized Gauss-Seidel.
|
|
|
|
! Here we have a gigantic kludge just to handle Symmetrized Gauss-Seidel.
|
|
|
|
! Will need rethinking...
|
|
|
|
! Will need rethinking...
|
|
|
|
!
|
|
|
|
!
|
|
|
|
if (allocated(prec%precv(1)%sm2a)) then
|
|
|
|
if (allocated(prec%precv(1)%sm2a)) then
|
|
|
|
is_symgs = .false.
|
|
|
|
is_symgs = .false.
|
|
|
|
select type(sv2 => prec%precv(1)%sm2a%sv)
|
|
|
|
select type(sv2 => prec%precv(1)%sm2a%sv)
|
|
|
|
class is (amg_c_bwgs_solver_type)
|
|
|
|
class is (amg_c_bwgs_solver_type)
|
|
|
|
select type(sv1 => prec%precv(1)%sm%sv)
|
|
|
|
select type(sv1 => prec%precv(1)%sm%sv)
|
|
|
|
class is (amg_c_gs_solver_type)
|
|
|
|
class is (amg_c_gs_solver_type)
|
|
|
|
is_symgs = .true.
|
|
|
|
is_symgs = .true.
|
|
|
|
|
|
|
|
end select
|
|
|
|
end select
|
|
|
|
end select
|
|
|
|
end select
|
|
|
|
if (is_symgs) then
|
|
|
|
if (is_symgs) then
|
|
|
|
write(iout_,*) ' Forward-Backward (symmetrized) Hybrid Gauss-Seidel'
|
|
|
|
write(iout_,*) ' Forward-Backward (symmetrized) Hybrid Gauss-Seidel'
|
|
|
|
else
|
|
|
|
|
|
|
|
write(iout_,*) 'Pre Smoother: '
|
|
|
|
|
|
|
|
call prec%precv(1)%sm%descr(info,iout=iout_)
|
|
|
|
|
|
|
|
write(iout_,*) 'Post smoother:'
|
|
|
|
|
|
|
|
call prec%precv(1)%sm2a%descr(info,iout=iout_)
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
nswps = max(prec%precv(1)%parms%sweeps_pre,prec%precv(1)%parms%sweeps_post)
|
|
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
else
|
|
|
|
|
|
|
|
call prec%precv(1)%sm%descr(info,iout=iout_)
|
|
|
|
|
|
|
|
nswps = prec%precv(1)%parms%sweeps_pre
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
if (nswps > 1) write(iout_,*) ' Number of sweeps : ',nswps
|
|
|
|
|
|
|
|
write(iout_,*)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else if (nlev > 1) then
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
! Print description of base preconditioner
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
write(iout_,*) 'Multilevel Preconditioner'
|
|
|
|
|
|
|
|
write(iout_,*) 'Outer sweeps:',prec%outer_sweeps
|
|
|
|
|
|
|
|
write(iout_,*)
|
|
|
|
|
|
|
|
if (allocated(prec%precv(1)%sm2a)) then
|
|
|
|
write(iout_,*) 'Pre Smoother: '
|
|
|
|
write(iout_,*) 'Pre Smoother: '
|
|
|
|
call prec%precv(1)%sm%descr(info,iout=iout_)
|
|
|
|
call prec%precv(1)%sm%descr(info,iout=iout_)
|
|
|
|
write(iout_,*) 'Post smoother:'
|
|
|
|
write(iout_,*) 'Post smoother:'
|
|
|
|
call prec%precv(1)%sm2a%descr(info,iout=iout_)
|
|
|
|
call prec%precv(1)%sm2a%descr(info,iout=iout_)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
write(iout_,*) 'Smoother: '
|
|
|
|
|
|
|
|
call prec%precv(1)%sm%descr(info,iout=iout_)
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
nswps = max(prec%precv(1)%parms%sweeps_pre,prec%precv(1)%parms%sweeps_post)
|
|
|
|
!
|
|
|
|
|
|
|
|
! Print multilevel details
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
write(iout_,*)
|
|
|
|
|
|
|
|
write(iout_,*) 'Multilevel hierarchy: '
|
|
|
|
|
|
|
|
write(iout_,*) ' Number of levels : ',nlev
|
|
|
|
|
|
|
|
write(iout_,*) ' Operator complexity: ',prec%get_complexity()
|
|
|
|
|
|
|
|
write(iout_,*) ' Average coarsening : ',prec%get_avg_cr()
|
|
|
|
|
|
|
|
ilmin = 2
|
|
|
|
|
|
|
|
if (nlev == 2) ilmin=1
|
|
|
|
|
|
|
|
do ilev=ilmin,nlev
|
|
|
|
|
|
|
|
call prec%precv(ilev)%descr(ilev,nlev,ilmin,info, &
|
|
|
|
|
|
|
|
& iout=iout_,verbosity=verbosity)
|
|
|
|
|
|
|
|
end do
|
|
|
|
|
|
|
|
write(iout_,*)
|
|
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call prec%precv(1)%sm%descr(info,iout=iout_)
|
|
|
|
write(iout_,*) trim(name), &
|
|
|
|
nswps = prec%precv(1)%parms%sweeps_pre
|
|
|
|
& ': invalid preconditioner array size ?',nlev
|
|
|
|
end if
|
|
|
|
info = -2
|
|
|
|
if (nswps > 1) write(iout_,*) ' Number of sweeps : ',nswps
|
|
|
|
return
|
|
|
|
write(iout_,*)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else if (nlev > 1) then
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
! Print description of base preconditioner
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
write(iout_,*) 'Multilevel Preconditioner'
|
|
|
|
|
|
|
|
write(iout_,*) 'Outer sweeps:',prec%outer_sweeps
|
|
|
|
|
|
|
|
write(iout_,*)
|
|
|
|
|
|
|
|
if (allocated(prec%precv(1)%sm2a)) then
|
|
|
|
|
|
|
|
write(iout_,*) 'Pre Smoother: '
|
|
|
|
|
|
|
|
call prec%precv(1)%sm%descr(info,iout=iout_)
|
|
|
|
|
|
|
|
write(iout_,*) 'Post smoother:'
|
|
|
|
|
|
|
|
call prec%precv(1)%sm2a%descr(info,iout=iout_)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
write(iout_,*) 'Smoother: '
|
|
|
|
|
|
|
|
call prec%precv(1)%sm%descr(info,iout=iout_)
|
|
|
|
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
!
|
|
|
|
|
|
|
|
! Print multilevel details
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
write(iout_,*)
|
|
|
|
|
|
|
|
write(iout_,*) 'Multilevel hierarchy: '
|
|
|
|
|
|
|
|
write(iout_,*) ' Number of levels : ',nlev
|
|
|
|
|
|
|
|
write(iout_,*) ' Operator complexity: ',prec%get_complexity()
|
|
|
|
|
|
|
|
write(iout_,*) ' Average coarsening : ',prec%get_avg_cr()
|
|
|
|
|
|
|
|
ilmin = 2
|
|
|
|
|
|
|
|
if (nlev == 2) ilmin=1
|
|
|
|
|
|
|
|
do ilev=ilmin,nlev
|
|
|
|
|
|
|
|
call prec%precv(ilev)%descr(ilev,nlev,ilmin,info,iout=iout_)
|
|
|
|
|
|
|
|
end do
|
|
|
|
|
|
|
|
write(iout_,*)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
write(iout_,*) trim(name), &
|
|
|
|
|
|
|
|
& ': invalid preconditioner array size ?',nlev
|
|
|
|
|
|
|
|
info = -2
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
else
|
|
|
|
write(iout_,*) trim(name), &
|
|
|
|
write(iout_,*) trim(name), &
|
|
|
|
& ': Error: no base preconditioner available, something is wrong!'
|
|
|
|
& ': Error: no base preconditioner available, something is wrong!'
|
|
|
|
info = -2
|
|
|
|
info = -2
|
|
|
|
return
|
|
|
|
return
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
9998 continue
|
|
|
|
end subroutine amg_cfile_prec_descr
|
|
|
|
end subroutine amg_cfile_prec_descr
|
|
|
|