Modified memory_use impl with GLOBAL and VERBOSITY

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

@ -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, verbosity,prefix) subroutine amg_c_base_onelev_memory_use(lv,il,nl,ilmin,info,iout, 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,8 +285,8 @@ 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
end subroutine amg_c_base_onelev_memory_use end subroutine amg_c_base_onelev_memory_use
end interface end interface

@ -173,7 +173,7 @@ module amg_c_prec_type
interface amg_memory_use interface amg_memory_use
subroutine amg_cfile_prec_memory_use(prec,info,iout,root,verbosity,prefix) subroutine amg_cfile_prec_memory_use(prec,info,iout,root,verbosity,prefix,global)
import :: amg_cprec_type, psb_ipk_ import :: amg_cprec_type, psb_ipk_
implicit none implicit none
! Arguments ! Arguments
@ -183,6 +183,7 @@ module amg_c_prec_type
integer(psb_ipk_), intent(in), optional :: root integer(psb_ipk_), intent(in), optional :: root
integer(psb_ipk_), intent(in), optional :: verbosity integer(psb_ipk_), intent(in), optional :: verbosity
character(len=*), intent(in), optional :: prefix character(len=*), intent(in), optional :: prefix
logical, intent(in), optional :: global
end subroutine amg_cfile_prec_memory_use end subroutine amg_cfile_prec_memory_use
end interface end interface

@ -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, verbosity,prefix) subroutine amg_d_base_onelev_memory_use(lv,il,nl,ilmin,info,iout, 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,8 +286,8 @@ 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
end subroutine amg_d_base_onelev_memory_use end subroutine amg_d_base_onelev_memory_use
end interface end interface

@ -173,7 +173,7 @@ module amg_d_prec_type
interface amg_memory_use interface amg_memory_use
subroutine amg_dfile_prec_memory_use(prec,info,iout,root,verbosity,prefix) subroutine amg_dfile_prec_memory_use(prec,info,iout,root,verbosity,prefix,global)
import :: amg_dprec_type, psb_ipk_ import :: amg_dprec_type, psb_ipk_
implicit none implicit none
! Arguments ! Arguments
@ -183,6 +183,7 @@ module amg_d_prec_type
integer(psb_ipk_), intent(in), optional :: root integer(psb_ipk_), intent(in), optional :: root
integer(psb_ipk_), intent(in), optional :: verbosity integer(psb_ipk_), intent(in), optional :: verbosity
character(len=*), intent(in), optional :: prefix character(len=*), intent(in), optional :: prefix
logical, intent(in), optional :: global
end subroutine amg_dfile_prec_memory_use end subroutine amg_dfile_prec_memory_use
end interface end interface

@ -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, verbosity,prefix) subroutine amg_s_base_onelev_memory_use(lv,il,nl,ilmin,info,iout, 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,8 +286,8 @@ 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
end subroutine amg_s_base_onelev_memory_use end subroutine amg_s_base_onelev_memory_use
end interface end interface

@ -173,7 +173,7 @@ module amg_s_prec_type
interface amg_memory_use interface amg_memory_use
subroutine amg_sfile_prec_memory_use(prec,info,iout,root,verbosity,prefix) subroutine amg_sfile_prec_memory_use(prec,info,iout,root,verbosity,prefix,global)
import :: amg_sprec_type, psb_ipk_ import :: amg_sprec_type, psb_ipk_
implicit none implicit none
! Arguments ! Arguments
@ -183,6 +183,7 @@ module amg_s_prec_type
integer(psb_ipk_), intent(in), optional :: root integer(psb_ipk_), intent(in), optional :: root
integer(psb_ipk_), intent(in), optional :: verbosity integer(psb_ipk_), intent(in), optional :: verbosity
character(len=*), intent(in), optional :: prefix character(len=*), intent(in), optional :: prefix
logical, intent(in), optional :: global
end subroutine amg_sfile_prec_memory_use end subroutine amg_sfile_prec_memory_use
end interface end interface

@ -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, verbosity,prefix) subroutine amg_z_base_onelev_memory_use(lv,il,nl,ilmin,info,iout, 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,8 +285,8 @@ 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
end subroutine amg_z_base_onelev_memory_use end subroutine amg_z_base_onelev_memory_use
end interface end interface

@ -173,7 +173,7 @@ module amg_z_prec_type
interface amg_memory_use interface amg_memory_use
subroutine amg_zfile_prec_memory_use(prec,info,iout,root,verbosity,prefix) subroutine amg_zfile_prec_memory_use(prec,info,iout,root,verbosity,prefix,global)
import :: amg_zprec_type, psb_ipk_ import :: amg_zprec_type, psb_ipk_
implicit none implicit none
! Arguments ! Arguments
@ -183,6 +183,7 @@ module amg_z_prec_type
integer(psb_ipk_), intent(in), optional :: root integer(psb_ipk_), intent(in), optional :: root
integer(psb_ipk_), intent(in), optional :: verbosity integer(psb_ipk_), intent(in), optional :: verbosity
character(len=*), intent(in), optional :: prefix character(len=*), intent(in), optional :: prefix
logical, intent(in), optional :: global
end subroutine amg_zfile_prec_memory_use end subroutine amg_zfile_prec_memory_use
end interface end interface

@ -65,7 +65,7 @@
! 0: normal ! 0: normal
! >1: increased details ! >1: increased details
! !
subroutine amg_cfile_prec_memory_use(prec,info,iout,root, verbosity,prefix) subroutine amg_cfile_prec_memory_use(prec,info,iout,root, verbosity,prefix,global)
use psb_base_mod use psb_base_mod
use amg_c_prec_mod, amg_protect_name => amg_cfile_prec_memory_use use amg_c_prec_mod, amg_protect_name => amg_cfile_prec_memory_use
use amg_c_inner_mod use amg_c_inner_mod
@ -79,6 +79,7 @@ subroutine amg_cfile_prec_memory_use(prec,info,iout,root, verbosity,prefix)
integer(psb_ipk_), intent(in), optional :: root integer(psb_ipk_), intent(in), optional :: root
integer(psb_ipk_), intent(in), optional :: verbosity integer(psb_ipk_), intent(in), optional :: verbosity
character(len=*), intent(in), optional :: prefix character(len=*), intent(in), optional :: prefix
logical, intent(in), optional :: global
! Local variables ! Local variables
@ -88,6 +89,7 @@ subroutine amg_cfile_prec_memory_use(prec,info,iout,root, verbosity,prefix)
logical :: is_symgs logical :: is_symgs
character(len=20), parameter :: name='amg_file_prec_memory_use' character(len=20), parameter :: name='amg_file_prec_memory_use'
integer(psb_ipk_) :: iout_, root_, verbosity_ integer(psb_ipk_) :: iout_, root_, verbosity_
logical :: global_
character(1024) :: prefix_ character(1024) :: prefix_
info = psb_success_ info = psb_success_
@ -103,17 +105,24 @@ subroutine amg_cfile_prec_memory_use(prec,info,iout,root, verbosity,prefix)
verbosity_ = 0 verbosity_ = 0
end if end if
if (verbosity_ < 0) goto 9998 if (verbosity_ < 0) goto 9998
ctxt = prec%ctxt
call psb_info(ctxt,me,np)
prefix_ = ""
if (verbosity == 0) then
if (present(prefix)) then if (present(prefix)) then
prefix_ = prefix prefix_ = prefix
end if
else if (verbosity > 0) then
if (present(prefix)) then
write(prefix_,'(a,a,i5,a)') prefix,' from process ',me,': '
else else
prefix_ = "" write(prefix_,'(a,i5,a)') 'Process ',me,': '
end if end if
ctxt = prec%ctxt end if
if (allocated(prec%precv)) then if (allocated(prec%precv)) then
call psb_info(ctxt,me,np)
if (present(root)) then if (present(root)) then
root_ = root root_ = root
else else
@ -122,11 +131,7 @@ subroutine amg_cfile_prec_memory_use(prec,info,iout,root, verbosity,prefix)
if (root_ == -1) root_ = me if (root_ == -1) root_ = me
if (verbosity_ >=0) then if (verbosity_ >=0) then
! if (verbosity_ == 0) then
! The preconditioner description is printed by processor psb_root_.
! This agrees with the fact that all the parameters defining the
! preconditioner have the same values on all the procs (this is
! ensured by amg_precbld).
! !
if (me == root_) then if (me == root_) then
@ -135,10 +140,22 @@ subroutine amg_cfile_prec_memory_use(prec,info,iout,root, verbosity,prefix)
nlev = size(prec%precv) nlev = size(prec%precv)
do ilev=1,nlev do ilev=1,nlev
call prec%precv(ilev)%memory_use(ilev,nlev,ilmin,info, & call prec%precv(ilev)%memory_use(ilev,nlev,ilmin,info, &
& iout=iout_,verbosity=verbosity,prefix=prefix) & iout=iout_,prefix=trim(prefix_),global=global)
end do end do
end if 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 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
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!'

@ -65,7 +65,7 @@
! 0: normal ! 0: normal
! >1: increased details ! >1: increased details
! !
subroutine amg_dfile_prec_memory_use(prec,info,iout,root, verbosity,prefix) subroutine amg_dfile_prec_memory_use(prec,info,iout,root, verbosity,prefix,global)
use psb_base_mod use psb_base_mod
use amg_d_prec_mod, amg_protect_name => amg_dfile_prec_memory_use use amg_d_prec_mod, amg_protect_name => amg_dfile_prec_memory_use
use amg_d_inner_mod use amg_d_inner_mod
@ -79,6 +79,7 @@ subroutine amg_dfile_prec_memory_use(prec,info,iout,root, verbosity,prefix)
integer(psb_ipk_), intent(in), optional :: root integer(psb_ipk_), intent(in), optional :: root
integer(psb_ipk_), intent(in), optional :: verbosity integer(psb_ipk_), intent(in), optional :: verbosity
character(len=*), intent(in), optional :: prefix character(len=*), intent(in), optional :: prefix
logical, intent(in), optional :: global
! Local variables ! Local variables
@ -88,6 +89,7 @@ subroutine amg_dfile_prec_memory_use(prec,info,iout,root, verbosity,prefix)
logical :: is_symgs logical :: is_symgs
character(len=20), parameter :: name='amg_file_prec_memory_use' character(len=20), parameter :: name='amg_file_prec_memory_use'
integer(psb_ipk_) :: iout_, root_, verbosity_ integer(psb_ipk_) :: iout_, root_, verbosity_
logical :: global_
character(1024) :: prefix_ character(1024) :: prefix_
info = psb_success_ info = psb_success_
@ -103,17 +105,24 @@ subroutine amg_dfile_prec_memory_use(prec,info,iout,root, verbosity,prefix)
verbosity_ = 0 verbosity_ = 0
end if end if
if (verbosity_ < 0) goto 9998 if (verbosity_ < 0) goto 9998
ctxt = prec%ctxt
call psb_info(ctxt,me,np)
prefix_ = ""
if (verbosity == 0) then
if (present(prefix)) then if (present(prefix)) then
prefix_ = prefix prefix_ = prefix
end if
else if (verbosity > 0) then
if (present(prefix)) then
write(prefix_,'(a,a,i5,a)') prefix,' from process ',me,': '
else else
prefix_ = "" write(prefix_,'(a,i5,a)') 'Process ',me,': '
end if end if
ctxt = prec%ctxt end if
if (allocated(prec%precv)) then if (allocated(prec%precv)) then
call psb_info(ctxt,me,np)
if (present(root)) then if (present(root)) then
root_ = root root_ = root
else else
@ -122,11 +131,7 @@ subroutine amg_dfile_prec_memory_use(prec,info,iout,root, verbosity,prefix)
if (root_ == -1) root_ = me if (root_ == -1) root_ = me
if (verbosity_ >=0) then if (verbosity_ >=0) then
! if (verbosity_ == 0) then
! The preconditioner description is printed by processor psb_root_.
! This agrees with the fact that all the parameters defining the
! preconditioner have the same values on all the procs (this is
! ensured by amg_precbld).
! !
if (me == root_) then if (me == root_) then
@ -135,10 +140,22 @@ subroutine amg_dfile_prec_memory_use(prec,info,iout,root, verbosity,prefix)
nlev = size(prec%precv) nlev = size(prec%precv)
do ilev=1,nlev do ilev=1,nlev
call prec%precv(ilev)%memory_use(ilev,nlev,ilmin,info, & call prec%precv(ilev)%memory_use(ilev,nlev,ilmin,info, &
& iout=iout_,verbosity=verbosity,prefix=prefix) & iout=iout_,prefix=trim(prefix_),global=global)
end do end do
end if 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 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
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!'

@ -65,7 +65,7 @@
! 0: normal ! 0: normal
! >1: increased details ! >1: increased details
! !
subroutine amg_sfile_prec_memory_use(prec,info,iout,root, verbosity,prefix) subroutine amg_sfile_prec_memory_use(prec,info,iout,root, verbosity,prefix,global)
use psb_base_mod use psb_base_mod
use amg_s_prec_mod, amg_protect_name => amg_sfile_prec_memory_use use amg_s_prec_mod, amg_protect_name => amg_sfile_prec_memory_use
use amg_s_inner_mod use amg_s_inner_mod
@ -79,6 +79,7 @@ subroutine amg_sfile_prec_memory_use(prec,info,iout,root, verbosity,prefix)
integer(psb_ipk_), intent(in), optional :: root integer(psb_ipk_), intent(in), optional :: root
integer(psb_ipk_), intent(in), optional :: verbosity integer(psb_ipk_), intent(in), optional :: verbosity
character(len=*), intent(in), optional :: prefix character(len=*), intent(in), optional :: prefix
logical, intent(in), optional :: global
! Local variables ! Local variables
@ -88,6 +89,7 @@ subroutine amg_sfile_prec_memory_use(prec,info,iout,root, verbosity,prefix)
logical :: is_symgs logical :: is_symgs
character(len=20), parameter :: name='amg_file_prec_memory_use' character(len=20), parameter :: name='amg_file_prec_memory_use'
integer(psb_ipk_) :: iout_, root_, verbosity_ integer(psb_ipk_) :: iout_, root_, verbosity_
logical :: global_
character(1024) :: prefix_ character(1024) :: prefix_
info = psb_success_ info = psb_success_
@ -103,17 +105,24 @@ subroutine amg_sfile_prec_memory_use(prec,info,iout,root, verbosity,prefix)
verbosity_ = 0 verbosity_ = 0
end if end if
if (verbosity_ < 0) goto 9998 if (verbosity_ < 0) goto 9998
ctxt = prec%ctxt
call psb_info(ctxt,me,np)
prefix_ = ""
if (verbosity == 0) then
if (present(prefix)) then if (present(prefix)) then
prefix_ = prefix prefix_ = prefix
end if
else if (verbosity > 0) then
if (present(prefix)) then
write(prefix_,'(a,a,i5,a)') prefix,' from process ',me,': '
else else
prefix_ = "" write(prefix_,'(a,i5,a)') 'Process ',me,': '
end if end if
ctxt = prec%ctxt end if
if (allocated(prec%precv)) then if (allocated(prec%precv)) then
call psb_info(ctxt,me,np)
if (present(root)) then if (present(root)) then
root_ = root root_ = root
else else
@ -122,11 +131,7 @@ subroutine amg_sfile_prec_memory_use(prec,info,iout,root, verbosity,prefix)
if (root_ == -1) root_ = me if (root_ == -1) root_ = me
if (verbosity_ >=0) then if (verbosity_ >=0) then
! if (verbosity_ == 0) then
! The preconditioner description is printed by processor psb_root_.
! This agrees with the fact that all the parameters defining the
! preconditioner have the same values on all the procs (this is
! ensured by amg_precbld).
! !
if (me == root_) then if (me == root_) then
@ -135,10 +140,22 @@ subroutine amg_sfile_prec_memory_use(prec,info,iout,root, verbosity,prefix)
nlev = size(prec%precv) nlev = size(prec%precv)
do ilev=1,nlev do ilev=1,nlev
call prec%precv(ilev)%memory_use(ilev,nlev,ilmin,info, & call prec%precv(ilev)%memory_use(ilev,nlev,ilmin,info, &
& iout=iout_,verbosity=verbosity,prefix=prefix) & iout=iout_,prefix=trim(prefix_),global=global)
end do end do
end if 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 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
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!'

@ -65,7 +65,7 @@
! 0: normal ! 0: normal
! >1: increased details ! >1: increased details
! !
subroutine amg_zfile_prec_memory_use(prec,info,iout,root, verbosity,prefix) subroutine amg_zfile_prec_memory_use(prec,info,iout,root, verbosity,prefix,global)
use psb_base_mod use psb_base_mod
use amg_z_prec_mod, amg_protect_name => amg_zfile_prec_memory_use use amg_z_prec_mod, amg_protect_name => amg_zfile_prec_memory_use
use amg_z_inner_mod use amg_z_inner_mod
@ -79,6 +79,7 @@ subroutine amg_zfile_prec_memory_use(prec,info,iout,root, verbosity,prefix)
integer(psb_ipk_), intent(in), optional :: root integer(psb_ipk_), intent(in), optional :: root
integer(psb_ipk_), intent(in), optional :: verbosity integer(psb_ipk_), intent(in), optional :: verbosity
character(len=*), intent(in), optional :: prefix character(len=*), intent(in), optional :: prefix
logical, intent(in), optional :: global
! Local variables ! Local variables
@ -88,6 +89,7 @@ subroutine amg_zfile_prec_memory_use(prec,info,iout,root, verbosity,prefix)
logical :: is_symgs logical :: is_symgs
character(len=20), parameter :: name='amg_file_prec_memory_use' character(len=20), parameter :: name='amg_file_prec_memory_use'
integer(psb_ipk_) :: iout_, root_, verbosity_ integer(psb_ipk_) :: iout_, root_, verbosity_
logical :: global_
character(1024) :: prefix_ character(1024) :: prefix_
info = psb_success_ info = psb_success_
@ -103,17 +105,24 @@ subroutine amg_zfile_prec_memory_use(prec,info,iout,root, verbosity,prefix)
verbosity_ = 0 verbosity_ = 0
end if end if
if (verbosity_ < 0) goto 9998 if (verbosity_ < 0) goto 9998
ctxt = prec%ctxt
call psb_info(ctxt,me,np)
prefix_ = ""
if (verbosity == 0) then
if (present(prefix)) then if (present(prefix)) then
prefix_ = prefix prefix_ = prefix
end if
else if (verbosity > 0) then
if (present(prefix)) then
write(prefix_,'(a,a,i5,a)') prefix,' from process ',me,': '
else else
prefix_ = "" write(prefix_,'(a,i5,a)') 'Process ',me,': '
end if end if
ctxt = prec%ctxt end if
if (allocated(prec%precv)) then if (allocated(prec%precv)) then
call psb_info(ctxt,me,np)
if (present(root)) then if (present(root)) then
root_ = root root_ = root
else else
@ -122,11 +131,7 @@ subroutine amg_zfile_prec_memory_use(prec,info,iout,root, verbosity,prefix)
if (root_ == -1) root_ = me if (root_ == -1) root_ = me
if (verbosity_ >=0) then if (verbosity_ >=0) then
! if (verbosity_ == 0) then
! The preconditioner description is printed by processor psb_root_.
! This agrees with the fact that all the parameters defining the
! preconditioner have the same values on all the procs (this is
! ensured by amg_precbld).
! !
if (me == root_) then if (me == root_) then
@ -135,10 +140,22 @@ subroutine amg_zfile_prec_memory_use(prec,info,iout,root, verbosity,prefix)
nlev = size(prec%precv) nlev = size(prec%precv)
do ilev=1,nlev do ilev=1,nlev
call prec%precv(ilev)%memory_use(ilev,nlev,ilmin,info, & call prec%precv(ilev)%memory_use(ilev,nlev,ilmin,info, &
& iout=iout_,verbosity=verbosity,prefix=prefix) & iout=iout_,prefix=trim(prefix_),global=global)
end do end do
end if 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 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
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!'

@ -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,verbosity,prefix) subroutine amg_c_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,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
@ -52,20 +52,24 @@ subroutine amg_c_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,verbosity,prefi
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
! Local variables ! Local variables
integer(psb_ipk_) :: err_act type(psb_ctxt_type) :: ctxt
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_, verbosity_ integer(psb_ipk_) :: iout_
logical :: coarse logical :: coarse, global_
character(1024) :: prefix_ character(1024) :: prefix_
integer(psb_epk_), allocatable :: sz(:)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
ctxt = lv%base_desc%get_ctxt()
call psb_info(ctxt,me,np)
coarse = (il==nl) coarse = (il==nl)
@ -75,12 +79,12 @@ subroutine amg_c_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,verbosity,prefi
iout_ = psb_out_unit iout_ = psb_out_unit
end if end if
if (present(verbosity)) then if (present(global)) then
verbosity_ = verbosity global_ = global
else else
verbosity_ = 0 global_ = .false.
end if end if
if (verbosity_ < 0) goto 9998
if (present(prefix)) then if (present(prefix)) then
prefix_ = prefix prefix_ = prefix
else else
@ -95,13 +99,33 @@ subroutine amg_c_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,verbosity,prefi
write(iout_,*) trim(prefix_), ' Level ',il write(iout_,*) trim(prefix_), ' Level ',il
end if end if
if (global_) then
allocate(sz(6))
sz(:) = 0
sz(1) = lv%base_a%sizeof()
sz(2) = lv%base_desc%sizeof()
if (il >1) sz(3) = lv%linmap%sizeof()
if (allocated(lv%sm)) sz(4) = lv%sm%sizeof()
if (allocated(lv%sm2a)) sz(5) = lv%sm2a%sizeof()
if (allocated(lv%wrk)) sz(6) = lv%wrk%sizeof()
call psb_sum(ctxt,sz)
if (me == 0) then
write(iout_,*) trim(prefix_), ' Matrix:', sz(1)
write(iout_,*) trim(prefix_), ' Descriptor:', sz(2)
if (il >1) write(iout_,*) trim(prefix_), ' Linear map:', sz(3)
if (allocated(lv%sm)) write(iout_,*) trim(prefix_), ' Smoother:', sz(4)
if (allocated(lv%sm2a)) write(iout_,*) trim(prefix_), ' Smoother 2:', sz(5)
if (allocated(lv%wrk)) write(iout_,*) trim(prefix_), ' Workspace:', sz(6)
end if
else
write(iout_,*) trim(prefix_), ' Matrix:', lv%base_a%sizeof() write(iout_,*) trim(prefix_), ' Matrix:', lv%base_a%sizeof()
write(iout_,*) trim(prefix_), ' Descriptor:', lv%base_desc%sizeof() write(iout_,*) trim(prefix_), ' Descriptor:', lv%base_desc%sizeof()
if (il >1) write(iout_,*) trim(prefix_), ' Linear map:', lv%linmap%sizeof() if (il >1) write(iout_,*) trim(prefix_), ' Linear map:', lv%linmap%sizeof()
if (allocated(lv%sm)) write(iout_,*) trim(prefix_), ' Smoother:', lv%sm%sizeof() if (allocated(lv%sm)) write(iout_,*) trim(prefix_), ' Smoother:', lv%sm%sizeof()
if (allocated(lv%sm2a)) write(iout_,*) trim(prefix_), ' Smoother 2:', lv%sm2a%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() if (allocated(lv%wrk)) write(iout_,*) trim(prefix_), ' Workspace:', lv%wrk%sizeof()
endif
9998 continue 9998 continue
call psb_erractionrestore(err_act) call psb_erractionrestore(err_act)

