|
|
@ -29,7 +29,7 @@
|
|
|
|
! POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
! POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
!
|
|
|
|
!
|
|
|
|
!
|
|
|
|
!
|
|
|
|
subroutine psi_i2_exscanv(n,x,info,shift,ibase)
|
|
|
|
subroutine psi_i2_exscanv(n,x,info,shift)
|
|
|
|
use psi_i2_serial_mod, psb_protect_name => psi_i2_exscanv
|
|
|
|
use psi_i2_serial_mod, psb_protect_name => psi_i2_exscanv
|
|
|
|
use psb_const_mod
|
|
|
|
use psb_const_mod
|
|
|
|
use psb_error_mod
|
|
|
|
use psb_error_mod
|
|
|
@ -41,10 +41,8 @@ subroutine psi_i2_exscanv(n,x,info,shift,ibase)
|
|
|
|
integer(psb_i2pk_), intent (inout) :: x(:)
|
|
|
|
integer(psb_i2pk_), intent (inout) :: x(:)
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
integer(psb_i2pk_), intent(in), optional :: shift
|
|
|
|
integer(psb_i2pk_), intent(in), optional :: shift
|
|
|
|
integer(psb_ipk_), intent(in), optional :: ibase
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
integer(psb_i2pk_) :: shift_, tp, ts
|
|
|
|
integer(psb_i2pk_) :: shift_, tp, ts
|
|
|
|
integer(psb_ipk_) :: ibase_
|
|
|
|
|
|
|
|
logical is_nested, is_parallel
|
|
|
|
logical is_nested, is_parallel
|
|
|
|
|
|
|
|
|
|
|
|
if (present(shift)) then
|
|
|
|
if (present(shift)) then
|
|
|
@ -52,11 +50,6 @@ subroutine psi_i2_exscanv(n,x,info,shift,ibase)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
shift_ = i2zero
|
|
|
|
shift_ = i2zero
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
if (present(ibase)) then
|
|
|
|
|
|
|
|
ibase_ = ibase
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
ibase_ = ione
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if defined(OPENMP)
|
|
|
|
#if defined(OPENMP)
|
|
|
|
is_parallel = omp_in_parallel()
|
|
|
|
is_parallel = omp_in_parallel()
|
|
|
@ -97,12 +90,12 @@ contains
|
|
|
|
wrk = (n)/nthreads
|
|
|
|
wrk = (n)/nthreads
|
|
|
|
if (ithread < MOD((n),nthreads)) then
|
|
|
|
if (ithread < MOD((n),nthreads)) then
|
|
|
|
wrk = wrk + 1
|
|
|
|
wrk = wrk + 1
|
|
|
|
first_idx = ithread*wrk + ibase_
|
|
|
|
first_idx = ithread*wrk + 1
|
|
|
|
else
|
|
|
|
else
|
|
|
|
first_idx = ithread*wrk + MOD((n),nthreads) + ibase_
|
|
|
|
first_idx = ithread*wrk + MOD((n),nthreads) + 1
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
last_idx = min(first_idx + wrk - 1,n - (ione-ibase_))
|
|
|
|
last_idx = min(first_idx + wrk - 1,n )
|
|
|
|
if (first_idx<=last_idx) then
|
|
|
|
if (first_idx<=last_idx) then
|
|
|
|
sumb(ithread+2) = sumb(ithread+2) + x(first_idx)
|
|
|
|
sumb(ithread+2) = sumb(ithread+2) + x(first_idx)
|
|
|
|
do i=first_idx+1,last_idx
|
|
|
|
do i=first_idx+1,last_idx
|
|
|
|