mirror of
https://github.com/sfilippone/amg4psblas.git
synced 2026-10-06 22:55:12 +00:00
New global option for sizeof()
This commit is contained in:
@@ -425,11 +425,22 @@ contains
|
||||
end if
|
||||
end function amg_c_get_nzeros
|
||||
|
||||
function amg_cprec_sizeof(prec) result(val)
|
||||
function amg_cprec_sizeof(prec, global) result(val)
|
||||
implicit none
|
||||
class(amg_cprec_type), intent(in) :: prec
|
||||
integer(psb_epk_) :: val
|
||||
logical, intent(in), optional :: global
|
||||
integer(psb_epk_) :: val
|
||||
integer(psb_ipk_) :: i
|
||||
type(psb_ctxt_type) :: ctxt
|
||||
|
||||
logical :: global_
|
||||
|
||||
if (present(global)) then
|
||||
global_ = global
|
||||
else
|
||||
global_ = .false.
|
||||
end if
|
||||
|
||||
val = 0
|
||||
val = val + psb_sizeof_ip
|
||||
if (allocated(prec%precv)) then
|
||||
@@ -437,6 +448,11 @@ contains
|
||||
val = val + prec%precv(i)%sizeof()
|
||||
end do
|
||||
end if
|
||||
if (global_) then
|
||||
ctxt = prec%ctxt
|
||||
call psb_sum(ctxt,val)
|
||||
end if
|
||||
|
||||
end function amg_cprec_sizeof
|
||||
|
||||
!
|
||||
|
||||
@@ -425,11 +425,22 @@ contains
|
||||
end if
|
||||
end function amg_d_get_nzeros
|
||||
|
||||
function amg_dprec_sizeof(prec) result(val)
|
||||
function amg_dprec_sizeof(prec, global) result(val)
|
||||
implicit none
|
||||
class(amg_dprec_type), intent(in) :: prec
|
||||
integer(psb_epk_) :: val
|
||||
logical, intent(in), optional :: global
|
||||
integer(psb_epk_) :: val
|
||||
integer(psb_ipk_) :: i
|
||||
type(psb_ctxt_type) :: ctxt
|
||||
|
||||
logical :: global_
|
||||
|
||||
if (present(global)) then
|
||||
global_ = global
|
||||
else
|
||||
global_ = .false.
|
||||
end if
|
||||
|
||||
val = 0
|
||||
val = val + psb_sizeof_ip
|
||||
if (allocated(prec%precv)) then
|
||||
@@ -437,6 +448,11 @@ contains
|
||||
val = val + prec%precv(i)%sizeof()
|
||||
end do
|
||||
end if
|
||||
if (global_) then
|
||||
ctxt = prec%ctxt
|
||||
call psb_sum(ctxt,val)
|
||||
end if
|
||||
|
||||
end function amg_dprec_sizeof
|
||||
|
||||
!
|
||||
|
||||
@@ -425,11 +425,22 @@ contains
|
||||
end if
|
||||
end function amg_s_get_nzeros
|
||||
|
||||
function amg_sprec_sizeof(prec) result(val)
|
||||
function amg_sprec_sizeof(prec, global) result(val)
|
||||
implicit none
|
||||
class(amg_sprec_type), intent(in) :: prec
|
||||
integer(psb_epk_) :: val
|
||||
logical, intent(in), optional :: global
|
||||
integer(psb_epk_) :: val
|
||||
integer(psb_ipk_) :: i
|
||||
type(psb_ctxt_type) :: ctxt
|
||||
|
||||
logical :: global_
|
||||
|
||||
if (present(global)) then
|
||||
global_ = global
|
||||
else
|
||||
global_ = .false.
|
||||
end if
|
||||
|
||||
val = 0
|
||||
val = val + psb_sizeof_ip
|
||||
if (allocated(prec%precv)) then
|
||||
@@ -437,6 +448,11 @@ contains
|
||||
val = val + prec%precv(i)%sizeof()
|
||||
end do
|
||||
end if
|
||||
if (global_) then
|
||||
ctxt = prec%ctxt
|
||||
call psb_sum(ctxt,val)
|
||||
end if
|
||||
|
||||
end function amg_sprec_sizeof
|
||||
|
||||
!
|
||||
|
||||
@@ -425,11 +425,22 @@ contains
|
||||
end if
|
||||
end function amg_z_get_nzeros
|
||||
|
||||
function amg_zprec_sizeof(prec) result(val)
|
||||
function amg_zprec_sizeof(prec, global) result(val)
|
||||
implicit none
|
||||
class(amg_zprec_type), intent(in) :: prec
|
||||
integer(psb_epk_) :: val
|
||||
logical, intent(in), optional :: global
|
||||
integer(psb_epk_) :: val
|
||||
integer(psb_ipk_) :: i
|
||||
type(psb_ctxt_type) :: ctxt
|
||||
|
||||
logical :: global_
|
||||
|
||||
if (present(global)) then
|
||||
global_ = global
|
||||
else
|
||||
global_ = .false.
|
||||
end if
|
||||
|
||||
val = 0
|
||||
val = val + psb_sizeof_ip
|
||||
if (allocated(prec%precv)) then
|
||||
@@ -437,6 +448,11 @@ contains
|
||||
val = val + prec%precv(i)%sizeof()
|
||||
end do
|
||||
end if
|
||||
if (global_) then
|
||||
ctxt = prec%ctxt
|
||||
call psb_sum(ctxt,val)
|
||||
end if
|
||||
|
||||
end function amg_zprec_sizeof
|
||||
|
||||
!
|
||||
|
||||
Reference in New Issue
Block a user