@ -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,verbosity,prefix) subroutine amg_d_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,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
@ -52,20 +52,24 @@ subroutine amg_d_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,verbosity,prefi
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
! Local variables ! Local variables
integer(psb_ipk_) :: err_act type(psb_ctxt_type) :: ctxt
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_, verbosity_ integer(psb_ipk_) :: iout_
logical :: coarse logical :: coarse, global_
character(1024) :: prefix_ character(1024) :: prefix_
integer(psb_epk_), allocatable :: sz(:)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
ctxt = lv%base_desc%get_ctxt()
call psb_info(ctxt,me,np)
coarse = (il==nl) coarse = (il==nl)
@ -75,12 +79,12 @@ subroutine amg_d_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,verbosity,prefi
iout_ = psb_out_unit iout_ = psb_out_unit
end if end if
if (present(verbosity)) then if (present(global)) then
verbosity_ = verbosity global_ = global
else else
verbosity_ = 0 global_ = .false.
end if end if
if (verbosity_ < 0) goto 9998
if (present(prefix)) then if (present(prefix)) then
prefix_ = prefix prefix_ = prefix
else else
@ -95,13 +99,33 @@ subroutine amg_d_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,verbosity,prefi
write(iout_,*) trim(prefix_), ' Level ',il write(iout_,*) trim(prefix_), ' Level ',il
end if end if
if (global_) then
allocate(sz(6))
sz(:) = 0
sz(1) = lv%base_a%sizeof()
sz(2) = lv%base_desc%sizeof()
if (il >1) sz(3) = lv%linmap%sizeof()
if (allocated(lv%sm)) sz(4) = lv%sm%sizeof()
if (allocated(lv%sm2a)) sz(5) = lv%sm2a%sizeof()
if (allocated(lv%wrk)) sz(6) = lv%wrk%sizeof()
call psb_sum(ctxt,sz)
if (me == 0) then
write(iout_,*) trim(prefix_), ' Matrix:', sz(1)
write(iout_,*) trim(prefix_), ' Descriptor:', sz(2)
if (il >1) write(iout_,*) trim(prefix_), ' Linear map:', sz(3)
if (allocated(lv%sm)) write(iout_,*) trim(prefix_), ' Smoother:', sz(4)
if (allocated(lv%sm2a)) write(iout_,*) trim(prefix_), ' Smoother 2:', sz(5)
if (allocated(lv%wrk)) write(iout_,*) trim(prefix_), ' Workspace:', sz(6)
end if
else
write(iout_,*) trim(prefix_), ' Matrix:', lv%base_a%sizeof() write(iout_,*) trim(prefix_), ' Matrix:', lv%base_a%sizeof()
write(iout_,*) trim(prefix_), ' Descriptor:', lv%base_desc%sizeof() write(iout_,*) trim(prefix_), ' Descriptor:', lv%base_desc%sizeof()
if (il >1) write(iout_,*) trim(prefix_), ' Linear map:', lv%linmap%sizeof() if (il >1) write(iout_,*) trim(prefix_), ' Linear map:', lv%linmap%sizeof()
if (allocated(lv%sm)) write(iout_,*) trim(prefix_), ' Smoother:', lv%sm%sizeof() if (allocated(lv%sm)) write(iout_,*) trim(prefix_), ' Smoother:', lv%sm%sizeof()
if (allocated(lv%sm2a)) write(iout_,*) trim(prefix_), ' Smoother 2:', lv%sm2a%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() if (allocated(lv%wrk)) write(iout_,*) trim(prefix_), ' Workspace:', lv%wrk%sizeof()
endif
9998 continue 9998 continue
call psb_erractionrestore(err_act) call psb_erractionrestore(err_act)

