*** empty log message ***

psblas3-submodules
Salvatore Filippone 11 years ago
parent 4102452f53
commit 7d4f17bf79

@ -52,107 +52,109 @@
! nrcv - integer Total receive buffer size on the calling process ! nrcv - integer Total receive buffer size on the calling process
! !
! !
subroutine psi_crea_index(desc_a,index_in,index_out,glob_idx,nxch,nsnd,nrcv,info) submodule (psi_i_mod) psi_crea_index_impl_mod
contains
use psb_realloc_mod subroutine psi_crea_index(desc_a,index_in,index_out,glob_idx,nxch,nsnd,nrcv,info)
use psb_desc_mod
use psb_error_mod use psb_realloc_mod
use psb_penv_mod use psb_desc_mod
use psi_mod, psb_protect_name => psi_crea_index use psb_error_mod
implicit none use psb_penv_mod
implicit none
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info,nxch,nsnd,nrcv type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(in) :: index_in(:) integer(psb_ipk_), intent(out) :: info,nxch,nsnd,nrcv
integer(psb_ipk_), allocatable, intent(inout) :: index_out(:) integer(psb_ipk_), intent(in) :: index_in(:)
logical :: glob_idx integer(psb_ipk_), allocatable, intent(inout) :: index_out(:)
logical :: glob_idx
! ....local scalars...
integer(psb_ipk_) :: ictxt, me, np, mode, err_act, dl_lda ! ....local scalars...
! ...parameters... integer(psb_ipk_) :: ictxt, me, np, mode, err_act, dl_lda
integer(psb_ipk_), allocatable :: dep_list(:,:), length_dl(:) ! ...parameters...
integer(psb_ipk_),parameter :: root=psb_root_,no_comm=-1 integer(psb_ipk_), allocatable :: dep_list(:,:), length_dl(:)
integer(psb_ipk_) :: debug_level, debug_unit integer(psb_ipk_),parameter :: root=psb_root_,no_comm=-1
character(len=20) :: name integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
info = psb_success_
name='psi_crea_index' info = psb_success_
call psb_erractionsave(err_act) name='psi_crea_index'
debug_unit = psb_get_debug_unit() call psb_erractionsave(err_act)
debug_level = psb_get_debug_level() debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
ictxt = desc_a%get_ctxt()
ictxt = desc_a%get_ctxt()
call psb_info(ictxt,me,np)
if (np == -1) then call psb_info(ictxt,me,np)
info = psb_err_context_error_ if (np == -1) then
call psb_errpush(info,name) info = psb_err_context_error_
goto 9999 call psb_errpush(info,name)
endif goto 9999
endif
! allocate dependency list
! This should be computed more efficiently to save space when ! allocate dependency list
! the number of processors becomes very high ! This should be computed more efficiently to save space when
dl_lda=np+1 ! the number of processors becomes very high
dl_lda=np+1
allocate(dep_list(max(1,dl_lda),0:np),length_dl(0:np),stat=info)
if (info /= psb_success_) then allocate(dep_list(max(1,dl_lda),0:np),length_dl(0:np),stat=info)
call psb_errpush(psb_err_from_subroutine_,name,a_err='Allocate') if (info /= psb_success_) then
goto 9999 call psb_errpush(psb_err_from_subroutine_,name,a_err='Allocate')
end if goto 9999
end if
! ...extract dependence list (ordered list of identifer process
! which every process must communcate with... ! ...extract dependence list (ordered list of identifer process
if (debug_level >= psb_debug_inner_) & ! which every process must communcate with...
& write(debug_unit,*) me,' ',trim(name),': calling extract_dep_list' if (debug_level >= psb_debug_inner_) &
mode = 1 & write(debug_unit,*) me,' ',trim(name),': calling extract_dep_list'
mode = 1
call psi_extract_dep_list(ictxt,&
& desc_a%is_bld(), desc_a%is_upd(),& call psi_extract_dep_list(ictxt,&
& index_in, dep_list,length_dl,np,max(1,dl_lda),mode,info) & desc_a%is_bld(), desc_a%is_upd(),&
if (info /= psb_success_) then & index_in, dep_list,length_dl,np,max(1,dl_lda),mode,info)
call psb_errpush(psb_err_from_subroutine_,name,a_err='extrct_dl') if (info /= psb_success_) then
goto 9999 call psb_errpush(psb_err_from_subroutine_,name,a_err='extrct_dl')
end if goto 9999
end if
if (debug_level >= psb_debug_inner_) &
& write(debug_unit,*) me,' ',trim(name),': from extract_dep_list',& if (debug_level >= psb_debug_inner_) &
& me,length_dl(0),index_in(1), ':',dep_list(:length_dl(me),me) & write(debug_unit,*) me,' ',trim(name),': from extract_dep_list',&
! ...now process root contains dependence list of all processes... & me,length_dl(0),index_in(1), ':',dep_list(:length_dl(me),me)
if (debug_level >= psb_debug_inner_) & ! ...now process root contains dependence list of all processes...
& write(debug_unit,*) me,' ',trim(name),': root sorting dep list' if (debug_level >= psb_debug_inner_) &
& write(debug_unit,*) me,' ',trim(name),': root sorting dep list'
call psi_dl_check(dep_list,max(1,dl_lda),np,length_dl)
call psi_dl_check(dep_list,max(1,dl_lda),np,length_dl)
! ....now i can sort dependency lists.
call psi_sort_dl(dep_list,length_dl,np,info) ! ....now i can sort dependency lists.
if(info /= psb_success_) then call psi_sort_dl(dep_list,length_dl,np,info)
call psb_errpush(psb_err_from_subroutine_,name,a_err='psi_sort_dl') if(info /= psb_success_) then
goto 9999 call psb_errpush(psb_err_from_subroutine_,name,a_err='psi_sort_dl')
end if goto 9999
end if
if(debug_level >= psb_debug_inner_)&
& write(debug_unit,*) me,' ',trim(name),': calling psi_desc_index' if(debug_level >= psb_debug_inner_)&
! Do the actual format conversion. & write(debug_unit,*) me,' ',trim(name),': calling psi_desc_index'
call psi_desc_index(desc_a,index_in,dep_list(1:,me),& ! Do the actual format conversion.
& length_dl(me),nsnd,nrcv, index_out,glob_idx,info) call psi_desc_index(desc_a,index_in,dep_list(1:,me),&
if(debug_level >= psb_debug_inner_) & & length_dl(me),nsnd,nrcv, index_out,glob_idx,info)
& write(debug_unit,*) me,' ',trim(name),': out of psi_desc_index',& if(debug_level >= psb_debug_inner_) &
& size(index_out) & write(debug_unit,*) me,' ',trim(name),': out of psi_desc_index',&
nxch = length_dl(me) & size(index_out)
if(info /= psb_success_) then nxch = length_dl(me)
call psb_errpush(psb_err_from_subroutine_,name,a_err='psi_desc_index') if(info /= psb_success_) then
goto 9999 call psb_errpush(psb_err_from_subroutine_,name,a_err='psi_desc_index')
end if goto 9999
end if
deallocate(dep_list,length_dl)
if(debug_level >= psb_debug_inner_) & deallocate(dep_list,length_dl)
& write(debug_unit,*) me,' ',trim(name),': done' if(debug_level >= psb_debug_inner_) &
& write(debug_unit,*) me,' ',trim(name),': done'
call psb_erractionrestore(err_act)
return call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(ictxt,err_act) 9999 call psb_error_handler(ictxt,err_act)
return return
end subroutine psi_crea_index end subroutine psi_crea_index
end submodule psi_crea_index_impl_mod

Loading…
Cancel
Save