|
|
@ -38,7 +38,7 @@
|
|
|
|
! Arguments:
|
|
|
|
! Arguments:
|
|
|
|
! x - real,dimension(:,:). The local part of the dense matrix.
|
|
|
|
! x - real,dimension(:,:). The local part of the dense matrix.
|
|
|
|
! desc_a - type(psb_desc_type). The communication descriptor.
|
|
|
|
! desc_a - type(psb_desc_type). The communication descriptor.
|
|
|
|
! info - integer. return code.
|
|
|
|
! info - integer. Return code
|
|
|
|
! alpha - real(optional). Scale factor.
|
|
|
|
! alpha - real(optional). Scale factor.
|
|
|
|
! jx - integer(optional). The starting column of the global matrix.
|
|
|
|
! jx - integer(optional). The starting column of the global matrix.
|
|
|
|
! ik - integer(optional). The number of columns to gather.
|
|
|
|
! ik - integer(optional). The number of columns to gather.
|
|
|
@ -67,7 +67,7 @@ subroutine psb_dhalom(x,desc_a,info,alpha,jx,ik,work,tran,mode,data)
|
|
|
|
character, intent(in), optional :: tran
|
|
|
|
character, intent(in), optional :: tran
|
|
|
|
|
|
|
|
|
|
|
|
! locals
|
|
|
|
! locals
|
|
|
|
integer :: ictxt, np, me,&
|
|
|
|
integer :: ictxt, np, me, &
|
|
|
|
& err_act, m, n, iix, jjx, ix, ijx, k, maxk, nrow, imode, i,&
|
|
|
|
& err_act, m, n, iix, jjx, ix, ijx, k, maxk, nrow, imode, i,&
|
|
|
|
& err, liwork,data_
|
|
|
|
& err, liwork,data_
|
|
|
|
real(psb_dpk_),pointer :: iwork(:), xp(:,:)
|
|
|
|
real(psb_dpk_),pointer :: iwork(:), xp(:,:)
|
|
|
@ -118,6 +118,11 @@ subroutine psb_dhalom(x,desc_a,info,alpha,jx,ik,work,tran,mode,data)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
tran_ = 'N'
|
|
|
|
tran_ = 'N'
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
if (present(mode)) then
|
|
|
|
|
|
|
|
imode = mode
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
imode = IOR(psb_swap_send_,psb_swap_recv_)
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
if (present(data)) then
|
|
|
|
if (present(data)) then
|
|
|
|
data_ = data
|
|
|
|
data_ = data
|
|
|
@ -125,13 +130,6 @@ subroutine psb_dhalom(x,desc_a,info,alpha,jx,ik,work,tran,mode,data)
|
|
|
|
data_ = psb_comm_halo_
|
|
|
|
data_ = psb_comm_halo_
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (present(mode)) then
|
|
|
|
|
|
|
|
imode = mode
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
imode = IOR(psb_swap_send_,psb_swap_recv_)
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
! check vector correctness
|
|
|
|
! check vector correctness
|
|
|
|
call psb_chkvect(m,1,size(x,1),ix,ijx,desc_a,info,iix,jjx)
|
|
|
|
call psb_chkvect(m,1,size(x,1),ix,ijx,desc_a,info,iix,jjx)
|
|
|
|
if(info /= psb_success_) then
|
|
|
|
if(info /= psb_success_) then
|
|
|
@ -160,8 +158,8 @@ subroutine psb_dhalom(x,desc_a,info,alpha,jx,ik,work,tran,mode,data)
|
|
|
|
liwork=nrow
|
|
|
|
liwork=nrow
|
|
|
|
if (present(work)) then
|
|
|
|
if (present(work)) then
|
|
|
|
if(size(work) >= liwork) then
|
|
|
|
if(size(work) >= liwork) then
|
|
|
|
iwork => work
|
|
|
|
|
|
|
|
aliw=.false.
|
|
|
|
aliw=.false.
|
|
|
|
|
|
|
|
iwork => work
|
|
|
|
else
|
|
|
|
else
|
|
|
|
aliw=.true.
|
|
|
|
aliw=.true.
|
|
|
|
allocate(iwork(liwork),stat=info)
|
|
|
|
allocate(iwork(liwork),stat=info)
|
|
|
@ -174,8 +172,8 @@ subroutine psb_dhalom(x,desc_a,info,alpha,jx,ik,work,tran,mode,data)
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
else
|
|
|
|
else
|
|
|
|
aliw=.true.
|
|
|
|
aliw=.true.
|
|
|
|
!!$ write(psb_err_unit,*) 'halom ',liwork
|
|
|
|
|
|
|
|
allocate(iwork(liwork),stat=info)
|
|
|
|
allocate(iwork(liwork),stat=info)
|
|
|
|
|
|
|
|
|
|
|
|
if(info /= psb_success_) then
|
|
|
|
if(info /= psb_success_) then
|
|
|
|
info=psb_err_from_subroutine_
|
|
|
|
info=psb_err_from_subroutine_
|
|
|
|
ch_err='psb_realloc'
|
|
|
|
ch_err='psb_realloc'
|
|
|
@ -199,12 +197,13 @@ subroutine psb_dhalom(x,desc_a,info,alpha,jx,ik,work,tran,mode,data)
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
if(info /= psb_success_) then
|
|
|
|
if(info /= psb_success_) then
|
|
|
|
ch_err='PSI_dSwapdata'
|
|
|
|
ch_err='PSI_cswapdata'
|
|
|
|
call psb_errpush(psb_err_from_subroutine_,name,a_err=ch_err)
|
|
|
|
call psb_errpush(psb_err_from_subroutine_,name,a_err=ch_err)
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
if (aliw) deallocate(iwork)
|
|
|
|
if (aliw) deallocate(iwork)
|
|
|
|
|
|
|
|
nullify(iwork)
|
|
|
|
|
|
|
|
|
|
|
|
call psb_erractionrestore(err_act)
|
|
|
|
call psb_erractionrestore(err_act)
|
|
|
|
return
|
|
|
|
return
|
|
|
@ -263,6 +262,8 @@ end subroutine psb_dhalom
|
|
|
|
! desc_a - type(psb_desc_type). The communication descriptor.
|
|
|
|
! desc_a - type(psb_desc_type). The communication descriptor.
|
|
|
|
! info - integer. Return code
|
|
|
|
! info - integer. Return code
|
|
|
|
! alpha - real(optional). Scale factor.
|
|
|
|
! alpha - real(optional). Scale factor.
|
|
|
|
|
|
|
|
! jx - integer(optional). The starting column of the global matrix.
|
|
|
|
|
|
|
|
! ik - integer(optional). The number of columns to gather.
|
|
|
|
! work - real(optional). Work area.
|
|
|
|
! work - real(optional). Work area.
|
|
|
|
! tran - character(optional). Transpose exchange.
|
|
|
|
! tran - character(optional). Transpose exchange.
|
|
|
|
! mode - integer(optional). Communication mode (see Swapdata)
|
|
|
|
! mode - integer(optional). Communication mode (see Swapdata)
|
|
|
@ -288,9 +289,8 @@ subroutine psb_dhalov(x,desc_a,info,alpha,work,tran,mode,data)
|
|
|
|
character, intent(in), optional :: tran
|
|
|
|
character, intent(in), optional :: tran
|
|
|
|
|
|
|
|
|
|
|
|
! locals
|
|
|
|
! locals
|
|
|
|
integer :: ictxt, np, me,&
|
|
|
|
integer :: ictxt, np, me, err_act, &
|
|
|
|
& err_act, m, n, iix, jjx, ix, ijx, nrow, imode,&
|
|
|
|
& m, n, iix, jjx, ix, ijx, nrow, imode, err, liwork,data_
|
|
|
|
& err, liwork,data_
|
|
|
|
|
|
|
|
real(psb_dpk_),pointer :: iwork(:)
|
|
|
|
real(psb_dpk_),pointer :: iwork(:)
|
|
|
|
character :: tran_
|
|
|
|
character :: tran_
|
|
|
|
character(len=20) :: name, ch_err
|
|
|
|
character(len=20) :: name, ch_err
|
|
|
@ -360,8 +360,8 @@ subroutine psb_dhalov(x,desc_a,info,alpha,work,tran,mode,data)
|
|
|
|
liwork=nrow
|
|
|
|
liwork=nrow
|
|
|
|
if (present(work)) then
|
|
|
|
if (present(work)) then
|
|
|
|
if(size(work) >= liwork) then
|
|
|
|
if(size(work) >= liwork) then
|
|
|
|
iwork => work
|
|
|
|
|
|
|
|
aliw=.false.
|
|
|
|
aliw=.false.
|
|
|
|
|
|
|
|
iwork => work
|
|
|
|
else
|
|
|
|
else
|
|
|
|
aliw=.true.
|
|
|
|
aliw=.true.
|
|
|
|
allocate(iwork(liwork),stat=info)
|
|
|
|
allocate(iwork(liwork),stat=info)
|
|
|
@ -403,6 +403,7 @@ subroutine psb_dhalov(x,desc_a,info,alpha,work,tran,mode,data)
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
if (aliw) deallocate(iwork)
|
|
|
|
if (aliw) deallocate(iwork)
|
|
|
|
|
|
|
|
nullify(iwork)
|
|
|
|
|
|
|
|
|
|
|
|
call psb_erractionrestore(err_act)
|
|
|
|
call psb_erractionrestore(err_act)
|
|
|
|
return
|
|
|
|
return
|
|
|
@ -417,6 +418,7 @@ subroutine psb_dhalov(x,desc_a,info,alpha,work,tran,mode,data)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
end subroutine psb_dhalov
|
|
|
|
end subroutine psb_dhalov
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
subroutine psb_dhalo_vect(x,desc_a,info,alpha,work,tran,mode,data)
|
|
|
|
subroutine psb_dhalo_vect(x,desc_a,info,alpha,work,tran,mode,data)
|
|
|
|
use psb_base_mod, psb_protect_name => psb_dhalo_vect
|
|
|
|
use psb_base_mod, psb_protect_name => psb_dhalo_vect
|
|
|
|
use psi_mod
|
|
|
|
use psi_mod
|
|
|
@ -501,7 +503,7 @@ subroutine psb_dhalo_vect(x,desc_a,info,alpha,work,tran,mode,data)
|
|
|
|
if(err /= 0) goto 9999
|
|
|
|
if(err /= 0) goto 9999
|
|
|
|
|
|
|
|
|
|
|
|
if(present(alpha)) then
|
|
|
|
if(present(alpha)) then
|
|
|
|
if(alpha /= 1.d0) then
|
|
|
|
if(alpha /= done) then
|
|
|
|
call x%scal(alpha)
|
|
|
|
call x%scal(alpha)
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
end if
|
|
|
@ -545,13 +547,14 @@ subroutine psb_dhalo_vect(x,desc_a,info,alpha,work,tran,mode,data)
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
if(info /= psb_success_) then
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
ch_err='PSI_swapdata'
|
|
|
|
ch_err='PSI_swapdata'
|
|
|
|
call psb_errpush(psb_err_from_subroutine_,name,a_err=ch_err)
|
|
|
|
call psb_errpush(psb_err_from_subroutine_,name,a_err=ch_err)
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
if (aliw) deallocate(iwork)
|
|
|
|
if (aliw) deallocate(iwork)
|
|
|
|
|
|
|
|
nullify(iwork)
|
|
|
|
|
|
|
|
|
|
|
|
call psb_erractionrestore(err_act)
|
|
|
|
call psb_erractionrestore(err_act)
|
|
|
|
return
|
|
|
|
return
|
|
|
|