psblas2-dev:

base/internals/psi_idx_ins_cnv.f90
 base/modules/psb_desc_type.f90
 base/tools/psb_cd_inloc.f90
 base/tools/psb_cdals.f90
 base/tools/psb_cdalv.f90
	

Performance fix: avoid loop to figure out current position in
halo_index inside psi_idx_ins_cnv.
psblas3-type-indexed
Salvatore Filippone 17 years ago
parent 2be7dcc2dc
commit a019113d24

@ -214,6 +214,7 @@ subroutine psi_idx_ins_cnv2(nv,idxin,idxout,desc,info,mask)
integer :: i,ictxt,k,mglob, nglob integer :: i,ictxt,k,mglob, nglob
integer :: np, me, isize integer :: np, me, isize
integer :: pnt_halo,nrow,ncol, nh, ip, err_act,lip,nxt integer :: pnt_halo,nrow,ncol, nh, ip, err_act,lip,nxt
logical :: pnth_ok
integer, parameter :: relocsz=200 integer, parameter :: relocsz=200
character(len=20) :: name,ch_err character(len=20) :: name,ch_err
logical, pointer :: mask_(:) logical, pointer :: mask_(:)
@ -319,11 +320,26 @@ subroutine psi_idx_ins_cnv2(nv,idxin,idxout,desc,info,mask)
if (.not.allocated(desc%halo_index)) then if (.not.allocated(desc%halo_index)) then
allocate(desc%halo_index(relocsz)) allocate(desc%halo_index(relocsz))
desc%halo_index(:) = -1 desc%halo_index(:) = -1
desc%matrix_data(psb_pnt_h_) = 1
endif endif
pnt_halo=1 pnt_halo = desc%matrix_data(psb_pnt_h_)
do while (desc%halo_index(pnt_halo) /= -1 )
pnt_halo = pnt_halo + 1 pnth_ok = .false.
end do if (desc%halo_index(pnt_halo) == -1 ) then
if (pnt_halo == 1) then
pnth_ok = .true.
else if (desc%halo_index(pnt_halo-1) /= -1 ) then
pnth_ok = .true.
end if
end if
if (.not.pnth_ok) then
pnt_halo = 1
do while (desc%halo_index(pnt_halo) /= -1 )
pnt_halo = pnt_halo + 1
end do
end if
isize = size(desc%halo_index) isize = size(desc%halo_index)
do i = 1, nv do i = 1, nv
@ -377,7 +393,7 @@ subroutine psi_idx_ins_cnv2(nv,idxin,idxout,desc,info,mask)
idxout(i) = -1 idxout(i) = -1
end if end if
enddo enddo
desc%matrix_data(psb_pnt_h_) = pnt_halo
end if end if
desc%matrix_data(psb_n_col_) = ncol desc%matrix_data(psb_n_col_) = ncol

@ -66,23 +66,28 @@ module psb_descriptor_type
! !
! Entries and values in desc%matrix_data ! Entries and values in desc%matrix_data
! !
integer, parameter :: psb_dec_type_=1, psb_m_=2,psb_n_=3 integer, parameter :: psb_dec_type_ = 1
integer, parameter :: psb_n_row_=4, psb_n_col_=5,psb_ctxt_=6 integer, parameter :: psb_m_ = 2
integer, parameter :: psb_desc_size_=7 integer, parameter :: psb_n_ = 3
integer, parameter :: psb_mpi_c_=9 integer, parameter :: psb_n_row_ = 4
integer, parameter :: psb_thal_xch_=11 integer, parameter :: psb_n_col_ = 5
integer, parameter :: psb_thal_snd_=12 integer, parameter :: psb_ctxt_ = 6
integer, parameter :: psb_thal_rcv_=13 integer, parameter :: psb_desc_size_ = 7
integer, parameter :: psb_tovr_xch_=14 integer, parameter :: psb_mpi_c_ = 9
integer, parameter :: psb_tovr_snd_=15 integer, parameter :: psb_pnt_h_ = 10
integer, parameter :: psb_tovr_rcv_=16 integer, parameter :: psb_thal_xch_ = 11
integer, parameter :: psb_text_xch_=17 integer, parameter :: psb_thal_snd_ = 12
integer, parameter :: psb_text_snd_=18 integer, parameter :: psb_thal_rcv_ = 13
integer, parameter :: psb_text_rcv_=19 integer, parameter :: psb_tovr_xch_ = 14
integer, parameter :: psb_tmov_xch_=20 integer, parameter :: psb_tovr_snd_ = 15
integer, parameter :: psb_tmov_snd_=21 integer, parameter :: psb_tovr_rcv_ = 16
integer, parameter :: psb_tmov_rcv_=22 integer, parameter :: psb_text_xch_ = 17
integer, parameter :: psb_mdata_size_=24 integer, parameter :: psb_text_snd_ = 18
integer, parameter :: psb_text_rcv_ = 19
integer, parameter :: psb_tmov_xch_ = 20
integer, parameter :: psb_tmov_snd_ = 21
integer, parameter :: psb_tmov_rcv_ = 22
integer, parameter :: psb_mdata_size_= 24
integer, parameter :: psb_desc_asb_=3099 integer, parameter :: psb_desc_asb_=3099
integer, parameter :: psb_desc_bld_=psb_desc_asb_+1 integer, parameter :: psb_desc_bld_=psb_desc_asb_+1
integer, parameter :: psb_desc_repl_=3199 integer, parameter :: psb_desc_repl_=3199

