|
|
@ -41,7 +41,7 @@
|
|
|
|
! nnz - integer(optional). The number of nonzeroes in the matrix.
|
|
|
|
! nnz - integer(optional). The number of nonzeroes in the matrix.
|
|
|
|
! (local, user estimate)
|
|
|
|
! (local, user estimate)
|
|
|
|
!
|
|
|
|
!
|
|
|
|
subroutine psb_cspalloc(a, desc_a, info, nnz)
|
|
|
|
subroutine psb_cspalloc(a, desc_a, info, nnz, bldmode)
|
|
|
|
use psb_base_mod, psb_protect_name => psb_cspalloc
|
|
|
|
use psb_base_mod, psb_protect_name => psb_cspalloc
|
|
|
|
implicit none
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
|
|
|
@ -49,13 +49,13 @@ subroutine psb_cspalloc(a, desc_a, info, nnz)
|
|
|
|
type(psb_desc_type), intent(in) :: desc_a
|
|
|
|
type(psb_desc_type), intent(in) :: desc_a
|
|
|
|
type(psb_cspmat_type), intent(inout) :: a
|
|
|
|
type(psb_cspmat_type), intent(inout) :: a
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
integer(psb_ipk_), optional, intent(in) :: nnz
|
|
|
|
integer(psb_ipk_), optional, intent(in) :: nnz, bldmode
|
|
|
|
|
|
|
|
|
|
|
|
!locals
|
|
|
|
!locals
|
|
|
|
type(psb_ctxt_type) :: ctxt
|
|
|
|
type(psb_ctxt_type) :: ctxt
|
|
|
|
integer(psb_ipk_) :: np, me, err_act
|
|
|
|
integer(psb_ipk_) :: np, me, err_act
|
|
|
|
integer(psb_ipk_) :: loc_row,loc_col, nnz_, dectype
|
|
|
|
integer(psb_ipk_) :: loc_row,loc_col, nnz_, dectype, bldmode_
|
|
|
|
integer(psb_lpk_) :: m, n
|
|
|
|
integer(psb_lpk_) :: m, n, nnzrmt_
|
|
|
|
integer(psb_ipk_) :: debug_level, debug_unit
|
|
|
|
integer(psb_ipk_) :: debug_level, debug_unit
|
|
|
|
character(len=20) :: name
|
|
|
|
character(len=20) :: name
|
|
|
|
|
|
|
|
|
|
|
@ -96,7 +96,12 @@ subroutine psb_cspalloc(a, desc_a, info, nnz)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
nnz_ = max(1,5*loc_row)
|
|
|
|
nnz_ = max(1,5*loc_row)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
if (present(bldmode)) then
|
|
|
|
|
|
|
|
bldmode_ = bldmode
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
bldmode_ = psb_matbld_noremote_
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
if (debug_level >= psb_debug_ext_) &
|
|
|
|
if (debug_level >= psb_debug_ext_) &
|
|
|
|
& write(debug_unit,*) me,' ',trim(name), &
|
|
|
|
& write(debug_unit,*) me,' ',trim(name), &
|
|
|
|
& ':allocating size:',loc_row,loc_col,nnz_
|
|
|
|
& ':allocating size:',loc_row,loc_col,nnz_
|
|
|
@ -109,6 +114,25 @@ subroutine psb_cspalloc(a, desc_a, info, nnz)
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
write(0,*) name,'Setting a%remote_build ',&
|
|
|
|
|
|
|
|
& bldmode_,psb_matbld_noremote_,psb_matbld_remote_
|
|
|
|
|
|
|
|
a%remote_build = bldmode_
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
select case(a%remote_build)
|
|
|
|
|
|
|
|
case (psb_matbld_noremote_)
|
|
|
|
|
|
|
|
! nothing needed
|
|
|
|
|
|
|
|
write(0,*) name,' matbld_noremote_ nothing needed'
|
|
|
|
|
|
|
|
case (psb_matbld_remote_)
|
|
|
|
|
|
|
|
write(0,*) name,' matbld_remote_ start '
|
|
|
|
|
|
|
|
allocate(psb_lc_coo_sparse_mat :: a%rmta)
|
|
|
|
|
|
|
|
nnzrmt_ = max(100,(nnz_/100))
|
|
|
|
|
|
|
|
call a%rmta%allocate(m,n,nnzrmt_)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case default
|
|
|
|
|
|
|
|
write(0,*) name,'Invalid value for remote_build '
|
|
|
|
|
|
|
|
a%remote_build = psb_matbld_noremote_
|
|
|
|
|
|
|
|
end select
|
|
|
|
|
|
|
|
|
|
|
|
if (debug_level >= psb_debug_ext_) &
|
|
|
|
if (debug_level >= psb_debug_ext_) &
|
|
|
|
& write(debug_unit,*) me,' ',trim(name),': ', &
|
|
|
|
& write(debug_unit,*) me,' ',trim(name),': ', &
|
|
|
|
& desc_a%get_dectype(),psb_desc_bld_
|
|
|
|
& desc_a%get_dectype(),psb_desc_bld_
|
|
|
|