|
|
@ -44,35 +44,27 @@
|
|
|
|
! info - integer. Return code
|
|
|
|
! info - integer. Return code
|
|
|
|
! jx - integer(optional). The column offset.
|
|
|
|
! jx - integer(optional). The column offset.
|
|
|
|
!
|
|
|
|
!
|
|
|
|
function psb_zamax (x,desc_a, info, jx)
|
|
|
|
function psb_zamax(x,desc_a, info, jx) result(res)
|
|
|
|
use psb_penv_mod
|
|
|
|
use psb_base_mod, psb_protect_name => psb_zamax
|
|
|
|
use psb_serial_mod
|
|
|
|
|
|
|
|
use psb_descriptor_type
|
|
|
|
|
|
|
|
use psb_check_mod
|
|
|
|
|
|
|
|
use psb_error_mod
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
|
|
|
|
complex(psb_dpk_), intent(in) :: x(:,:)
|
|
|
|
complex(psb_dpk_), intent(in) :: x(:,:)
|
|
|
|
type(psb_desc_type), intent(in) :: desc_a
|
|
|
|
type(psb_desc_type), intent(in) :: desc_a
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
integer(psb_ipk_), optional, intent(in) :: jx
|
|
|
|
integer(psb_ipk_), optional, intent(in) :: jx
|
|
|
|
real(psb_dpk_) :: psb_zamax
|
|
|
|
real(psb_dpk_) :: res
|
|
|
|
|
|
|
|
|
|
|
|
! locals
|
|
|
|
! locals
|
|
|
|
integer(psb_ipk_) :: ictxt, np, me,&
|
|
|
|
integer(psb_ipk_) :: ictxt, np, me,&
|
|
|
|
& err_act, iix, jjx, ix, ijx, m, imax, izamax
|
|
|
|
& err_act, iix, jjx, ix, ijx, m, ldx
|
|
|
|
real(psb_dpk_) :: amax
|
|
|
|
|
|
|
|
character(len=20) :: name, ch_err
|
|
|
|
character(len=20) :: name, ch_err
|
|
|
|
double complex :: zdum
|
|
|
|
|
|
|
|
double precision :: cabs1
|
|
|
|
|
|
|
|
cabs1( zdum ) = abs( dble( zdum ) ) + abs( dimag( zdum ) )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
name='psb_zamax'
|
|
|
|
name='psb_zamax'
|
|
|
|
if(psb_get_errstatus() /= 0) return
|
|
|
|
if(psb_get_errstatus() /= 0) return
|
|
|
|
info=psb_success_
|
|
|
|
info=psb_success_
|
|
|
|
call psb_erractionsave(err_act)
|
|
|
|
call psb_erractionsave(err_act)
|
|
|
|
|
|
|
|
|
|
|
|
amax=0.d0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ictxt = desc_a%get_context()
|
|
|
|
ictxt = desc_a%get_context()
|
|
|
|
|
|
|
|
|
|
|
@ -91,8 +83,9 @@ function psb_zamax (x,desc_a, info, jx)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
m = desc_a%get_global_rows()
|
|
|
|
m = desc_a%get_global_rows()
|
|
|
|
|
|
|
|
ldx = size(x,1)
|
|
|
|
|
|
|
|
|
|
|
|
call psb_chkvect(m,1,size(x,1),ix,ijx,desc_a,info,iix,jjx)
|
|
|
|
call psb_chkvect(m,ione,ldx,ix,ijx,desc_a,info,iix,jjx)
|
|
|
|
if(info /= psb_success_) then
|
|
|
|
if(info /= psb_success_) then
|
|
|
|
info=psb_err_from_subroutine_
|
|
|
|
info=psb_err_from_subroutine_
|
|
|
|
ch_err='psb_chkvect'
|
|
|
|
ch_err='psb_chkvect'
|
|
|
@ -108,16 +101,13 @@ function psb_zamax (x,desc_a, info, jx)
|
|
|
|
|
|
|
|
|
|
|
|
! compute local max
|
|
|
|
! compute local max
|
|
|
|
if ((desc_a%get_local_rows() > 0).and.(m /= 0)) then
|
|
|
|
if ((desc_a%get_local_rows() > 0).and.(m /= 0)) then
|
|
|
|
imax=izamax(desc_a%get_local_rows()-iix+1,x(iix,jjx),1)
|
|
|
|
res = psb_amax(desc_a%get_local_rows()-iix+1,x(:,jjx))
|
|
|
|
amax=cabs1(x(iix+imax-1,jjx))
|
|
|
|
|
|
|
|
else
|
|
|
|
else
|
|
|
|
amax = dzero
|
|
|
|
res = dzero
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
! compute global max
|
|
|
|
! compute global max
|
|
|
|
call psb_amx(ictxt, amax)
|
|
|
|
call psb_amx(ictxt, res)
|
|
|
|
|
|
|
|
|
|
|
|
psb_zamax=amax
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
call psb_erractionrestore(err_act)
|
|
|
|
call psb_erractionrestore(err_act)
|
|
|
|
return
|
|
|
|
return
|
|
|
@ -133,24 +123,64 @@ function psb_zamax (x,desc_a, info, jx)
|
|
|
|
end function psb_zamax
|
|
|
|
end function psb_zamax
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function psb_zamax_vect(x, desc_a, info) result(res)
|
|
|
|
|
|
|
|
use psb_penv_mod
|
|
|
|
|
|
|
|
use psb_serial_mod
|
|
|
|
!!$
|
|
|
|
use psb_descriptor_type
|
|
|
|
!!$ Parallel Sparse BLAS version 3.0
|
|
|
|
use psb_check_mod
|
|
|
|
!!$ (C) Copyright 2006, 2007, 2008, 2009, 2010
|
|
|
|
use psb_error_mod
|
|
|
|
!!$ Salvatore Filippone University of Rome Tor Vergata
|
|
|
|
use psb_z_vect_mod
|
|
|
|
!!$ Alfredo Buttari CNRS-IRIT, Toulouse
|
|
|
|
|
|
|
|
!!$
|
|
|
|
|
|
|
|
!!$ Redistribution and use in source and binary forms, with or without
|
|
|
|
|
|
|
|
!!$ modification, are permitted provided that the following conditions
|
|
|
|
|
|
|
|
!!$ are met:
|
|
|
|
|
|
|
|
!!$ 1. Redistributions of source code must retain the above copyright
|
|
|
|
|
|
|
|
!!$ notice, this list of conditions and the following disclaimer.
|
|
|
|
|
|
|
|
!!$ 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
|
|
|
|
!!$ notice, this list of conditions, and the following disclaimer in the
|
|
|
|
|
|
|
|
!!$ documentation and/or other materials provided with the distribution.
|
|
|
|
|
|
|
|
!!$ 3. The name of the PSBLAS group or the names of its contributors may
|
|
|
|
|
|
|
|
!!$ not be used to endorse or promote products derived from this
|
|
|
|
|
|
|
|
!!$ software without specific written permission.
|
|
|
|
|
|
|
|
!!$
|
|
|
|
|
|
|
|
!!$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
|
|
|
|
!!$ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
|
|
|
|
!!$ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
|
|
|
|
!!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
|
|
|
|
|
|
|
|
!!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
|
|
|
|
!!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
|
|
|
|
!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
|
|
|
|
!!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
|
|
|
|
!!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
|
|
|
|
!!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
|
|
|
|
!!$ POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
|
|
|
!!$
|
|
|
|
|
|
|
|
!!$
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
! Function: psb_zamaxv
|
|
|
|
|
|
|
|
! Searches the absolute max of X.
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
! normi := max(abs(X(i))
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
! Arguments:
|
|
|
|
|
|
|
|
! x(:) - complex The input vector.
|
|
|
|
|
|
|
|
! desc_a - type(psb_desc_type). The communication descriptor.
|
|
|
|
|
|
|
|
! info - integer. Return code
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
function psb_zamaxv (x,desc_a, info) result(res)
|
|
|
|
|
|
|
|
use psb_base_mod, psb_protect_name => psb_zamaxv
|
|
|
|
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
|
|
|
|
real(psb_dpk_) :: res
|
|
|
|
complex(psb_dpk_), intent(in) :: x(:)
|
|
|
|
type(psb_z_vect_type), intent (inout) :: x
|
|
|
|
|
|
|
|
type(psb_desc_type), intent(in) :: desc_a
|
|
|
|
type(psb_desc_type), intent(in) :: desc_a
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
|
|
|
real(psb_dpk_) :: res
|
|
|
|
|
|
|
|
|
|
|
|
! locals
|
|
|
|
! locals
|
|
|
|
integer(psb_ipk_) :: ictxt, np, me,&
|
|
|
|
integer(psb_ipk_) :: ictxt, np, me,&
|
|
|
|
& err_act, iix, jjx, jx, ix, m, imax, isamax
|
|
|
|
& err_act, iix, jjx, jx, ix, m, ldx
|
|
|
|
real(psb_dpk_) :: amax
|
|
|
|
|
|
|
|
character(len=20) :: name, ch_err
|
|
|
|
character(len=20) :: name, ch_err
|
|
|
|
|
|
|
|
|
|
|
|
name='psb_zamaxv'
|
|
|
|
name='psb_zamaxv'
|
|
|
@ -158,7 +188,7 @@ function psb_zamax_vect(x, desc_a, info) result(res)
|
|
|
|
info=psb_success_
|
|
|
|
info=psb_success_
|
|
|
|
call psb_erractionsave(err_act)
|
|
|
|
call psb_erractionsave(err_act)
|
|
|
|
|
|
|
|
|
|
|
|
amax=dzero
|
|
|
|
|
|
|
|
ictxt=desc_a%get_context()
|
|
|
|
ictxt=desc_a%get_context()
|
|
|
|
|
|
|
|
|
|
|
|
call psb_info(ictxt, me, np)
|
|
|
|
call psb_info(ictxt, me, np)
|
|
|
@ -168,18 +198,13 @@ function psb_zamax_vect(x, desc_a, info) result(res)
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
if (.not.allocated(x%v)) then
|
|
|
|
|
|
|
|
info = psb_err_invalid_vect_state_
|
|
|
|
|
|
|
|
call psb_errpush(info,name)
|
|
|
|
|
|
|
|
goto 9999
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ix = 1
|
|
|
|
ix = 1
|
|
|
|
jx = 1
|
|
|
|
jx = 1
|
|
|
|
|
|
|
|
|
|
|
|
m = desc_a%get_global_rows()
|
|
|
|
m = desc_a%get_global_rows()
|
|
|
|
|
|
|
|
ldx = size(x,1)
|
|
|
|
|
|
|
|
|
|
|
|
call psb_chkvect(m,1,x%get_nrows(),ix,jx,desc_a,info,iix,jjx)
|
|
|
|
call psb_chkvect(m,ione,ldx,ix,jx,desc_a,info,iix,jjx)
|
|
|
|
if(info /= psb_success_) then
|
|
|
|
if(info /= psb_success_) then
|
|
|
|
info=psb_err_from_subroutine_
|
|
|
|
info=psb_err_from_subroutine_
|
|
|
|
ch_err='psb_chkvect'
|
|
|
|
ch_err='psb_chkvect'
|
|
|
@ -195,15 +220,13 @@ function psb_zamax_vect(x, desc_a, info) result(res)
|
|
|
|
|
|
|
|
|
|
|
|
! compute local max
|
|
|
|
! compute local max
|
|
|
|
if ((desc_a%get_local_rows() > 0).and.(m /= 0)) then
|
|
|
|
if ((desc_a%get_local_rows() > 0).and.(m /= 0)) then
|
|
|
|
amax=x%amax(desc_a%get_local_rows())
|
|
|
|
res = psb_amax(desc_a%get_local_rows()-iix+1,x)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
amax = dzero
|
|
|
|
res = dzero
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
! compute global max
|
|
|
|
! compute global max
|
|
|
|
call psb_amx(ictxt, amax)
|
|
|
|
call psb_amx(ictxt, res)
|
|
|
|
|
|
|
|
|
|
|
|
res=amax
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
call psb_erractionrestore(err_act)
|
|
|
|
call psb_erractionrestore(err_act)
|
|
|
|
return
|
|
|
|
return
|
|
|
@ -216,84 +239,33 @@ function psb_zamax_vect(x, desc_a, info) result(res)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
end function psb_zamaxv
|
|
|
|
end function psb_zamax_vect
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!!$
|
|
|
|
function psb_zamax_vect(x, desc_a, info) result(res)
|
|
|
|
!!$ Parallel Sparse BLAS version 3.0
|
|
|
|
|
|
|
|
!!$ (C) Copyright 2006, 2007, 2008, 2009, 2010
|
|
|
|
|
|
|
|
!!$ Salvatore Filippone University of Rome Tor Vergata
|
|
|
|
|
|
|
|
!!$ Alfredo Buttari CNRS-IRIT, Toulouse
|
|
|
|
|
|
|
|
!!$
|
|
|
|
|
|
|
|
!!$ Redistribution and use in source and binary forms, with or without
|
|
|
|
|
|
|
|
!!$ modification, are permitted provided that the following conditions
|
|
|
|
|
|
|
|
!!$ are met:
|
|
|
|
|
|
|
|
!!$ 1. Redistributions of source code must retain the above copyright
|
|
|
|
|
|
|
|
!!$ notice, this list of conditions and the following disclaimer.
|
|
|
|
|
|
|
|
!!$ 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
|
|
|
|
!!$ notice, this list of conditions, and the following disclaimer in the
|
|
|
|
|
|
|
|
!!$ documentation and/or other materials provided with the distribution.
|
|
|
|
|
|
|
|
!!$ 3. The name of the PSBLAS group or the names of its contributors may
|
|
|
|
|
|
|
|
!!$ not be used to endorse or promote products derived from this
|
|
|
|
|
|
|
|
!!$ software without specific written permission.
|
|
|
|
|
|
|
|
!!$
|
|
|
|
|
|
|
|
!!$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
|
|
|
|
!!$ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
|
|
|
|
!!$ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
|
|
|
|
!!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
|
|
|
|
|
|
|
|
!!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
|
|
|
|
!!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
|
|
|
|
!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
|
|
|
|
!!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
|
|
|
|
!!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
|
|
|
|
!!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
|
|
|
|
!!$ POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
|
|
|
!!$
|
|
|
|
|
|
|
|
!!$
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
! Function: psb_zamaxv
|
|
|
|
|
|
|
|
! Searches the absolute max of X.
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
! normi := max(abs(X(i))
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
! Arguments:
|
|
|
|
|
|
|
|
! x(:) - complex The input vector.
|
|
|
|
|
|
|
|
! desc_a - type(psb_desc_type). The communication descriptor.
|
|
|
|
|
|
|
|
! info - integer. Return code
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
function psb_zamaxv (x,desc_a, info)
|
|
|
|
|
|
|
|
use psb_penv_mod
|
|
|
|
use psb_penv_mod
|
|
|
|
use psb_serial_mod
|
|
|
|
use psb_serial_mod
|
|
|
|
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_z_vect_mod
|
|
|
|
implicit none
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
|
|
|
|
complex(psb_dpk_), intent(in) :: x(:)
|
|
|
|
real(psb_dpk_) :: res
|
|
|
|
|
|
|
|
type(psb_z_vect_type), intent (inout) :: x
|
|
|
|
type(psb_desc_type), intent (in) :: desc_a
|
|
|
|
type(psb_desc_type), intent (in) :: desc_a
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
real(psb_dpk_) :: psb_zamaxv
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
! locals
|
|
|
|
! locals
|
|
|
|
integer(psb_ipk_) :: ictxt, np, me,&
|
|
|
|
integer(psb_ipk_) :: ictxt, np, me,&
|
|
|
|
& err_act, iix, jjx, jx, ix, m, imax, izamax
|
|
|
|
& err_act, iix, jjx, jx, ix, m
|
|
|
|
real(psb_dpk_) :: amax
|
|
|
|
|
|
|
|
complex(psb_dpk_) :: cmax
|
|
|
|
|
|
|
|
character(len=20) :: name, ch_err
|
|
|
|
character(len=20) :: name, ch_err
|
|
|
|
double complex :: zdum
|
|
|
|
|
|
|
|
double precision :: cabs1
|
|
|
|
|
|
|
|
cabs1( zdum ) = abs( dble( zdum ) ) + abs( dimag( zdum ) )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
name='psb_zamaxv'
|
|
|
|
name='psb_zamaxv'
|
|
|
|
if(psb_get_errstatus() /= 0) return
|
|
|
|
if(psb_get_errstatus() /= 0) return
|
|
|
|
info=psb_success_
|
|
|
|
info=psb_success_
|
|
|
|
call psb_erractionsave(err_act)
|
|
|
|
call psb_erractionsave(err_act)
|
|
|
|
|
|
|
|
|
|
|
|
amax=0.d0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ictxt=desc_a%get_context()
|
|
|
|
ictxt=desc_a%get_context()
|
|
|
|
|
|
|
|
|
|
|
|
call psb_info(ictxt, me, np)
|
|
|
|
call psb_info(ictxt, me, np)
|
|
|
@ -303,12 +275,17 @@ function psb_zamaxv (x,desc_a, info)
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (.not.allocated(x%v)) then
|
|
|
|
|
|
|
|
info = psb_err_invalid_vect_state_
|
|
|
|
|
|
|
|
call psb_errpush(info,name)
|
|
|
|
|
|
|
|
goto 9999
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
ix = 1
|
|
|
|
ix = 1
|
|
|
|
jx = 1
|
|
|
|
jx = 1
|
|
|
|
|
|
|
|
|
|
|
|
m = desc_a%get_global_rows()
|
|
|
|
m = desc_a%get_global_rows()
|
|
|
|
|
|
|
|
call psb_chkvect(m,ione,x%get_nrows(),ix,jx,desc_a,info,iix,jjx)
|
|
|
|
call psb_chkvect(m,1,size(x,1),ix,jx,desc_a,info,iix,jjx)
|
|
|
|
|
|
|
|
if(info /= psb_success_) then
|
|
|
|
if(info /= psb_success_) then
|
|
|
|
info=psb_err_from_subroutine_
|
|
|
|
info=psb_err_from_subroutine_
|
|
|
|
ch_err='psb_chkvect'
|
|
|
|
ch_err='psb_chkvect'
|
|
|
@ -324,17 +301,13 @@ function psb_zamaxv (x,desc_a, info)
|
|
|
|
|
|
|
|
|
|
|
|
! compute local max
|
|
|
|
! compute local max
|
|
|
|
if ((desc_a%get_local_rows() > 0).and.(m /= 0)) then
|
|
|
|
if ((desc_a%get_local_rows() > 0).and.(m /= 0)) then
|
|
|
|
imax=izamax(desc_a%get_local_rows()-iix+1,x(iix),1)
|
|
|
|
res = x%amax(desc_a%get_local_rows())
|
|
|
|
cmax=(x(iix+imax-1))
|
|
|
|
|
|
|
|
amax=cabs1(cmax)
|
|
|
|
|
|
|
|
else
|
|
|
|
else
|
|
|
|
amax = dzero
|
|
|
|
res = dzero
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
! compute global max
|
|
|
|
! compute global max
|
|
|
|
call psb_amx(ictxt, amax)
|
|
|
|
call psb_amx(ictxt, res)
|
|
|
|
|
|
|
|
|
|
|
|
psb_zamaxv=amax
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
call psb_erractionrestore(err_act)
|
|
|
|
call psb_erractionrestore(err_act)
|
|
|
|
return
|
|
|
|
return
|
|
|
@ -347,7 +320,9 @@ function psb_zamaxv (x,desc_a, info)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
return
|
|
|
|
return
|
|
|
|
end function psb_zamaxv
|
|
|
|
|
|
|
|
|
|
|
|
end function psb_zamax_vect
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!!$
|
|
|
|
!!$
|
|
|
|
!!$ Parallel Sparse BLAS version 3.0
|
|
|
|
!!$ Parallel Sparse BLAS version 3.0
|
|
|
@ -397,6 +372,7 @@ end function psb_zamaxv
|
|
|
|
!
|
|
|
|
!
|
|
|
|
subroutine psb_zamaxvs(res,x,desc_a, info)
|
|
|
|
subroutine psb_zamaxvs(res,x,desc_a, info)
|
|
|
|
use psb_base_mod, psb_protect_name => psb_zamaxvs
|
|
|
|
use psb_base_mod, psb_protect_name => psb_zamaxvs
|
|
|
|
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
|
|
|
|
complex(psb_dpk_), intent(in) :: x(:)
|
|
|
|
complex(psb_dpk_), intent(in) :: x(:)
|
|
|
@ -406,20 +382,14 @@ subroutine psb_zamaxvs(res,x,desc_a, info)
|
|
|
|
|
|
|
|
|
|
|
|
! locals
|
|
|
|
! locals
|
|
|
|
integer(psb_ipk_) :: ictxt, np, me,&
|
|
|
|
integer(psb_ipk_) :: ictxt, np, me,&
|
|
|
|
& err_act, iix, jjx, ix, ijx, m, imax, izamax
|
|
|
|
& err_act, iix, jjx, ix, ijx, m, ldx
|
|
|
|
real(psb_dpk_) :: amax
|
|
|
|
|
|
|
|
character(len=20) :: name, ch_err
|
|
|
|
character(len=20) :: name, ch_err
|
|
|
|
complex(psb_dpk_) :: cmax
|
|
|
|
|
|
|
|
double complex :: zdum
|
|
|
|
|
|
|
|
double precision :: cabs1
|
|
|
|
|
|
|
|
cabs1( zdum ) = abs( dble( zdum ) ) + abs( dimag( zdum ) )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
name='psb_zamaxvs'
|
|
|
|
name='psb_zamaxvs'
|
|
|
|
if(psb_get_errstatus() /= 0) return
|
|
|
|
if(psb_get_errstatus() /= 0) return
|
|
|
|
info=psb_success_
|
|
|
|
info=psb_success_
|
|
|
|
call psb_erractionsave(err_act)
|
|
|
|
call psb_erractionsave(err_act)
|
|
|
|
|
|
|
|
|
|
|
|
amax=0.d0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ictxt = desc_a%get_context()
|
|
|
|
ictxt = desc_a%get_context()
|
|
|
|
|
|
|
|
|
|
|
@ -434,7 +404,8 @@ subroutine psb_zamaxvs(res,x,desc_a, info)
|
|
|
|
ijx=1
|
|
|
|
ijx=1
|
|
|
|
|
|
|
|
|
|
|
|
m = desc_a%get_global_rows()
|
|
|
|
m = desc_a%get_global_rows()
|
|
|
|
call psb_chkvect(m,1,size(x,1),ix,ijx,desc_a,info,iix,jjx)
|
|
|
|
ldx=size(x,1)
|
|
|
|
|
|
|
|
call psb_chkvect(m,ione,ldx,ix,ijx,desc_a,info,iix,jjx)
|
|
|
|
if(info /= psb_success_) then
|
|
|
|
if(info /= psb_success_) then
|
|
|
|
info=psb_err_from_subroutine_
|
|
|
|
info=psb_err_from_subroutine_
|
|
|
|
ch_err='psb_chkvect'
|
|
|
|
ch_err='psb_chkvect'
|
|
|
@ -450,17 +421,13 @@ subroutine psb_zamaxvs(res,x,desc_a, info)
|
|
|
|
|
|
|
|
|
|
|
|
! compute local max
|
|
|
|
! compute local max
|
|
|
|
if ((desc_a%get_local_rows() > 0).and.(m /= 0)) then
|
|
|
|
if ((desc_a%get_local_rows() > 0).and.(m /= 0)) then
|
|
|
|
imax=izamax(desc_a%get_local_rows()-iix+1,x(iix),1)
|
|
|
|
res = psb_amax(desc_a%get_local_rows()-iix+1,x)
|
|
|
|
cmax=(x(iix+imax-1))
|
|
|
|
|
|
|
|
amax=cabs1(cmax)
|
|
|
|
|
|
|
|
else
|
|
|
|
else
|
|
|
|
amax = dzero
|
|
|
|
res = dzero
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
! compute global max
|
|
|
|
! compute global max
|
|
|
|
call psb_amx(ictxt, amax)
|
|
|
|
call psb_amx(ictxt, res)
|
|
|
|
|
|
|
|
|
|
|
|
res = amax
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
call psb_erractionrestore(err_act)
|
|
|
|
call psb_erractionrestore(err_act)
|
|
|
|
return
|
|
|
|
return
|
|
|
@ -521,6 +488,7 @@ end subroutine psb_zamaxvs
|
|
|
|
!
|
|
|
|
!
|
|
|
|
subroutine psb_zmamaxs(res,x,desc_a, info,jx)
|
|
|
|
subroutine psb_zmamaxs(res,x,desc_a, info,jx)
|
|
|
|
use psb_base_mod, psb_protect_name => psb_zmamaxs
|
|
|
|
use psb_base_mod, psb_protect_name => psb_zmamaxs
|
|
|
|
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
|
|
|
|
complex(psb_dpk_), intent(in) :: x(:,:)
|
|
|
|
complex(psb_dpk_), intent(in) :: x(:,:)
|
|
|
@ -531,21 +499,14 @@ subroutine psb_zmamaxs(res,x,desc_a, info,jx)
|
|
|
|
|
|
|
|
|
|
|
|
! locals
|
|
|
|
! locals
|
|
|
|
integer(psb_ipk_) :: ictxt, np, me,&
|
|
|
|
integer(psb_ipk_) :: ictxt, np, me,&
|
|
|
|
& err_act, iix, jjx, ix, ijx, m, imax, i, k, izamax
|
|
|
|
& err_act, iix, jjx, ix, ijx, m, ldx, i, k
|
|
|
|
real(psb_dpk_) :: amax
|
|
|
|
|
|
|
|
character(len=20) :: name, ch_err
|
|
|
|
character(len=20) :: name, ch_err
|
|
|
|
complex(psb_dpk_) :: cmax
|
|
|
|
|
|
|
|
double complex :: zdum
|
|
|
|
|
|
|
|
double precision :: cabs1
|
|
|
|
|
|
|
|
cabs1( zdum ) = abs( dble( zdum ) ) + abs( dimag( zdum ) )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
name='psb_zmamaxs'
|
|
|
|
name='psb_zmamaxs'
|
|
|
|
if (psb_get_errstatus() /= 0) return
|
|
|
|
if (psb_get_errstatus() /= 0) return
|
|
|
|
info=psb_success_
|
|
|
|
info=psb_success_
|
|
|
|
call psb_erractionsave(err_act)
|
|
|
|
call psb_erractionsave(err_act)
|
|
|
|
|
|
|
|
|
|
|
|
amax=0.d0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ictxt=desc_a%get_context()
|
|
|
|
ictxt=desc_a%get_context()
|
|
|
|
|
|
|
|
|
|
|
|
call psb_info(ictxt, me, np)
|
|
|
|
call psb_info(ictxt, me, np)
|
|
|
@ -564,8 +525,8 @@ subroutine psb_zmamaxs(res,x,desc_a, info,jx)
|
|
|
|
|
|
|
|
|
|
|
|
m = desc_a%get_global_rows()
|
|
|
|
m = desc_a%get_global_rows()
|
|
|
|
k = min(size(x,2),size(res,1))
|
|
|
|
k = min(size(x,2),size(res,1))
|
|
|
|
|
|
|
|
ldx = size(x,1)
|
|
|
|
call psb_chkvect(m,1,size(x,1),ix,ijx,desc_a,info,iix,jjx)
|
|
|
|
call psb_chkvect(m,ione,ldx,ix,ijx,desc_a,info,iix,jjx)
|
|
|
|
if(info /= psb_success_) then
|
|
|
|
if(info /= psb_success_) then
|
|
|
|
info=psb_err_from_subroutine_
|
|
|
|
info=psb_err_from_subroutine_
|
|
|
|
ch_err='psb_chkvect'
|
|
|
|
ch_err='psb_chkvect'
|
|
|
@ -579,15 +540,12 @@ subroutine psb_zmamaxs(res,x,desc_a, info,jx)
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res(1:k) = dzero
|
|
|
|
! compute local max
|
|
|
|
! compute local max
|
|
|
|
if ((desc_a%get_local_rows() > 0).and.(m /= 0)) then
|
|
|
|
if ((desc_a%get_local_rows() > 0).and.(m /= 0)) then
|
|
|
|
do i=1,k
|
|
|
|
do i=1,k
|
|
|
|
imax=izamax(desc_a%get_local_rows()-iix+1,x(iix,jjx+i-1),1)
|
|
|
|
res(i) = psb_amax(desc_a%get_local_rows()-iix+1,x(:,jjx+i-1))
|
|
|
|
cmax=(x(iix+imax-1,jjx+i-1))
|
|
|
|
|
|
|
|
res(i)=cabs1(cmax)
|
|
|
|
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
else
|
|
|
|
|
|
|
|
amax = dzero
|
|
|
|
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
! compute global max
|
|
|
|
! compute global max
|
|
|
|