Fixed implementation of GLOBAL vs VERBOSITY

Poly-novrl
Salvatore Filippone 9 months ago
parent 3671285c7a
commit 678237cf29

@ -275,7 +275,7 @@ module amg_c_onelev_mod
end interface end interface
interface interface
subroutine amg_c_base_onelev_memory_use(lv,il,nl,ilmin,info,iout, prefix,global) subroutine amg_c_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,verbosity, prefix,global)
import :: psb_cspmat_type, psb_c_vect_type, psb_c_base_vect_type, & import :: psb_cspmat_type, psb_c_vect_type, psb_c_base_vect_type, &
& psb_clinmap_type, psb_spk_, amg_c_onelev_type, & & psb_clinmap_type, psb_spk_, amg_c_onelev_type, &
& psb_ipk_, psb_epk_, psb_desc_type & psb_ipk_, psb_epk_, psb_desc_type
@ -285,6 +285,7 @@ module amg_c_onelev_mod
integer(psb_ipk_), intent(in) :: il,nl,ilmin integer(psb_ipk_), intent(in) :: il,nl,ilmin
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: iout integer(psb_ipk_), intent(in), optional :: iout
integer(psb_ipk_), intent(in), optional :: verbosity
character(len=*), intent(in), optional :: prefix character(len=*), intent(in), optional :: prefix
logical, intent(in), optional :: global logical, intent(in), optional :: global
end subroutine amg_c_base_onelev_memory_use end subroutine amg_c_base_onelev_memory_use

@ -276,7 +276,7 @@ module amg_d_onelev_mod
end interface end interface
interface interface
subroutine amg_d_base_onelev_memory_use(lv,il,nl,ilmin,info,iout, prefix,global) subroutine amg_d_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,verbosity, prefix,global)
import :: psb_dspmat_type, psb_d_vect_type, psb_d_base_vect_type, & import :: psb_dspmat_type, psb_d_vect_type, psb_d_base_vect_type, &
& psb_dlinmap_type, psb_dpk_, amg_d_onelev_type, & & psb_dlinmap_type, psb_dpk_, amg_d_onelev_type, &
& psb_ipk_, psb_epk_, psb_desc_type & psb_ipk_, psb_epk_, psb_desc_type
@ -286,6 +286,7 @@ module amg_d_onelev_mod
integer(psb_ipk_), intent(in) :: il,nl,ilmin integer(psb_ipk_), intent(in) :: il,nl,ilmin
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: iout integer(psb_ipk_), intent(in), optional :: iout
integer(psb_ipk_), intent(in), optional :: verbosity
character(len=*), intent(in), optional :: prefix character(len=*), intent(in), optional :: prefix
logical, intent(in), optional :: global logical, intent(in), optional :: global
end subroutine amg_d_base_onelev_memory_use end subroutine amg_d_base_onelev_memory_use

@ -276,7 +276,7 @@ module amg_s_onelev_mod
end interface end interface
interface interface
subroutine amg_s_base_onelev_memory_use(lv,il,nl,ilmin,info,iout, prefix,global) subroutine amg_s_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,verbosity, prefix,global)
import :: psb_sspmat_type, psb_s_vect_type, psb_s_base_vect_type, & import :: psb_sspmat_type, psb_s_vect_type, psb_s_base_vect_type, &
& psb_slinmap_type, psb_spk_, amg_s_onelev_type, & & psb_slinmap_type, psb_spk_, amg_s_onelev_type, &
& psb_ipk_, psb_epk_, psb_desc_type & psb_ipk_, psb_epk_, psb_desc_type
@ -286,6 +286,7 @@ module amg_s_onelev_mod
integer(psb_ipk_), intent(in) :: il,nl,ilmin integer(psb_ipk_), intent(in) :: il,nl,ilmin
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: iout integer(psb_ipk_), intent(in), optional :: iout
integer(psb_ipk_), intent(in), optional :: verbosity
character(len=*), intent(in), optional :: prefix character(len=*), intent(in), optional :: prefix
logical, intent(in), optional :: global logical, intent(in), optional :: global
end subroutine amg_s_base_onelev_memory_use end subroutine amg_s_base_onelev_memory_use

