From 4a7f9d786d60746547e2249bd1f8409b6b818ac8 Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Mon, 7 Feb 2022 09:10:30 +0100 Subject: [PATCH] Keep track of inner integer class for descriptor reassembly --- base/tools/psb_cspasb.f90 | 9 +++++++-- base/tools/psb_dspasb.f90 | 9 +++++++-- base/tools/psb_sspasb.f90 | 9 +++++++-- base/tools/psb_zspasb.f90 | 9 +++++++-- 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/base/tools/psb_cspasb.f90 b/base/tools/psb_cspasb.f90 index 6cec5fa7..390bdcaf 100644 --- a/base/tools/psb_cspasb.f90 +++ b/base/tools/psb_cspasb.f90 @@ -68,6 +68,7 @@ subroutine psb_cspasb(a,desc_a, info, afmt, upd, dupl, mold) integer(psb_ipk_) :: n_row,n_col integer(psb_ipk_) :: debug_level, debug_unit character(len=20) :: name, ch_err + class(psb_i_base_vect_type), allocatable :: ivm info = psb_success_ name = 'psb_spasb' @@ -120,7 +121,10 @@ subroutine psb_cspasb(a,desc_a, info, afmt, upd, dupl, mold) !!$ write(0,*) me,name,' Nz to be added',nz nzt = nz call psb_sum(ctxt,nzt) - if (nzt>0) call psb_cd_reinit(desc_a, info) + if (nzt>0) then + allocate(ivm, mold=desc_a%v_halo_index%v) + call psb_cd_reinit(desc_a, info) + end if if (nz > 0) then ! ! Should we check for new indices here? @@ -132,10 +136,11 @@ subroutine psb_cspasb(a,desc_a, info, afmt, upd, dupl, mold) !write(0,*) me,name,' Check before insert',a%get_nzeros() n_row = desc_a%get_local_rows() n_col = desc_a%get_local_cols() + call a%set_ncols(desc_a%get_local_cols()) call a%csput(nz,ila,jla,a_add%val,ione,n_row,ione,n_col,info) !write(0,*) me,name,' Check after insert',a%get_nzeros(),nz end if - if (nzt > 0) call psb_cdasb(desc_a,info) + if (nzt > 0) call psb_cdasb(desc_a,info,mold=ivm) end block end select diff --git a/base/tools/psb_dspasb.f90 b/base/tools/psb_dspasb.f90 index 422a8661..d82f5efe 100644 --- a/base/tools/psb_dspasb.f90 +++ b/base/tools/psb_dspasb.f90 @@ -68,6 +68,7 @@ subroutine psb_dspasb(a,desc_a, info, afmt, upd, dupl, mold) integer(psb_ipk_) :: n_row,n_col integer(psb_ipk_) :: debug_level, debug_unit character(len=20) :: name, ch_err + class(psb_i_base_vect_type), allocatable :: ivm info = psb_success_ name = 'psb_spasb' @@ -120,7 +121,10 @@ subroutine psb_dspasb(a,desc_a, info, afmt, upd, dupl, mold) !!$ write(0,*) me,name,' Nz to be added',nz nzt = nz call psb_sum(ctxt,nzt) - if (nzt>0) call psb_cd_reinit(desc_a, info) + if (nzt>0) then + allocate(ivm, mold=desc_a%v_halo_index%v) + call psb_cd_reinit(desc_a, info) + end if if (nz > 0) then ! ! Should we check for new indices here? @@ -132,10 +136,11 @@ subroutine psb_dspasb(a,desc_a, info, afmt, upd, dupl, mold) !write(0,*) me,name,' Check before insert',a%get_nzeros() n_row = desc_a%get_local_rows() n_col = desc_a%get_local_cols() + call a%set_ncols(desc_a%get_local_cols()) call a%csput(nz,ila,jla,a_add%val,ione,n_row,ione,n_col,info) !write(0,*) me,name,' Check after insert',a%get_nzeros(),nz end if - if (nzt > 0) call psb_cdasb(desc_a,info) + if (nzt > 0) call psb_cdasb(desc_a,info,mold=ivm) end block end select diff --git a/base/tools/psb_sspasb.f90 b/base/tools/psb_sspasb.f90 index d6de2136..87372d01 100644 --- a/base/tools/psb_sspasb.f90 +++ b/base/tools/psb_sspasb.f90 @@ -68,6 +68,7 @@ subroutine psb_sspasb(a,desc_a, info, afmt, upd, dupl, mold) integer(psb_ipk_) :: n_row,n_col integer(psb_ipk_) :: debug_level, debug_unit character(len=20) :: name, ch_err + class(psb_i_base_vect_type), allocatable :: ivm info = psb_success_ name = 'psb_spasb' @@ -120,7 +121,10 @@ subroutine psb_sspasb(a,desc_a, info, afmt, upd, dupl, mold) !!$ write(0,*) me,name,' Nz to be added',nz nzt = nz call psb_sum(ctxt,nzt) - if (nzt>0) call psb_cd_reinit(desc_a, info) + if (nzt>0) then + allocate(ivm, mold=desc_a%v_halo_index%v) + call psb_cd_reinit(desc_a, info) + end if if (nz > 0) then ! ! Should we check for new indices here? @@ -132,10 +136,11 @@ subroutine psb_sspasb(a,desc_a, info, afmt, upd, dupl, mold) !write(0,*) me,name,' Check before insert',a%get_nzeros() n_row = desc_a%get_local_rows() n_col = desc_a%get_local_cols() + call a%set_ncols(desc_a%get_local_cols()) call a%csput(nz,ila,jla,a_add%val,ione,n_row,ione,n_col,info) !write(0,*) me,name,' Check after insert',a%get_nzeros(),nz end if - if (nzt > 0) call psb_cdasb(desc_a,info) + if (nzt > 0) call psb_cdasb(desc_a,info,mold=ivm) end block end select diff --git a/base/tools/psb_zspasb.f90 b/base/tools/psb_zspasb.f90 index b343426d..9c42ae85 100644 --- a/base/tools/psb_zspasb.f90 +++ b/base/tools/psb_zspasb.f90 @@ -68,6 +68,7 @@ subroutine psb_zspasb(a,desc_a, info, afmt, upd, dupl, mold) integer(psb_ipk_) :: n_row,n_col integer(psb_ipk_) :: debug_level, debug_unit character(len=20) :: name, ch_err + class(psb_i_base_vect_type), allocatable :: ivm info = psb_success_ name = 'psb_spasb' @@ -120,7 +121,10 @@ subroutine psb_zspasb(a,desc_a, info, afmt, upd, dupl, mold) !!$ write(0,*) me,name,' Nz to be added',nz nzt = nz call psb_sum(ctxt,nzt) - if (nzt>0) call psb_cd_reinit(desc_a, info) + if (nzt>0) then + allocate(ivm, mold=desc_a%v_halo_index%v) + call psb_cd_reinit(desc_a, info) + end if if (nz > 0) then ! ! Should we check for new indices here? @@ -132,10 +136,11 @@ subroutine psb_zspasb(a,desc_a, info, afmt, upd, dupl, mold) !write(0,*) me,name,' Check before insert',a%get_nzeros() n_row = desc_a%get_local_rows() n_col = desc_a%get_local_cols() + call a%set_ncols(desc_a%get_local_cols()) call a%csput(nz,ila,jla,a_add%val,ione,n_row,ione,n_col,info) !write(0,*) me,name,' Check after insert',a%get_nzeros(),nz end if - if (nzt > 0) call psb_cdasb(desc_a,info) + if (nzt > 0) call psb_cdasb(desc_a,info,mold=ivm) end block end select