@ -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,verbosity,prefix) subroutine amg_s_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,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
@ -52,20 +52,24 @@ subroutine amg_s_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,verbosity,prefi
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
! Local variables ! Local variables
integer(psb_ipk_) :: err_act type(psb_ctxt_type) :: ctxt
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_, verbosity_ integer(psb_ipk_) :: iout_
logical :: coarse logical :: coarse, global_
character(1024) :: prefix_ character(1024) :: prefix_
integer(psb_epk_), allocatable :: sz(:)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
ctxt = lv%base_desc%get_ctxt()
call psb_info(ctxt,me,np)
coarse = (il==nl) coarse = (il==nl)
@ -75,12 +79,12 @@ subroutine amg_s_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,verbosity,prefi
iout_ = psb_out_unit iout_ = psb_out_unit
end if end if
if (present(verbosity)) then if (present(global)) then
verbosity_ = verbosity global_ = global
else else
verbosity_ = 0 global_ = .false.
end if end if
if (verbosity_ < 0) goto 9998
if (present(prefix)) then if (present(prefix)) then
prefix_ = prefix prefix_ = prefix
else else
@ -95,13 +99,33 @@ subroutine amg_s_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,verbosity,prefi
write(iout_,*) trim(prefix_), ' Level ',il write(iout_,*) trim(prefix_), ' Level ',il
end if end if
if (global_) then
allocate(sz(6))
sz(:) = 0
sz(1) = lv%base_a%sizeof()
sz(2) = lv%base_desc%sizeof()
if (il >1) sz(3) = lv%linmap%sizeof()
if (allocated(lv%sm)) sz(4) = lv%sm%sizeof()
if (allocated(lv%sm2a)) sz(5) = lv%sm2a%sizeof()
if (allocated(lv%wrk)) sz(6) = lv%wrk%sizeof()
call psb_sum(ctxt,sz)
if (me == 0) then
write(iout_,*) trim(prefix_), ' Matrix:', sz(1)
write(iout_,*) trim(prefix_), ' Descriptor:', sz(2)
if (il >1) write(iout_,*) trim(prefix_), ' Linear map:', sz(3)
if (allocated(lv%sm)) write(iout_,*) trim(prefix_), ' Smoother:', sz(4)
if (allocated(lv%sm2a)) write(iout_,*) trim(prefix_), ' Smoother 2:', sz(5)
if (allocated(lv%wrk)) write(iout_,*) trim(prefix_), ' Workspace:', sz(6)
end if
else
write(iout_,*) trim(prefix_), ' Matrix:', lv%base_a%sizeof() write(iout_,*) trim(prefix_), ' Matrix:', lv%base_a%sizeof()
write(iout_,*) trim(prefix_), ' Descriptor:', lv%base_desc%sizeof() write(iout_,*) trim(prefix_), ' Descriptor:', lv%base_desc%sizeof()
if (il >1) write(iout_,*) trim(prefix_), ' Linear map:', lv%linmap%sizeof() if (il >1) write(iout_,*) trim(prefix_), ' Linear map:', lv%linmap%sizeof()
if (allocated(lv%sm)) write(iout_,*) trim(prefix_), ' Smoother:', lv%sm%sizeof() if (allocated(lv%sm)) write(iout_,*) trim(prefix_), ' Smoother:', lv%sm%sizeof()
if (allocated(lv%sm2a)) write(iout_,*) trim(prefix_), ' Smoother 2:', lv%sm2a%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() if (allocated(lv%wrk)) write(iout_,*) trim(prefix_), ' Workspace:', lv%wrk%sizeof()
endif
9998 continue 9998 continue
call psb_erractionrestore(err_act) call psb_erractionrestore(err_act)