@ -275,7 +275,7 @@ module amg_z_onelev_mod
end interface end interface
interface interface
subroutine amg_z_base_onelev_memory_use(lv,il,nl,ilmin,info,iout, prefix,global) subroutine amg_z_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,verbosity, prefix,global)
import :: psb_zspmat_type, psb_z_vect_type, psb_z_base_vect_type, & import :: psb_zspmat_type, psb_z_vect_type, psb_z_base_vect_type, &
& psb_zlinmap_type, psb_dpk_, amg_z_onelev_type, & & psb_zlinmap_type, psb_dpk_, amg_z_onelev_type, &
& psb_ipk_, psb_epk_, psb_desc_type & psb_ipk_, psb_epk_, psb_desc_type
@ -285,6 +285,7 @@ module amg_z_onelev_mod
integer(psb_ipk_), intent(in) :: il,nl,ilmin integer(psb_ipk_), intent(in) :: il,nl,ilmin
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: iout integer(psb_ipk_), intent(in), optional :: iout
integer(psb_ipk_), intent(in), optional :: verbosity
character(len=*), intent(in), optional :: prefix character(len=*), intent(in), optional :: prefix
logical, intent(in), optional :: global logical, intent(in), optional :: global
end subroutine amg_z_base_onelev_memory_use end subroutine amg_z_base_onelev_memory_use

