New global argument in sizeof()

newG2L
Salvatore Filippone 4 years ago
parent f6e01658b5
commit abf486077c

@ -385,14 +385,31 @@ contains
end subroutine psb_c_prec_free end subroutine psb_c_prec_free
function psb_cprec_sizeof(prec) result(val) function psb_cprec_sizeof(prec, global) result(val)
implicit none
class(psb_cprec_type), intent(in) :: prec class(psb_cprec_type), intent(in) :: prec
integer(psb_epk_) :: val logical, intent(in), optional :: global
integer(psb_ipk_) :: i 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 = 0
if (allocated(prec%prec)) then val = val + psb_sizeof_int
val = val + prec%prec%sizeof() if (allocated(prec%precv)) then
do i=1, size(prec%precv)
val = val + prec%precv(i)%sizeof()
end do
end if
if (global_) then
ctxt = prec%ctxt
call psb_sum(ctxt,val)
end if end if
end function psb_cprec_sizeof end function psb_cprec_sizeof

@ -385,14 +385,31 @@ contains
end subroutine psb_d_prec_free end subroutine psb_d_prec_free
function psb_dprec_sizeof(prec) result(val) function psb_dprec_sizeof(prec, global) result(val)
implicit none
class(psb_dprec_type), intent(in) :: prec class(psb_dprec_type), intent(in) :: prec
integer(psb_epk_) :: val logical, intent(in), optional :: global
integer(psb_ipk_) :: i 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 = 0
if (allocated(prec%prec)) then val = val + psb_sizeof_int
val = val + prec%prec%sizeof() if (allocated(prec%precv)) then
do i=1, size(prec%precv)
val = val + prec%precv(i)%sizeof()
end do
end if
if (global_) then
ctxt = prec%ctxt
call psb_sum(ctxt,val)
end if end if
end function psb_dprec_sizeof end function psb_dprec_sizeof

@ -385,14 +385,31 @@ contains
end subroutine psb_s_prec_free end subroutine psb_s_prec_free
function psb_sprec_sizeof(prec) result(val) function psb_sprec_sizeof(prec, global) result(val)
implicit none
class(psb_sprec_type), intent(in) :: prec class(psb_sprec_type), intent(in) :: prec
integer(psb_epk_) :: val logical, intent(in), optional :: global
integer(psb_ipk_) :: i 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 = 0
if (allocated(prec%prec)) then val = val + psb_sizeof_int
val = val + prec%prec%sizeof() if (allocated(prec%precv)) then
do i=1, size(prec%precv)
val = val + prec%precv(i)%sizeof()
end do
end if
if (global_) then
ctxt = prec%ctxt
call psb_sum(ctxt,val)
end if end if
end function psb_sprec_sizeof end function psb_sprec_sizeof

@ -385,14 +385,31 @@ contains
end subroutine psb_z_prec_free end subroutine psb_z_prec_free
function psb_zprec_sizeof(prec) result(val) function psb_zprec_sizeof(prec, global) result(val)
implicit none
class(psb_zprec_type), intent(in) :: prec class(psb_zprec_type), intent(in) :: prec
integer(psb_epk_) :: val logical, intent(in), optional :: global
integer(psb_ipk_) :: i 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 = 0
if (allocated(prec%prec)) then val = val + psb_sizeof_int
val = val + prec%prec%sizeof() if (allocated(prec%precv)) then
do i=1, size(prec%precv)
val = val + prec%precv(i)%sizeof()
end do
end if
if (global_) then
ctxt = prec%ctxt
call psb_sum(ctxt,val)
end if end if
end function psb_zprec_sizeof end function psb_zprec_sizeof

Loading…
Cancel
Save