From 678237cf29996dc8b896356b1b7d28553d1455e4 Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Sat, 16 Mar 2024 13:31:47 +0100 Subject: [PATCH] Fixed implementation of GLOBAL vs VERBOSITY --- amgprec/amg_c_onelev_mod.f90 | 3 +- amgprec/amg_d_onelev_mod.f90 | 3 +- amgprec/amg_s_onelev_mod.f90 | 3 +- amgprec/amg_z_onelev_mod.f90 | 3 +- amgprec/impl/amg_cfile_prec_memory_use.f90 | 66 ++++++++----------- amgprec/impl/amg_dfile_prec_memory_use.f90 | 66 ++++++++----------- amgprec/impl/amg_sfile_prec_memory_use.f90 | 66 ++++++++----------- amgprec/impl/amg_zfile_prec_memory_use.f90 | 66 ++++++++----------- .../level/amg_c_base_onelev_memory_use.f90 | 25 ++++--- .../level/amg_d_base_onelev_memory_use.f90 | 25 ++++--- .../level/amg_s_base_onelev_memory_use.f90 | 25 ++++--- .../level/amg_z_base_onelev_memory_use.f90 | 25 ++++--- 12 files changed, 180 insertions(+), 196 deletions(-) diff --git a/amgprec/amg_c_onelev_mod.f90 b/amgprec/amg_c_onelev_mod.f90 index f5411e45..d926e2bf 100644 --- a/amgprec/amg_c_onelev_mod.f90 +++ b/amgprec/amg_c_onelev_mod.f90 @@ -275,7 +275,7 @@ module amg_c_onelev_mod end 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, & & psb_clinmap_type, psb_spk_, amg_c_onelev_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(out) :: info integer(psb_ipk_), intent(in), optional :: iout + integer(psb_ipk_), intent(in), optional :: verbosity character(len=*), intent(in), optional :: prefix logical, intent(in), optional :: global end subroutine amg_c_base_onelev_memory_use diff --git a/amgprec/amg_d_onelev_mod.f90 b/amgprec/amg_d_onelev_mod.f90 index f7e7f678..51c482cb 100644 --- a/amgprec/amg_d_onelev_mod.f90 +++ b/amgprec/amg_d_onelev_mod.f90 @@ -276,7 +276,7 @@ module amg_d_onelev_mod end 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, & & psb_dlinmap_type, psb_dpk_, amg_d_onelev_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(out) :: info integer(psb_ipk_), intent(in), optional :: iout + integer(psb_ipk_), intent(in), optional :: verbosity character(len=*), intent(in), optional :: prefix logical, intent(in), optional :: global end subroutine amg_d_base_onelev_memory_use diff --git a/amgprec/amg_s_onelev_mod.f90 b/amgprec/amg_s_onelev_mod.f90 index d6651396..f11b64ca 100644 --- a/amgprec/amg_s_onelev_mod.f90 +++ b/amgprec/amg_s_onelev_mod.f90 @@ -276,7 +276,7 @@ module amg_s_onelev_mod end 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, & & psb_slinmap_type, psb_spk_, amg_s_onelev_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(out) :: info integer(psb_ipk_), intent(in), optional :: iout + integer(psb_ipk_), intent(in), optional :: verbosity character(len=*), intent(in), optional :: prefix logical, intent(in), optional :: global end subroutine amg_s_base_onelev_memory_use diff --git a/amgprec/amg_z_onelev_mod.f90 b/amgprec/amg_z_onelev_mod.f90 index 16d59e44..fffe88c0 100644 --- a/amgprec/amg_z_onelev_mod.f90 +++ b/amgprec/amg_z_onelev_mod.f90 @@ -275,7 +275,7 @@ module amg_z_onelev_mod end 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, & & psb_zlinmap_type, psb_dpk_, amg_z_onelev_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(out) :: info integer(psb_ipk_), intent(in), optional :: iout + integer(psb_ipk_), intent(in), optional :: verbosity character(len=*), intent(in), optional :: prefix logical, intent(in), optional :: global end subroutine amg_z_base_onelev_memory_use diff --git a/amgprec/impl/amg_cfile_prec_memory_use.f90 b/amgprec/impl/amg_cfile_prec_memory_use.f90 index d92539f1..922f4087 100644 --- a/amgprec/impl/amg_cfile_prec_memory_use.f90 +++ b/amgprec/impl/amg_cfile_prec_memory_use.f90 @@ -105,7 +105,7 @@ subroutine amg_cfile_prec_memory_use(prec,info,iout,root, verbosity,prefix,globa verbosity_ = 0 end if if (verbosity_ < 0) goto 9998 - + ctxt = prec%ctxt call psb_info(ctxt,me,np) prefix_ = "" @@ -119,48 +119,34 @@ subroutine amg_cfile_prec_memory_use(prec,info,iout,root, verbosity,prefix,globa else write(prefix_,'(a,i5,a)') 'Process ',me,': ' end if - - end if - if (allocated(prec%precv)) then - if (present(root)) then - root_ = root - else - root_ = psb_root_ - end if - if (root_ == -1) root_ = me + end if + + if (present(root)) then + root_ = root + else + root_ = psb_root_ + end if + if (root_ == -1) root_ = me + if (allocated(prec%precv)) then if (verbosity_ >=0) then - if (verbosity_ == 0) then - ! - if (me == root_) then - - 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 + if (me == root_) then + write(iout_,*) + write(iout_,'(a,1x,a)') trim(prefix_),'Preconditioner memory usage' end if - - else - write(iout_,*) trim(name), & - & ': Error: no base preconditioner available, something is wrong!' - info = -2 - return - endif + 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 + write(iout_,*) trim(name), & + & ': Error: no base preconditioner available, something is wrong!' + info = -2 + return + endif + end if 9998 continue end subroutine amg_cfile_prec_memory_use diff --git a/amgprec/impl/amg_dfile_prec_memory_use.f90 b/amgprec/impl/amg_dfile_prec_memory_use.f90 index 20878ad0..9423498f 100644 --- a/amgprec/impl/amg_dfile_prec_memory_use.f90 +++ b/amgprec/impl/amg_dfile_prec_memory_use.f90 @@ -105,7 +105,7 @@ subroutine amg_dfile_prec_memory_use(prec,info,iout,root, verbosity,prefix,globa verbosity_ = 0 end if if (verbosity_ < 0) goto 9998 - + ctxt = prec%ctxt call psb_info(ctxt,me,np) prefix_ = "" @@ -119,48 +119,34 @@ subroutine amg_dfile_prec_memory_use(prec,info,iout,root, verbosity,prefix,globa else write(prefix_,'(a,i5,a)') 'Process ',me,': ' end if - - end if - if (allocated(prec%precv)) then - if (present(root)) then - root_ = root - else - root_ = psb_root_ - end if - if (root_ == -1) root_ = me + end if + + if (present(root)) then + root_ = root + else + root_ = psb_root_ + end if + if (root_ == -1) root_ = me + if (allocated(prec%precv)) then if (verbosity_ >=0) then - if (verbosity_ == 0) then - ! - if (me == root_) then - - 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 + if (me == root_) then + write(iout_,*) + write(iout_,'(a,1x,a)') trim(prefix_),'Preconditioner memory usage' end if - - else - write(iout_,*) trim(name), & - & ': Error: no base preconditioner available, something is wrong!' - info = -2 - return - endif + 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 + write(iout_,*) trim(name), & + & ': Error: no base preconditioner available, something is wrong!' + info = -2 + return + endif + end if 9998 continue end subroutine amg_dfile_prec_memory_use diff --git a/amgprec/impl/amg_sfile_prec_memory_use.f90 b/amgprec/impl/amg_sfile_prec_memory_use.f90 index 9a0622ce..ea776c2b 100644 --- a/amgprec/impl/amg_sfile_prec_memory_use.f90 +++ b/amgprec/impl/amg_sfile_prec_memory_use.f90 @@ -105,7 +105,7 @@ subroutine amg_sfile_prec_memory_use(prec,info,iout,root, verbosity,prefix,globa verbosity_ = 0 end if if (verbosity_ < 0) goto 9998 - + ctxt = prec%ctxt call psb_info(ctxt,me,np) prefix_ = "" @@ -119,48 +119,34 @@ subroutine amg_sfile_prec_memory_use(prec,info,iout,root, verbosity,prefix,globa else write(prefix_,'(a,i5,a)') 'Process ',me,': ' end if - - end if - if (allocated(prec%precv)) then - if (present(root)) then - root_ = root - else - root_ = psb_root_ - end if - if (root_ == -1) root_ = me + end if + + if (present(root)) then + root_ = root + else + root_ = psb_root_ + end if + if (root_ == -1) root_ = me + if (allocated(prec%precv)) then if (verbosity_ >=0) then - if (verbosity_ == 0) then - ! - if (me == root_) then - - 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 + if (me == root_) then + write(iout_,*) + write(iout_,'(a,1x,a)') trim(prefix_),'Preconditioner memory usage' end if - - else - write(iout_,*) trim(name), & - & ': Error: no base preconditioner available, something is wrong!' - info = -2 - return - endif + 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 + write(iout_,*) trim(name), & + & ': Error: no base preconditioner available, something is wrong!' + info = -2 + return + endif + end if 9998 continue end subroutine amg_sfile_prec_memory_use diff --git a/amgprec/impl/amg_zfile_prec_memory_use.f90 b/amgprec/impl/amg_zfile_prec_memory_use.f90 index c36635b4..e54b13ad 100644 --- a/amgprec/impl/amg_zfile_prec_memory_use.f90 +++ b/amgprec/impl/amg_zfile_prec_memory_use.f90 @@ -105,7 +105,7 @@ subroutine amg_zfile_prec_memory_use(prec,info,iout,root, verbosity,prefix,globa verbosity_ = 0 end if if (verbosity_ < 0) goto 9998 - + ctxt = prec%ctxt call psb_info(ctxt,me,np) prefix_ = "" @@ -119,48 +119,34 @@ subroutine amg_zfile_prec_memory_use(prec,info,iout,root, verbosity,prefix,globa else write(prefix_,'(a,i5,a)') 'Process ',me,': ' end if - - end if - if (allocated(prec%precv)) then - if (present(root)) then - root_ = root - else - root_ = psb_root_ - end if - if (root_ == -1) root_ = me + end if + + if (present(root)) then + root_ = root + else + root_ = psb_root_ + end if + if (root_ == -1) root_ = me + if (allocated(prec%precv)) then if (verbosity_ >=0) then - if (verbosity_ == 0) then - ! - if (me == root_) then - - 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 + if (me == root_) then + write(iout_,*) + write(iout_,'(a,1x,a)') trim(prefix_),'Preconditioner memory usage' end if - - else - write(iout_,*) trim(name), & - & ': Error: no base preconditioner available, something is wrong!' - info = -2 - return - endif + 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 + write(iout_,*) trim(name), & + & ': Error: no base preconditioner available, something is wrong!' + info = -2 + return + endif + end if 9998 continue end subroutine amg_zfile_prec_memory_use diff --git a/amgprec/impl/level/amg_c_base_onelev_memory_use.f90 b/amgprec/impl/level/amg_c_base_onelev_memory_use.f90 index 5163a95a..9cfc369e 100644 --- a/amgprec/impl/level/amg_c_base_onelev_memory_use.f90 +++ b/amgprec/impl/level/amg_c_base_onelev_memory_use.f90 @@ -42,7 +42,7 @@ ! 0: normal ! >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 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(in), optional :: iout character(len=*), intent(in), optional :: prefix + integer(psb_ipk_), intent(in), optional :: verbosity 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 integer(psb_ipk_) :: err_act ,me, np character(len=20), parameter :: name='amg_c_base_onelev_memory_use' - integer(psb_ipk_) :: iout_ + integer(psb_ipk_) :: iout_, verbosity_ logical :: coarse, global_ character(1024) :: prefix_ 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 end if + if (present(verbosity)) then + verbosity_ = verbosity + else + verbosity_ = 0 + end if + if (verbosity_ < 0) goto 9998 if (present(global)) then global_ = global else @@ -119,12 +126,14 @@ subroutine amg_c_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,prefix,global) end if else - write(iout_,*) trim(prefix_), ' Matrix:', lv%base_a%sizeof() - write(iout_,*) trim(prefix_), ' Descriptor:', lv%base_desc%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%sm2a)) write(iout_,*) trim(prefix_), ' Smoother 2:', lv%sm2a%sizeof() - if (allocated(lv%wrk)) write(iout_,*) trim(prefix_), ' Workspace:', lv%wrk%sizeof() + if ((me == 0).or.(verbosity_>0)) then + write(iout_,*) trim(prefix_), ' Matrix:', lv%base_a%sizeof() + write(iout_,*) trim(prefix_), ' Descriptor:', lv%base_desc%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%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 9998 continue diff --git a/amgprec/impl/level/amg_d_base_onelev_memory_use.f90 b/amgprec/impl/level/amg_d_base_onelev_memory_use.f90 index d2103de2..1e9bb9a9 100644 --- a/amgprec/impl/level/amg_d_base_onelev_memory_use.f90 +++ b/amgprec/impl/level/amg_d_base_onelev_memory_use.f90 @@ -42,7 +42,7 @@ ! 0: normal ! >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 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(in), optional :: iout character(len=*), intent(in), optional :: prefix + integer(psb_ipk_), intent(in), optional :: verbosity 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 integer(psb_ipk_) :: err_act ,me, np character(len=20), parameter :: name='amg_d_base_onelev_memory_use' - integer(psb_ipk_) :: iout_ + integer(psb_ipk_) :: iout_, verbosity_ logical :: coarse, global_ character(1024) :: prefix_ 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 end if + if (present(verbosity)) then + verbosity_ = verbosity + else + verbosity_ = 0 + end if + if (verbosity_ < 0) goto 9998 if (present(global)) then global_ = global else @@ -119,12 +126,14 @@ subroutine amg_d_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,prefix,global) end if else - write(iout_,*) trim(prefix_), ' Matrix:', lv%base_a%sizeof() - write(iout_,*) trim(prefix_), ' Descriptor:', lv%base_desc%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%sm2a)) write(iout_,*) trim(prefix_), ' Smoother 2:', lv%sm2a%sizeof() - if (allocated(lv%wrk)) write(iout_,*) trim(prefix_), ' Workspace:', lv%wrk%sizeof() + if ((me == 0).or.(verbosity_>0)) then + write(iout_,*) trim(prefix_), ' Matrix:', lv%base_a%sizeof() + write(iout_,*) trim(prefix_), ' Descriptor:', lv%base_desc%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%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 9998 continue diff --git a/amgprec/impl/level/amg_s_base_onelev_memory_use.f90 b/amgprec/impl/level/amg_s_base_onelev_memory_use.f90 index 759bdf1e..53be7406 100644 --- a/amgprec/impl/level/amg_s_base_onelev_memory_use.f90 +++ b/amgprec/impl/level/amg_s_base_onelev_memory_use.f90 @@ -42,7 +42,7 @@ ! 0: normal ! >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 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(in), optional :: iout character(len=*), intent(in), optional :: prefix + integer(psb_ipk_), intent(in), optional :: verbosity 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 integer(psb_ipk_) :: err_act ,me, np character(len=20), parameter :: name='amg_s_base_onelev_memory_use' - integer(psb_ipk_) :: iout_ + integer(psb_ipk_) :: iout_, verbosity_ logical :: coarse, global_ character(1024) :: prefix_ 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 end if + if (present(verbosity)) then + verbosity_ = verbosity + else + verbosity_ = 0 + end if + if (verbosity_ < 0) goto 9998 if (present(global)) then global_ = global else @@ -119,12 +126,14 @@ subroutine amg_s_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,prefix,global) end if else - write(iout_,*) trim(prefix_), ' Matrix:', lv%base_a%sizeof() - write(iout_,*) trim(prefix_), ' Descriptor:', lv%base_desc%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%sm2a)) write(iout_,*) trim(prefix_), ' Smoother 2:', lv%sm2a%sizeof() - if (allocated(lv%wrk)) write(iout_,*) trim(prefix_), ' Workspace:', lv%wrk%sizeof() + if ((me == 0).or.(verbosity_>0)) then + write(iout_,*) trim(prefix_), ' Matrix:', lv%base_a%sizeof() + write(iout_,*) trim(prefix_), ' Descriptor:', lv%base_desc%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%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 9998 continue diff --git a/amgprec/impl/level/amg_z_base_onelev_memory_use.f90 b/amgprec/impl/level/amg_z_base_onelev_memory_use.f90 index bb157814..cf9ddcbe 100644 --- a/amgprec/impl/level/amg_z_base_onelev_memory_use.f90 +++ b/amgprec/impl/level/amg_z_base_onelev_memory_use.f90 @@ -42,7 +42,7 @@ ! 0: normal ! >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 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(in), optional :: iout character(len=*), intent(in), optional :: prefix + integer(psb_ipk_), intent(in), optional :: verbosity 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 integer(psb_ipk_) :: err_act ,me, np character(len=20), parameter :: name='amg_z_base_onelev_memory_use' - integer(psb_ipk_) :: iout_ + integer(psb_ipk_) :: iout_, verbosity_ logical :: coarse, global_ character(1024) :: prefix_ 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 end if + if (present(verbosity)) then + verbosity_ = verbosity + else + verbosity_ = 0 + end if + if (verbosity_ < 0) goto 9998 if (present(global)) then global_ = global else @@ -119,12 +126,14 @@ subroutine amg_z_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,prefix,global) end if else - write(iout_,*) trim(prefix_), ' Matrix:', lv%base_a%sizeof() - write(iout_,*) trim(prefix_), ' Descriptor:', lv%base_desc%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%sm2a)) write(iout_,*) trim(prefix_), ' Smoother 2:', lv%sm2a%sizeof() - if (allocated(lv%wrk)) write(iout_,*) trim(prefix_), ' Workspace:', lv%wrk%sizeof() + if ((me == 0).or.(verbosity_>0)) then + write(iout_,*) trim(prefix_), ' Matrix:', lv%base_a%sizeof() + write(iout_,*) trim(prefix_), ' Descriptor:', lv%base_desc%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%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 9998 continue