@ -121,46 +121,32 @@ subroutine amg_cfile_prec_memory_use(prec,info,iout,root, verbosity,prefix,globa
end if end if
end if end if
if (allocated(prec%precv)) then
if (present(root)) then if (present(root)) then
root_ = root root_ = root
else else
root_ = psb_root_ root_ = psb_root_
end if end if
if (root_ == -1) root_ = me if (root_ == -1) root_ = me
if (allocated(prec%precv)) then
if (verbosity_ >=0) then if (verbosity_ >=0) then
if (verbosity_ == 0) then if (me == root_) then
! write(iout_,*)
if (me == root_) then write(iout_,'(a,1x,a)') trim(prefix_),'Preconditioner memory usage'
write(iout_,*)
write(iout_,'(a,1x,a)') trim(prefix_),'Preconditioner memory usage'
nlev = size(prec%precv)
do ilev=1,nlev
call prec%precv(ilev)%memory_use(ilev,nlev,ilmin,info, &
& iout=iout_,prefix=trim(prefix_),global=global)
end do
end if
else if (verbosity_ >0) then
if (me == root_) then
write(iout_,*)
write(iout_,'(a,1x,a)') trim(prefix_),'Preconditioner memory usage'
end if
nlev = size(prec%precv)
do ilev=1,nlev
call prec%precv(ilev)%memory_use(ilev,nlev,ilmin,info, &
& iout=iout_,prefix=trim(prefix_),global=global)
end do
end if end if
nlev = size(prec%precv)
do ilev=1,nlev
call prec%precv(ilev)%memory_use(ilev,nlev,ilmin,info, &
& iout=iout_,verbosity=verbosity_,prefix=trim(prefix_),global=global)
end do
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
end if
9998 continue 9998 continue
end subroutine amg_cfile_prec_memory_use end subroutine amg_cfile_prec_memory_use

@ -121,46 +121,32 @@ subroutine amg_dfile_prec_memory_use(prec,info,iout,root, verbosity,prefix,globa
end if end if
end if end if
if (allocated(prec%precv)) then
if (present(root)) then if (present(root)) then
root_ = root root_ = root
else else
root_ = psb_root_ root_ = psb_root_
end if end if
if (root_ == -1) root_ = me if (root_ == -1) root_ = me
if (allocated(prec%precv)) then
if (verbosity_ >=0) then if (verbosity_ >=0) then
if (verbosity_ == 0) then if (me == root_) then
! write(iout_,*)
if (me == root_) then write(iout_,'(a,1x,a)') trim(prefix_),'Preconditioner memory usage'
write(iout_,*)
write(iout_,'(a,1x,a)') trim(prefix_),'Preconditioner memory usage'
nlev = size(prec%precv)
do ilev=1,nlev
call prec%precv(ilev)%memory_use(ilev,nlev,ilmin,info, &
& iout=iout_,prefix=trim(prefix_),global=global)
end do
end if
else if (verbosity_ >0) then
if (me == root_) then
write(iout_,*)
write(iout_,'(a,1x,a)') trim(prefix_),'Preconditioner memory usage'
end if
nlev = size(prec%precv)
do ilev=1,nlev
call prec%precv(ilev)%memory_use(ilev,nlev,ilmin,info, &
& iout=iout_,prefix=trim(prefix_),global=global)
end do
end if end if
nlev = size(prec%precv)
do ilev=1,nlev
call prec%precv(ilev)%memory_use(ilev,nlev,ilmin,info, &
& iout=iout_,verbosity=verbosity_,prefix=trim(prefix_),global=global)
end do
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
end if
9998 continue 9998 continue
end subroutine amg_dfile_prec_memory_use end subroutine amg_dfile_prec_memory_use

@ -121,46 +121,32 @@ subroutine amg_sfile_prec_memory_use(prec,info,iout,root, verbosity,prefix,globa
end if end if
end if end if
if (allocated(prec%precv)) then
if (present(root)) then if (present(root)) then
root_ = root root_ = root
else else
root_ = psb_root_ root_ = psb_root_
end if end if
if (root_ == -1) root_ = me if (root_ == -1) root_ = me
if (allocated(prec%precv)) then
if (verbosity_ >=0) then if (verbosity_ >=0) then
if (verbosity_ == 0) then if (me == root_) then
! write(iout_,*)
if (me == root_) then write(iout_,'(a,1x,a)') trim(prefix_),'Preconditioner memory usage'
write(iout_,*)
write(iout_,'(a,1x,a)') trim(prefix_),'Preconditioner memory usage'
nlev = size(prec%precv)
do ilev=1,nlev
call prec%precv(ilev)%memory_use(ilev,nlev,ilmin,info, &
& iout=iout_,prefix=trim(prefix_),global=global)
end do
end if
else if (verbosity_ >0) then
if (me == root_) then
write(iout_,*)
write(iout_,'(a,1x,a)') trim(prefix_),'Preconditioner memory usage'
end if
nlev = size(prec%precv)
do ilev=1,nlev
call prec%precv(ilev)%memory_use(ilev,nlev,ilmin,info, &
& iout=iout_,prefix=trim(prefix_),global=global)
end do
end if end if
nlev = size(prec%precv)
do ilev=1,nlev
call prec%precv(ilev)%memory_use(ilev,nlev,ilmin,info, &
& iout=iout_,verbosity=verbosity_,prefix=trim(prefix_),global=global)
end do
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
end if
9998 continue 9998 continue
end subroutine amg_sfile_prec_memory_use end subroutine amg_sfile_prec_memory_use

@ -121,46 +121,32 @@ subroutine amg_zfile_prec_memory_use(prec,info,iout,root, verbosity,prefix,globa
end if end if
end if end if
if (allocated(prec%precv)) then
if (present(root)) then if (present(root)) then
root_ = root root_ = root
else else
root_ = psb_root_ root_ = psb_root_
end if end if
if (root_ == -1) root_ = me if (root_ == -1) root_ = me
if (allocated(prec%precv)) then
if (verbosity_ >=0) then if (verbosity_ >=0) then
if (verbosity_ == 0) then if (me == root_) then
! write(iout_,*)
if (me == root_) then write(iout_,'(a,1x,a)') trim(prefix_),'Preconditioner memory usage'
write(iout_,*)
write(iout_,'(a,1x,a)') trim(prefix_),'Preconditioner memory usage'
nlev = size(prec%precv)
do ilev=1,nlev
call prec%precv(ilev)%memory_use(ilev,nlev,ilmin,info, &
& iout=iout_,prefix=trim(prefix_),global=global)
end do
end if
else if (verbosity_ >0) then
if (me == root_) then
write(iout_,*)
write(iout_,'(a,1x,a)') trim(prefix_),'Preconditioner memory usage'
end if
nlev = size(prec%precv)
do ilev=1,nlev
call prec%precv(ilev)%memory_use(ilev,nlev,ilmin,info, &
& iout=iout_,prefix=trim(prefix_),global=global)
end do
end if end if
nlev = size(prec%precv)
do ilev=1,nlev
call prec%precv(ilev)%memory_use(ilev,nlev,ilmin,info, &
& iout=iout_,verbosity=verbosity_,prefix=trim(prefix_),global=global)
end do
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
end if
9998 continue 9998 continue
end subroutine amg_zfile_prec_memory_use end subroutine amg_zfile_prec_memory_use

@ -42,7 +42,7 @@
! 0: normal ! 0: normal
! >1: increased details ! >1: increased details
! !
subroutine amg_c_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,prefix,global) subroutine amg_c_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,verbosity,prefix,global)
use psb_base_mod use psb_base_mod
use amg_c_onelev_mod, amg_protect_name => amg_c_base_onelev_memory_use use amg_c_onelev_mod, amg_protect_name => amg_c_base_onelev_memory_use
@ -53,6 +53,7 @@ subroutine amg_c_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,prefix,global)
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: iout integer(psb_ipk_), intent(in), optional :: iout
character(len=*), intent(in), optional :: prefix character(len=*), intent(in), optional :: prefix
integer(psb_ipk_), intent(in), optional :: verbosity
logical, intent(in), optional :: global logical, intent(in), optional :: global
@ -60,7 +61,7 @@ subroutine amg_c_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,prefix,global)
type(psb_ctxt_type) :: ctxt type(psb_ctxt_type) :: ctxt
integer(psb_ipk_) :: err_act ,me, np integer(psb_ipk_) :: err_act ,me, np
character(len=20), parameter :: name='amg_c_base_onelev_memory_use' character(len=20), parameter :: name='amg_c_base_onelev_memory_use'
integer(psb_ipk_) :: iout_ integer(psb_ipk_) :: iout_, verbosity_
logical :: coarse, global_ logical :: coarse, global_
character(1024) :: prefix_ character(1024) :: prefix_
integer(psb_epk_), allocatable :: sz(:) integer(psb_epk_), allocatable :: sz(:)
@ -79,6 +80,12 @@ subroutine amg_c_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,prefix,global)
iout_ = psb_out_unit iout_ = psb_out_unit
end if end if
if (present(verbosity)) then
verbosity_ = verbosity
else
verbosity_ = 0
end if
if (verbosity_ < 0) goto 9998
if (present(global)) then if (present(global)) then
global_ = global global_ = global
else else
@ -119,12 +126,14 @@ subroutine amg_c_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,prefix,global)
end if end if
else else
write(iout_,*) trim(prefix_), ' Matrix:', lv%base_a%sizeof() if ((me == 0).or.(verbosity_>0)) then
write(iout_,*) trim(prefix_), ' Descriptor:', lv%base_desc%sizeof() write(iout_,*) trim(prefix_), ' Matrix:', lv%base_a%sizeof()
if (il >1) write(iout_,*) trim(prefix_), ' Linear map:', lv%linmap%sizeof() write(iout_,*) trim(prefix_), ' Descriptor:', lv%base_desc%sizeof()
if (allocated(lv%sm)) write(iout_,*) trim(prefix_), ' Smoother:', lv%sm%sizeof() if (il >1) write(iout_,*) trim(prefix_), ' Linear map:', lv%linmap%sizeof()
if (allocated(lv%sm2a)) write(iout_,*) trim(prefix_), ' Smoother 2:', lv%sm2a%sizeof() if (allocated(lv%sm)) write(iout_,*) trim(prefix_), ' Smoother:', lv%sm%sizeof()
if (allocated(lv%wrk)) write(iout_,*) trim(prefix_), ' Workspace:', lv%wrk%sizeof() if (allocated(lv%sm2a)) write(iout_,*) trim(prefix_), ' Smoother 2:', lv%sm2a%sizeof()
if (allocated(lv%wrk)) write(iout_,*) trim(prefix_), ' Workspace:', lv%wrk%sizeof()
end if
endif endif
9998 continue 9998 continue

