From 15a92d2f614a80443015fe614f5d99f0036c3ab4 Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Wed, 28 Aug 2013 13:30:01 +0000 Subject: [PATCH] psblas-399: base/tools/psb_csphalo.F90 base/tools/psb_dsphalo.F90 base/tools/psb_ssphalo.F90 base/tools/psb_zsphalo.F90 Use V_HALO_INDEX instead of halo_index. --- base/tools/psb_csphalo.F90 | 32 +++++++++++++++++++------------- base/tools/psb_dsphalo.F90 | 32 +++++++++++++++++++------------- base/tools/psb_ssphalo.F90 | 32 +++++++++++++++++++------------- base/tools/psb_zsphalo.F90 | 32 +++++++++++++++++++------------- 4 files changed, 76 insertions(+), 52 deletions(-) diff --git a/base/tools/psb_csphalo.F90 b/base/tools/psb_csphalo.F90 index 6dcb741e..6f785eb1 100644 --- a/base/tools/psb_csphalo.F90 +++ b/base/tools/psb_csphalo.F90 @@ -87,6 +87,8 @@ Subroutine psb_csphalo(a,desc_a,blk,info,rowcnv,colcnv,& complex(psb_spk_), allocatable :: valsnd(:) type(psb_c_coo_sparse_mat), allocatable :: acoo integer(psb_ipk_), pointer :: idxv(:) + class(psb_i_base_vect_type), pointer :: pdxv + integer(psb_ipk_), allocatable :: ipdxv(:) logical :: rowcnv_,colcnv_,rowscale_,colscale_ character(len=5) :: outfmt_ integer(psb_ipk_) :: debug_level, debug_unit @@ -158,12 +160,11 @@ Subroutine psb_csphalo(a,desc_a,blk,info,rowcnv,colcnv,& goto 9999 end select - call desc_a%get_list(data_,idxv,totxch,nxs,nxr,info) - l1 = 0 sdsz(:)=0 rvsz(:)=0 + l1 = 0 ipx = 1 brvindx(ipx) = 0 bsdindx(ipx) = 0 @@ -171,17 +172,22 @@ Subroutine psb_csphalo(a,desc_a,blk,info,rowcnv,colcnv,& idx = 0 idxs = 0 idxr = 0 + call acoo%allocate(izero,a%get_ncols(),info) + + + call desc_a%get_list(data_,pdxv,totxch,nxr,nxs,info) + ipdxv = pdxv%get_vect() ! For all rows in the halo descriptor, extract and send/receive. Do - proc=idxv(counter) + proc=ipdxv(counter) if (proc == -1) exit - n_el_recv = idxv(counter+psb_n_elem_recv_) + n_el_recv = ipdxv(counter+psb_n_elem_recv_) counter = counter+n_el_recv - n_el_send = idxv(counter+psb_n_elem_send_) + n_el_send = ipdxv(counter+psb_n_elem_send_) tot_elem = 0 Do j=0,n_el_send-1 - idx = idxv(counter+psb_elem_send_+j) + idx = ipdxv(counter+psb_elem_send_+j) n_elem = a%get_nz_row(idx) tot_elem = tot_elem+n_elem Enddo @@ -203,11 +209,11 @@ Subroutine psb_csphalo(a,desc_a,blk,info,rowcnv,colcnv,& idxr = 0 counter = 1 Do - proc=idxv(counter) + proc=ipdxv(counter) if (proc == -1) exit - n_el_recv = idxv(counter+psb_n_elem_recv_) + n_el_recv = ipdxv(counter+psb_n_elem_recv_) counter = counter+n_el_recv - n_el_send = idxv(counter+psb_n_elem_send_) + n_el_send = ipdxv(counter+psb_n_elem_send_) bsdindx(proc+1) = idxs idxs = idxs + sdsz(proc+1) @@ -240,14 +246,14 @@ Subroutine psb_csphalo(a,desc_a,blk,info,rowcnv,colcnv,& tot_elem=0 Do - proc=idxv(counter) + proc=ipdxv(counter) if (proc == -1) exit - n_el_recv=idxv(counter+psb_n_elem_recv_) + n_el_recv=ipdxv(counter+psb_n_elem_recv_) counter=counter+n_el_recv - n_el_send=idxv(counter+psb_n_elem_send_) + n_el_send=ipdxv(counter+psb_n_elem_send_) Do j=0,n_el_send-1 - idx = idxv(counter+psb_elem_send_+j) + idx = ipdxv(counter+psb_elem_send_+j) n_elem = a%get_nz_row(idx) call a%csget(idx,idx,ngtz,iasnd,jasnd,valsnd,info,& & append=.true.,nzin=tot_elem) diff --git a/base/tools/psb_dsphalo.F90 b/base/tools/psb_dsphalo.F90 index 1d31d078..97e9464c 100644 --- a/base/tools/psb_dsphalo.F90 +++ b/base/tools/psb_dsphalo.F90 @@ -87,6 +87,8 @@ Subroutine psb_dsphalo(a,desc_a,blk,info,rowcnv,colcnv,& real(psb_dpk_), allocatable :: valsnd(:) type(psb_d_coo_sparse_mat), allocatable :: acoo integer(psb_ipk_), pointer :: idxv(:) + class(psb_i_base_vect_type), pointer :: pdxv + integer(psb_ipk_), allocatable :: ipdxv(:) logical :: rowcnv_,colcnv_,rowscale_,colscale_ character(len=5) :: outfmt_ integer(psb_ipk_) :: debug_level, debug_unit @@ -158,12 +160,11 @@ Subroutine psb_dsphalo(a,desc_a,blk,info,rowcnv,colcnv,& goto 9999 end select - call desc_a%get_list(data_,idxv,totxch,nxs,nxr,info) - l1 = 0 sdsz(:)=0 rvsz(:)=0 + l1 = 0 ipx = 1 brvindx(ipx) = 0 bsdindx(ipx) = 0 @@ -171,17 +172,22 @@ Subroutine psb_dsphalo(a,desc_a,blk,info,rowcnv,colcnv,& idx = 0 idxs = 0 idxr = 0 + call acoo%allocate(izero,a%get_ncols(),info) + + + call desc_a%get_list(data_,pdxv,totxch,nxr,nxs,info) + ipdxv = pdxv%get_vect() ! For all rows in the halo descriptor, extract and send/receive. Do - proc=idxv(counter) + proc=ipdxv(counter) if (proc == -1) exit - n_el_recv = idxv(counter+psb_n_elem_recv_) + n_el_recv = ipdxv(counter+psb_n_elem_recv_) counter = counter+n_el_recv - n_el_send = idxv(counter+psb_n_elem_send_) + n_el_send = ipdxv(counter+psb_n_elem_send_) tot_elem = 0 Do j=0,n_el_send-1 - idx = idxv(counter+psb_elem_send_+j) + idx = ipdxv(counter+psb_elem_send_+j) n_elem = a%get_nz_row(idx) tot_elem = tot_elem+n_elem Enddo @@ -203,11 +209,11 @@ Subroutine psb_dsphalo(a,desc_a,blk,info,rowcnv,colcnv,& idxr = 0 counter = 1 Do - proc=idxv(counter) + proc=ipdxv(counter) if (proc == -1) exit - n_el_recv = idxv(counter+psb_n_elem_recv_) + n_el_recv = ipdxv(counter+psb_n_elem_recv_) counter = counter+n_el_recv - n_el_send = idxv(counter+psb_n_elem_send_) + n_el_send = ipdxv(counter+psb_n_elem_send_) bsdindx(proc+1) = idxs idxs = idxs + sdsz(proc+1) @@ -240,14 +246,14 @@ Subroutine psb_dsphalo(a,desc_a,blk,info,rowcnv,colcnv,& tot_elem=0 Do - proc=idxv(counter) + proc=ipdxv(counter) if (proc == -1) exit - n_el_recv=idxv(counter+psb_n_elem_recv_) + n_el_recv=ipdxv(counter+psb_n_elem_recv_) counter=counter+n_el_recv - n_el_send=idxv(counter+psb_n_elem_send_) + n_el_send=ipdxv(counter+psb_n_elem_send_) Do j=0,n_el_send-1 - idx = idxv(counter+psb_elem_send_+j) + idx = ipdxv(counter+psb_elem_send_+j) n_elem = a%get_nz_row(idx) call a%csget(idx,idx,ngtz,iasnd,jasnd,valsnd,info,& & append=.true.,nzin=tot_elem) diff --git a/base/tools/psb_ssphalo.F90 b/base/tools/psb_ssphalo.F90 index 4fb6b910..3bc3f9aa 100644 --- a/base/tools/psb_ssphalo.F90 +++ b/base/tools/psb_ssphalo.F90 @@ -87,6 +87,8 @@ Subroutine psb_ssphalo(a,desc_a,blk,info,rowcnv,colcnv,& real(psb_spk_), allocatable :: valsnd(:) type(psb_s_coo_sparse_mat), allocatable :: acoo integer(psb_ipk_), pointer :: idxv(:) + class(psb_i_base_vect_type), pointer :: pdxv + integer(psb_ipk_), allocatable :: ipdxv(:) logical :: rowcnv_,colcnv_,rowscale_,colscale_ character(len=5) :: outfmt_ integer(psb_ipk_) :: debug_level, debug_unit @@ -158,12 +160,11 @@ Subroutine psb_ssphalo(a,desc_a,blk,info,rowcnv,colcnv,& goto 9999 end select - call desc_a%get_list(data_,idxv,totxch,nxs,nxr,info) - l1 = 0 sdsz(:)=0 rvsz(:)=0 + l1 = 0 ipx = 1 brvindx(ipx) = 0 bsdindx(ipx) = 0 @@ -171,17 +172,22 @@ Subroutine psb_ssphalo(a,desc_a,blk,info,rowcnv,colcnv,& idx = 0 idxs = 0 idxr = 0 + call acoo%allocate(izero,a%get_ncols(),info) + + + call desc_a%get_list(data_,pdxv,totxch,nxr,nxs,info) + ipdxv = pdxv%get_vect() ! For all rows in the halo descriptor, extract and send/receive. Do - proc=idxv(counter) + proc=ipdxv(counter) if (proc == -1) exit - n_el_recv = idxv(counter+psb_n_elem_recv_) + n_el_recv = ipdxv(counter+psb_n_elem_recv_) counter = counter+n_el_recv - n_el_send = idxv(counter+psb_n_elem_send_) + n_el_send = ipdxv(counter+psb_n_elem_send_) tot_elem = 0 Do j=0,n_el_send-1 - idx = idxv(counter+psb_elem_send_+j) + idx = ipdxv(counter+psb_elem_send_+j) n_elem = a%get_nz_row(idx) tot_elem = tot_elem+n_elem Enddo @@ -203,11 +209,11 @@ Subroutine psb_ssphalo(a,desc_a,blk,info,rowcnv,colcnv,& idxr = 0 counter = 1 Do - proc=idxv(counter) + proc=ipdxv(counter) if (proc == -1) exit - n_el_recv = idxv(counter+psb_n_elem_recv_) + n_el_recv = ipdxv(counter+psb_n_elem_recv_) counter = counter+n_el_recv - n_el_send = idxv(counter+psb_n_elem_send_) + n_el_send = ipdxv(counter+psb_n_elem_send_) bsdindx(proc+1) = idxs idxs = idxs + sdsz(proc+1) @@ -240,14 +246,14 @@ Subroutine psb_ssphalo(a,desc_a,blk,info,rowcnv,colcnv,& tot_elem=0 Do - proc=idxv(counter) + proc=ipdxv(counter) if (proc == -1) exit - n_el_recv=idxv(counter+psb_n_elem_recv_) + n_el_recv=ipdxv(counter+psb_n_elem_recv_) counter=counter+n_el_recv - n_el_send=idxv(counter+psb_n_elem_send_) + n_el_send=ipdxv(counter+psb_n_elem_send_) Do j=0,n_el_send-1 - idx = idxv(counter+psb_elem_send_+j) + idx = ipdxv(counter+psb_elem_send_+j) n_elem = a%get_nz_row(idx) call a%csget(idx,idx,ngtz,iasnd,jasnd,valsnd,info,& & append=.true.,nzin=tot_elem) diff --git a/base/tools/psb_zsphalo.F90 b/base/tools/psb_zsphalo.F90 index dbd9c512..48bc9004 100644 --- a/base/tools/psb_zsphalo.F90 +++ b/base/tools/psb_zsphalo.F90 @@ -87,6 +87,8 @@ Subroutine psb_zsphalo(a,desc_a,blk,info,rowcnv,colcnv,& complex(psb_dpk_), allocatable :: valsnd(:) type(psb_z_coo_sparse_mat), allocatable :: acoo integer(psb_ipk_), pointer :: idxv(:) + class(psb_i_base_vect_type), pointer :: pdxv + integer(psb_ipk_), allocatable :: ipdxv(:) logical :: rowcnv_,colcnv_,rowscale_,colscale_ character(len=5) :: outfmt_ integer(psb_ipk_) :: debug_level, debug_unit @@ -158,12 +160,11 @@ Subroutine psb_zsphalo(a,desc_a,blk,info,rowcnv,colcnv,& goto 9999 end select - call desc_a%get_list(data_,idxv,totxch,nxs,nxr,info) - l1 = 0 sdsz(:)=0 rvsz(:)=0 + l1 = 0 ipx = 1 brvindx(ipx) = 0 bsdindx(ipx) = 0 @@ -171,17 +172,22 @@ Subroutine psb_zsphalo(a,desc_a,blk,info,rowcnv,colcnv,& idx = 0 idxs = 0 idxr = 0 + call acoo%allocate(izero,a%get_ncols(),info) + + + call desc_a%get_list(data_,pdxv,totxch,nxr,nxs,info) + ipdxv = pdxv%get_vect() ! For all rows in the halo descriptor, extract and send/receive. Do - proc=idxv(counter) + proc=ipdxv(counter) if (proc == -1) exit - n_el_recv = idxv(counter+psb_n_elem_recv_) + n_el_recv = ipdxv(counter+psb_n_elem_recv_) counter = counter+n_el_recv - n_el_send = idxv(counter+psb_n_elem_send_) + n_el_send = ipdxv(counter+psb_n_elem_send_) tot_elem = 0 Do j=0,n_el_send-1 - idx = idxv(counter+psb_elem_send_+j) + idx = ipdxv(counter+psb_elem_send_+j) n_elem = a%get_nz_row(idx) tot_elem = tot_elem+n_elem Enddo @@ -203,11 +209,11 @@ Subroutine psb_zsphalo(a,desc_a,blk,info,rowcnv,colcnv,& idxr = 0 counter = 1 Do - proc=idxv(counter) + proc=ipdxv(counter) if (proc == -1) exit - n_el_recv = idxv(counter+psb_n_elem_recv_) + n_el_recv = ipdxv(counter+psb_n_elem_recv_) counter = counter+n_el_recv - n_el_send = idxv(counter+psb_n_elem_send_) + n_el_send = ipdxv(counter+psb_n_elem_send_) bsdindx(proc+1) = idxs idxs = idxs + sdsz(proc+1) @@ -240,14 +246,14 @@ Subroutine psb_zsphalo(a,desc_a,blk,info,rowcnv,colcnv,& tot_elem=0 Do - proc=idxv(counter) + proc=ipdxv(counter) if (proc == -1) exit - n_el_recv=idxv(counter+psb_n_elem_recv_) + n_el_recv=ipdxv(counter+psb_n_elem_recv_) counter=counter+n_el_recv - n_el_send=idxv(counter+psb_n_elem_send_) + n_el_send=ipdxv(counter+psb_n_elem_send_) Do j=0,n_el_send-1 - idx = idxv(counter+psb_elem_send_+j) + idx = ipdxv(counter+psb_elem_send_+j) n_elem = a%get_nz_row(idx) call a%csget(idx,idx,ngtz,iasnd,jasnd,valsnd,info,& & append=.true.,nzin=tot_elem)