diff --git a/amgprec/amg_c_onelev_mod.f90 b/amgprec/amg_c_onelev_mod.f90 index 3a980ff3..f5411e45 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, 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, & & psb_clinmap_type, psb_spk_, amg_c_onelev_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(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 end interface diff --git a/amgprec/amg_c_prec_type.f90 b/amgprec/amg_c_prec_type.f90 index 1afdad53..2ce58807 100644 --- a/amgprec/amg_c_prec_type.f90 +++ b/amgprec/amg_c_prec_type.f90 @@ -173,7 +173,7 @@ module amg_c_prec_type 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_ implicit none ! Arguments @@ -183,6 +183,7 @@ module amg_c_prec_type integer(psb_ipk_), intent(in), optional :: root integer(psb_ipk_), intent(in), optional :: verbosity character(len=*), intent(in), optional :: prefix + logical, intent(in), optional :: global end subroutine amg_cfile_prec_memory_use end interface diff --git a/amgprec/amg_d_onelev_mod.f90 b/amgprec/amg_d_onelev_mod.f90 index 3f21a2a6..f7e7f678 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, 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, & & psb_dlinmap_type, psb_dpk_, amg_d_onelev_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(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 end interface diff --git a/amgprec/amg_d_prec_type.f90 b/amgprec/amg_d_prec_type.f90 index 90f5a2a8..e2c48cc2 100644 --- a/amgprec/amg_d_prec_type.f90 +++ b/amgprec/amg_d_prec_type.f90 @@ -173,7 +173,7 @@ module amg_d_prec_type 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_ implicit none ! Arguments @@ -183,6 +183,7 @@ module amg_d_prec_type integer(psb_ipk_), intent(in), optional :: root integer(psb_ipk_), intent(in), optional :: verbosity character(len=*), intent(in), optional :: prefix + logical, intent(in), optional :: global end subroutine amg_dfile_prec_memory_use end interface diff --git a/amgprec/amg_s_onelev_mod.f90 b/amgprec/amg_s_onelev_mod.f90 index 9019c643..d6651396 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, 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, & & psb_slinmap_type, psb_spk_, amg_s_onelev_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(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 end interface diff --git a/amgprec/amg_s_prec_type.f90 b/amgprec/amg_s_prec_type.f90 index 246e763c..e64703bc 100644 --- a/amgprec/amg_s_prec_type.f90 +++ b/amgprec/amg_s_prec_type.f90 @@ -173,7 +173,7 @@ module amg_s_prec_type 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_ implicit none ! Arguments @@ -183,6 +183,7 @@ module amg_s_prec_type integer(psb_ipk_), intent(in), optional :: root integer(psb_ipk_), intent(in), optional :: verbosity character(len=*), intent(in), optional :: prefix + logical, intent(in), optional :: global end subroutine amg_sfile_prec_memory_use end interface diff --git a/amgprec/amg_z_onelev_mod.f90 b/amgprec/amg_z_onelev_mod.f90 index 538ea9fa..16d59e44 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, 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, & & psb_zlinmap_type, psb_dpk_, amg_z_onelev_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(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 end interface diff --git a/amgprec/amg_z_prec_type.f90 b/amgprec/amg_z_prec_type.f90 index 1d1addc6..adeecf23 100644 --- a/amgprec/amg_z_prec_type.f90 +++ b/amgprec/amg_z_prec_type.f90 @@ -173,7 +173,7 @@ module amg_z_prec_type 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_ implicit none ! Arguments @@ -183,6 +183,7 @@ module amg_z_prec_type integer(psb_ipk_), intent(in), optional :: root integer(psb_ipk_), intent(in), optional :: verbosity character(len=*), intent(in), optional :: prefix + logical, intent(in), optional :: global end subroutine amg_zfile_prec_memory_use end interface diff --git a/amgprec/impl/amg_cfile_prec_memory_use.f90 b/amgprec/impl/amg_cfile_prec_memory_use.f90 index b71cefe2..d92539f1 100644 --- a/amgprec/impl/amg_cfile_prec_memory_use.f90 +++ b/amgprec/impl/amg_cfile_prec_memory_use.f90 @@ -65,7 +65,7 @@ ! 0: normal ! >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 amg_c_prec_mod, amg_protect_name => amg_cfile_prec_memory_use 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 :: verbosity character(len=*), intent(in), optional :: prefix + logical, intent(in), optional :: global ! Local variables @@ -88,6 +89,7 @@ subroutine amg_cfile_prec_memory_use(prec,info,iout,root, verbosity,prefix) logical :: is_symgs character(len=20), parameter :: name='amg_file_prec_memory_use' integer(psb_ipk_) :: iout_, root_, verbosity_ + logical :: global_ character(1024) :: prefix_ info = psb_success_ @@ -103,17 +105,24 @@ subroutine amg_cfile_prec_memory_use(prec,info,iout,root, verbosity,prefix) verbosity_ = 0 end if if (verbosity_ < 0) goto 9998 - if (present(prefix)) then - prefix_ = prefix - else - prefix_ = "" - end if - + ctxt = prec%ctxt - + call psb_info(ctxt,me,np) + prefix_ = "" + if (verbosity == 0) then + if (present(prefix)) then + prefix_ = prefix + end if + else if (verbosity > 0) then + if (present(prefix)) then + write(prefix_,'(a,a,i5,a)') prefix,' from process ',me,': ' + else + write(prefix_,'(a,i5,a)') 'Process ',me,': ' + end if + + end if if (allocated(prec%precv)) then - call psb_info(ctxt,me,np) if (present(root)) then root_ = root else @@ -122,23 +131,31 @@ subroutine amg_cfile_prec_memory_use(prec,info,iout,root, verbosity,prefix) 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 - ! preconditioner have the same values on all the procs (this is - ! ensured by amg_precbld). - ! - if (me == root_) then + if (verbosity_ == 0) then + ! + if (me == root_) then - write(iout_,*) - 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_,verbosity=verbosity,prefix=prefix) + & iout=iout_,prefix=trim(prefix_),global=global) end do end if - end if + else write(iout_,*) trim(name), & & ': Error: no base preconditioner available, something is wrong!' diff --git a/amgprec/impl/amg_dfile_prec_memory_use.f90 b/amgprec/impl/amg_dfile_prec_memory_use.f90 index 9eb63c8b..20878ad0 100644 --- a/amgprec/impl/amg_dfile_prec_memory_use.f90 +++ b/amgprec/impl/amg_dfile_prec_memory_use.f90 @@ -65,7 +65,7 @@ ! 0: normal ! >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 amg_d_prec_mod, amg_protect_name => amg_dfile_prec_memory_use 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 :: verbosity character(len=*), intent(in), optional :: prefix + logical, intent(in), optional :: global ! Local variables @@ -88,6 +89,7 @@ subroutine amg_dfile_prec_memory_use(prec,info,iout,root, verbosity,prefix) logical :: is_symgs character(len=20), parameter :: name='amg_file_prec_memory_use' integer(psb_ipk_) :: iout_, root_, verbosity_ + logical :: global_ character(1024) :: prefix_ info = psb_success_ @@ -103,17 +105,24 @@ subroutine amg_dfile_prec_memory_use(prec,info,iout,root, verbosity,prefix) verbosity_ = 0 end if if (verbosity_ < 0) goto 9998 - if (present(prefix)) then - prefix_ = prefix - else - prefix_ = "" - end if - + ctxt = prec%ctxt - + call psb_info(ctxt,me,np) + prefix_ = "" + if (verbosity == 0) then + if (present(prefix)) then + prefix_ = prefix + end if + else if (verbosity > 0) then + if (present(prefix)) then + write(prefix_,'(a,a,i5,a)') prefix,' from process ',me,': ' + else + write(prefix_,'(a,i5,a)') 'Process ',me,': ' + end if + + end if if (allocated(prec%precv)) then - call psb_info(ctxt,me,np) if (present(root)) then root_ = root else @@ -122,23 +131,31 @@ subroutine amg_dfile_prec_memory_use(prec,info,iout,root, verbosity,prefix) 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 - ! preconditioner have the same values on all the procs (this is - ! ensured by amg_precbld). - ! - if (me == root_) then + if (verbosity_ == 0) then + ! + if (me == root_) then - write(iout_,*) - 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_,verbosity=verbosity,prefix=prefix) + & iout=iout_,prefix=trim(prefix_),global=global) end do end if - end if + else write(iout_,*) trim(name), & & ': Error: no base preconditioner available, something is wrong!' diff --git a/amgprec/impl/amg_sfile_prec_memory_use.f90 b/amgprec/impl/amg_sfile_prec_memory_use.f90 index 49373233..9a0622ce 100644 --- a/amgprec/impl/amg_sfile_prec_memory_use.f90 +++ b/amgprec/impl/amg_sfile_prec_memory_use.f90 @@ -65,7 +65,7 @@ ! 0: normal ! >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 amg_s_prec_mod, amg_protect_name => amg_sfile_prec_memory_use 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 :: verbosity character(len=*), intent(in), optional :: prefix + logical, intent(in), optional :: global ! Local variables @@ -88,6 +89,7 @@ subroutine amg_sfile_prec_memory_use(prec,info,iout,root, verbosity,prefix) logical :: is_symgs character(len=20), parameter :: name='amg_file_prec_memory_use' integer(psb_ipk_) :: iout_, root_, verbosity_ + logical :: global_ character(1024) :: prefix_ info = psb_success_ @@ -103,17 +105,24 @@ subroutine amg_sfile_prec_memory_use(prec,info,iout,root, verbosity,prefix) verbosity_ = 0 end if if (verbosity_ < 0) goto 9998 - if (present(prefix)) then - prefix_ = prefix - else - prefix_ = "" - end if - + ctxt = prec%ctxt - + call psb_info(ctxt,me,np) + prefix_ = "" + if (verbosity == 0) then + if (present(prefix)) then + prefix_ = prefix + end if + else if (verbosity > 0) then + if (present(prefix)) then + write(prefix_,'(a,a,i5,a)') prefix,' from process ',me,': ' + else + write(prefix_,'(a,i5,a)') 'Process ',me,': ' + end if + + end if if (allocated(prec%precv)) then - call psb_info(ctxt,me,np) if (present(root)) then root_ = root else @@ -122,23 +131,31 @@ subroutine amg_sfile_prec_memory_use(prec,info,iout,root, verbosity,prefix) 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 - ! preconditioner have the same values on all the procs (this is - ! ensured by amg_precbld). - ! - if (me == root_) then + if (verbosity_ == 0) then + ! + if (me == root_) then - write(iout_,*) - 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_,verbosity=verbosity,prefix=prefix) + & iout=iout_,prefix=trim(prefix_),global=global) end do end if - end if + else write(iout_,*) trim(name), & & ': Error: no base preconditioner available, something is wrong!' diff --git a/amgprec/impl/amg_zfile_prec_memory_use.f90 b/amgprec/impl/amg_zfile_prec_memory_use.f90 index 3657e9a5..c36635b4 100644 --- a/amgprec/impl/amg_zfile_prec_memory_use.f90 +++ b/amgprec/impl/amg_zfile_prec_memory_use.f90 @@ -65,7 +65,7 @@ ! 0: normal ! >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 amg_z_prec_mod, amg_protect_name => amg_zfile_prec_memory_use 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 :: verbosity character(len=*), intent(in), optional :: prefix + logical, intent(in), optional :: global ! Local variables @@ -88,6 +89,7 @@ subroutine amg_zfile_prec_memory_use(prec,info,iout,root, verbosity,prefix) logical :: is_symgs character(len=20), parameter :: name='amg_file_prec_memory_use' integer(psb_ipk_) :: iout_, root_, verbosity_ + logical :: global_ character(1024) :: prefix_ info = psb_success_ @@ -103,17 +105,24 @@ subroutine amg_zfile_prec_memory_use(prec,info,iout,root, verbosity,prefix) verbosity_ = 0 end if if (verbosity_ < 0) goto 9998 - if (present(prefix)) then - prefix_ = prefix - else - prefix_ = "" - end if - + ctxt = prec%ctxt - + call psb_info(ctxt,me,np) + prefix_ = "" + if (verbosity == 0) then + if (present(prefix)) then + prefix_ = prefix + end if + else if (verbosity > 0) then + if (present(prefix)) then + write(prefix_,'(a,a,i5,a)') prefix,' from process ',me,': ' + else + write(prefix_,'(a,i5,a)') 'Process ',me,': ' + end if + + end if if (allocated(prec%precv)) then - call psb_info(ctxt,me,np) if (present(root)) then root_ = root else @@ -122,23 +131,31 @@ subroutine amg_zfile_prec_memory_use(prec,info,iout,root, verbosity,prefix) 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 - ! preconditioner have the same values on all the procs (this is - ! ensured by amg_precbld). - ! - if (me == root_) then + if (verbosity_ == 0) then + ! + if (me == root_) then - write(iout_,*) - 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_,verbosity=verbosity,prefix=prefix) + & iout=iout_,prefix=trim(prefix_),global=global) end do end if - end if + else write(iout_,*) trim(name), & & ': Error: no base preconditioner available, something is wrong!' 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 517c3892..5163a95a 100644 --- a/amgprec/impl/level/amg_c_base_onelev_memory_use.f90 +++ b/amgprec/impl/level/amg_c_base_onelev_memory_use.f90 @@ -42,8 +42,8 @@ ! 0: normal ! >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 amg_c_onelev_mod, amg_protect_name => amg_c_base_onelev_memory_use Implicit None @@ -52,21 +52,25 @@ 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(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 ! 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' - integer(psb_ipk_) :: iout_, verbosity_ - logical :: coarse + integer(psb_ipk_) :: iout_ + logical :: coarse, global_ character(1024) :: prefix_ + integer(psb_epk_), allocatable :: sz(:) call psb_erractionsave(err_act) - + ctxt = lv%base_desc%get_ctxt() + call psb_info(ctxt,me,np) + coarse = (il==nl) if (present(iout)) then @@ -74,34 +78,54 @@ subroutine amg_c_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,verbosity,prefi else iout_ = psb_out_unit end if - - if (present(verbosity)) then - verbosity_ = verbosity + + if (present(global)) then + global_ = global else - verbosity_ = 0 + global_ = .false. + end if + + if (present(prefix)) then + prefix_ = prefix + else + prefix_ = "" end if - if (verbosity_ < 0) goto 9998 - if (present(prefix)) then - prefix_ = prefix - else - prefix_ = "" - end if write(iout_,*) trim(prefix_) - + if (coarse) then write(iout_,*) trim(prefix_), ' Level ',il,' (coarse)' else write(iout_,*) trim(prefix_), ' Level ',il end if - - 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 (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_), ' 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() + endif 9998 continue call psb_erractionrestore(err_act) 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 d339d3a9..d2103de2 100644 --- a/amgprec/impl/level/amg_d_base_onelev_memory_use.f90 +++ b/amgprec/impl/level/amg_d_base_onelev_memory_use.f90 @@ -42,8 +42,8 @@ ! 0: normal ! >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 amg_d_onelev_mod, amg_protect_name => amg_d_base_onelev_memory_use Implicit None @@ -52,21 +52,25 @@ 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(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 ! 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' - integer(psb_ipk_) :: iout_, verbosity_ - logical :: coarse + integer(psb_ipk_) :: iout_ + logical :: coarse, global_ character(1024) :: prefix_ + integer(psb_epk_), allocatable :: sz(:) call psb_erractionsave(err_act) - + ctxt = lv%base_desc%get_ctxt() + call psb_info(ctxt,me,np) + coarse = (il==nl) if (present(iout)) then @@ -74,34 +78,54 @@ subroutine amg_d_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,verbosity,prefi else iout_ = psb_out_unit end if - - if (present(verbosity)) then - verbosity_ = verbosity + + if (present(global)) then + global_ = global else - verbosity_ = 0 + global_ = .false. + end if + + if (present(prefix)) then + prefix_ = prefix + else + prefix_ = "" end if - if (verbosity_ < 0) goto 9998 - if (present(prefix)) then - prefix_ = prefix - else - prefix_ = "" - end if write(iout_,*) trim(prefix_) - + if (coarse) then write(iout_,*) trim(prefix_), ' Level ',il,' (coarse)' else write(iout_,*) trim(prefix_), ' Level ',il end if - - 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 (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_), ' 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() + endif 9998 continue call psb_erractionrestore(err_act) 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 a8c130e6..759bdf1e 100644 --- a/amgprec/impl/level/amg_s_base_onelev_memory_use.f90 +++ b/amgprec/impl/level/amg_s_base_onelev_memory_use.f90 @@ -42,8 +42,8 @@ ! 0: normal ! >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 amg_s_onelev_mod, amg_protect_name => amg_s_base_onelev_memory_use Implicit None @@ -52,21 +52,25 @@ 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(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 ! 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' - integer(psb_ipk_) :: iout_, verbosity_ - logical :: coarse + integer(psb_ipk_) :: iout_ + logical :: coarse, global_ character(1024) :: prefix_ + integer(psb_epk_), allocatable :: sz(:) call psb_erractionsave(err_act) - + ctxt = lv%base_desc%get_ctxt() + call psb_info(ctxt,me,np) + coarse = (il==nl) if (present(iout)) then @@ -74,34 +78,54 @@ subroutine amg_s_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,verbosity,prefi else iout_ = psb_out_unit end if - - if (present(verbosity)) then - verbosity_ = verbosity + + if (present(global)) then + global_ = global else - verbosity_ = 0 + global_ = .false. + end if + + if (present(prefix)) then + prefix_ = prefix + else + prefix_ = "" end if - if (verbosity_ < 0) goto 9998 - if (present(prefix)) then - prefix_ = prefix - else - prefix_ = "" - end if write(iout_,*) trim(prefix_) - + if (coarse) then write(iout_,*) trim(prefix_), ' Level ',il,' (coarse)' else write(iout_,*) trim(prefix_), ' Level ',il end if - - 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 (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_), ' 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() + endif 9998 continue call psb_erractionrestore(err_act) 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 db73ac0b..bb157814 100644 --- a/amgprec/impl/level/amg_z_base_onelev_memory_use.f90 +++ b/amgprec/impl/level/amg_z_base_onelev_memory_use.f90 @@ -42,8 +42,8 @@ ! 0: normal ! >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 amg_z_onelev_mod, amg_protect_name => amg_z_base_onelev_memory_use Implicit None @@ -52,21 +52,25 @@ 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(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 ! 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' - integer(psb_ipk_) :: iout_, verbosity_ - logical :: coarse + integer(psb_ipk_) :: iout_ + logical :: coarse, global_ character(1024) :: prefix_ + integer(psb_epk_), allocatable :: sz(:) call psb_erractionsave(err_act) - + ctxt = lv%base_desc%get_ctxt() + call psb_info(ctxt,me,np) + coarse = (il==nl) if (present(iout)) then @@ -74,34 +78,54 @@ subroutine amg_z_base_onelev_memory_use(lv,il,nl,ilmin,info,iout,verbosity,prefi else iout_ = psb_out_unit end if - - if (present(verbosity)) then - verbosity_ = verbosity + + if (present(global)) then + global_ = global else - verbosity_ = 0 + global_ = .false. + end if + + if (present(prefix)) then + prefix_ = prefix + else + prefix_ = "" end if - if (verbosity_ < 0) goto 9998 - if (present(prefix)) then - prefix_ = prefix - else - prefix_ = "" - end if write(iout_,*) trim(prefix_) - + if (coarse) then write(iout_,*) trim(prefix_), ' Level ',il,' (coarse)' else write(iout_,*) trim(prefix_), ' Level ',il end if - - 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 (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_), ' 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() + endif 9998 continue call psb_erractionrestore(err_act)