@ -42,7 +42,7 @@
! 0: normal ! 0: normal
! >1: increased details ! >1: increased details
! !
subroutine amg_d_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,prefix,global) subroutine amg_d_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,verbosity,prefix,global)
use psb_base_mod use psb_base_mod
use amg_d_onelev_mod, amg_protect_name => amg_d_base_onelev_memory_use use amg_d_onelev_mod, amg_protect_name => amg_d_base_onelev_memory_use
@ -53,6 +53,7 @@ subroutine amg_d_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,prefix,global)
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: iout integer(psb_ipk_), intent(in), optional :: iout
character(len=*), intent(in), optional :: prefix character(len=*), intent(in), optional :: prefix
integer(psb_ipk_), intent(in), optional :: verbosity
logical, intent(in), optional :: global logical, intent(in), optional :: global
@ -60,7 +61,7 @@ subroutine amg_d_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,prefix,global)
type(psb_ctxt_type) :: ctxt type(psb_ctxt_type) :: ctxt
integer(psb_ipk_) :: err_act ,me, np integer(psb_ipk_) :: err_act ,me, np
character(len=20), parameter :: name='amg_d_base_onelev_memory_use' character(len=20), parameter :: name='amg_d_base_onelev_memory_use'
integer(psb_ipk_) :: iout_ integer(psb_ipk_) :: iout_, verbosity_
logical :: coarse, global_ logical :: coarse, global_
character(1024) :: prefix_ character(1024) :: prefix_
integer(psb_epk_), allocatable :: sz(:) integer(psb_epk_), allocatable :: sz(:)
@ -79,6 +80,12 @@ subroutine amg_d_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,prefix,global)
iout_ = psb_out_unit iout_ = psb_out_unit
end if end if
if (present(verbosity)) then
verbosity_ = verbosity
else
verbosity_ = 0
end if
if (verbosity_ < 0) goto 9998
if (present(global)) then if (present(global)) then
global_ = global global_ = global
else else
@ -119,12 +126,14 @@ subroutine amg_d_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,prefix,global)
end if end if
else else
write(iout_,*) trim(prefix_), ' Matrix:', lv%base_a%sizeof() if ((me == 0).or.(verbosity_>0)) then
write(iout_,*) trim(prefix_), ' Descriptor:', lv%base_desc%sizeof() write(iout_,*) trim(prefix_), ' Matrix:', lv%base_a%sizeof()
if (il >1) write(iout_,*) trim(prefix_), ' Linear map:', lv%linmap%sizeof() write(iout_,*) trim(prefix_), ' Descriptor:', lv%base_desc%sizeof()
if (allocated(lv%sm)) write(iout_,*) trim(prefix_), ' Smoother:', lv%sm%sizeof() if (il >1) write(iout_,*) trim(prefix_), ' Linear map:', lv%linmap%sizeof()
if (allocated(lv%sm2a)) write(iout_,*) trim(prefix_), ' Smoother 2:', lv%sm2a%sizeof() if (allocated(lv%sm)) write(iout_,*) trim(prefix_), ' Smoother:', lv%sm%sizeof()
if (allocated(lv%wrk)) write(iout_,*) trim(prefix_), ' Workspace:', lv%wrk%sizeof() if (allocated(lv%sm2a)) write(iout_,*) trim(prefix_), ' Smoother 2:', lv%sm2a%sizeof()
if (allocated(lv%wrk)) write(iout_,*) trim(prefix_), ' Workspace:', lv%wrk%sizeof()
end if
endif endif
9998 continue 9998 continue

