|
|
@ -49,6 +49,7 @@ function psb_dasum (x,desc_a, info, jx)
|
|
|
|
use psb_descriptor_type
|
|
|
|
use psb_descriptor_type
|
|
|
|
use psb_check_mod
|
|
|
|
use psb_check_mod
|
|
|
|
use psb_error_mod
|
|
|
|
use psb_error_mod
|
|
|
|
|
|
|
|
use psb_blacs_mod
|
|
|
|
implicit none
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
|
|
|
|
real(kind(1.d0)), intent(in) :: x(:,:)
|
|
|
|
real(kind(1.d0)), intent(in) :: x(:,:)
|
|
|
@ -61,7 +62,6 @@ function psb_dasum (x,desc_a, info, jx)
|
|
|
|
integer :: int_err(5), icontxt, nprow, npcol, myrow, mycol,&
|
|
|
|
integer :: int_err(5), icontxt, nprow, npcol, myrow, mycol,&
|
|
|
|
& err_act, n, iix, jjx, temp(2), ix, ijx, m, i
|
|
|
|
& err_act, n, iix, jjx, temp(2), ix, ijx, m, i
|
|
|
|
real(kind(1.d0)) :: asum, dasum
|
|
|
|
real(kind(1.d0)) :: asum, dasum
|
|
|
|
real(kind(1.d0)),pointer :: tmpx(:)
|
|
|
|
|
|
|
|
character(len=20) :: name, ch_err
|
|
|
|
character(len=20) :: name, ch_err
|
|
|
|
|
|
|
|
|
|
|
|
name='psb_dasum'
|
|
|
|
name='psb_dasum'
|
|
|
@ -120,19 +120,17 @@ function psb_dasum (x,desc_a, info, jx)
|
|
|
|
do while (desc_a%ovrlap_elem(i).ne.-ione)
|
|
|
|
do while (desc_a%ovrlap_elem(i).ne.-ione)
|
|
|
|
asum = asum -&
|
|
|
|
asum = asum -&
|
|
|
|
& (desc_a%ovrlap_elem(i+1)-1)/desc_a%ovrlap_elem(i+1)*&
|
|
|
|
& (desc_a%ovrlap_elem(i+1)-1)/desc_a%ovrlap_elem(i+1)*&
|
|
|
|
& tmpx(desc_a%ovrlap_elem(i))
|
|
|
|
& abs(x(desc_a%ovrlap_elem(i)-iix+1,jjx))
|
|
|
|
i = i+2
|
|
|
|
i = i+2
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
|
|
|
|
|
|
|
|
! compute global sum
|
|
|
|
! compute global sum
|
|
|
|
call dgsum2d(icontxt, 'A', ' ', ione, ione, asum,&
|
|
|
|
call gsum2d(icontxt, 'A', asum)
|
|
|
|
& ione, mone ,mycol)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
else
|
|
|
|
asum=0.d0
|
|
|
|
asum=0.d0
|
|
|
|
! compute global sum
|
|
|
|
! compute global sum
|
|
|
|
call dgsum2d(icontxt, 'A', ' ', ione, ione, asum,&
|
|
|
|
call gsum2d(icontxt, 'A', asum)
|
|
|
|
& ione, mone ,mycol)
|
|
|
|
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
else
|
|
|
|
else
|
|
|
|
asum=0.d0
|
|
|
|
asum=0.d0
|
|
|
@ -201,6 +199,7 @@ function psb_dasumv (x,desc_a, info)
|
|
|
|
use psb_descriptor_type
|
|
|
|
use psb_descriptor_type
|
|
|
|
use psb_check_mod
|
|
|
|
use psb_check_mod
|
|
|
|
use psb_error_mod
|
|
|
|
use psb_error_mod
|
|
|
|
|
|
|
|
use psb_blacs_mod
|
|
|
|
implicit none
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
|
|
|
|
real(kind(1.d0)), intent(in) :: x(:)
|
|
|
|
real(kind(1.d0)), intent(in) :: x(:)
|
|
|
@ -212,7 +211,6 @@ function psb_dasumv (x,desc_a, info)
|
|
|
|
integer :: int_err(5), icontxt, nprow, npcol, myrow, mycol,&
|
|
|
|
integer :: int_err(5), icontxt, nprow, npcol, myrow, mycol,&
|
|
|
|
& err_act, n, iix, jjx, temp(2), jx, ix, ijx, m, i
|
|
|
|
& err_act, n, iix, jjx, temp(2), jx, ix, ijx, m, i
|
|
|
|
real(kind(1.d0)) :: asum, dasum
|
|
|
|
real(kind(1.d0)) :: asum, dasum
|
|
|
|
real(kind(1.d0)),pointer :: tmpx(:)
|
|
|
|
|
|
|
|
character(len=20) :: name, ch_err
|
|
|
|
character(len=20) :: name, ch_err
|
|
|
|
|
|
|
|
|
|
|
|
name='psb_dasumv'
|
|
|
|
name='psb_dasumv'
|
|
|
@ -267,19 +265,17 @@ function psb_dasumv (x,desc_a, info)
|
|
|
|
do while (desc_a%ovrlap_elem(i).ne.-ione)
|
|
|
|
do while (desc_a%ovrlap_elem(i).ne.-ione)
|
|
|
|
asum = asum -&
|
|
|
|
asum = asum -&
|
|
|
|
& (desc_a%ovrlap_elem(i+1)-1)/desc_a%ovrlap_elem(i+1)*&
|
|
|
|
& (desc_a%ovrlap_elem(i+1)-1)/desc_a%ovrlap_elem(i+1)*&
|
|
|
|
& tmpx(desc_a%ovrlap_elem(i))
|
|
|
|
& abs(x(desc_a%ovrlap_elem(i)))
|
|
|
|
i = i+2
|
|
|
|
i = i+2
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
|
|
|
|
|
|
|
|
! compute global sum
|
|
|
|
! compute global sum
|
|
|
|
call dgsum2d(icontxt, 'A', ' ', ione, ione, asum,&
|
|
|
|
call gsum2d(icontxt, 'A', asum)
|
|
|
|
& ione, mone ,mycol)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
else
|
|
|
|
asum=0.d0
|
|
|
|
asum=0.d0
|
|
|
|
! compute global sum
|
|
|
|
! compute global sum
|
|
|
|
call dgsum2d(icontxt, 'A', ' ', ione, ione, asum,&
|
|
|
|
call gsum2d(icontxt, 'A', asum)
|
|
|
|
& ione, mone ,mycol)
|
|
|
|
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
else
|
|
|
|
else
|
|
|
|
asum=0.d0
|
|
|
|
asum=0.d0
|
|
|
@ -348,6 +344,7 @@ subroutine psb_dasumvs (res,x,desc_a, info)
|
|
|
|
use psb_descriptor_type
|
|
|
|
use psb_descriptor_type
|
|
|
|
use psb_check_mod
|
|
|
|
use psb_check_mod
|
|
|
|
use psb_error_mod
|
|
|
|
use psb_error_mod
|
|
|
|
|
|
|
|
use psb_blacs_mod
|
|
|
|
implicit none
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
|
|
|
|
real(kind(1.d0)), intent(in) :: x(:)
|
|
|
|
real(kind(1.d0)), intent(in) :: x(:)
|
|
|
@ -359,7 +356,6 @@ subroutine psb_dasumvs (res,x,desc_a, info)
|
|
|
|
integer :: int_err(5), icontxt, nprow, npcol, myrow, mycol,&
|
|
|
|
integer :: int_err(5), icontxt, nprow, npcol, myrow, mycol,&
|
|
|
|
& err_act, n, iix, jjx, temp(2), ix, jx, ijx, m, i
|
|
|
|
& err_act, n, iix, jjx, temp(2), ix, jx, ijx, m, i
|
|
|
|
real(kind(1.d0)) :: asum, dasum
|
|
|
|
real(kind(1.d0)) :: asum, dasum
|
|
|
|
real(kind(1.d0)),pointer :: tmpx(:)
|
|
|
|
|
|
|
|
character(len=20) :: name, ch_err
|
|
|
|
character(len=20) :: name, ch_err
|
|
|
|
|
|
|
|
|
|
|
|
name='psb_dasumvs'
|
|
|
|
name='psb_dasumvs'
|
|
|
@ -414,19 +410,17 @@ subroutine psb_dasumvs (res,x,desc_a, info)
|
|
|
|
do while (desc_a%ovrlap_elem(i).ne.-ione)
|
|
|
|
do while (desc_a%ovrlap_elem(i).ne.-ione)
|
|
|
|
asum = asum -&
|
|
|
|
asum = asum -&
|
|
|
|
& (desc_a%ovrlap_elem(i+1)-1)/desc_a%ovrlap_elem(i+1)*&
|
|
|
|
& (desc_a%ovrlap_elem(i+1)-1)/desc_a%ovrlap_elem(i+1)*&
|
|
|
|
& tmpx(desc_a%ovrlap_elem(i))
|
|
|
|
& abs(x(desc_a%ovrlap_elem(i)))
|
|
|
|
i = i+2
|
|
|
|
i = i+2
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
|
|
|
|
|
|
|
|
! compute global sum
|
|
|
|
! compute global sum
|
|
|
|
call dgsum2d(icontxt, 'A', ' ', ione, ione, asum,&
|
|
|
|
call gsum2d(icontxt, 'A',asum)
|
|
|
|
& ione, mone ,mycol)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
else
|
|
|
|
asum=0.d0
|
|
|
|
asum=0.d0
|
|
|
|
! compute global sum
|
|
|
|
! compute global sum
|
|
|
|
call dgsum2d(icontxt, 'A', ' ', ione, ione, asum,&
|
|
|
|
call gsum2d(icontxt, 'A', asum)
|
|
|
|
& ione, mone ,mycol)
|
|
|
|
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
else
|
|
|
|
else
|
|
|
|
asum=0.d0
|
|
|
|
asum=0.d0
|
|
|
|