@ -354,15 +354,17 @@ subroutine psb_cd_inloc(v, ictxt, desc, info)
desc%matrix_data(psb_n_row_) = loc_row desc%matrix_data(psb_n_row_) = loc_row
desc%matrix_data(psb_n_col_) = loc_row desc%matrix_data(psb_n_col_) = loc_row
call psb_realloc(1,desc%halo_index, info) call psb_realloc(max(1,loc_row/2),desc%halo_index, info)
if (info == 0) call psb_realloc(1,desc%ext_index, info) if (info == 0) call psb_realloc(1,desc%ext_index, info)
if (info /= 0) then if (info /= 0) then
info=4010 info=4010
call psb_errpush(info,name,a_err='psb_realloc') call psb_errpush(info,name,a_err='psb_realloc')
Goto 9999 Goto 9999
end if end if
desc%halo_index(:) = -1 desc%matrix_data(psb_pnt_h_) = 1
desc%ext_index(:) = -1 desc%halo_index(:) = -1
desc%ext_index(:) = -1
if (debug_level >= psb_debug_ext_) & if (debug_level >= psb_debug_ext_) &
& write(debug_unit,*) me,' ',trim(name),': end' & write(debug_unit,*) me,' ',trim(name),': end'

@ -168,6 +168,7 @@ subroutine psb_cdals(m, n, parts, ictxt, desc, info)
! hashed by the low order bits of the entries. ! hashed by the low order bits of the entries.
! !
loc_col = (m+np-1)/np loc_col = (m+np-1)/np
loc_col = min(2*loc_col,m)
allocate(desc%loc_to_glob(loc_col), desc%lprm(1),& allocate(desc%loc_to_glob(loc_col), desc%lprm(1),&
& desc%ptree(2),stat=info) & desc%ptree(2),stat=info)
if (info == 0) call InitPairSearchTree(desc%ptree,info) if (info == 0) call InitPairSearchTree(desc%ptree,info)
@ -380,15 +381,16 @@ subroutine psb_cdals(m, n, parts, ictxt, desc, info)
desc%matrix_data(psb_n_row_) = loc_row desc%matrix_data(psb_n_row_) = loc_row
desc%matrix_data(psb_n_col_) = loc_row desc%matrix_data(psb_n_col_) = loc_row
call psb_realloc(1,desc%halo_index, info) call psb_realloc(max(1,loc_row/2),desc%halo_index, info)
if (info == 0) call psb_realloc(1,desc%ext_index, info) if (info == 0) call psb_realloc(1,desc%ext_index, info)
if (info /= 0) then if (info /= 0) then
info=4010 info=4010
call psb_errpush(info,name,a_err='psb_realloc') call psb_errpush(info,name,a_err='psb_realloc')
Goto 9999 Goto 9999
end if end if
desc%halo_index(:) = -1 desc%matrix_data(psb_pnt_h_) = 1
desc%ext_index(:) = -1 desc%halo_index(:) = -1
desc%ext_index(:) = -1
call psb_cd_set_bld(desc,info) call psb_cd_set_bld(desc,info)

@ -314,21 +314,16 @@ subroutine psb_cdalv(v, ictxt, desc, info, flag)
desc%matrix_data(psb_n_row_) = loc_row desc%matrix_data(psb_n_row_) = loc_row
desc%matrix_data(psb_n_col_) = loc_row desc%matrix_data(psb_n_col_) = loc_row
call psb_realloc(1,desc%halo_index, info) call psb_realloc(max(1,loc_row/2),desc%halo_index, info)
if (info /= psb_no_err_) then if (info == 0) call psb_realloc(1,desc%ext_index, info)
if (info /= 0) then
info=4010 info=4010
call psb_errpush(err,name,a_err='psb_realloc') call psb_errpush(info,name,a_err='psb_realloc')
Goto 9999 Goto 9999
end if end if
desc%halo_index(:) = -1 desc%matrix_data(psb_pnt_h_) = 1
desc%halo_index(:) = -1
call psb_realloc(1,desc%ext_index, info) desc%ext_index(:) = -1
if (info /= psb_no_err_) then
info=4010
call psb_errpush(err,name,a_err='psb_realloc')
Goto 9999
end if
desc%ext_index(:) = -1
call psb_cd_set_bld(desc,info) call psb_cd_set_bld(desc,info)

Loading…
Cancel
Save