@ -42,7 +42,7 @@
! 0: normal ! 0: normal
! >1: increased details ! >1: increased details
! !
subroutine amg_s_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,prefix,global) subroutine amg_s_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,verbosity,prefix,global)
use psb_base_mod use psb_base_mod
use amg_s_onelev_mod, amg_protect_name => amg_s_base_onelev_memory_use use amg_s_onelev_mod, amg_protect_name => amg_s_base_onelev_memory_use
@ -53,6 +53,7 @@ subroutine amg_s_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,prefix,global)
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: iout integer(psb_ipk_), intent(in), optional :: iout
character(len=*), intent(in), optional :: prefix character(len=*), intent(in), optional :: prefix
integer(psb_ipk_), intent(in), optional :: verbosity
logical, intent(in), optional :: global logical, intent(in), optional :: global
@ -60,7 +61,7 @@ subroutine amg_s_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,prefix,global)
type(psb_ctxt_type) :: ctxt type(psb_ctxt_type) :: ctxt
integer(psb_ipk_) :: err_act ,me, np integer(psb_ipk_) :: err_act ,me, np
character(len=20), parameter :: name='amg_s_base_onelev_memory_use' character(len=20), parameter :: name='amg_s_base_onelev_memory_use'
integer(psb_ipk_) :: iout_ integer(psb_ipk_) :: iout_, verbosity_
logical :: coarse, global_ logical :: coarse, global_
character(1024) :: prefix_ character(1024) :: prefix_
integer(psb_epk_), allocatable :: sz(:) integer(psb_epk_), allocatable :: sz(:)
@ -79,6 +80,12 @@ subroutine amg_s_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,prefix,global)
iout_ = psb_out_unit iout_ = psb_out_unit
end if end if
if (present(verbosity)) then
verbosity_ = verbosity
else
verbosity_ = 0
end if
if (verbosity_ < 0) goto 9998
if (present(global)) then if (present(global)) then
global_ = global global_ = global
else else
@ -119,12 +126,14 @@ subroutine amg_s_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,prefix,global)
end if end if
else else
write(iout_,*) trim(prefix_), ' Matrix:', lv%base_a%sizeof() if ((me == 0).or.(verbosity_>0)) then
write(iout_,*) trim(prefix_), ' Descriptor:', lv%base_desc%sizeof() write(iout_,*) trim(prefix_), ' Matrix:', lv%base_a%sizeof()
if (il >1) write(iout_,*) trim(prefix_), ' Linear map:', lv%linmap%sizeof() write(iout_,*) trim(prefix_), ' Descriptor:', lv%base_desc%sizeof()
if (allocated(lv%sm)) write(iout_,*) trim(prefix_), ' Smoother:', lv%sm%sizeof() if (il >1) write(iout_,*) trim(prefix_), ' Linear map:', lv%linmap%sizeof()
if (allocated(lv%sm2a)) write(iout_,*) trim(prefix_), ' Smoother 2:', lv%sm2a%sizeof() if (allocated(lv%sm)) write(iout_,*) trim(prefix_), ' Smoother:', lv%sm%sizeof()
if (allocated(lv%wrk)) write(iout_,*) trim(prefix_), ' Workspace:', lv%wrk%sizeof() if (allocated(lv%sm2a)) write(iout_,*) trim(prefix_), ' Smoother 2:', lv%sm2a%sizeof()
if (allocated(lv%wrk)) write(iout_,*) trim(prefix_), ' Workspace:', lv%wrk%sizeof()
end if
endif endif
9998 continue 9998 continue