@ -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,verbosity,prefix) subroutine amg_z_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,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
@ -52,20 +52,24 @@ subroutine amg_z_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,verbosity,prefi
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
! Local variables ! Local variables
integer(psb_ipk_) :: err_act type(psb_ctxt_type) :: ctxt
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_, verbosity_ integer(psb_ipk_) :: iout_
logical :: coarse logical :: coarse, global_
character(1024) :: prefix_ character(1024) :: prefix_
integer(psb_epk_), allocatable :: sz(:)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
ctxt = lv%base_desc%get_ctxt()
call psb_info(ctxt,me,np)
coarse = (il==nl) coarse = (il==nl)
@ -75,12 +79,12 @@ subroutine amg_z_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,verbosity,prefi
iout_ = psb_out_unit iout_ = psb_out_unit
end if end if
if (present(verbosity)) then if (present(global)) then
verbosity_ = verbosity global_ = global
else else
verbosity_ = 0 global_ = .false.
end if end if
if (verbosity_ < 0) goto 9998
if (present(prefix)) then if (present(prefix)) then
prefix_ = prefix prefix_ = prefix
else else
@ -95,13 +99,33 @@ subroutine amg_z_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,verbosity,prefi
write(iout_,*) trim(prefix_), ' Level ',il write(iout_,*) trim(prefix_), ' Level ',il
end if end if
if (global_) then
allocate(sz(6))
sz(:) = 0
sz(1) = lv%base_a%sizeof()
sz(2) = lv%base_desc%sizeof()
if (il >1) sz(3) = lv%linmap%sizeof()
if (allocated(lv%sm)) sz(4) = lv%sm%sizeof()
if (allocated(lv%sm2a)) sz(5) = lv%sm2a%sizeof()
if (allocated(lv%wrk)) sz(6) = lv%wrk%sizeof()
call psb_sum(ctxt,sz)
if (me == 0) then
write(iout_,*) trim(prefix_), ' Matrix:', sz(1)
write(iout_,*) trim(prefix_), ' Descriptor:', sz(2)
if (il >1) write(iout_,*) trim(prefix_), ' Linear map:', sz(3)
if (allocated(lv%sm)) write(iout_,*) trim(prefix_), ' Smoother:', sz(4)
if (allocated(lv%sm2a)) write(iout_,*) trim(prefix_), ' Smoother 2:', sz(5)
if (allocated(lv%wrk)) write(iout_,*) trim(prefix_), ' Workspace:', sz(6)
end if
else
write(iout_,*) trim(prefix_), ' Matrix:', lv%base_a%sizeof() write(iout_,*) trim(prefix_), ' Matrix:', lv%base_a%sizeof()
write(iout_,*) trim(prefix_), ' Descriptor:', lv%base_desc%sizeof() write(iout_,*) trim(prefix_), ' Descriptor:', lv%base_desc%sizeof()
if (il >1) write(iout_,*) trim(prefix_), ' Linear map:', lv%linmap%sizeof() if (il >1) write(iout_,*) trim(prefix_), ' Linear map:', lv%linmap%sizeof()
if (allocated(lv%sm)) write(iout_,*) trim(prefix_), ' Smoother:', lv%sm%sizeof() if (allocated(lv%sm)) write(iout_,*) trim(prefix_), ' Smoother:', lv%sm%sizeof()
if (allocated(lv%sm2a)) write(iout_,*) trim(prefix_), ' Smoother 2:', lv%sm2a%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() if (allocated(lv%wrk)) write(iout_,*) trim(prefix_), ' Workspace:', lv%wrk%sizeof()
endif
9998 continue 9998 continue
call psb_erractionrestore(err_act) call psb_erractionrestore(err_act)

Loading…
Cancel
Save