diff --git a/base/modules/auxil/psi_c_serial_mod.f90 b/base/modules/auxil/psi_c_serial_mod.f90 index d62ba3bc..0fdff04b 100644 --- a/base/modules/auxil/psi_c_serial_mod.f90 +++ b/base/modules/auxil/psi_c_serial_mod.f90 @@ -157,14 +157,13 @@ module psi_c_serial_mod end interface psi_sct interface psi_exscan - subroutine psi_c_exscanv(n,x,info,shift,ibase) + subroutine psi_c_exscanv(n,x,info,shift) import :: psb_ipk_, psb_spk_ implicit none integer(psb_ipk_), intent(in) :: n complex(psb_spk_), intent (inout) :: x(:) integer(psb_ipk_), intent(out) :: info complex(psb_spk_), intent(in), optional :: shift - integer(psb_ipk_), intent(in), optional :: ibase end subroutine psi_c_exscanv end interface psi_exscan diff --git a/base/modules/auxil/psi_d_serial_mod.f90 b/base/modules/auxil/psi_d_serial_mod.f90 index ae88be74..0ce14dbb 100644 --- a/base/modules/auxil/psi_d_serial_mod.f90 +++ b/base/modules/auxil/psi_d_serial_mod.f90 @@ -157,14 +157,13 @@ module psi_d_serial_mod end interface psi_sct interface psi_exscan - subroutine psi_d_exscanv(n,x,info,shift,ibase) + subroutine psi_d_exscanv(n,x,info,shift) import :: psb_ipk_, psb_dpk_ implicit none integer(psb_ipk_), intent(in) :: n real(psb_dpk_), intent (inout) :: x(:) integer(psb_ipk_), intent(out) :: info real(psb_dpk_), intent(in), optional :: shift - integer(psb_ipk_), intent(in), optional :: ibase end subroutine psi_d_exscanv end interface psi_exscan diff --git a/base/modules/auxil/psi_e_serial_mod.f90 b/base/modules/auxil/psi_e_serial_mod.f90 index a5544075..f0372e01 100644 --- a/base/modules/auxil/psi_e_serial_mod.f90 +++ b/base/modules/auxil/psi_e_serial_mod.f90 @@ -157,14 +157,13 @@ module psi_e_serial_mod end interface psi_sct interface psi_exscan - subroutine psi_e_exscanv(n,x,info,shift,ibase) + subroutine psi_e_exscanv(n,x,info,shift) import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_ implicit none integer(psb_ipk_), intent(in) :: n integer(psb_epk_), intent (inout) :: x(:) integer(psb_ipk_), intent(out) :: info integer(psb_epk_), intent(in), optional :: shift - integer(psb_ipk_), intent(in), optional :: ibase end subroutine psi_e_exscanv end interface psi_exscan diff --git a/base/modules/auxil/psi_i2_serial_mod.f90 b/base/modules/auxil/psi_i2_serial_mod.f90 index c0b5a327..70dd95e1 100644 --- a/base/modules/auxil/psi_i2_serial_mod.f90 +++ b/base/modules/auxil/psi_i2_serial_mod.f90 @@ -157,14 +157,13 @@ module psi_i2_serial_mod end interface psi_sct interface psi_exscan - subroutine psi_i2_exscanv(n,x,info,shift,ibase) + subroutine psi_i2_exscanv(n,x,info,shift) import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_ implicit none integer(psb_ipk_), intent(in) :: n integer(psb_i2pk_), intent (inout) :: x(:) integer(psb_ipk_), intent(out) :: info integer(psb_i2pk_), intent(in), optional :: shift - integer(psb_ipk_), intent(in), optional :: ibase end subroutine psi_i2_exscanv end interface psi_exscan diff --git a/base/modules/auxil/psi_m_serial_mod.f90 b/base/modules/auxil/psi_m_serial_mod.f90 index ab875f7b..cfd1348e 100644 --- a/base/modules/auxil/psi_m_serial_mod.f90 +++ b/base/modules/auxil/psi_m_serial_mod.f90 @@ -157,14 +157,13 @@ module psi_m_serial_mod end interface psi_sct interface psi_exscan - subroutine psi_m_exscanv(n,x,info,shift,ibase) + subroutine psi_m_exscanv(n,x,info,shift) import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_ implicit none integer(psb_ipk_), intent(in) :: n integer(psb_mpk_), intent (inout) :: x(:) integer(psb_ipk_), intent(out) :: info integer(psb_mpk_), intent(in), optional :: shift - integer(psb_ipk_), intent(in), optional :: ibase end subroutine psi_m_exscanv end interface psi_exscan diff --git a/base/modules/auxil/psi_s_serial_mod.f90 b/base/modules/auxil/psi_s_serial_mod.f90 index fee1afc6..25c4a7ef 100644 --- a/base/modules/auxil/psi_s_serial_mod.f90 +++ b/base/modules/auxil/psi_s_serial_mod.f90 @@ -157,14 +157,13 @@ module psi_s_serial_mod end interface psi_sct interface psi_exscan - subroutine psi_s_exscanv(n,x,info,shift,ibase) + subroutine psi_s_exscanv(n,x,info,shift) import :: psb_ipk_, psb_spk_ implicit none integer(psb_ipk_), intent(in) :: n real(psb_spk_), intent (inout) :: x(:) integer(psb_ipk_), intent(out) :: info real(psb_spk_), intent(in), optional :: shift - integer(psb_ipk_), intent(in), optional :: ibase end subroutine psi_s_exscanv end interface psi_exscan diff --git a/base/modules/auxil/psi_z_serial_mod.f90 b/base/modules/auxil/psi_z_serial_mod.f90 index 3ab430cc..b40cf05a 100644 --- a/base/modules/auxil/psi_z_serial_mod.f90 +++ b/base/modules/auxil/psi_z_serial_mod.f90 @@ -157,14 +157,13 @@ module psi_z_serial_mod end interface psi_sct interface psi_exscan - subroutine psi_z_exscanv(n,x,info,shift,ibase) + subroutine psi_z_exscanv(n,x,info,shift) import :: psb_ipk_, psb_dpk_ implicit none integer(psb_ipk_), intent(in) :: n complex(psb_dpk_), intent (inout) :: x(:) integer(psb_ipk_), intent(out) :: info complex(psb_dpk_), intent(in), optional :: shift - integer(psb_ipk_), intent(in), optional :: ibase end subroutine psi_z_exscanv end interface psi_exscan diff --git a/base/serial/impl/psb_c_csc_impl.F90 b/base/serial/impl/psb_c_csc_impl.F90 index 7532d5a0..bb500628 100644 --- a/base/serial/impl/psb_c_csc_impl.F90 +++ b/base/serial/impl/psb_c_csc_impl.F90 @@ -2243,7 +2243,7 @@ subroutine psb_c_mv_csc_from_coo(a,b,info) !$OMP END ATOMIC end do !$OMP END DO - call psi_exscan(nc+1,a%icp,info,shift=ione,ibase=ione) + call psi_exscan(nc+1,a%icp,info,shift=ione) !$OMP END PARALLEL #else a%icp(:) = 0 @@ -2251,7 +2251,7 @@ subroutine psb_c_mv_csc_from_coo(a,b,info) i = itemp(k) a%icp(i) = a%icp(i) + 1 end do - call psi_exscan(nc+1,a%icp,info,shift=ione,ibase=ione) + call psi_exscan(nc+1,a%icp,info,shift=ione) #endif call a%set_host() diff --git a/base/serial/impl/psb_c_csr_impl.F90 b/base/serial/impl/psb_c_csr_impl.F90 index b742204d..06dec27d 100644 --- a/base/serial/impl/psb_c_csr_impl.F90 +++ b/base/serial/impl/psb_c_csr_impl.F90 @@ -2935,7 +2935,7 @@ subroutine psb_c_cp_csr_from_coo(a,b,info) !$OMP END ATOMIC end do !$OMP END DO - call psi_exscan(nr+1,a%irp,info,shift=ione,ibase=ione) + call psi_exscan(nr+1,a%irp,info,shift=ione) !$OMP END PARALLEL #else a%irp(:) = 0 @@ -2943,7 +2943,7 @@ subroutine psb_c_cp_csr_from_coo(a,b,info) i = itemp(k) a%irp(i) = a%irp(i) + 1 end do - call psi_exscan(nr+1,a%irp,info,shift=cone,ibase=ione) + call psi_exscan(nr+1,a%irp,info,shift=ione) #endif call a%set_host() @@ -3103,7 +3103,7 @@ subroutine psb_c_mv_csr_from_coo(a,b,info) !$OMP END ATOMIC end do !$OMP END DO - call psi_exscan(nr+1,a%irp,info,shift=ione,ibase=ione) + call psi_exscan(nr+1,a%irp,info,shift=ione) !$OMP END PARALLEL #else a%irp(:) = 0 @@ -3111,7 +3111,7 @@ subroutine psb_c_mv_csr_from_coo(a,b,info) i = itemp(k) a%irp(i) = a%irp(i) + 1 end do - call psi_exscan(nr+1,a%irp,info,shift=ione,ibase=ione) + call psi_exscan(nr+1,a%irp,info,shift=ione) #endif call a%set_host() diff --git a/base/serial/impl/psb_d_csc_impl.F90 b/base/serial/impl/psb_d_csc_impl.F90 index 38f746de..ec80875a 100644 --- a/base/serial/impl/psb_d_csc_impl.F90 +++ b/base/serial/impl/psb_d_csc_impl.F90 @@ -2243,7 +2243,7 @@ subroutine psb_d_mv_csc_from_coo(a,b,info) !$OMP END ATOMIC end do !$OMP END DO - call psi_exscan(nc+1,a%icp,info,shift=ione,ibase=ione) + call psi_exscan(nc+1,a%icp,info,shift=ione) !$OMP END PARALLEL #else a%icp(:) = 0 @@ -2251,7 +2251,7 @@ subroutine psb_d_mv_csc_from_coo(a,b,info) i = itemp(k) a%icp(i) = a%icp(i) + 1 end do - call psi_exscan(nc+1,a%icp,info,shift=ione,ibase=ione) + call psi_exscan(nc+1,a%icp,info,shift=ione) #endif call a%set_host() diff --git a/base/serial/impl/psb_d_csr_impl.F90 b/base/serial/impl/psb_d_csr_impl.F90 index 86287e32..f071a5b8 100644 --- a/base/serial/impl/psb_d_csr_impl.F90 +++ b/base/serial/impl/psb_d_csr_impl.F90 @@ -2935,7 +2935,7 @@ subroutine psb_d_cp_csr_from_coo(a,b,info) !$OMP END ATOMIC end do !$OMP END DO - call psi_exscan(nr+1,a%irp,info,shift=ione,ibase=ione) + call psi_exscan(nr+1,a%irp,info,shift=ione) !$OMP END PARALLEL #else a%irp(:) = 0 @@ -2943,7 +2943,7 @@ subroutine psb_d_cp_csr_from_coo(a,b,info) i = itemp(k) a%irp(i) = a%irp(i) + 1 end do - call psi_exscan(nr+1,a%irp,info,shift=done,ibase=ione) + call psi_exscan(nr+1,a%irp,info,shift=ione) #endif call a%set_host() @@ -3103,7 +3103,7 @@ subroutine psb_d_mv_csr_from_coo(a,b,info) !$OMP END ATOMIC end do !$OMP END DO - call psi_exscan(nr+1,a%irp,info,shift=ione,ibase=ione) + call psi_exscan(nr+1,a%irp,info,shift=ione) !$OMP END PARALLEL #else a%irp(:) = 0 @@ -3111,7 +3111,7 @@ subroutine psb_d_mv_csr_from_coo(a,b,info) i = itemp(k) a%irp(i) = a%irp(i) + 1 end do - call psi_exscan(nr+1,a%irp,info,shift=ione,ibase=ione) + call psi_exscan(nr+1,a%irp,info,shift=ione) #endif call a%set_host() diff --git a/base/serial/impl/psb_s_csc_impl.F90 b/base/serial/impl/psb_s_csc_impl.F90 index d1fb8c4b..fa3fe880 100644 --- a/base/serial/impl/psb_s_csc_impl.F90 +++ b/base/serial/impl/psb_s_csc_impl.F90 @@ -2243,7 +2243,7 @@ subroutine psb_s_mv_csc_from_coo(a,b,info) !$OMP END ATOMIC end do !$OMP END DO - call psi_exscan(nc+1,a%icp,info,shift=ione,ibase=ione) + call psi_exscan(nc+1,a%icp,info,shift=ione) !$OMP END PARALLEL #else a%icp(:) = 0 @@ -2251,7 +2251,7 @@ subroutine psb_s_mv_csc_from_coo(a,b,info) i = itemp(k) a%icp(i) = a%icp(i) + 1 end do - call psi_exscan(nc+1,a%icp,info,shift=ione,ibase=ione) + call psi_exscan(nc+1,a%icp,info,shift=ione) #endif call a%set_host() diff --git a/base/serial/impl/psb_s_csr_impl.F90 b/base/serial/impl/psb_s_csr_impl.F90 index 46ead8fc..cd2933f7 100644 --- a/base/serial/impl/psb_s_csr_impl.F90 +++ b/base/serial/impl/psb_s_csr_impl.F90 @@ -2935,7 +2935,7 @@ subroutine psb_s_cp_csr_from_coo(a,b,info) !$OMP END ATOMIC end do !$OMP END DO - call psi_exscan(nr+1,a%irp,info,shift=ione,ibase=ione) + call psi_exscan(nr+1,a%irp,info,shift=ione) !$OMP END PARALLEL #else a%irp(:) = 0 @@ -2943,7 +2943,7 @@ subroutine psb_s_cp_csr_from_coo(a,b,info) i = itemp(k) a%irp(i) = a%irp(i) + 1 end do - call psi_exscan(nr+1,a%irp,info,shift=sone,ibase=ione) + call psi_exscan(nr+1,a%irp,info,shift=ione) #endif call a%set_host() @@ -3103,7 +3103,7 @@ subroutine psb_s_mv_csr_from_coo(a,b,info) !$OMP END ATOMIC end do !$OMP END DO - call psi_exscan(nr+1,a%irp,info,shift=ione,ibase=ione) + call psi_exscan(nr+1,a%irp,info,shift=ione) !$OMP END PARALLEL #else a%irp(:) = 0 @@ -3111,7 +3111,7 @@ subroutine psb_s_mv_csr_from_coo(a,b,info) i = itemp(k) a%irp(i) = a%irp(i) + 1 end do - call psi_exscan(nr+1,a%irp,info,shift=ione,ibase=ione) + call psi_exscan(nr+1,a%irp,info,shift=ione) #endif call a%set_host() diff --git a/base/serial/impl/psb_z_csc_impl.F90 b/base/serial/impl/psb_z_csc_impl.F90 index 2735bcbd..28285e4d 100644 --- a/base/serial/impl/psb_z_csc_impl.F90 +++ b/base/serial/impl/psb_z_csc_impl.F90 @@ -2243,7 +2243,7 @@ subroutine psb_z_mv_csc_from_coo(a,b,info) !$OMP END ATOMIC end do !$OMP END DO - call psi_exscan(nc+1,a%icp,info,shift=ione,ibase=ione) + call psi_exscan(nc+1,a%icp,info,shift=ione) !$OMP END PARALLEL #else a%icp(:) = 0 @@ -2251,7 +2251,7 @@ subroutine psb_z_mv_csc_from_coo(a,b,info) i = itemp(k) a%icp(i) = a%icp(i) + 1 end do - call psi_exscan(nc+1,a%icp,info,shift=ione,ibase=ione) + call psi_exscan(nc+1,a%icp,info,shift=ione) #endif call a%set_host() diff --git a/base/serial/impl/psb_z_csr_impl.F90 b/base/serial/impl/psb_z_csr_impl.F90 index b6ec8fe7..88f49335 100644 --- a/base/serial/impl/psb_z_csr_impl.F90 +++ b/base/serial/impl/psb_z_csr_impl.F90 @@ -2935,7 +2935,7 @@ subroutine psb_z_cp_csr_from_coo(a,b,info) !$OMP END ATOMIC end do !$OMP END DO - call psi_exscan(nr+1,a%irp,info,shift=ione,ibase=ione) + call psi_exscan(nr+1,a%irp,info,shift=ione) !$OMP END PARALLEL #else a%irp(:) = 0 @@ -2943,7 +2943,7 @@ subroutine psb_z_cp_csr_from_coo(a,b,info) i = itemp(k) a%irp(i) = a%irp(i) + 1 end do - call psi_exscan(nr+1,a%irp,info,shift=zone,ibase=ione) + call psi_exscan(nr+1,a%irp,info,shift=ione) #endif call a%set_host() @@ -3103,7 +3103,7 @@ subroutine psb_z_mv_csr_from_coo(a,b,info) !$OMP END ATOMIC end do !$OMP END DO - call psi_exscan(nr+1,a%irp,info,shift=ione,ibase=ione) + call psi_exscan(nr+1,a%irp,info,shift=ione) !$OMP END PARALLEL #else a%irp(:) = 0 @@ -3111,7 +3111,7 @@ subroutine psb_z_mv_csr_from_coo(a,b,info) i = itemp(k) a%irp(i) = a%irp(i) + 1 end do - call psi_exscan(nr+1,a%irp,info,shift=ione,ibase=ione) + call psi_exscan(nr+1,a%irp,info,shift=ione) #endif call a%set_host() diff --git a/base/serial/psi_c_serial_impl.F90 b/base/serial/psi_c_serial_impl.F90 index 2391becb..d7c92d3a 100644 --- a/base/serial/psi_c_serial_impl.F90 +++ b/base/serial/psi_c_serial_impl.F90 @@ -29,7 +29,7 @@ ! POSSIBILITY OF SUCH DAMAGE. ! ! -subroutine psi_c_exscanv(n,x,info,shift,ibase) +subroutine psi_c_exscanv(n,x,info,shift) use psi_c_serial_mod, psb_protect_name => psi_c_exscanv use psb_const_mod use psb_error_mod @@ -41,10 +41,8 @@ subroutine psi_c_exscanv(n,x,info,shift,ibase) complex(psb_spk_), intent (inout) :: x(:) integer(psb_ipk_), intent(out) :: info complex(psb_spk_), intent(in), optional :: shift - integer(psb_ipk_), intent(in), optional :: ibase complex(psb_spk_) :: shift_, tp, ts - integer(psb_ipk_) :: ibase_ logical is_nested, is_parallel if (present(shift)) then @@ -52,11 +50,6 @@ subroutine psi_c_exscanv(n,x,info,shift,ibase) else shift_ = czero end if - if (present(ibase)) then - ibase_ = ibase - else - ibase_ = ione - end if #if defined(OPENMP) is_parallel = omp_in_parallel() @@ -97,12 +90,12 @@ contains wrk = (n)/nthreads if (ithread < MOD((n),nthreads)) then wrk = wrk + 1 - first_idx = ithread*wrk + ibase_ + first_idx = ithread*wrk + 1 else - first_idx = ithread*wrk + MOD((n),nthreads) + ibase_ + first_idx = ithread*wrk + MOD((n),nthreads) + 1 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 sumb(ithread+2) = sumb(ithread+2) + x(first_idx) do i=first_idx+1,last_idx diff --git a/base/serial/psi_d_serial_impl.F90 b/base/serial/psi_d_serial_impl.F90 index 099dd1d4..56bedc84 100644 --- a/base/serial/psi_d_serial_impl.F90 +++ b/base/serial/psi_d_serial_impl.F90 @@ -29,7 +29,7 @@ ! POSSIBILITY OF SUCH DAMAGE. ! ! -subroutine psi_d_exscanv(n,x,info,shift,ibase) +subroutine psi_d_exscanv(n,x,info,shift) use psi_d_serial_mod, psb_protect_name => psi_d_exscanv use psb_const_mod use psb_error_mod @@ -41,10 +41,8 @@ subroutine psi_d_exscanv(n,x,info,shift,ibase) real(psb_dpk_), intent (inout) :: x(:) integer(psb_ipk_), intent(out) :: info real(psb_dpk_), intent(in), optional :: shift - integer(psb_ipk_), intent(in), optional :: ibase real(psb_dpk_) :: shift_, tp, ts - integer(psb_ipk_) :: ibase_ logical is_nested, is_parallel if (present(shift)) then @@ -52,11 +50,6 @@ subroutine psi_d_exscanv(n,x,info,shift,ibase) else shift_ = dzero end if - if (present(ibase)) then - ibase_ = ibase - else - ibase_ = ione - end if #if defined(OPENMP) is_parallel = omp_in_parallel() @@ -97,12 +90,12 @@ contains wrk = (n)/nthreads if (ithread < MOD((n),nthreads)) then wrk = wrk + 1 - first_idx = ithread*wrk + ibase_ + first_idx = ithread*wrk + 1 else - first_idx = ithread*wrk + MOD((n),nthreads) + ibase_ + first_idx = ithread*wrk + MOD((n),nthreads) + 1 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 sumb(ithread+2) = sumb(ithread+2) + x(first_idx) do i=first_idx+1,last_idx diff --git a/base/serial/psi_e_serial_impl.F90 b/base/serial/psi_e_serial_impl.F90 index 10ca93b4..ba9a0b2a 100644 --- a/base/serial/psi_e_serial_impl.F90 +++ b/base/serial/psi_e_serial_impl.F90 @@ -29,7 +29,7 @@ ! POSSIBILITY OF SUCH DAMAGE. ! ! -subroutine psi_e_exscanv(n,x,info,shift,ibase) +subroutine psi_e_exscanv(n,x,info,shift) use psi_e_serial_mod, psb_protect_name => psi_e_exscanv use psb_const_mod use psb_error_mod @@ -41,10 +41,8 @@ subroutine psi_e_exscanv(n,x,info,shift,ibase) integer(psb_epk_), intent (inout) :: x(:) integer(psb_ipk_), intent(out) :: info integer(psb_epk_), intent(in), optional :: shift - integer(psb_ipk_), intent(in), optional :: ibase integer(psb_epk_) :: shift_, tp, ts - integer(psb_ipk_) :: ibase_ logical is_nested, is_parallel if (present(shift)) then @@ -52,11 +50,6 @@ subroutine psi_e_exscanv(n,x,info,shift,ibase) else shift_ = ezero end if - if (present(ibase)) then - ibase_ = ibase - else - ibase_ = ione - end if #if defined(OPENMP) is_parallel = omp_in_parallel() @@ -97,12 +90,12 @@ contains wrk = (n)/nthreads if (ithread < MOD((n),nthreads)) then wrk = wrk + 1 - first_idx = ithread*wrk + ibase_ + first_idx = ithread*wrk + 1 else - first_idx = ithread*wrk + MOD((n),nthreads) + ibase_ + first_idx = ithread*wrk + MOD((n),nthreads) + 1 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 sumb(ithread+2) = sumb(ithread+2) + x(first_idx) do i=first_idx+1,last_idx diff --git a/base/serial/psi_i2_serial_impl.F90 b/base/serial/psi_i2_serial_impl.F90 index 3ccd35bc..200e378a 100644 --- a/base/serial/psi_i2_serial_impl.F90 +++ b/base/serial/psi_i2_serial_impl.F90 @@ -29,7 +29,7 @@ ! 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 psb_const_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_ipk_), intent(out) :: info integer(psb_i2pk_), intent(in), optional :: shift - integer(psb_ipk_), intent(in), optional :: ibase integer(psb_i2pk_) :: shift_, tp, ts - integer(psb_ipk_) :: ibase_ logical is_nested, is_parallel if (present(shift)) then @@ -52,11 +50,6 @@ subroutine psi_i2_exscanv(n,x,info,shift,ibase) else shift_ = i2zero end if - if (present(ibase)) then - ibase_ = ibase - else - ibase_ = ione - end if #if defined(OPENMP) is_parallel = omp_in_parallel() @@ -97,12 +90,12 @@ contains wrk = (n)/nthreads if (ithread < MOD((n),nthreads)) then wrk = wrk + 1 - first_idx = ithread*wrk + ibase_ + first_idx = ithread*wrk + 1 else - first_idx = ithread*wrk + MOD((n),nthreads) + ibase_ + first_idx = ithread*wrk + MOD((n),nthreads) + 1 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 sumb(ithread+2) = sumb(ithread+2) + x(first_idx) do i=first_idx+1,last_idx diff --git a/base/serial/psi_m_serial_impl.F90 b/base/serial/psi_m_serial_impl.F90 index c3d73e5a..05461e1e 100644 --- a/base/serial/psi_m_serial_impl.F90 +++ b/base/serial/psi_m_serial_impl.F90 @@ -29,7 +29,7 @@ ! POSSIBILITY OF SUCH DAMAGE. ! ! -subroutine psi_m_exscanv(n,x,info,shift,ibase) +subroutine psi_m_exscanv(n,x,info,shift) use psi_m_serial_mod, psb_protect_name => psi_m_exscanv use psb_const_mod use psb_error_mod @@ -41,10 +41,8 @@ subroutine psi_m_exscanv(n,x,info,shift,ibase) integer(psb_mpk_), intent (inout) :: x(:) integer(psb_ipk_), intent(out) :: info integer(psb_mpk_), intent(in), optional :: shift - integer(psb_ipk_), intent(in), optional :: ibase integer(psb_mpk_) :: shift_, tp, ts - integer(psb_ipk_) :: ibase_ logical is_nested, is_parallel if (present(shift)) then @@ -52,11 +50,6 @@ subroutine psi_m_exscanv(n,x,info,shift,ibase) else shift_ = mzero end if - if (present(ibase)) then - ibase_ = ibase - else - ibase_ = ione - end if #if defined(OPENMP) is_parallel = omp_in_parallel() @@ -97,12 +90,12 @@ contains wrk = (n)/nthreads if (ithread < MOD((n),nthreads)) then wrk = wrk + 1 - first_idx = ithread*wrk + ibase_ + first_idx = ithread*wrk + 1 else - first_idx = ithread*wrk + MOD((n),nthreads) + ibase_ + first_idx = ithread*wrk + MOD((n),nthreads) + 1 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 sumb(ithread+2) = sumb(ithread+2) + x(first_idx) do i=first_idx+1,last_idx diff --git a/base/serial/psi_s_serial_impl.F90 b/base/serial/psi_s_serial_impl.F90 index fd1c4cd4..6e5eadd7 100644 --- a/base/serial/psi_s_serial_impl.F90 +++ b/base/serial/psi_s_serial_impl.F90 @@ -29,7 +29,7 @@ ! POSSIBILITY OF SUCH DAMAGE. ! ! -subroutine psi_s_exscanv(n,x,info,shift,ibase) +subroutine psi_s_exscanv(n,x,info,shift) use psi_s_serial_mod, psb_protect_name => psi_s_exscanv use psb_const_mod use psb_error_mod @@ -41,10 +41,8 @@ subroutine psi_s_exscanv(n,x,info,shift,ibase) real(psb_spk_), intent (inout) :: x(:) integer(psb_ipk_), intent(out) :: info real(psb_spk_), intent(in), optional :: shift - integer(psb_ipk_), intent(in), optional :: ibase real(psb_spk_) :: shift_, tp, ts - integer(psb_ipk_) :: ibase_ logical is_nested, is_parallel if (present(shift)) then @@ -52,11 +50,6 @@ subroutine psi_s_exscanv(n,x,info,shift,ibase) else shift_ = szero end if - if (present(ibase)) then - ibase_ = ibase - else - ibase_ = ione - end if #if defined(OPENMP) is_parallel = omp_in_parallel() @@ -97,12 +90,12 @@ contains wrk = (n)/nthreads if (ithread < MOD((n),nthreads)) then wrk = wrk + 1 - first_idx = ithread*wrk + ibase_ + first_idx = ithread*wrk + 1 else - first_idx = ithread*wrk + MOD((n),nthreads) + ibase_ + first_idx = ithread*wrk + MOD((n),nthreads) + 1 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 sumb(ithread+2) = sumb(ithread+2) + x(first_idx) do i=first_idx+1,last_idx diff --git a/base/serial/psi_z_serial_impl.F90 b/base/serial/psi_z_serial_impl.F90 index bf055476..ef13db0b 100644 --- a/base/serial/psi_z_serial_impl.F90 +++ b/base/serial/psi_z_serial_impl.F90 @@ -29,7 +29,7 @@ ! POSSIBILITY OF SUCH DAMAGE. ! ! -subroutine psi_z_exscanv(n,x,info,shift,ibase) +subroutine psi_z_exscanv(n,x,info,shift) use psi_z_serial_mod, psb_protect_name => psi_z_exscanv use psb_const_mod use psb_error_mod @@ -41,10 +41,8 @@ subroutine psi_z_exscanv(n,x,info,shift,ibase) complex(psb_dpk_), intent (inout) :: x(:) integer(psb_ipk_), intent(out) :: info complex(psb_dpk_), intent(in), optional :: shift - integer(psb_ipk_), intent(in), optional :: ibase complex(psb_dpk_) :: shift_, tp, ts - integer(psb_ipk_) :: ibase_ logical is_nested, is_parallel if (present(shift)) then @@ -52,11 +50,6 @@ subroutine psi_z_exscanv(n,x,info,shift,ibase) else shift_ = zzero end if - if (present(ibase)) then - ibase_ = ibase - else - ibase_ = ione - end if #if defined(OPENMP) is_parallel = omp_in_parallel() @@ -97,12 +90,12 @@ contains wrk = (n)/nthreads if (ithread < MOD((n),nthreads)) then wrk = wrk + 1 - first_idx = ithread*wrk + ibase_ + first_idx = ithread*wrk + 1 else - first_idx = ithread*wrk + MOD((n),nthreads) + ibase_ + first_idx = ithread*wrk + MOD((n),nthreads) + 1 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 sumb(ithread+2) = sumb(ithread+2) + x(first_idx) do i=first_idx+1,last_idx