From 8f8337e59ec076e37f67eca63ef0c5181b3bfa4b Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Wed, 3 Feb 2016 15:33:04 +0000 Subject: [PATCH] psblas-3.3-maint: base/tools/psb_ccdbldext.F90 base/tools/psb_dcdbldext.F90 base/tools/psb_scdbldext.F90 base/tools/psb_zcdbldext.F90 Allow for empyt input matrices in BLDEXT --- base/tools/psb_ccdbldext.F90 | 12 ++++-------- base/tools/psb_dcdbldext.F90 | 12 ++++-------- base/tools/psb_scdbldext.F90 | 12 ++++-------- base/tools/psb_zcdbldext.F90 | 12 ++++-------- 4 files changed, 16 insertions(+), 32 deletions(-) diff --git a/base/tools/psb_ccdbldext.F90 b/base/tools/psb_ccdbldext.F90 index ba54d5f2..57a805d1 100644 --- a/base/tools/psb_ccdbldext.F90 +++ b/base/tools/psb_ccdbldext.F90 @@ -177,9 +177,8 @@ Subroutine psb_ccdbldext(a,desc_a,novr,desc_ov,info, extype) ! in a separate method. call psb_cd_switch_ovl_indxmap(desc_ov,info) end if - if (info == 0) call desc_ov%indxmap%reinit(info) - if (info == 0) call psb_cd_set_ovl_bld(desc_ov,info) - if (info /= 0) goto 9999 + + call psb_cd_set_ovl_bld(desc_ov,info) If (debug_level >= psb_debug_outer_)then Write(debug_unit,*) me,' ',trim(name),& @@ -191,15 +190,12 @@ Subroutine psb_ccdbldext(a,desc_a,novr,desc_ov,info, extype) ! LOVR= (NNZ/NROW)*N_HALO*NOVR This assumes that the local average ! nonzeros per row is the same as the global. ! - nztot = a%get_nzeros() + ! Allow for zero-szied matrices. + nztot = max(ione,a%get_nzeros()) if (nztot>0) then lovr = ((nztot+m-1)/m)*nhalo*novr lworks = ((nztot+m-1)/m)*nhalo lworkr = ((nztot+m-1)/m)*nhalo - else - info = -1 - call psb_errpush(info,name) - goto 9999 endif If (debug_level >= psb_debug_outer_)& & Write(debug_unit,*) me,' ',trim(name),':ovr_est done',novr,lovr diff --git a/base/tools/psb_dcdbldext.F90 b/base/tools/psb_dcdbldext.F90 index 9da792a0..3bd5e65d 100644 --- a/base/tools/psb_dcdbldext.F90 +++ b/base/tools/psb_dcdbldext.F90 @@ -177,9 +177,8 @@ Subroutine psb_dcdbldext(a,desc_a,novr,desc_ov,info, extype) ! in a separate method. call psb_cd_switch_ovl_indxmap(desc_ov,info) end if - if (info == 0) call desc_ov%indxmap%reinit(info) - if (info == 0) call psb_cd_set_ovl_bld(desc_ov,info) - if (info /= 0) goto 9999 + + call psb_cd_set_ovl_bld(desc_ov,info) If (debug_level >= psb_debug_outer_)then Write(debug_unit,*) me,' ',trim(name),& @@ -191,15 +190,12 @@ Subroutine psb_dcdbldext(a,desc_a,novr,desc_ov,info, extype) ! LOVR= (NNZ/NROW)*N_HALO*NOVR This assumes that the local average ! nonzeros per row is the same as the global. ! - nztot = a%get_nzeros() + ! Allow for zero-szied matrices. + nztot = max(ione,a%get_nzeros()) if (nztot>0) then lovr = ((nztot+m-1)/m)*nhalo*novr lworks = ((nztot+m-1)/m)*nhalo lworkr = ((nztot+m-1)/m)*nhalo - else - info = -1 - call psb_errpush(info,name) - goto 9999 endif If (debug_level >= psb_debug_outer_)& & Write(debug_unit,*) me,' ',trim(name),':ovr_est done',novr,lovr diff --git a/base/tools/psb_scdbldext.F90 b/base/tools/psb_scdbldext.F90 index 46afc061..b917cfc8 100644 --- a/base/tools/psb_scdbldext.F90 +++ b/base/tools/psb_scdbldext.F90 @@ -177,9 +177,8 @@ Subroutine psb_scdbldext(a,desc_a,novr,desc_ov,info, extype) ! in a separate method. call psb_cd_switch_ovl_indxmap(desc_ov,info) end if - if (info == 0) call desc_ov%indxmap%reinit(info) - if (info == 0) call psb_cd_set_ovl_bld(desc_ov,info) - if (info /= 0) goto 9999 + + call psb_cd_set_ovl_bld(desc_ov,info) If (debug_level >= psb_debug_outer_)then Write(debug_unit,*) me,' ',trim(name),& @@ -191,15 +190,12 @@ Subroutine psb_scdbldext(a,desc_a,novr,desc_ov,info, extype) ! LOVR= (NNZ/NROW)*N_HALO*NOVR This assumes that the local average ! nonzeros per row is the same as the global. ! - nztot = a%get_nzeros() + ! Allow for zero-szied matrices. + nztot = max(ione,a%get_nzeros()) if (nztot>0) then lovr = ((nztot+m-1)/m)*nhalo*novr lworks = ((nztot+m-1)/m)*nhalo lworkr = ((nztot+m-1)/m)*nhalo - else - info = -1 - call psb_errpush(info,name) - goto 9999 endif If (debug_level >= psb_debug_outer_)& & Write(debug_unit,*) me,' ',trim(name),':ovr_est done',novr,lovr diff --git a/base/tools/psb_zcdbldext.F90 b/base/tools/psb_zcdbldext.F90 index 306cb512..28137494 100644 --- a/base/tools/psb_zcdbldext.F90 +++ b/base/tools/psb_zcdbldext.F90 @@ -177,9 +177,8 @@ Subroutine psb_zcdbldext(a,desc_a,novr,desc_ov,info, extype) ! in a separate method. call psb_cd_switch_ovl_indxmap(desc_ov,info) end if - if (info == 0) call desc_ov%indxmap%reinit(info) - if (info == 0) call psb_cd_set_ovl_bld(desc_ov,info) - if (info /= 0) goto 9999 + + call psb_cd_set_ovl_bld(desc_ov,info) If (debug_level >= psb_debug_outer_)then Write(debug_unit,*) me,' ',trim(name),& @@ -191,15 +190,12 @@ Subroutine psb_zcdbldext(a,desc_a,novr,desc_ov,info, extype) ! LOVR= (NNZ/NROW)*N_HALO*NOVR This assumes that the local average ! nonzeros per row is the same as the global. ! - nztot = a%get_nzeros() + ! Allow for zero-szied matrices. + nztot = max(ione,a%get_nzeros()) if (nztot>0) then lovr = ((nztot+m-1)/m)*nhalo*novr lworks = ((nztot+m-1)/m)*nhalo lworkr = ((nztot+m-1)/m)*nhalo - else - info = -1 - call psb_errpush(info,name) - goto 9999 endif If (debug_level >= psb_debug_outer_)& & Write(debug_unit,*) me,' ',trim(name),':ovr_est done',novr,lovr