Add support for size statistics

This commit is contained in:
Salvatore Filippone
2021-02-18 14:59:50 +01:00
parent 08f3de57f0
commit 583ca19e9c
5 changed files with 65 additions and 10 deletions
+13 -2
View File
@@ -43,6 +43,8 @@ module psb_base_linmap_mod
type psb_base_linmap_type
integer(psb_ipk_) :: kind
integer(psb_lpk_) :: nagmin, nagmax, nagtot
real(psb_dpk_) :: nagavg
integer(psb_lpk_), allocatable :: iaggr(:), naggr(:)
type(psb_desc_type), pointer :: p_desc_U=>null(), p_desc_V=>null()
type(psb_desc_type) :: desc_U, desc_V
@@ -162,7 +164,11 @@ contains
type(psb_base_linmap_type), intent(inout) :: mapin,mapout
integer(psb_ipk_), intent(out) :: info
mapout%kind = mapin%kind
mapout%kind = mapin%kind
mapout%nagmin = mapin%nagmin
mapout%nagmax = mapin%nagmax
mapout%nagavg = mapin%nagavg
mapout%nagtot = mapin%nagtot
call psb_move_alloc(mapin%iaggr,mapout%iaggr,info)
call psb_move_alloc(mapin%naggr,mapout%naggr,info)
mapout%p_desc_U => mapin%p_desc_U
@@ -184,7 +190,12 @@ contains
class(psb_base_linmap_type), intent(inout) :: mapout
integer(psb_ipk_) :: info
mapout%kind = map%kind
mapout%kind = map%kind
mapout%nagmin = map%nagmin
mapout%nagmax = map%nagmax
mapout%nagavg = map%nagavg
mapout%nagtot = map%nagtot
call psb_safe_ab_cpy(map%iaggr,mapout%iaggr,info)
call psb_safe_ab_cpy(map%naggr,mapout%naggr,info)
mapout%p_desc_U => map%p_desc_U
+13 -2
View File
@@ -407,19 +407,22 @@ function psb_c_linmap(map_kind,desc_U, desc_V, mat_U2V, mat_V2U,iaggr,naggr) &
integer(psb_lpk_), intent(in), optional :: iaggr(:), naggr(:)
!
integer(psb_ipk_) :: info
integer(psb_ipk_) :: me, np
character(len=20), parameter :: name='psb_linmap'
type(psb_ctxt_type) :: ctxt
info = psb_success_
select case(map_kind)
case (psb_map_aggr_)
! OK
if (psb_is_ok_desc(desc_U)) then
if (desc_U%is_ok()) then
this%p_desc_U=>desc_U
ctxt = desc_U%get_ctxt()
else
info = psb_err_invalid_cd_state_
endif
if (psb_is_ok_desc(desc_V)) then
if (desc_V%is_ok()) then
this%p_desc_V=>desc_V
else
info = psb_err_invalid_cd_state_
@@ -443,6 +446,7 @@ function psb_c_linmap(map_kind,desc_U, desc_V, mat_U2V, mat_V2U,iaggr,naggr) &
if (desc_U%is_ok()) then
call desc_U%clone(this%desc_U,info)
ctxt = desc_U%get_ctxt()
else
info = psb_err_invalid_cd_state_
endif
@@ -482,4 +486,11 @@ function psb_c_linmap(map_kind,desc_U, desc_V, mat_U2V, mat_V2U,iaggr,naggr) &
return
end if
call psb_info(ctxt,me,np)
this%nagmin = minval(this%naggr)
this%nagmax = maxval(this%naggr)
this%nagtot = sum(this%naggr)
this%nagavg = this%nagtot
this%nagavg = this%nagavg/np
end function psb_c_linmap
+13 -2
View File
@@ -407,19 +407,22 @@ function psb_d_linmap(map_kind,desc_U, desc_V, mat_U2V, mat_V2U,iaggr,naggr) &
integer(psb_lpk_), intent(in), optional :: iaggr(:), naggr(:)
!
integer(psb_ipk_) :: info
integer(psb_ipk_) :: me, np
character(len=20), parameter :: name='psb_linmap'
type(psb_ctxt_type) :: ctxt
info = psb_success_
select case(map_kind)
case (psb_map_aggr_)
! OK
if (psb_is_ok_desc(desc_U)) then
if (desc_U%is_ok()) then
this%p_desc_U=>desc_U
ctxt = desc_U%get_ctxt()
else
info = psb_err_invalid_cd_state_
endif
if (psb_is_ok_desc(desc_V)) then
if (desc_V%is_ok()) then
this%p_desc_V=>desc_V
else
info = psb_err_invalid_cd_state_
@@ -443,6 +446,7 @@ function psb_d_linmap(map_kind,desc_U, desc_V, mat_U2V, mat_V2U,iaggr,naggr) &
if (desc_U%is_ok()) then
call desc_U%clone(this%desc_U,info)
ctxt = desc_U%get_ctxt()
else
info = psb_err_invalid_cd_state_
endif
@@ -482,4 +486,11 @@ function psb_d_linmap(map_kind,desc_U, desc_V, mat_U2V, mat_V2U,iaggr,naggr) &
return
end if
call psb_info(ctxt,me,np)
this%nagmin = minval(this%naggr)
this%nagmax = maxval(this%naggr)
this%nagtot = sum(this%naggr)
this%nagavg = this%nagtot
this%nagavg = this%nagavg/np
end function psb_d_linmap
+13 -2
View File
@@ -407,19 +407,22 @@ function psb_s_linmap(map_kind,desc_U, desc_V, mat_U2V, mat_V2U,iaggr,naggr) &
integer(psb_lpk_), intent(in), optional :: iaggr(:), naggr(:)
!
integer(psb_ipk_) :: info
integer(psb_ipk_) :: me, np
character(len=20), parameter :: name='psb_linmap'
type(psb_ctxt_type) :: ctxt
info = psb_success_
select case(map_kind)
case (psb_map_aggr_)
! OK
if (psb_is_ok_desc(desc_U)) then
if (desc_U%is_ok()) then
this%p_desc_U=>desc_U
ctxt = desc_U%get_ctxt()
else
info = psb_err_invalid_cd_state_
endif
if (psb_is_ok_desc(desc_V)) then
if (desc_V%is_ok()) then
this%p_desc_V=>desc_V
else
info = psb_err_invalid_cd_state_
@@ -443,6 +446,7 @@ function psb_s_linmap(map_kind,desc_U, desc_V, mat_U2V, mat_V2U,iaggr,naggr) &
if (desc_U%is_ok()) then
call desc_U%clone(this%desc_U,info)
ctxt = desc_U%get_ctxt()
else
info = psb_err_invalid_cd_state_
endif
@@ -482,4 +486,11 @@ function psb_s_linmap(map_kind,desc_U, desc_V, mat_U2V, mat_V2U,iaggr,naggr) &
return
end if
call psb_info(ctxt,me,np)
this%nagmin = minval(this%naggr)
this%nagmax = maxval(this%naggr)
this%nagtot = sum(this%naggr)
this%nagavg = this%nagtot
this%nagavg = this%nagavg/np
end function psb_s_linmap
+13 -2
View File
@@ -407,19 +407,22 @@ function psb_z_linmap(map_kind,desc_U, desc_V, mat_U2V, mat_V2U,iaggr,naggr) &
integer(psb_lpk_), intent(in), optional :: iaggr(:), naggr(:)
!
integer(psb_ipk_) :: info
integer(psb_ipk_) :: me, np
character(len=20), parameter :: name='psb_linmap'
type(psb_ctxt_type) :: ctxt
info = psb_success_
select case(map_kind)
case (psb_map_aggr_)
! OK
if (psb_is_ok_desc(desc_U)) then
if (desc_U%is_ok()) then
this%p_desc_U=>desc_U
ctxt = desc_U%get_ctxt()
else
info = psb_err_invalid_cd_state_
endif
if (psb_is_ok_desc(desc_V)) then
if (desc_V%is_ok()) then
this%p_desc_V=>desc_V
else
info = psb_err_invalid_cd_state_
@@ -443,6 +446,7 @@ function psb_z_linmap(map_kind,desc_U, desc_V, mat_U2V, mat_V2U,iaggr,naggr) &
if (desc_U%is_ok()) then
call desc_U%clone(this%desc_U,info)
ctxt = desc_U%get_ctxt()
else
info = psb_err_invalid_cd_state_
endif
@@ -482,4 +486,11 @@ function psb_z_linmap(map_kind,desc_U, desc_V, mat_U2V, mat_V2U,iaggr,naggr) &
return
end if
call psb_info(ctxt,me,np)
this%nagmin = minval(this%naggr)
this%nagmax = maxval(this%naggr)
this%nagtot = sum(this%naggr)
this%nagavg = this%nagtot
this%nagavg = this%nagavg/np
end function psb_z_linmap