|
|
@ -41,8 +41,9 @@ subroutine psb_dasb(x, desc_a, info)
|
|
|
|
!....assembly dense matrix x .....
|
|
|
|
!....assembly dense matrix x .....
|
|
|
|
use psb_descriptor_type
|
|
|
|
use psb_descriptor_type
|
|
|
|
use psb_const_mod
|
|
|
|
use psb_const_mod
|
|
|
|
use psb_psblas_mod
|
|
|
|
use psb_comm_mod
|
|
|
|
use psb_error_mod
|
|
|
|
use psb_error_mod
|
|
|
|
|
|
|
|
use psb_realloc_mod
|
|
|
|
implicit none
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
|
|
|
|
type(psb_desc_type), intent(in) :: desc_a
|
|
|
|
type(psb_desc_type), intent(in) :: desc_a
|
|
|
@ -51,7 +52,6 @@ subroutine psb_dasb(x, desc_a, info)
|
|
|
|
|
|
|
|
|
|
|
|
! local variables
|
|
|
|
! local variables
|
|
|
|
integer :: err, icontxt,nprow,npcol,me,mypcol,temp,lwork,nrow,ncol, err_act
|
|
|
|
integer :: err, icontxt,nprow,npcol,me,mypcol,temp,lwork,nrow,ncol, err_act
|
|
|
|
real(kind(1.d0)),pointer :: dtemp(:,:)
|
|
|
|
|
|
|
|
integer :: int_err(5), i1sz, i2sz, dectype, i,j
|
|
|
|
integer :: int_err(5), i1sz, i2sz, dectype, i,j
|
|
|
|
double precision :: real_err(5)
|
|
|
|
double precision :: real_err(5)
|
|
|
|
real(kind(1.d0)),parameter :: one=1
|
|
|
|
real(kind(1.d0)),parameter :: one=1
|
|
|
@ -62,18 +62,18 @@ subroutine psb_dasb(x, desc_a, info)
|
|
|
|
info=0
|
|
|
|
info=0
|
|
|
|
name='psb_dasb'
|
|
|
|
name='psb_dasb'
|
|
|
|
call psb_erractionsave(err_act)
|
|
|
|
call psb_erractionsave(err_act)
|
|
|
|
|
|
|
|
|
|
|
|
icontxt=desc_a%matrix_data(psb_ctxt_)
|
|
|
|
icontxt=desc_a%matrix_data(psb_ctxt_)
|
|
|
|
dectype=desc_a%matrix_data(psb_dec_type_)
|
|
|
|
dectype=desc_a%matrix_data(psb_dec_type_)
|
|
|
|
|
|
|
|
|
|
|
|
call blacs_gridinfo(icontxt, nprow, npcol, me, mypcol)
|
|
|
|
call blacs_gridinfo(icontxt, nprow, npcol, me, mypcol)
|
|
|
|
|
|
|
|
|
|
|
|
if ((.not.associated(desc_a%matrix_data))) then
|
|
|
|
if ((.not.associated(desc_a%matrix_data))) then
|
|
|
|
info=3110
|
|
|
|
info=3110
|
|
|
|
call psb_errpush(info,name)
|
|
|
|
call psb_errpush(info,name)
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
if (debug) write(*,*) 'asb start: ',nprow,npcol,me,&
|
|
|
|
if (debug) write(*,*) 'asb start: ',nprow,npcol,me,&
|
|
|
|
&desc_a%matrix_data(psb_dec_type_)
|
|
|
|
&desc_a%matrix_data(psb_dec_type_)
|
|
|
|
! ....verify blacs grid correctness..
|
|
|
|
! ....verify blacs grid correctness..
|
|
|
@ -93,7 +93,7 @@ subroutine psb_dasb(x, desc_a, info)
|
|
|
|
call psb_errpush(info,name,i_err=int_err)
|
|
|
|
call psb_errpush(info,name,i_err=int_err)
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
! check size
|
|
|
|
! check size
|
|
|
|
icontxt=desc_a%matrix_data(psb_ctxt_)
|
|
|
|
icontxt=desc_a%matrix_data(psb_ctxt_)
|
|
|
|
nrow=desc_a%matrix_data(psb_n_row_)
|
|
|
|
nrow=desc_a%matrix_data(psb_n_row_)
|
|
|
@ -102,22 +102,13 @@ subroutine psb_dasb(x, desc_a, info)
|
|
|
|
i2sz = size(x,dim=2)
|
|
|
|
i2sz = size(x,dim=2)
|
|
|
|
if (debug) write(*,*) 'asb: ',i1sz,i2sz,nrow,ncol
|
|
|
|
if (debug) write(*,*) 'asb: ',i1sz,i2sz,nrow,ncol
|
|
|
|
if (i1sz.lt.ncol) then
|
|
|
|
if (i1sz.lt.ncol) then
|
|
|
|
allocate(dtemp(ncol,i2sz),stat=info)
|
|
|
|
call psb_realloc(ncol,i2sz,x,info)
|
|
|
|
if (info.ne.0) then
|
|
|
|
if (info.ne.0) then
|
|
|
|
info=2025
|
|
|
|
info=2025
|
|
|
|
int_err(1)=ncol
|
|
|
|
int_err(1)=ncol
|
|
|
|
call psb_errpush(info,name,i_err=int_err)
|
|
|
|
call psb_errpush(info,name,i_err=int_err)
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
do j=1,size(x,2)
|
|
|
|
|
|
|
|
do i=1,nrow
|
|
|
|
|
|
|
|
dtemp(i,j) = x(i,j)
|
|
|
|
|
|
|
|
end do
|
|
|
|
|
|
|
|
end do
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
deallocate(x)
|
|
|
|
|
|
|
|
x => dtemp
|
|
|
|
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
! ..update halo elements..
|
|
|
|
! ..update halo elements..
|
|
|
@ -186,8 +177,9 @@ subroutine psb_dasbv(x, desc_a, info)
|
|
|
|
!....assembly dense matrix x .....
|
|
|
|
!....assembly dense matrix x .....
|
|
|
|
use psb_descriptor_type
|
|
|
|
use psb_descriptor_type
|
|
|
|
use psb_const_mod
|
|
|
|
use psb_const_mod
|
|
|
|
use psb_psblas_mod
|
|
|
|
use psb_comm_mod
|
|
|
|
use psb_error_mod
|
|
|
|
use psb_error_mod
|
|
|
|
|
|
|
|
use psb_realloc_mod
|
|
|
|
implicit none
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
|
|
|
|
type(psb_desc_type), intent(in) :: desc_a
|
|
|
|
type(psb_desc_type), intent(in) :: desc_a
|
|
|
@ -197,7 +189,6 @@ subroutine psb_dasbv(x, desc_a, info)
|
|
|
|
! local variables
|
|
|
|
! local variables
|
|
|
|
integer :: err, icontxt,nprow,npcol,me,mypcol,temp,lwork
|
|
|
|
integer :: err, icontxt,nprow,npcol,me,mypcol,temp,lwork
|
|
|
|
integer :: int_err(5), i1sz,nrow,ncol, dectype, i, err_act
|
|
|
|
integer :: int_err(5), i1sz,nrow,ncol, dectype, i, err_act
|
|
|
|
real(kind(1.d0)),pointer :: dtemp(:)
|
|
|
|
|
|
|
|
double precision :: real_err(5)
|
|
|
|
double precision :: real_err(5)
|
|
|
|
real(kind(1.d0)),parameter :: one=1
|
|
|
|
real(kind(1.d0)),parameter :: one=1
|
|
|
|
logical, parameter :: debug=.false.
|
|
|
|
logical, parameter :: debug=.false.
|
|
|
@ -206,7 +197,7 @@ subroutine psb_dasbv(x, desc_a, info)
|
|
|
|
info = 0
|
|
|
|
info = 0
|
|
|
|
int_err(1) = 0
|
|
|
|
int_err(1) = 0
|
|
|
|
name = 'psb_dasbv'
|
|
|
|
name = 'psb_dasbv'
|
|
|
|
|
|
|
|
|
|
|
|
icontxt=desc_a%matrix_data(psb_ctxt_)
|
|
|
|
icontxt=desc_a%matrix_data(psb_ctxt_)
|
|
|
|
dectype=desc_a%matrix_data(psb_dec_type_)
|
|
|
|
dectype=desc_a%matrix_data(psb_dec_type_)
|
|
|
|
|
|
|
|
|
|
|
@ -214,18 +205,18 @@ subroutine psb_dasbv(x, desc_a, info)
|
|
|
|
|
|
|
|
|
|
|
|
! ....verify blacs grid correctness..
|
|
|
|
! ....verify blacs grid correctness..
|
|
|
|
if (nprow.eq.-1) then
|
|
|
|
if (nprow.eq.-1) then
|
|
|
|
info = 2010
|
|
|
|
info = 2010
|
|
|
|
call psb_errpush(info,name)
|
|
|
|
call psb_errpush(info,name)
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
else if (npcol.ne.1) then
|
|
|
|
else if (npcol.ne.1) then
|
|
|
|
info = 2030
|
|
|
|
info = 2030
|
|
|
|
int_err(1) = npcol
|
|
|
|
int_err(1) = npcol
|
|
|
|
call psb_errpush(info,name,i_err=int_err)
|
|
|
|
call psb_errpush(info,name,i_err=int_err)
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
else if (.not.psb_is_asb_dec(dectype)) then
|
|
|
|
else if (.not.psb_is_asb_dec(dectype)) then
|
|
|
|
info = 3110
|
|
|
|
info = 3110
|
|
|
|
call psb_errpush(info,name)
|
|
|
|
call psb_errpush(info,name)
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
nrow=desc_a%matrix_data(psb_n_row_)
|
|
|
|
nrow=desc_a%matrix_data(psb_n_row_)
|
|
|
@ -234,20 +225,14 @@ subroutine psb_dasbv(x, desc_a, info)
|
|
|
|
i1sz = size(x)
|
|
|
|
i1sz = size(x)
|
|
|
|
if (debug) write(*,*) 'dasb: sizes ',i1sz,ncol
|
|
|
|
if (debug) write(*,*) 'dasb: sizes ',i1sz,ncol
|
|
|
|
if (i1sz.lt.ncol) then
|
|
|
|
if (i1sz.lt.ncol) then
|
|
|
|
allocate(dtemp(ncol),stat=info)
|
|
|
|
call psb_realloc(ncol,x,info)
|
|
|
|
if (info.ne.0) then
|
|
|
|
if (info.ne.0) then
|
|
|
|
info=2025
|
|
|
|
info=2025
|
|
|
|
int_err(1)=ncol
|
|
|
|
int_err(1)=ncol
|
|
|
|
call psb_errpush(info,name,i_err=int_err)
|
|
|
|
call psb_errpush(info,name,i_err=int_err)
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
endif
|
|
|
|
do i=1,nrow
|
|
|
|
|
|
|
|
dtemp(i) = x(i)
|
|
|
|
|
|
|
|
end do
|
|
|
|
|
|
|
|
deallocate(x)
|
|
|
|
|
|
|
|
x => dtemp
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
! ..update halo elements..
|
|
|
|
! ..update halo elements..
|
|
|
|
call psb_halo(x,desc_a,info)
|
|
|
|
call psb_halo(x,desc_a,info)
|
|
|
|