@ -42,7 +42,7 @@
! 0: normal ! 0: normal
! >1: increased details ! >1: increased details
! !
subroutine amg_z_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,prefix,global) subroutine amg_z_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,verbosity,prefix,global)
use psb_base_mod use psb_base_mod
use amg_z_onelev_mod, amg_protect_name => amg_z_base_onelev_memory_use use amg_z_onelev_mod, amg_protect_name => amg_z_base_onelev_memory_use
@ -53,6 +53,7 @@ subroutine amg_z_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,prefix,global)
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: iout integer(psb_ipk_), intent(in), optional :: iout
character(len=*), intent(in), optional :: prefix character(len=*), intent(in), optional :: prefix
integer(psb_ipk_), intent(in), optional :: verbosity
logical, intent(in), optional :: global logical, intent(in), optional :: global
@ -60,7 +61,7 @@ subroutine amg_z_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,prefix,global)
type(psb_ctxt_type) :: ctxt type(psb_ctxt_type) :: ctxt
integer(psb_ipk_) :: err_act ,me, np integer(psb_ipk_) :: err_act ,me, np
character(len=20), parameter :: name='amg_z_base_onelev_memory_use' character(len=20), parameter :: name='amg_z_base_onelev_memory_use'
integer(psb_ipk_) :: iout_ integer(psb_ipk_) :: iout_, verbosity_
logical :: coarse, global_ logical :: coarse, global_
character(1024) :: prefix_ character(1024) :: prefix_
integer(psb_epk_), allocatable :: sz(:) integer(psb_epk_), allocatable :: sz(:)
@ -79,6 +80,12 @@ subroutine amg_z_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,prefix,global)
iout_ = psb_out_unit iout_ = psb_out_unit
end if end if
if (present(verbosity)) then
verbosity_ = verbosity
else
verbosity_ = 0
end if
if (verbosity_ < 0) goto 9998
if (present(global)) then if (present(global)) then
global_ = global global_ = global
else else
@ -119,12 +126,14 @@ subroutine amg_z_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,prefix,global)
end if end if
else else
write(iout_,*) trim(prefix_), ' Matrix:', lv%base_a%sizeof() if ((me == 0).or.(verbosity_>0)) then
write(iout_,*) trim(prefix_), ' Descriptor:', lv%base_desc%sizeof() write(iout_,*) trim(prefix_), ' Matrix:', lv%base_a%sizeof()
if (il >1) write(iout_,*) trim(prefix_), ' Linear map:', lv%linmap%sizeof() write(iout_,*) trim(prefix_), ' Descriptor:', lv%base_desc%sizeof()
if (allocated(lv%sm)) write(iout_,*) trim(prefix_), ' Smoother:', lv%sm%sizeof() if (il >1) write(iout_,*) trim(prefix_), ' Linear map:', lv%linmap%sizeof()
if (allocated(lv%sm2a)) write(iout_,*) trim(prefix_), ' Smoother 2:', lv%sm2a%sizeof() if (allocated(lv%sm)) write(iout_,*) trim(prefix_), ' Smoother:', lv%sm%sizeof()
if (allocated(lv%wrk)) write(iout_,*) trim(prefix_), ' Workspace:', lv%wrk%sizeof() if (allocated(lv%sm2a)) write(iout_,*) trim(prefix_), ' Smoother 2:', lv%sm2a%sizeof()
if (allocated(lv%wrk)) write(iout_,*) trim(prefix_), ' Workspace:', lv%wrk%sizeof()
end if
endif endif
9998 continue 9998 continue

Loading…
Cancel
Save