Merge pull request #7 from sfilippone/development

Updates for emergency performance fix.
sphalo-a2av v3.5.2
Salvatore Filippone 7 years ago committed by GitHub
commit 21164cbcbd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,5 +1,7 @@
Changelog. A lot less detailed than usual, at least for past
history.
2018/04/23: Change default for CDALL with VL. New GLOBAL argument for
reductions.
2018/04/15: Fixed pargen benchmark programs. Made MOLD mandatory.
2018/01/10: Updated docs.
2017/12/15: Fixed preconditioner build.

@ -3,7 +3,7 @@ include ../../Make.inc
FOBJS = psi_compute_size.o psi_crea_bnd_elem.o psi_crea_index.o \
psi_crea_ovr_elem.o psi_bld_tmpovrl.o psi_dl_check.o \
psi_bld_tmphalo.o psi_sort_dl.o \
psi_desc_impl.o psi_exist_ovr_elem.o psi_list_search.o psi_srtlist.o
psi_desc_impl.o psi_list_search.o psi_srtlist.o
MPFOBJS = psi_desc_index.o psi_extrct_dl.o \
psi_fnd_owner.o psb_indx_map_fnd_owner.o

@ -44,16 +44,12 @@
! mapping parts are used.
! index_in(:) - integer The index list, build format
! index_out(:) - integer(psb_ipk_), allocatable The index list, assembled format
! glob_idx - logical Whether the input indices are in local or global
! numbering; the global numbering is used when
! converting the overlap exchange lists.
! nxch - integer The number of data exchanges on the calling process
! nsnd - integer Total send buffer size on the calling process
! nrcv - integer Total receive buffer size on the calling process
!
!
subroutine psi_crea_index(desc_a,index_in,index_out,glob_idx,nxch,nsnd,nrcv,info)
subroutine psi_crea_index(desc_a,index_in,index_out,nxch,nsnd,nrcv,info)
use psb_realloc_mod
use psb_desc_mod
use psb_error_mod
@ -65,7 +61,6 @@ subroutine psi_crea_index(desc_a,index_in,index_out,glob_idx,nxch,nsnd,nrcv,info
integer(psb_ipk_), intent(out) :: info,nxch,nsnd,nrcv
integer(psb_ipk_), intent(in) :: index_in(:)
integer(psb_ipk_), allocatable, intent(inout) :: index_out(:)
logical :: glob_idx
! ....local scalars...
integer(psb_ipk_) :: ictxt, me, np, mode, err_act, dl_lda
@ -135,7 +130,7 @@ subroutine psi_crea_index(desc_a,index_in,index_out,glob_idx,nxch,nsnd,nrcv,info
& write(debug_unit,*) me,' ',trim(name),': calling psi_desc_index'
! Do the actual format conversion.
call psi_desc_index(desc_a,index_in,dep_list(1:,me),&
& length_dl(me),nsnd,nrcv, index_out,glob_idx,info)
& length_dl(me),nsnd,nrcv, index_out,info)
if(debug_level >= psb_debug_inner_) &
& write(debug_unit,*) me,' ',trim(name),': out of psi_desc_index',&
& size(index_out)

@ -61,10 +61,6 @@ subroutine psi_crea_ovr_elem(me,desc_overlap,ovr_elem,info)
integer(psb_ipk_) :: dim_ovr_elem
integer(psb_ipk_) :: pairtree(2)
! ...external function...
integer(psb_ipk_) :: psi_exist_ovr_elem
external :: psi_exist_ovr_elem
integer(psb_ipk_) :: nel, ip, ix, iel, insize, err_act, iproc
integer(psb_ipk_), allocatable :: telem(:,:)

@ -102,7 +102,7 @@ subroutine psi_cnv_dsc(halo_in,ovrlap_in,ext_in,cdesc, info, mold)
! first the halo index
if (debug_level>0) write(debug_unit,*) me,'Calling crea_index on halo',&
& size(halo_in)
call psi_crea_index(cdesc,halo_in, idx_out,.false.,nxch,nsnd,nrcv,info)
call psi_crea_index(cdesc,halo_in, idx_out,nxch,nsnd,nrcv,info)
if (info /= psb_success_) then
call psb_errpush(psb_err_from_subroutine_,name,a_err='psi_crea_index')
goto 9999
@ -115,7 +115,7 @@ subroutine psi_cnv_dsc(halo_in,ovrlap_in,ext_in,cdesc, info, mold)
! then ext index
if (debug_level>0) write(debug_unit,*) me,'Calling crea_index on ext'
call psi_crea_index(cdesc,ext_in, idx_out,.false.,nxch,nsnd,nrcv,info)
call psi_crea_index(cdesc,ext_in, idx_out,nxch,nsnd,nrcv,info)
if (info /= psb_success_) then
call psb_errpush(psb_err_from_subroutine_,name,a_err='psi_crea_index')
goto 9999
@ -126,7 +126,7 @@ subroutine psi_cnv_dsc(halo_in,ovrlap_in,ext_in,cdesc, info, mold)
if (debug_level>0) write(debug_unit,*) me,'Calling crea_index on ovrlap'
! then the overlap index
call psi_crea_index(cdesc,ovrlap_in, idx_out,.true.,nxch,nsnd,nrcv,info)
call psi_crea_index(cdesc,ovrlap_in, idx_out,nxch,nsnd,nrcv,info)
if (info /= psb_success_) then
call psb_errpush(psb_err_from_subroutine_,name,a_err='psi_crea_index')
goto 9999
@ -150,7 +150,7 @@ subroutine psi_cnv_dsc(halo_in,ovrlap_in,ext_in,cdesc, info, mold)
if (debug_level>0) write(debug_unit,*) me,'Calling bld_ovr_mst'
call psi_bld_ovr_mst(me,cdesc%ovrlap_elem,tmp_mst_idx,info)
if (info == psb_success_) call psi_crea_index(cdesc,&
& tmp_mst_idx,idx_out,.false.,nxch,nsnd,nrcv,info)
& tmp_mst_idx,idx_out,nxch,nsnd,nrcv,info)
if (debug_level>0) write(debug_unit,*) me,'Done crea_indx'
if (info /= psb_success_) then
call psb_errpush(psb_err_from_subroutine_,name,a_err='psi_bld_ovr_mst')

@ -42,9 +42,6 @@
! mapping parts are used.
! index_in(:) - integer The index list, build format
! index_out(:) - integer(psb_ipk_), allocatable The index list, assembled format
! glob_idx - logical Whether the input indices are in local or global
! numbering; the global numbering is used when
! converting the overlap exchange lists.
! nxch - integer The number of data exchanges on the calling process
! nsnd - integer Total send buffer size on the calling process
! nrcv - integer Total receive buffer size on the calling process
@ -99,7 +96,7 @@
!
!
subroutine psi_desc_index(desc,index_in,dep_list,&
& length_dl,nsnd,nrcv,desc_index,isglob_in,info)
& length_dl,nsnd,nrcv,desc_index,info)
use psb_desc_mod
use psb_realloc_mod
use psb_error_mod
@ -119,7 +116,6 @@ subroutine psi_desc_index(desc,index_in,dep_list,&
integer(psb_ipk_) :: index_in(:),dep_list(:)
integer(psb_ipk_),allocatable :: desc_index(:)
integer(psb_ipk_) :: length_dl,nsnd,nrcv,info
logical :: isglob_in
! ....local scalars...
integer(psb_ipk_) :: j,me,np,i,proc
! ...parameters...
@ -255,12 +251,6 @@ subroutine psi_desc_index(desc,index_in,dep_list,&
!
! note that here bsdinx is zero-based, hence the following loop
!
if (isglob_in) then
do j=1, nerv
sndbuf(bsdindx(proc+1)+j) = (index_in(i+j))
end do
else
call desc%indxmap%l2g(index_in(i+1:i+nerv),&
& sndbuf(bsdindx(proc+1)+1:bsdindx(proc+1)+nerv),&
& info)
@ -270,7 +260,6 @@ subroutine psi_desc_index(desc,index_in,dep_list,&
goto 9999
end if
endif
bsdindx(proc+1) = bsdindx(proc+1) + nerv
i = i + nerv + 1
end do

@ -1,73 +0,0 @@
!
! Parallel Sparse BLAS version 3.5
! (C) Copyright 2006, 2010, 2015, 2017
! Salvatore Filippone
! 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.
!
!
integer function psi_exist_ovr_elem(ovr_elem, dim_list,elem_searched)
use psb_const_mod
! PURPOSE:
! == = ====
!
! If ELEM_SEARCHED exist in the list OVR_ELEM returns its position in
! the list, else returns -1
!
!
! INPUT
! == = ===
! OVRLAP_ELEMENT_D.: Contains for all overlap points belonging to
! the current process:
! 1. overlap point index
! 2. Number of domains sharing that overlap point
! the end is marked by a -1...............................
!
! DIM_LIST..........: Dimension of list OVRLAP_ELEMENT_D
!
! ELEM_SEARCHED.....:point's Local index identifier to be searched.
implicit none
! ....Scalars parameters....
integer(psb_ipk_) :: dim_list,elem_searched
! ...array parameters....
integer(psb_ipk_) :: ovr_elem(dim_list,*)
! ...local scalars....
integer(psb_ipk_) :: i
i=1
do while ((i.le.dim_list).and.(ovr_elem(i,1).ne.elem_searched))
i=i+1
enddo
if ((i.le.dim_list).and.(ovr_elem(i,1).eq.elem_searched)) then
psi_exist_ovr_elem=i
else
psi_exist_ovr_elem=-1
endif
end function psi_exist_ovr_elem

@ -1,4 +1,4 @@
!
! Parallel Sparse BLAS version 3.5
! (C) Copyright 2006-2018
! Salvatore Filippone
@ -142,9 +142,9 @@ module psb_desc_mod
! psb_ovrl subroutine.
!
! 8. When the descriptor is in the BLD state the INDEX vectors contains only
! the indices to be received, organized as a sequence
! of entries of the form (proc,N,(lx1,lx2,...,lxn)) with owning process,
! number of indices (most often but not necessarily N=1), list of local indices.
! the indices to be received, organized as a sequence of entries of
! the form (proc,N,(lx1,lx2,...,lxn)) with owning process, number of indices
! (most often but not necessarily N=1), list of local indices.
! This is because we only know the list of halo indices to be received
! as we go about building the sparse matrix pattern, and we want the build
! phase to be loosely synchronized. Thus we record the indices we have to ask
@ -334,11 +334,23 @@ contains
val = cd_large_threshold
end function psb_cd_get_large_threshold
logical function psb_cd_choose_large_state(ictxt,m)
function psb_cd_is_large_size(m) result(val)
use psb_penv_mod
implicit none
integer(psb_ipk_), intent(in) :: ictxt,m
integer(psb_ipk_), intent(in) :: m
logical :: val
!locals
val = (m > psb_cd_get_large_threshold())
end function psb_cd_is_large_size
function psb_cd_choose_large_state(ictxt,m) result(val)
use psb_penv_mod
implicit none
integer(psb_ipk_), intent(in) :: ictxt
integer(psb_ipk_), intent(in) :: m
logical :: val
!locals
integer(psb_ipk_) :: np,me
@ -348,9 +360,7 @@ contains
! it makes no sense to use them if you don't have at least
! 3 processes, no matter what the size of the process.
!
psb_cd_choose_large_state = &
& (m > psb_cd_get_large_threshold()) .and. &
& (np > 2)
val = psb_cd_is_large_size(m) .and. (np > 2)
end function psb_cd_choose_large_state
subroutine psb_nullify_desc(desc)
@ -1072,7 +1082,7 @@ contains
end subroutine psb_cd_clone
Subroutine psb_cd_get_recv_idx(tmp,desc,data,info,toglob)
Subroutine psb_cd_get_recv_idx(tmp,desc,data,info)
use psb_error_mod
use psb_penv_mod
@ -1082,7 +1092,6 @@ contains
integer(psb_ipk_), intent(in) :: data
Type(psb_desc_type), Intent(in), target :: desc
integer(psb_ipk_), intent(out) :: info
logical, intent(in) :: toglob
! .. Local Scalars ..
integer(psb_ipk_) :: incnt, outcnt, j, np, me, ictxt, l_tmp,&
@ -1141,23 +1150,10 @@ contains
call psb_errpush(info,name,a_err='psb_ensure_size')
goto 9999
end if
if (toglob) then
call desc%indxmap%l2g(idx,gidx,info)
If (gidx < 0) then
info=-3
call psb_errpush(info,name)
goto 9999
endif
tmp(outcnt) = proc
tmp(outcnt+1) = 1
tmp(outcnt+2) = gidx
tmp(outcnt+3) = -1
else
tmp(outcnt) = proc
tmp(outcnt+1) = 1
tmp(outcnt+2) = idx
tmp(outcnt+3) = -1
end if
outcnt = outcnt+3
end Do
incnt = incnt+n_elem_recv+n_elem_send+3

@ -35,23 +35,25 @@ module psb_c_psblas_mod
use psb_c_mat_mod, only : psb_cspmat_type
interface psb_gedot
function psb_cdot_vect(x, y, desc_a,info) result(res)
function psb_cdot_vect(x, y, desc_a,info,global) result(res)
import :: psb_desc_type, psb_spk_, psb_ipk_, &
& psb_c_vect_type, psb_cspmat_type
complex(psb_spk_) :: res
type(psb_c_vect_type), intent(inout) :: x, y
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_cdot_vect
function psb_cdotv(x, y, desc_a,info)
function psb_cdotv(x, y, desc_a,info,global)
import :: psb_desc_type, psb_spk_, psb_ipk_, &
& psb_c_vect_type, psb_cspmat_type
complex(psb_spk_) :: psb_cdotv
complex(psb_spk_), intent(in) :: x(:), y(:)
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_cdotv
function psb_cdot(x, y, desc_a, info, jx, jy)
function psb_cdot(x, y, desc_a, info, jx, jy,global)
import :: psb_desc_type, psb_spk_, psb_ipk_, &
& psb_c_vect_type, psb_cspmat_type
complex(psb_spk_) :: psb_cdot
@ -59,26 +61,29 @@ module psb_c_psblas_mod
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), optional, intent(in) :: jx, jy
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_cdot
end interface
interface psb_gedots
subroutine psb_cdotvs(res,x, y, desc_a, info)
subroutine psb_cdotvs(res,x, y, desc_a, info,global)
import :: psb_desc_type, psb_spk_, psb_ipk_, &
& psb_c_vect_type, psb_cspmat_type
complex(psb_spk_), intent(out) :: res
complex(psb_spk_), intent(in) :: x(:), y(:)
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end subroutine psb_cdotvs
subroutine psb_cmdots(res,x, y, desc_a,info)
subroutine psb_cmdots(res,x, y, desc_a,info,global)
import :: psb_desc_type, psb_spk_, psb_ipk_, &
& psb_c_vect_type, psb_cspmat_type
complex(psb_spk_), intent(out) :: res(:)
complex(psb_spk_), intent(in) :: x(:,:), y(:,:)
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end subroutine psb_cmdots
end interface
@ -117,7 +122,7 @@ module psb_c_psblas_mod
end interface
interface psb_geamax
function psb_camax(x, desc_a, info, jx)
function psb_camax(x, desc_a, info, jx,global)
import :: psb_desc_type, psb_spk_, psb_ipk_, &
& psb_c_vect_type, psb_cspmat_type
real(psb_spk_) psb_camax
@ -125,22 +130,25 @@ module psb_c_psblas_mod
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), optional, intent (in) :: jx
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_camax
function psb_camaxv(x, desc_a,info)
function psb_camaxv(x, desc_a,info,global)
import :: psb_desc_type, psb_spk_, psb_ipk_, &
& psb_c_vect_type, psb_cspmat_type
real(psb_spk_) psb_camaxv
complex(psb_spk_), intent (in) :: x(:)
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_camaxv
function psb_camax_vect(x, desc_a, info) result(res)
function psb_camax_vect(x, desc_a, info,global) result(res)
import :: psb_desc_type, psb_spk_, psb_ipk_, &
& psb_c_vect_type, psb_cspmat_type
real(psb_spk_) :: res
type(psb_c_vect_type), intent (inout) :: x
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_camax_vect
end interface
@ -154,15 +162,16 @@ module psb_c_psblas_mod
#endif
interface psb_geamaxs
subroutine psb_camaxvs(res,x,desc_a,info)
subroutine psb_camaxvs(res,x,desc_a,info,global)
import :: psb_desc_type, psb_spk_, psb_ipk_, &
& psb_c_vect_type, psb_cspmat_type
real(psb_spk_), intent (out) :: res
complex(psb_spk_), intent (in) :: x(:)
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end subroutine psb_camaxvs
subroutine psb_cmamaxs(res,x,desc_a,info,jx)
subroutine psb_cmamaxs(res,x,desc_a,info,jx,global)
import :: psb_desc_type, psb_spk_, psb_ipk_, &
& psb_c_vect_type, psb_cspmat_type
real(psb_spk_), intent (out) :: res(:)
@ -170,19 +179,21 @@ module psb_c_psblas_mod
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), optional, intent(in) :: jx
logical, intent(in), optional :: global
end subroutine psb_cmamaxs
end interface
interface psb_geasum
function psb_casum_vect(x, desc_a, info) result(res)
function psb_casum_vect(x, desc_a, info,global) result(res)
import :: psb_desc_type, psb_spk_, psb_ipk_, &
& psb_c_vect_type, psb_cspmat_type
real(psb_spk_) :: res
type(psb_c_vect_type), intent (inout) :: x
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_casum_vect
function psb_casum(x, desc_a, info, jx)
function psb_casum(x, desc_a, info, jx,global)
import :: psb_desc_type, psb_spk_, psb_ipk_, &
& psb_c_vect_type, psb_cspmat_type
real(psb_spk_) psb_casum
@ -190,33 +201,37 @@ module psb_c_psblas_mod
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), optional, intent (in) :: jx
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_casum
function psb_casumv(x, desc_a, info)
function psb_casumv(x, desc_a, info,global)
import :: psb_desc_type, psb_spk_, psb_ipk_, &
& psb_c_vect_type, psb_cspmat_type
real(psb_spk_) psb_casumv
complex(psb_spk_), intent (in) :: x(:)
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_casumv
end interface
interface psb_geasums
subroutine psb_casumvs(res,x,desc_a,info)
subroutine psb_casumvs(res,x,desc_a,info,global)
import :: psb_desc_type, psb_spk_, psb_ipk_, &
& psb_c_vect_type, psb_cspmat_type
real(psb_spk_), intent (out) :: res
complex(psb_spk_), intent (in) :: x(:)
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end subroutine psb_casumvs
subroutine psb_cmasum(res,x,desc_a,info)
subroutine psb_cmasum(res,x,desc_a,info,global)
import :: psb_desc_type, psb_spk_, psb_ipk_, &
& psb_c_vect_type, psb_cspmat_type
real(psb_spk_), intent (out) :: res(:)
complex(psb_spk_), intent (in) :: x(:,:)
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end subroutine psb_cmasum
end interface
@ -230,7 +245,7 @@ module psb_c_psblas_mod
#endif
interface psb_genrm2
function psb_cnrm2(x, desc_a, info, jx)
function psb_cnrm2(x, desc_a, info, jx,global)
import :: psb_desc_type, psb_spk_, psb_ipk_, &
& psb_c_vect_type, psb_cspmat_type
real(psb_spk_) psb_cnrm2
@ -238,22 +253,25 @@ module psb_c_psblas_mod
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), optional, intent (in) :: jx
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_cnrm2
function psb_cnrm2v(x, desc_a, info)
function psb_cnrm2v(x, desc_a, info,global)
import :: psb_desc_type, psb_spk_, psb_ipk_, &
& psb_c_vect_type, psb_cspmat_type
real(psb_spk_) psb_cnrm2v
complex(psb_spk_), intent (in) :: x(:)
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_cnrm2v
function psb_cnrm2_vect(x, desc_a, info) result(res)
function psb_cnrm2_vect(x, desc_a, info,global) result(res)
import :: psb_desc_type, psb_spk_, psb_ipk_, &
& psb_c_vect_type, psb_cspmat_type
real(psb_spk_) :: res
type(psb_c_vect_type), intent (inout) :: x
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_cnrm2_vect
end interface
@ -264,25 +282,27 @@ module psb_c_psblas_mod
#endif
interface psb_genrm2s
subroutine psb_cnrm2vs(res,x,desc_a,info)
subroutine psb_cnrm2vs(res,x,desc_a,info,global)
import :: psb_desc_type, psb_spk_, psb_ipk_, &
& psb_c_vect_type, psb_cspmat_type
real(psb_spk_), intent (out) :: res
complex(psb_spk_), intent (in) :: x(:)
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end subroutine psb_cnrm2vs
end interface
interface psb_spnrmi
function psb_cnrmi(a, desc_a,info)
function psb_cnrmi(a, desc_a,info,global)
import :: psb_desc_type, psb_spk_, psb_ipk_, &
& psb_c_vect_type, psb_cspmat_type
real(psb_spk_) :: psb_cnrmi
type(psb_cspmat_type), intent (in) :: a
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_cnrmi
end interface
@ -293,13 +313,14 @@ module psb_c_psblas_mod
#endif
interface psb_spnrm1
function psb_cspnrm1(a, desc_a,info)
function psb_cspnrm1(a, desc_a,info,global)
import :: psb_desc_type, psb_spk_, psb_ipk_, &
& psb_c_vect_type, psb_cspmat_type
real(psb_spk_) :: psb_cspnrm1
type(psb_cspmat_type), intent (in) :: a
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_cspnrm1
end interface

@ -35,23 +35,25 @@ module psb_d_psblas_mod
use psb_d_mat_mod, only : psb_dspmat_type
interface psb_gedot
function psb_ddot_vect(x, y, desc_a,info) result(res)
function psb_ddot_vect(x, y, desc_a,info,global) result(res)
import :: psb_desc_type, psb_dpk_, psb_ipk_, &
& psb_d_vect_type, psb_dspmat_type
real(psb_dpk_) :: res
type(psb_d_vect_type), intent(inout) :: x, y
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_ddot_vect
function psb_ddotv(x, y, desc_a,info)
function psb_ddotv(x, y, desc_a,info,global)
import :: psb_desc_type, psb_dpk_, psb_ipk_, &
& psb_d_vect_type, psb_dspmat_type
real(psb_dpk_) :: psb_ddotv
real(psb_dpk_), intent(in) :: x(:), y(:)
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_ddotv
function psb_ddot(x, y, desc_a, info, jx, jy)
function psb_ddot(x, y, desc_a, info, jx, jy,global)
import :: psb_desc_type, psb_dpk_, psb_ipk_, &
& psb_d_vect_type, psb_dspmat_type
real(psb_dpk_) :: psb_ddot
@ -59,26 +61,29 @@ module psb_d_psblas_mod
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), optional, intent(in) :: jx, jy
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_ddot
end interface
interface psb_gedots
subroutine psb_ddotvs(res,x, y, desc_a, info)
subroutine psb_ddotvs(res,x, y, desc_a, info,global)
import :: psb_desc_type, psb_dpk_, psb_ipk_, &
& psb_d_vect_type, psb_dspmat_type
real(psb_dpk_), intent(out) :: res
real(psb_dpk_), intent(in) :: x(:), y(:)
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end subroutine psb_ddotvs
subroutine psb_dmdots(res,x, y, desc_a,info)
subroutine psb_dmdots(res,x, y, desc_a,info,global)
import :: psb_desc_type, psb_dpk_, psb_ipk_, &
& psb_d_vect_type, psb_dspmat_type
real(psb_dpk_), intent(out) :: res(:)
real(psb_dpk_), intent(in) :: x(:,:), y(:,:)
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end subroutine psb_dmdots
end interface
@ -117,7 +122,7 @@ module psb_d_psblas_mod
end interface
interface psb_geamax
function psb_damax(x, desc_a, info, jx)
function psb_damax(x, desc_a, info, jx,global)
import :: psb_desc_type, psb_dpk_, psb_ipk_, &
& psb_d_vect_type, psb_dspmat_type
real(psb_dpk_) psb_damax
@ -125,22 +130,25 @@ module psb_d_psblas_mod
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), optional, intent (in) :: jx
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_damax
function psb_damaxv(x, desc_a,info)
function psb_damaxv(x, desc_a,info,global)
import :: psb_desc_type, psb_dpk_, psb_ipk_, &
& psb_d_vect_type, psb_dspmat_type
real(psb_dpk_) psb_damaxv
real(psb_dpk_), intent (in) :: x(:)
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_damaxv
function psb_damax_vect(x, desc_a, info) result(res)
function psb_damax_vect(x, desc_a, info,global) result(res)
import :: psb_desc_type, psb_dpk_, psb_ipk_, &
& psb_d_vect_type, psb_dspmat_type
real(psb_dpk_) :: res
type(psb_d_vect_type), intent (inout) :: x
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_damax_vect
end interface
@ -154,15 +162,16 @@ module psb_d_psblas_mod
#endif
interface psb_geamaxs
subroutine psb_damaxvs(res,x,desc_a,info)
subroutine psb_damaxvs(res,x,desc_a,info,global)
import :: psb_desc_type, psb_dpk_, psb_ipk_, &
& psb_d_vect_type, psb_dspmat_type
real(psb_dpk_), intent (out) :: res
real(psb_dpk_), intent (in) :: x(:)
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end subroutine psb_damaxvs
subroutine psb_dmamaxs(res,x,desc_a,info,jx)
subroutine psb_dmamaxs(res,x,desc_a,info,jx,global)
import :: psb_desc_type, psb_dpk_, psb_ipk_, &
& psb_d_vect_type, psb_dspmat_type
real(psb_dpk_), intent (out) :: res(:)
@ -170,19 +179,21 @@ module psb_d_psblas_mod
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), optional, intent(in) :: jx
logical, intent(in), optional :: global
end subroutine psb_dmamaxs
end interface
interface psb_geasum
function psb_dasum_vect(x, desc_a, info) result(res)
function psb_dasum_vect(x, desc_a, info,global) result(res)
import :: psb_desc_type, psb_dpk_, psb_ipk_, &
& psb_d_vect_type, psb_dspmat_type
real(psb_dpk_) :: res
type(psb_d_vect_type), intent (inout) :: x
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_dasum_vect
function psb_dasum(x, desc_a, info, jx)
function psb_dasum(x, desc_a, info, jx,global)
import :: psb_desc_type, psb_dpk_, psb_ipk_, &
& psb_d_vect_type, psb_dspmat_type
real(psb_dpk_) psb_dasum
@ -190,33 +201,37 @@ module psb_d_psblas_mod
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), optional, intent (in) :: jx
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_dasum
function psb_dasumv(x, desc_a, info)
function psb_dasumv(x, desc_a, info,global)
import :: psb_desc_type, psb_dpk_, psb_ipk_, &
& psb_d_vect_type, psb_dspmat_type
real(psb_dpk_) psb_dasumv
real(psb_dpk_), intent (in) :: x(:)
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_dasumv
end interface
interface psb_geasums
subroutine psb_dasumvs(res,x,desc_a,info)
subroutine psb_dasumvs(res,x,desc_a,info,global)
import :: psb_desc_type, psb_dpk_, psb_ipk_, &
& psb_d_vect_type, psb_dspmat_type
real(psb_dpk_), intent (out) :: res
real(psb_dpk_), intent (in) :: x(:)
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end subroutine psb_dasumvs
subroutine psb_dmasum(res,x,desc_a,info)
subroutine psb_dmasum(res,x,desc_a,info,global)
import :: psb_desc_type, psb_dpk_, psb_ipk_, &
& psb_d_vect_type, psb_dspmat_type
real(psb_dpk_), intent (out) :: res(:)
real(psb_dpk_), intent (in) :: x(:,:)
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end subroutine psb_dmasum
end interface
@ -230,7 +245,7 @@ module psb_d_psblas_mod
#endif
interface psb_genrm2
function psb_dnrm2(x, desc_a, info, jx)
function psb_dnrm2(x, desc_a, info, jx,global)
import :: psb_desc_type, psb_dpk_, psb_ipk_, &
& psb_d_vect_type, psb_dspmat_type
real(psb_dpk_) psb_dnrm2
@ -238,22 +253,25 @@ module psb_d_psblas_mod
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), optional, intent (in) :: jx
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_dnrm2
function psb_dnrm2v(x, desc_a, info)
function psb_dnrm2v(x, desc_a, info,global)
import :: psb_desc_type, psb_dpk_, psb_ipk_, &
& psb_d_vect_type, psb_dspmat_type
real(psb_dpk_) psb_dnrm2v
real(psb_dpk_), intent (in) :: x(:)
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_dnrm2v
function psb_dnrm2_vect(x, desc_a, info) result(res)
function psb_dnrm2_vect(x, desc_a, info,global) result(res)
import :: psb_desc_type, psb_dpk_, psb_ipk_, &
& psb_d_vect_type, psb_dspmat_type
real(psb_dpk_) :: res
type(psb_d_vect_type), intent (inout) :: x
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_dnrm2_vect
end interface
@ -264,25 +282,27 @@ module psb_d_psblas_mod
#endif
interface psb_genrm2s
subroutine psb_dnrm2vs(res,x,desc_a,info)
subroutine psb_dnrm2vs(res,x,desc_a,info,global)
import :: psb_desc_type, psb_dpk_, psb_ipk_, &
& psb_d_vect_type, psb_dspmat_type
real(psb_dpk_), intent (out) :: res
real(psb_dpk_), intent (in) :: x(:)
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end subroutine psb_dnrm2vs
end interface
interface psb_spnrmi
function psb_dnrmi(a, desc_a,info)
function psb_dnrmi(a, desc_a,info,global)
import :: psb_desc_type, psb_dpk_, psb_ipk_, &
& psb_d_vect_type, psb_dspmat_type
real(psb_dpk_) :: psb_dnrmi
type(psb_dspmat_type), intent (in) :: a
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_dnrmi
end interface
@ -293,13 +313,14 @@ module psb_d_psblas_mod
#endif
interface psb_spnrm1
function psb_dspnrm1(a, desc_a,info)
function psb_dspnrm1(a, desc_a,info,global)
import :: psb_desc_type, psb_dpk_, psb_ipk_, &
& psb_d_vect_type, psb_dspmat_type
real(psb_dpk_) :: psb_dspnrm1
type(psb_dspmat_type), intent (in) :: a
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_dspnrm1
end interface

@ -35,23 +35,25 @@ module psb_s_psblas_mod
use psb_s_mat_mod, only : psb_sspmat_type
interface psb_gedot
function psb_sdot_vect(x, y, desc_a,info) result(res)
function psb_sdot_vect(x, y, desc_a,info,global) result(res)
import :: psb_desc_type, psb_spk_, psb_ipk_, &
& psb_s_vect_type, psb_sspmat_type
real(psb_spk_) :: res
type(psb_s_vect_type), intent(inout) :: x, y
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_sdot_vect
function psb_sdotv(x, y, desc_a,info)
function psb_sdotv(x, y, desc_a,info,global)
import :: psb_desc_type, psb_spk_, psb_ipk_, &
& psb_s_vect_type, psb_sspmat_type
real(psb_spk_) :: psb_sdotv
real(psb_spk_), intent(in) :: x(:), y(:)
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_sdotv
function psb_sdot(x, y, desc_a, info, jx, jy)
function psb_sdot(x, y, desc_a, info, jx, jy,global)
import :: psb_desc_type, psb_spk_, psb_ipk_, &
& psb_s_vect_type, psb_sspmat_type
real(psb_spk_) :: psb_sdot
@ -59,26 +61,29 @@ module psb_s_psblas_mod
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), optional, intent(in) :: jx, jy
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_sdot
end interface
interface psb_gedots
subroutine psb_sdotvs(res,x, y, desc_a, info)
subroutine psb_sdotvs(res,x, y, desc_a, info,global)
import :: psb_desc_type, psb_spk_, psb_ipk_, &
& psb_s_vect_type, psb_sspmat_type
real(psb_spk_), intent(out) :: res
real(psb_spk_), intent(in) :: x(:), y(:)
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end subroutine psb_sdotvs
subroutine psb_smdots(res,x, y, desc_a,info)
subroutine psb_smdots(res,x, y, desc_a,info,global)
import :: psb_desc_type, psb_spk_, psb_ipk_, &
& psb_s_vect_type, psb_sspmat_type
real(psb_spk_), intent(out) :: res(:)
real(psb_spk_), intent(in) :: x(:,:), y(:,:)
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end subroutine psb_smdots
end interface
@ -117,7 +122,7 @@ module psb_s_psblas_mod
end interface
interface psb_geamax
function psb_samax(x, desc_a, info, jx)
function psb_samax(x, desc_a, info, jx,global)
import :: psb_desc_type, psb_spk_, psb_ipk_, &
& psb_s_vect_type, psb_sspmat_type
real(psb_spk_) psb_samax
@ -125,22 +130,25 @@ module psb_s_psblas_mod
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), optional, intent (in) :: jx
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_samax
function psb_samaxv(x, desc_a,info)
function psb_samaxv(x, desc_a,info,global)
import :: psb_desc_type, psb_spk_, psb_ipk_, &
& psb_s_vect_type, psb_sspmat_type
real(psb_spk_) psb_samaxv
real(psb_spk_), intent (in) :: x(:)
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_samaxv
function psb_samax_vect(x, desc_a, info) result(res)
function psb_samax_vect(x, desc_a, info,global) result(res)
import :: psb_desc_type, psb_spk_, psb_ipk_, &
& psb_s_vect_type, psb_sspmat_type
real(psb_spk_) :: res
type(psb_s_vect_type), intent (inout) :: x
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_samax_vect
end interface
@ -154,15 +162,16 @@ module psb_s_psblas_mod
#endif
interface psb_geamaxs
subroutine psb_samaxvs(res,x,desc_a,info)
subroutine psb_samaxvs(res,x,desc_a,info,global)
import :: psb_desc_type, psb_spk_, psb_ipk_, &
& psb_s_vect_type, psb_sspmat_type
real(psb_spk_), intent (out) :: res
real(psb_spk_), intent (in) :: x(:)
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end subroutine psb_samaxvs
subroutine psb_smamaxs(res,x,desc_a,info,jx)
subroutine psb_smamaxs(res,x,desc_a,info,jx,global)
import :: psb_desc_type, psb_spk_, psb_ipk_, &
& psb_s_vect_type, psb_sspmat_type
real(psb_spk_), intent (out) :: res(:)
@ -170,19 +179,21 @@ module psb_s_psblas_mod
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), optional, intent(in) :: jx
logical, intent(in), optional :: global
end subroutine psb_smamaxs
end interface
interface psb_geasum
function psb_sasum_vect(x, desc_a, info) result(res)
function psb_sasum_vect(x, desc_a, info,global) result(res)
import :: psb_desc_type, psb_spk_, psb_ipk_, &
& psb_s_vect_type, psb_sspmat_type
real(psb_spk_) :: res
type(psb_s_vect_type), intent (inout) :: x
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_sasum_vect
function psb_sasum(x, desc_a, info, jx)
function psb_sasum(x, desc_a, info, jx,global)
import :: psb_desc_type, psb_spk_, psb_ipk_, &
& psb_s_vect_type, psb_sspmat_type
real(psb_spk_) psb_sasum
@ -190,33 +201,37 @@ module psb_s_psblas_mod
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), optional, intent (in) :: jx
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_sasum
function psb_sasumv(x, desc_a, info)
function psb_sasumv(x, desc_a, info,global)
import :: psb_desc_type, psb_spk_, psb_ipk_, &
& psb_s_vect_type, psb_sspmat_type
real(psb_spk_) psb_sasumv
real(psb_spk_), intent (in) :: x(:)
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_sasumv
end interface
interface psb_geasums
subroutine psb_sasumvs(res,x,desc_a,info)
subroutine psb_sasumvs(res,x,desc_a,info,global)
import :: psb_desc_type, psb_spk_, psb_ipk_, &
& psb_s_vect_type, psb_sspmat_type
real(psb_spk_), intent (out) :: res
real(psb_spk_), intent (in) :: x(:)
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end subroutine psb_sasumvs
subroutine psb_smasum(res,x,desc_a,info)
subroutine psb_smasum(res,x,desc_a,info,global)
import :: psb_desc_type, psb_spk_, psb_ipk_, &
& psb_s_vect_type, psb_sspmat_type
real(psb_spk_), intent (out) :: res(:)
real(psb_spk_), intent (in) :: x(:,:)
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end subroutine psb_smasum
end interface
@ -230,7 +245,7 @@ module psb_s_psblas_mod
#endif
interface psb_genrm2
function psb_snrm2(x, desc_a, info, jx)
function psb_snrm2(x, desc_a, info, jx,global)
import :: psb_desc_type, psb_spk_, psb_ipk_, &
& psb_s_vect_type, psb_sspmat_type
real(psb_spk_) psb_snrm2
@ -238,22 +253,25 @@ module psb_s_psblas_mod
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), optional, intent (in) :: jx
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_snrm2
function psb_snrm2v(x, desc_a, info)
function psb_snrm2v(x, desc_a, info,global)
import :: psb_desc_type, psb_spk_, psb_ipk_, &
& psb_s_vect_type, psb_sspmat_type
real(psb_spk_) psb_snrm2v
real(psb_spk_), intent (in) :: x(:)
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_snrm2v
function psb_snrm2_vect(x, desc_a, info) result(res)
function psb_snrm2_vect(x, desc_a, info,global) result(res)
import :: psb_desc_type, psb_spk_, psb_ipk_, &
& psb_s_vect_type, psb_sspmat_type
real(psb_spk_) :: res
type(psb_s_vect_type), intent (inout) :: x
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_snrm2_vect
end interface
@ -264,25 +282,27 @@ module psb_s_psblas_mod
#endif
interface psb_genrm2s
subroutine psb_snrm2vs(res,x,desc_a,info)
subroutine psb_snrm2vs(res,x,desc_a,info,global)
import :: psb_desc_type, psb_spk_, psb_ipk_, &
& psb_s_vect_type, psb_sspmat_type
real(psb_spk_), intent (out) :: res
real(psb_spk_), intent (in) :: x(:)
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end subroutine psb_snrm2vs
end interface
interface psb_spnrmi
function psb_snrmi(a, desc_a,info)
function psb_snrmi(a, desc_a,info,global)
import :: psb_desc_type, psb_spk_, psb_ipk_, &
& psb_s_vect_type, psb_sspmat_type
real(psb_spk_) :: psb_snrmi
type(psb_sspmat_type), intent (in) :: a
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_snrmi
end interface
@ -293,13 +313,14 @@ module psb_s_psblas_mod
#endif
interface psb_spnrm1
function psb_sspnrm1(a, desc_a,info)
function psb_sspnrm1(a, desc_a,info,global)
import :: psb_desc_type, psb_spk_, psb_ipk_, &
& psb_s_vect_type, psb_sspmat_type
real(psb_spk_) :: psb_sspnrm1
type(psb_sspmat_type), intent (in) :: a
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_sspnrm1
end interface

@ -35,23 +35,25 @@ module psb_z_psblas_mod
use psb_z_mat_mod, only : psb_zspmat_type
interface psb_gedot
function psb_zdot_vect(x, y, desc_a,info) result(res)
function psb_zdot_vect(x, y, desc_a,info,global) result(res)
import :: psb_desc_type, psb_dpk_, psb_ipk_, &
& psb_z_vect_type, psb_zspmat_type
complex(psb_dpk_) :: res
type(psb_z_vect_type), intent(inout) :: x, y
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_zdot_vect
function psb_zdotv(x, y, desc_a,info)
function psb_zdotv(x, y, desc_a,info,global)
import :: psb_desc_type, psb_dpk_, psb_ipk_, &
& psb_z_vect_type, psb_zspmat_type
complex(psb_dpk_) :: psb_zdotv
complex(psb_dpk_), intent(in) :: x(:), y(:)
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_zdotv
function psb_zdot(x, y, desc_a, info, jx, jy)
function psb_zdot(x, y, desc_a, info, jx, jy,global)
import :: psb_desc_type, psb_dpk_, psb_ipk_, &
& psb_z_vect_type, psb_zspmat_type
complex(psb_dpk_) :: psb_zdot
@ -59,26 +61,29 @@ module psb_z_psblas_mod
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), optional, intent(in) :: jx, jy
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_zdot
end interface
interface psb_gedots
subroutine psb_zdotvs(res,x, y, desc_a, info)
subroutine psb_zdotvs(res,x, y, desc_a, info,global)
import :: psb_desc_type, psb_dpk_, psb_ipk_, &
& psb_z_vect_type, psb_zspmat_type
complex(psb_dpk_), intent(out) :: res
complex(psb_dpk_), intent(in) :: x(:), y(:)
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end subroutine psb_zdotvs
subroutine psb_zmdots(res,x, y, desc_a,info)
subroutine psb_zmdots(res,x, y, desc_a,info,global)
import :: psb_desc_type, psb_dpk_, psb_ipk_, &
& psb_z_vect_type, psb_zspmat_type
complex(psb_dpk_), intent(out) :: res(:)
complex(psb_dpk_), intent(in) :: x(:,:), y(:,:)
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end subroutine psb_zmdots
end interface
@ -117,7 +122,7 @@ module psb_z_psblas_mod
end interface
interface psb_geamax
function psb_zamax(x, desc_a, info, jx)
function psb_zamax(x, desc_a, info, jx,global)
import :: psb_desc_type, psb_dpk_, psb_ipk_, &
& psb_z_vect_type, psb_zspmat_type
real(psb_dpk_) psb_zamax
@ -125,22 +130,25 @@ module psb_z_psblas_mod
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), optional, intent (in) :: jx
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_zamax
function psb_zamaxv(x, desc_a,info)
function psb_zamaxv(x, desc_a,info,global)
import :: psb_desc_type, psb_dpk_, psb_ipk_, &
& psb_z_vect_type, psb_zspmat_type
real(psb_dpk_) psb_zamaxv
complex(psb_dpk_), intent (in) :: x(:)
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_zamaxv
function psb_zamax_vect(x, desc_a, info) result(res)
function psb_zamax_vect(x, desc_a, info,global) result(res)
import :: psb_desc_type, psb_dpk_, psb_ipk_, &
& psb_z_vect_type, psb_zspmat_type
real(psb_dpk_) :: res
type(psb_z_vect_type), intent (inout) :: x
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_zamax_vect
end interface
@ -154,15 +162,16 @@ module psb_z_psblas_mod
#endif
interface psb_geamaxs
subroutine psb_zamaxvs(res,x,desc_a,info)
subroutine psb_zamaxvs(res,x,desc_a,info,global)
import :: psb_desc_type, psb_dpk_, psb_ipk_, &
& psb_z_vect_type, psb_zspmat_type
real(psb_dpk_), intent (out) :: res
complex(psb_dpk_), intent (in) :: x(:)
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end subroutine psb_zamaxvs
subroutine psb_zmamaxs(res,x,desc_a,info,jx)
subroutine psb_zmamaxs(res,x,desc_a,info,jx,global)
import :: psb_desc_type, psb_dpk_, psb_ipk_, &
& psb_z_vect_type, psb_zspmat_type
real(psb_dpk_), intent (out) :: res(:)
@ -170,19 +179,21 @@ module psb_z_psblas_mod
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), optional, intent(in) :: jx
logical, intent(in), optional :: global
end subroutine psb_zmamaxs
end interface
interface psb_geasum
function psb_zasum_vect(x, desc_a, info) result(res)
function psb_zasum_vect(x, desc_a, info,global) result(res)
import :: psb_desc_type, psb_dpk_, psb_ipk_, &
& psb_z_vect_type, psb_zspmat_type
real(psb_dpk_) :: res
type(psb_z_vect_type), intent (inout) :: x
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_zasum_vect
function psb_zasum(x, desc_a, info, jx)
function psb_zasum(x, desc_a, info, jx,global)
import :: psb_desc_type, psb_dpk_, psb_ipk_, &
& psb_z_vect_type, psb_zspmat_type
real(psb_dpk_) psb_zasum
@ -190,33 +201,37 @@ module psb_z_psblas_mod
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), optional, intent (in) :: jx
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_zasum
function psb_zasumv(x, desc_a, info)
function psb_zasumv(x, desc_a, info,global)
import :: psb_desc_type, psb_dpk_, psb_ipk_, &
& psb_z_vect_type, psb_zspmat_type
real(psb_dpk_) psb_zasumv
complex(psb_dpk_), intent (in) :: x(:)
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_zasumv
end interface
interface psb_geasums
subroutine psb_zasumvs(res,x,desc_a,info)
subroutine psb_zasumvs(res,x,desc_a,info,global)
import :: psb_desc_type, psb_dpk_, psb_ipk_, &
& psb_z_vect_type, psb_zspmat_type
real(psb_dpk_), intent (out) :: res
complex(psb_dpk_), intent (in) :: x(:)
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end subroutine psb_zasumvs
subroutine psb_zmasum(res,x,desc_a,info)
subroutine psb_zmasum(res,x,desc_a,info,global)
import :: psb_desc_type, psb_dpk_, psb_ipk_, &
& psb_z_vect_type, psb_zspmat_type
real(psb_dpk_), intent (out) :: res(:)
complex(psb_dpk_), intent (in) :: x(:,:)
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end subroutine psb_zmasum
end interface
@ -230,7 +245,7 @@ module psb_z_psblas_mod
#endif
interface psb_genrm2
function psb_znrm2(x, desc_a, info, jx)
function psb_znrm2(x, desc_a, info, jx,global)
import :: psb_desc_type, psb_dpk_, psb_ipk_, &
& psb_z_vect_type, psb_zspmat_type
real(psb_dpk_) psb_znrm2
@ -238,22 +253,25 @@ module psb_z_psblas_mod
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), optional, intent (in) :: jx
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_znrm2
function psb_znrm2v(x, desc_a, info)
function psb_znrm2v(x, desc_a, info,global)
import :: psb_desc_type, psb_dpk_, psb_ipk_, &
& psb_z_vect_type, psb_zspmat_type
real(psb_dpk_) psb_znrm2v
complex(psb_dpk_), intent (in) :: x(:)
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_znrm2v
function psb_znrm2_vect(x, desc_a, info) result(res)
function psb_znrm2_vect(x, desc_a, info,global) result(res)
import :: psb_desc_type, psb_dpk_, psb_ipk_, &
& psb_z_vect_type, psb_zspmat_type
real(psb_dpk_) :: res
type(psb_z_vect_type), intent (inout) :: x
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_znrm2_vect
end interface
@ -264,25 +282,27 @@ module psb_z_psblas_mod
#endif
interface psb_genrm2s
subroutine psb_znrm2vs(res,x,desc_a,info)
subroutine psb_znrm2vs(res,x,desc_a,info,global)
import :: psb_desc_type, psb_dpk_, psb_ipk_, &
& psb_z_vect_type, psb_zspmat_type
real(psb_dpk_), intent (out) :: res
complex(psb_dpk_), intent (in) :: x(:)
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end subroutine psb_znrm2vs
end interface
interface psb_spnrmi
function psb_znrmi(a, desc_a,info)
function psb_znrmi(a, desc_a,info,global)
import :: psb_desc_type, psb_dpk_, psb_ipk_, &
& psb_z_vect_type, psb_zspmat_type
real(psb_dpk_) :: psb_znrmi
type(psb_zspmat_type), intent (in) :: a
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_znrmi
end interface
@ -293,13 +313,14 @@ module psb_z_psblas_mod
#endif
interface psb_spnrm1
function psb_zspnrm1(a, desc_a,info)
function psb_zspnrm1(a, desc_a,info,global)
import :: psb_desc_type, psb_dpk_, psb_ipk_, &
& psb_z_vect_type, psb_zspmat_type
real(psb_dpk_) :: psb_zspnrm1
type(psb_zspmat_type), intent (in) :: a
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
end function psb_zspnrm1
end interface

@ -53,13 +53,12 @@ module psi_i_mod
end interface
interface
subroutine psi_crea_index(desc_a,index_in,index_out,glob_idx,nxch,nsnd,nrcv,info)
subroutine psi_crea_index(desc_a,index_in,index_out,nxch,nsnd,nrcv,info)
import
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info,nxch,nsnd,nrcv
integer(psb_ipk_), intent(in) :: index_in(:)
integer(psb_ipk_), allocatable, intent(inout) :: index_out(:)
logical :: glob_idx
end subroutine psi_crea_index
end interface
@ -74,13 +73,12 @@ module psi_i_mod
interface
subroutine psi_desc_index(desc,index_in,dep_list,&
& length_dl,nsnd,nrcv,desc_index,isglob_in,info)
& length_dl,nsnd,nrcv,desc_index,info)
import
type(psb_desc_type) :: desc
integer(psb_ipk_) :: index_in(:),dep_list(:)
integer(psb_ipk_),allocatable :: desc_index(:)
integer(psb_ipk_) :: length_dl,nsnd,nrcv,info
logical :: isglob_in
end subroutine psi_desc_index
end interface

@ -44,7 +44,7 @@
! info - integer. Return code
! jx - integer(optional). The column offset.
!
function psb_camax(x,desc_a, info, jx) result(res)
function psb_camax(x,desc_a, info, jx,global) result(res)
use psb_base_mod, psb_protect_name => psb_camax
implicit none
@ -54,10 +54,12 @@ function psb_camax(x,desc_a, info, jx) result(res)
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), optional, intent(in) :: jx
real(psb_spk_) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, ix, ijx, m, ldx
logical :: global_
character(len=20) :: name, ch_err
name='psb_camax'
@ -82,6 +84,12 @@ function psb_camax(x,desc_a, info, jx) result(res)
ijx = 1
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
m = desc_a%get_global_rows()
ldx = size(x,1)
@ -107,7 +115,7 @@ function psb_camax(x,desc_a, info, jx) result(res)
end if
! compute global max
call psb_amx(ictxt, res)
if (global_) call psb_amx(ictxt, res)
call psb_erractionrestore(err_act)
return
@ -162,7 +170,7 @@ end function psb_camax
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. Return code
!
function psb_camaxv (x,desc_a, info) result(res)
function psb_camaxv (x,desc_a, info,global) result(res)
use psb_base_mod, psb_protect_name => psb_camaxv
implicit none
@ -171,11 +179,12 @@ function psb_camaxv (x,desc_a, info) result(res)
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
real(psb_spk_) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, jx, ix, m, ldx
logical :: global_
character(len=20) :: name, ch_err
name='psb_camaxv'
@ -193,6 +202,12 @@ function psb_camaxv (x,desc_a, info) result(res)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = 1
jx = 1
@ -221,7 +236,7 @@ function psb_camaxv (x,desc_a, info) result(res)
end if
! compute global max
call psb_amx(ictxt, res)
if (global_) call psb_amx(ictxt, res)
call psb_erractionrestore(err_act)
return
@ -232,7 +247,7 @@ function psb_camaxv (x,desc_a, info) result(res)
end function psb_camaxv
function psb_camax_vect(x, desc_a, info) result(res)
function psb_camax_vect(x, desc_a, info,global) result(res)
use psb_penv_mod
use psb_serial_mod
use psb_desc_mod
@ -245,10 +260,12 @@ function psb_camax_vect(x, desc_a, info) result(res)
type(psb_c_vect_type), intent (inout) :: x
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, jx, ix, m
logical :: global_
character(len=20) :: name, ch_err
name='psb_camaxv'
@ -271,6 +288,12 @@ function psb_camax_vect(x, desc_a, info) result(res)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = 1
jx = 1
@ -297,7 +320,7 @@ function psb_camax_vect(x, desc_a, info) result(res)
end if
! compute global max
call psb_amx(ictxt, res)
if (global_) call psb_amx(ictxt, res)
call psb_erractionrestore(err_act)
return
@ -355,7 +378,7 @@ end function psb_camax_vect
! info - integer. Return code
! jx - integer(optional). The column offset.
!
subroutine psb_camaxvs(res,x,desc_a, info)
subroutine psb_camaxvs(res,x,desc_a, info,global)
use psb_base_mod, psb_protect_name => psb_camaxvs
implicit none
@ -364,10 +387,12 @@ subroutine psb_camaxvs(res,x,desc_a, info)
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
real(psb_spk_), intent(out) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, ix, ijx, m, ldx
logical :: global_
character(len=20) :: name, ch_err
name='psb_camaxvs'
@ -385,6 +410,12 @@ subroutine psb_camaxvs(res,x,desc_a, info)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = 1
ijx=1
@ -412,7 +443,7 @@ subroutine psb_camaxvs(res,x,desc_a, info)
end if
! compute global max
call psb_amx(ictxt, res)
if (global_) call psb_amx(ictxt, res)
call psb_erractionrestore(err_act)
return
@ -466,7 +497,7 @@ end subroutine psb_camaxvs
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. Return code
!
subroutine psb_cmamaxs(res,x,desc_a, info,jx)
subroutine psb_cmamaxs(res,x,desc_a, info,jx,global)
use psb_base_mod, psb_protect_name => psb_cmamaxs
implicit none
@ -476,10 +507,12 @@ subroutine psb_cmamaxs(res,x,desc_a, info,jx)
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), optional, intent(in) :: jx
real(psb_spk_), intent(out) :: res(:)
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, ix, ijx, m, ldx, i, k
logical :: global_
character(len=20) :: name, ch_err
name='psb_cmamaxs'
@ -503,6 +536,12 @@ subroutine psb_cmamaxs(res,x,desc_a, info,jx)
ijx = 1
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
m = desc_a%get_global_rows()
k = min(size(x,2),size(res,1))
ldx = size(x,1)
@ -529,7 +568,7 @@ subroutine psb_cmamaxs(res,x,desc_a, info,jx)
end if
! compute global max
call psb_amx(ictxt, res(1:k))
if (global_) call psb_amx(ictxt, res(1:k))
call psb_erractionrestore(err_act)
return

@ -44,7 +44,7 @@
! info - integer. Return code
! jx - integer(optional). The column offset.
!
function psb_casum (x,desc_a, info, jx) result(res)
function psb_casum (x,desc_a, info, jx,global) result(res)
use psb_base_mod, psb_protect_name => psb_casum
implicit none
@ -54,10 +54,12 @@ function psb_casum (x,desc_a, info, jx) result(res)
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), optional, intent(in) :: jx
real(psb_spk_) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me, &
& err_act, iix, jjx, ix, ijx, m, i, idx, ndm, ldx
logical :: global_
character(len=20) :: name, ch_err
name='psb_casum'
@ -82,6 +84,12 @@ function psb_casum (x,desc_a, info, jx) result(res)
ijx = 1
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
m = desc_a%get_global_rows()
ldx = size(x,1)
! check vector correctness
@ -114,7 +122,7 @@ function psb_casum (x,desc_a, info, jx) result(res)
res = szero
end if
! compute global sum
call psb_sum(ictxt, res)
if (global_) call psb_sum(ictxt, res)
call psb_erractionrestore(err_act)
return
@ -125,7 +133,7 @@ function psb_casum (x,desc_a, info, jx) result(res)
end function psb_casum
function psb_casum_vect(x, desc_a, info) result(res)
function psb_casum_vect(x, desc_a, info,global) result(res)
use psb_base_mod, psb_protect_name => psb_casum_vect
implicit none
@ -133,10 +141,12 @@ function psb_casum_vect(x, desc_a, info) result(res)
type(psb_c_vect_type), intent (inout) :: x
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, jx, ix, m, imax
& err_act, iix, jjx, jx, ix, m, imax, i, idx, ndm
logical :: global_
character(len=20) :: name, ch_err
name='psb_casumv'
@ -160,6 +170,11 @@ function psb_casum_vect(x, desc_a, info) result(res)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = 1
jx = 1
@ -182,12 +197,21 @@ function psb_casum_vect(x, desc_a, info) result(res)
! compute local max
if ((desc_a%get_local_rows() > 0).and.(m /= 0)) then
res = x%asum(desc_a%get_local_rows())
if (size(desc_a%ovrlap_elem,1)>0) then
if (x%is_dev()) call x%sync()
! adjust res because overlapped elements are computed more than once
do i=1,size(desc_a%ovrlap_elem,1)
idx = desc_a%ovrlap_elem(i,1)
ndm = desc_a%ovrlap_elem(i,2)
res = res - (real(ndm-1)/real(ndm))*abs(x%v%v(idx))
end do
end if
else
res = szero
end if
! compute global sum
call psb_sum(ictxt, res)
if (global_) call psb_sum(ictxt, res)
call psb_erractionrestore(err_act)
return
@ -242,7 +266,7 @@ end function psb_casum_vect
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. Return code
!
function psb_casumv(x,desc_a, info) result(res)
function psb_casumv(x,desc_a, info,global) result(res)
use psb_base_mod, psb_protect_name => psb_casumv
implicit none
@ -251,10 +275,12 @@ function psb_casumv(x,desc_a, info) result(res)
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
real(psb_spk_) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, jx, ix, m, i, idx, ndm, ldx
logical :: global_
character(len=20) :: name, ch_err
name='psb_casumv'
@ -271,6 +297,12 @@ function psb_casumv(x,desc_a, info) result(res)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = 1
jx=1
@ -307,7 +339,7 @@ function psb_casumv(x,desc_a, info) result(res)
end if
! compute global sum
call psb_sum(ictxt, res)
if (global_) call psb_sum(ictxt, res)
call psb_erractionrestore(err_act)
return
@ -362,7 +394,7 @@ end function psb_casumv
! info - integer. Return code
! jx - integer(optional). The column offset.
!
subroutine psb_casumvs(res,x,desc_a, info)
subroutine psb_casumvs(res,x,desc_a, info,global)
use psb_base_mod, psb_protect_name => psb_casumvs
implicit none
@ -371,10 +403,12 @@ subroutine psb_casumvs(res,x,desc_a, info)
real(psb_spk_), intent(out) :: res
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, ix, jx, m, i, idx, ndm, ldx
logical :: global_
character(len=20) :: name, ch_err
name='psb_casumvs'
@ -391,6 +425,12 @@ subroutine psb_casumvs(res,x,desc_a, info)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = 1
jx = 1
@ -427,7 +467,7 @@ subroutine psb_casumvs(res,x,desc_a, info)
end if
! compute global sum
call psb_sum(ictxt,res)
if (global_) call psb_sum(ictxt,res)
call psb_erractionrestore(err_act)
return

@ -48,7 +48,7 @@
! jx - integer(optional). The column offset for sub( X ).
! jy - integer(optional). The column offset for sub( Y ).
!
function psb_cdot_vect(x, y, desc_a,info) result(res)
function psb_cdot_vect(x, y, desc_a,info,global) result(res)
use psb_desc_mod
use psb_c_base_mat_mod
use psb_check_mod
@ -61,10 +61,12 @@ function psb_cdot_vect(x, y, desc_a,info) result(res)
type(psb_c_vect_type), intent(inout) :: x, y
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me, idx, ndm,&
& err_act, iix, jjx, ix, ijx, iy, ijy, iiy, jjy, i, m, nr
logical :: global_
character(len=20) :: name, ch_err
name='psb_cdot_vect'
@ -91,6 +93,11 @@ function psb_cdot_vect(x, y, desc_a,info) result(res)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = ione
ijx = ione
@ -122,17 +129,21 @@ function psb_cdot_vect(x, y, desc_a,info) result(res)
res = x%dot(nr,y)
! FIXME
! adjust dot_local because overlapped elements are computed more than once
!!$ do i=1,size(desc_a%ovrlap_elem,1)
!!$ idx = desc_a%ovrlap_elem(i,1)
!!$ ndm = desc_a%ovrlap_elem(i,2)
!!$ dot_local = dot_local - (real(ndm-1)/real(ndm))*(x(idx)*y(idx))
!!$ end do
if (size(desc_a%ovrlap_elem,1)>0) then
if (x%is_dev()) call x%sync()
if (y%is_dev()) call y%sync()
do i=1,size(desc_a%ovrlap_elem,1)
idx = desc_a%ovrlap_elem(i,1)
ndm = desc_a%ovrlap_elem(i,2)
res = res - (real(ndm-1)/real(ndm))*(x%v%v(idx)*y%v%v(idx))
end do
end if
else
res = czero
end if
! compute global sum
call psb_sum(ictxt, res)
if (global_) call psb_sum(ictxt, res)
call psb_erractionrestore(err_act)
return
@ -143,7 +154,7 @@ function psb_cdot_vect(x, y, desc_a,info) result(res)
end function psb_cdot_vect
function psb_cdot(x, y,desc_a, info, jx, jy) result(res)
function psb_cdot(x, y,desc_a, info, jx, jy,global) result(res)
use psb_base_mod, psb_protect_name => psb_cdot
implicit none
@ -152,12 +163,14 @@ function psb_cdot(x, y,desc_a, info, jx, jy) result(res)
integer(psb_ipk_), intent(in), optional :: jx, jy
integer(psb_ipk_), intent(out) :: info
complex(psb_spk_) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me, idx, ndm,&
& err_act, iix, jjx, ix, ijx, iy, ijy, iiy, jjy, i, m, nr, &
& lldx, lldy
complex(psb_spk_) :: cdotc
logical :: global_
character(len=20) :: name, ch_err
name='psb_cdot'
@ -193,6 +206,12 @@ function psb_cdot(x, y,desc_a, info, jx, jy) result(res)
goto 9999
end if
if (present(global)) then
global_ = global
else
global_ = .true.
end if
m = desc_a%get_global_rows()
lldx = size(x,1)
lldy = size(y,1)
@ -228,7 +247,7 @@ function psb_cdot(x, y,desc_a, info, jx, jy) result(res)
end if
! compute global sum
call psb_sum(ictxt, res)
if (global_) call psb_sum(ictxt, res)
call psb_erractionrestore(err_act)
return
@ -284,7 +303,7 @@ end function psb_cdot
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. Return code
!
function psb_cdotv(x, y,desc_a, info) result(res)
function psb_cdotv(x, y,desc_a, info,global) result(res)
use psb_base_mod, psb_protect_name => psb_cdotv
implicit none
@ -292,11 +311,13 @@ function psb_cdotv(x, y,desc_a, info) result(res)
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
complex(psb_spk_) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me, idx, ndm,&
& err_act, iix, jjx, ix, jx, iy, jy, iiy, jjy, i, m, nr, &
& lldx, lldy
logical :: global_
complex(psb_spk_) :: cdotc
character(len=20) :: name, ch_err
@ -314,6 +335,12 @@ function psb_cdotv(x, y,desc_a, info) result(res)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = ione
iy = ione
jx = ione
@ -352,7 +379,7 @@ function psb_cdotv(x, y,desc_a, info) result(res)
end if
! compute global sum
call psb_sum(ictxt, res)
if (global_) call psb_sum(ictxt, res)
call psb_erractionrestore(err_act)
@ -409,7 +436,7 @@ end function psb_cdotv
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. Return code
!
subroutine psb_cdotvs(res, x, y,desc_a, info)
subroutine psb_cdotvs(res, x, y,desc_a, info,global)
use psb_base_mod, psb_protect_name => psb_cdotvs
implicit none
@ -417,11 +444,13 @@ subroutine psb_cdotvs(res, x, y,desc_a, info)
complex(psb_spk_), intent(out) :: res
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me, idx, ndm,&
& err_act, iix, jjx, ix, iy, iiy, jjy, i, m,nr, &
& lldx, lldy
logical :: global_
complex(psb_spk_) :: cdotc
character(len=20) :: name, ch_err
@ -439,6 +468,12 @@ subroutine psb_cdotvs(res, x, y,desc_a, info)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = ione
iy = ione
m = desc_a%get_global_rows()
@ -475,7 +510,7 @@ subroutine psb_cdotvs(res, x, y,desc_a, info)
end if
! compute global sum
call psb_sum(ictxt, res)
if (global_) call psb_sum(ictxt, res)
call psb_erractionrestore(err_act)
return
@ -532,7 +567,7 @@ end subroutine psb_cdotvs
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. Return code
!
subroutine psb_cmdots(res, x, y, desc_a, info)
subroutine psb_cmdots(res, x, y, desc_a, info,global)
use psb_base_mod, psb_protect_name => psb_cmdots
implicit none
@ -540,11 +575,13 @@ subroutine psb_cmdots(res, x, y, desc_a, info)
complex(psb_spk_), intent(out) :: res(:)
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me, idx, ndm,&
& err_act, iix, jjx, ix, iy, iiy, jjy, i, m, j, k, nr, &
& lldx, lldy
logical :: global_
complex(psb_spk_) :: cdotc
character(len=20) :: name, ch_err
@ -562,6 +599,11 @@ subroutine psb_cmdots(res, x, y, desc_a, info)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = ione
iy = ione
@ -611,7 +653,7 @@ subroutine psb_cmdots(res, x, y, desc_a, info)
! compute global sum
call psb_sum(ictxt, res(1:k))
if (global_) call psb_sum(ictxt, res(1:k))
call psb_erractionrestore(err_act)
return

@ -44,7 +44,7 @@
! info - integer. Return code
! jx - integer(optional). The column offset for sub( X ).
!
function psb_cnrm2(x, desc_a, info, jx) result(res)
function psb_cnrm2(x, desc_a, info, jx,global) result(res)
use psb_desc_mod
use psb_check_mod
use psb_error_mod
@ -56,10 +56,12 @@ function psb_cnrm2(x, desc_a, info, jx) result(res)
integer(psb_ipk_), intent(in), optional :: jx
integer(psb_ipk_), intent(out) :: info
real(psb_spk_) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, ndim, ix, ijx, i, m, id, idx, ndm, ldx
logical :: global_
real(psb_spk_) :: scnrm2, dd
character(len=20) :: name, ch_err
@ -84,6 +86,12 @@ function psb_cnrm2(x, desc_a, info, jx) result(res)
ijx = 1
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
m = desc_a%get_global_rows()
ldx = size(x,1)
call psb_chkvect(m,ione,ldx,ix,ijx,desc_a,info,iix,jjx)
@ -114,7 +122,7 @@ function psb_cnrm2(x, desc_a, info, jx) result(res)
res = szero
end if
call psb_nrm2(ictxt,res)
if (global_) call psb_nrm2(ictxt,res)
call psb_erractionrestore(err_act)
return
@ -168,7 +176,7 @@ end function psb_cnrm2
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. Return code
!
function psb_cnrm2v(x, desc_a, info) result(res)
function psb_cnrm2v(x, desc_a, info,global) result(res)
use psb_desc_mod
use psb_check_mod
use psb_error_mod
@ -179,13 +187,13 @@ function psb_cnrm2v(x, desc_a, info) result(res)
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
real(psb_spk_) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, ndim, ix, jx, i, m, id, idx, ndm, ldx
logical :: global_
real(psb_spk_) :: scnrm2, dd
!!$ external scombnrm2
character(len=20) :: name, ch_err
name='psb_cnrm2v'
@ -202,6 +210,11 @@ function psb_cnrm2v(x, desc_a, info) result(res)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = 1
jx=1
m = desc_a%get_global_rows()
@ -233,8 +246,7 @@ function psb_cnrm2v(x, desc_a, info) result(res)
res = szero
end if
call psb_nrm2(ictxt,res)
if (global_) call psb_nrm2(ictxt,res)
call psb_erractionrestore(err_act)
return
@ -246,7 +258,7 @@ end function psb_cnrm2v
function psb_cnrm2_vect(x, desc_a, info) result(res)
function psb_cnrm2_vect(x, desc_a, info,global) result(res)
use psb_desc_mod
use psb_check_mod
use psb_error_mod
@ -258,12 +270,13 @@ function psb_cnrm2_vect(x, desc_a, info) result(res)
type(psb_c_vect_type), intent (inout) :: x
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, ndim, ix, jx, i, m, id, idx, ndm, ldx
logical :: global_
real(psb_spk_) :: snrm2, dd
!!$ external dcombnrm2
character(len=20) :: name, ch_err
name='psb_cnrm2v'
@ -286,6 +299,11 @@ function psb_cnrm2_vect(x, desc_a, info) result(res)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = 1
jx=1
@ -307,18 +325,21 @@ function psb_cnrm2_vect(x, desc_a, info) result(res)
if (desc_a%get_local_rows() > 0) then
ndim = desc_a%get_local_rows()
res = x%nrm2(ndim)
!!$ ! adjust because overlapped elements are computed more than once
!!$ do i=1,size(desc_a%ovrlap_elem,1)
!!$ idx = desc_a%ovrlap_elem(i,1)
!!$ ndm = desc_a%ovrlap_elem(i,2)
!!$ dd = dble(ndm-1)/dble(ndm)
!!$ nrm2 = nrm2 * sqrt(done - dd*(abs(x(idx))/nrm2)**2)
!!$ end do
! adjust because overlapped elements are computed more than once
if (size(desc_a%ovrlap_elem,1)>0) then
if (x%is_dev()) call x%sync()
do i=1,size(desc_a%ovrlap_elem,1)
idx = desc_a%ovrlap_elem(i,1)
ndm = desc_a%ovrlap_elem(i,2)
dd = dble(ndm-1)/dble(ndm)
res = res - sqrt(cone - dd*(abs(x%v%v(idx))/res)**2)
end do
end if
else
res = szero
end if
call psb_nrm2(ictxt,res)
if (global_) call psb_nrm2(ictxt,res)
call psb_erractionrestore(err_act)
return
@ -329,7 +350,6 @@ function psb_cnrm2_vect(x, desc_a, info) result(res)
end function psb_cnrm2_vect
!!$
!!$ Parallel Sparse BLAS version 3.5
!!$ (C) Copyright 2006-2018
@ -373,7 +393,7 @@ end function psb_cnrm2_vect
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. Return code
!
subroutine psb_cnrm2vs(res, x, desc_a, info)
subroutine psb_cnrm2vs(res, x, desc_a, info,global)
use psb_desc_mod
use psb_check_mod
use psb_error_mod
@ -384,13 +404,13 @@ subroutine psb_cnrm2vs(res, x, desc_a, info)
real(psb_spk_), intent(out) :: res
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, ndim, ix, jx, i, m, id, idx, ndm, ldx
logical :: global_
real(psb_spk_) :: nrm2, scnrm2, dd
!!$ external scombnrm2
character(len=20) :: name, ch_err
name='psb_cnrm2'
@ -407,6 +427,12 @@ subroutine psb_cnrm2vs(res, x, desc_a, info)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = 1
jx = 1
m = desc_a%get_global_rows()
@ -439,7 +465,7 @@ subroutine psb_cnrm2vs(res, x, desc_a, info)
res = szero
end if
call psb_nrm2(ictxt,res)
if (global_) call psb_nrm2(ictxt,res)
call psb_erractionrestore(err_act)

@ -41,7 +41,7 @@
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. Return code
!
function psb_cnrmi(a,desc_a,info) result(res)
function psb_cnrmi(a,desc_a,info,global) result(res)
use psb_base_mod, psb_protect_name => psb_cnrmi
implicit none
@ -49,10 +49,12 @@ function psb_cnrmi(a,desc_a,info) result(res)
integer(psb_ipk_), intent(out) :: info
type(psb_desc_type), intent(in) :: desc_a
real(psb_spk_) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, n, iia, jja, ia, ja, mdim, ndim, m
logical :: global_
character(len=20) :: name, ch_err
name='psb_cnrmi'
@ -69,6 +71,12 @@ function psb_cnrmi(a,desc_a,info) result(res)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ia = 1
ja = 1
m = desc_a%get_global_rows()
@ -101,7 +109,7 @@ function psb_cnrmi(a,desc_a,info) result(res)
end if
! compute global max
call psb_amx(ictxt, res)
if (global_) call psb_amx(ictxt, res)
call psb_erractionrestore(err_act)
return

@ -41,7 +41,7 @@
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. Return code
!
function psb_cspnrm1(a,desc_a,info) result(res)
function psb_cspnrm1(a,desc_a,info,global) result(res)
use psb_base_mod, psb_protect_name => psb_cspnrm1
implicit none
@ -49,10 +49,12 @@ function psb_cspnrm1(a,desc_a,info) result(res)
integer(psb_ipk_), intent(out) :: info
type(psb_desc_type), intent(in) :: desc_a
real(psb_spk_) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me, nr,nc,&
& err_act, n, iia, jja, ia, ja, mdim, ndim, m
logical :: global_
character(len=20) :: name, ch_err
real(psb_spk_), allocatable :: v(:)
@ -70,6 +72,12 @@ function psb_cspnrm1(a,desc_a,info) result(res)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ia = 1
ja = 1
m = desc_a%get_global_rows()
@ -119,7 +127,7 @@ function psb_cspnrm1(a,desc_a,info) result(res)
res = szero
end if
! compute global max
call psb_amx(ictxt, res)
if (global_) call psb_amx(ictxt, res)
call psb_erractionrestore(err_act)
return

@ -44,7 +44,7 @@
! info - integer. Return code
! jx - integer(optional). The column offset.
!
function psb_damax(x,desc_a, info, jx) result(res)
function psb_damax(x,desc_a, info, jx,global) result(res)
use psb_base_mod, psb_protect_name => psb_damax
implicit none
@ -54,10 +54,12 @@ function psb_damax(x,desc_a, info, jx) result(res)
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), optional, intent(in) :: jx
real(psb_dpk_) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, ix, ijx, m, ldx
logical :: global_
character(len=20) :: name, ch_err
name='psb_damax'
@ -82,6 +84,12 @@ function psb_damax(x,desc_a, info, jx) result(res)
ijx = 1
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
m = desc_a%get_global_rows()
ldx = size(x,1)
@ -107,7 +115,7 @@ function psb_damax(x,desc_a, info, jx) result(res)
end if
! compute global max
call psb_amx(ictxt, res)
if (global_) call psb_amx(ictxt, res)
call psb_erractionrestore(err_act)
return
@ -162,7 +170,7 @@ end function psb_damax
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. Return code
!
function psb_damaxv (x,desc_a, info) result(res)
function psb_damaxv (x,desc_a, info,global) result(res)
use psb_base_mod, psb_protect_name => psb_damaxv
implicit none
@ -171,11 +179,12 @@ function psb_damaxv (x,desc_a, info) result(res)
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
real(psb_dpk_) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, jx, ix, m, ldx
logical :: global_
character(len=20) :: name, ch_err
name='psb_damaxv'
@ -193,6 +202,12 @@ function psb_damaxv (x,desc_a, info) result(res)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = 1
jx = 1
@ -221,7 +236,7 @@ function psb_damaxv (x,desc_a, info) result(res)
end if
! compute global max
call psb_amx(ictxt, res)
if (global_) call psb_amx(ictxt, res)
call psb_erractionrestore(err_act)
return
@ -232,7 +247,7 @@ function psb_damaxv (x,desc_a, info) result(res)
end function psb_damaxv
function psb_damax_vect(x, desc_a, info) result(res)
function psb_damax_vect(x, desc_a, info,global) result(res)
use psb_penv_mod
use psb_serial_mod
use psb_desc_mod
@ -245,10 +260,12 @@ function psb_damax_vect(x, desc_a, info) result(res)
type(psb_d_vect_type), intent (inout) :: x
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, jx, ix, m
logical :: global_
character(len=20) :: name, ch_err
name='psb_damaxv'
@ -271,6 +288,12 @@ function psb_damax_vect(x, desc_a, info) result(res)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = 1
jx = 1
@ -297,7 +320,7 @@ function psb_damax_vect(x, desc_a, info) result(res)
end if
! compute global max
call psb_amx(ictxt, res)
if (global_) call psb_amx(ictxt, res)
call psb_erractionrestore(err_act)
return
@ -355,7 +378,7 @@ end function psb_damax_vect
! info - integer. Return code
! jx - integer(optional). The column offset.
!
subroutine psb_damaxvs(res,x,desc_a, info)
subroutine psb_damaxvs(res,x,desc_a, info,global)
use psb_base_mod, psb_protect_name => psb_damaxvs
implicit none
@ -364,10 +387,12 @@ subroutine psb_damaxvs(res,x,desc_a, info)
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
real(psb_dpk_), intent(out) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, ix, ijx, m, ldx
logical :: global_
character(len=20) :: name, ch_err
name='psb_damaxvs'
@ -385,6 +410,12 @@ subroutine psb_damaxvs(res,x,desc_a, info)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = 1
ijx=1
@ -412,7 +443,7 @@ subroutine psb_damaxvs(res,x,desc_a, info)
end if
! compute global max
call psb_amx(ictxt, res)
if (global_) call psb_amx(ictxt, res)
call psb_erractionrestore(err_act)
return
@ -466,7 +497,7 @@ end subroutine psb_damaxvs
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. Return code
!
subroutine psb_dmamaxs(res,x,desc_a, info,jx)
subroutine psb_dmamaxs(res,x,desc_a, info,jx,global)
use psb_base_mod, psb_protect_name => psb_dmamaxs
implicit none
@ -476,10 +507,12 @@ subroutine psb_dmamaxs(res,x,desc_a, info,jx)
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), optional, intent(in) :: jx
real(psb_dpk_), intent(out) :: res(:)
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, ix, ijx, m, ldx, i, k
logical :: global_
character(len=20) :: name, ch_err
name='psb_dmamaxs'
@ -503,6 +536,12 @@ subroutine psb_dmamaxs(res,x,desc_a, info,jx)
ijx = 1
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
m = desc_a%get_global_rows()
k = min(size(x,2),size(res,1))
ldx = size(x,1)
@ -529,7 +568,7 @@ subroutine psb_dmamaxs(res,x,desc_a, info,jx)
end if
! compute global max
call psb_amx(ictxt, res(1:k))
if (global_) call psb_amx(ictxt, res(1:k))
call psb_erractionrestore(err_act)
return

@ -44,7 +44,7 @@
! info - integer. Return code
! jx - integer(optional). The column offset.
!
function psb_dasum (x,desc_a, info, jx) result(res)
function psb_dasum (x,desc_a, info, jx,global) result(res)
use psb_base_mod, psb_protect_name => psb_dasum
implicit none
@ -54,10 +54,12 @@ function psb_dasum (x,desc_a, info, jx) result(res)
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), optional, intent(in) :: jx
real(psb_dpk_) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me, &
& err_act, iix, jjx, ix, ijx, m, i, idx, ndm, ldx
logical :: global_
character(len=20) :: name, ch_err
name='psb_dasum'
@ -82,6 +84,12 @@ function psb_dasum (x,desc_a, info, jx) result(res)
ijx = 1
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
m = desc_a%get_global_rows()
ldx = size(x,1)
! check vector correctness
@ -114,7 +122,7 @@ function psb_dasum (x,desc_a, info, jx) result(res)
res = dzero
end if
! compute global sum
call psb_sum(ictxt, res)
if (global_) call psb_sum(ictxt, res)
call psb_erractionrestore(err_act)
return
@ -125,7 +133,7 @@ function psb_dasum (x,desc_a, info, jx) result(res)
end function psb_dasum
function psb_dasum_vect(x, desc_a, info) result(res)
function psb_dasum_vect(x, desc_a, info,global) result(res)
use psb_base_mod, psb_protect_name => psb_dasum_vect
implicit none
@ -133,10 +141,12 @@ function psb_dasum_vect(x, desc_a, info) result(res)
type(psb_d_vect_type), intent (inout) :: x
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, jx, ix, m, imax
& err_act, iix, jjx, jx, ix, m, imax, i, idx, ndm
logical :: global_
character(len=20) :: name, ch_err
name='psb_dasumv'
@ -160,6 +170,11 @@ function psb_dasum_vect(x, desc_a, info) result(res)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = 1
jx = 1
@ -182,12 +197,21 @@ function psb_dasum_vect(x, desc_a, info) result(res)
! compute local max
if ((desc_a%get_local_rows() > 0).and.(m /= 0)) then
res = x%asum(desc_a%get_local_rows())
if (size(desc_a%ovrlap_elem,1)>0) then
if (x%is_dev()) call x%sync()
! adjust res because overlapped elements are computed more than once
do i=1,size(desc_a%ovrlap_elem,1)
idx = desc_a%ovrlap_elem(i,1)
ndm = desc_a%ovrlap_elem(i,2)
res = res - (real(ndm-1)/real(ndm))*abs(x%v%v(idx))
end do
end if
else
res = dzero
end if
! compute global sum
call psb_sum(ictxt, res)
if (global_) call psb_sum(ictxt, res)
call psb_erractionrestore(err_act)
return
@ -242,7 +266,7 @@ end function psb_dasum_vect
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. Return code
!
function psb_dasumv(x,desc_a, info) result(res)
function psb_dasumv(x,desc_a, info,global) result(res)
use psb_base_mod, psb_protect_name => psb_dasumv
implicit none
@ -251,10 +275,12 @@ function psb_dasumv(x,desc_a, info) result(res)
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
real(psb_dpk_) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, jx, ix, m, i, idx, ndm, ldx
logical :: global_
character(len=20) :: name, ch_err
name='psb_dasumv'
@ -271,6 +297,12 @@ function psb_dasumv(x,desc_a, info) result(res)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = 1
jx=1
@ -307,7 +339,7 @@ function psb_dasumv(x,desc_a, info) result(res)
end if
! compute global sum
call psb_sum(ictxt, res)
if (global_) call psb_sum(ictxt, res)
call psb_erractionrestore(err_act)
return
@ -362,7 +394,7 @@ end function psb_dasumv
! info - integer. Return code
! jx - integer(optional). The column offset.
!
subroutine psb_dasumvs(res,x,desc_a, info)
subroutine psb_dasumvs(res,x,desc_a, info,global)
use psb_base_mod, psb_protect_name => psb_dasumvs
implicit none
@ -371,10 +403,12 @@ subroutine psb_dasumvs(res,x,desc_a, info)
real(psb_dpk_), intent(out) :: res
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, ix, jx, m, i, idx, ndm, ldx
logical :: global_
character(len=20) :: name, ch_err
name='psb_dasumvs'
@ -391,6 +425,12 @@ subroutine psb_dasumvs(res,x,desc_a, info)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = 1
jx = 1
@ -427,7 +467,7 @@ subroutine psb_dasumvs(res,x,desc_a, info)
end if
! compute global sum
call psb_sum(ictxt,res)
if (global_) call psb_sum(ictxt,res)
call psb_erractionrestore(err_act)
return

@ -48,7 +48,7 @@
! jx - integer(optional). The column offset for sub( X ).
! jy - integer(optional). The column offset for sub( Y ).
!
function psb_ddot_vect(x, y, desc_a,info) result(res)
function psb_ddot_vect(x, y, desc_a,info,global) result(res)
use psb_desc_mod
use psb_d_base_mat_mod
use psb_check_mod
@ -61,10 +61,12 @@ function psb_ddot_vect(x, y, desc_a,info) result(res)
type(psb_d_vect_type), intent(inout) :: x, y
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me, idx, ndm,&
& err_act, iix, jjx, ix, ijx, iy, ijy, iiy, jjy, i, m, nr
logical :: global_
character(len=20) :: name, ch_err
name='psb_ddot_vect'
@ -91,6 +93,11 @@ function psb_ddot_vect(x, y, desc_a,info) result(res)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = ione
ijx = ione
@ -122,17 +129,21 @@ function psb_ddot_vect(x, y, desc_a,info) result(res)
res = x%dot(nr,y)
! FIXME
! adjust dot_local because overlapped elements are computed more than once
!!$ do i=1,size(desc_a%ovrlap_elem,1)
!!$ idx = desc_a%ovrlap_elem(i,1)
!!$ ndm = desc_a%ovrlap_elem(i,2)
!!$ dot_local = dot_local - (real(ndm-1)/real(ndm))*(x(idx)*y(idx))
!!$ end do
if (size(desc_a%ovrlap_elem,1)>0) then
if (x%is_dev()) call x%sync()
if (y%is_dev()) call y%sync()
do i=1,size(desc_a%ovrlap_elem,1)
idx = desc_a%ovrlap_elem(i,1)
ndm = desc_a%ovrlap_elem(i,2)
res = res - (real(ndm-1)/real(ndm))*(x%v%v(idx)*y%v%v(idx))
end do
end if
else
res = dzero
end if
! compute global sum
call psb_sum(ictxt, res)
if (global_) call psb_sum(ictxt, res)
call psb_erractionrestore(err_act)
return
@ -143,7 +154,7 @@ function psb_ddot_vect(x, y, desc_a,info) result(res)
end function psb_ddot_vect
function psb_ddot(x, y,desc_a, info, jx, jy) result(res)
function psb_ddot(x, y,desc_a, info, jx, jy,global) result(res)
use psb_base_mod, psb_protect_name => psb_ddot
implicit none
@ -152,12 +163,14 @@ function psb_ddot(x, y,desc_a, info, jx, jy) result(res)
integer(psb_ipk_), intent(in), optional :: jx, jy
integer(psb_ipk_), intent(out) :: info
real(psb_dpk_) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me, idx, ndm,&
& err_act, iix, jjx, ix, ijx, iy, ijy, iiy, jjy, i, m, nr, &
& lldx, lldy
real(psb_dpk_) :: ddot
logical :: global_
character(len=20) :: name, ch_err
name='psb_ddot'
@ -193,6 +206,12 @@ function psb_ddot(x, y,desc_a, info, jx, jy) result(res)
goto 9999
end if
if (present(global)) then
global_ = global
else
global_ = .true.
end if
m = desc_a%get_global_rows()
lldx = size(x,1)
lldy = size(y,1)
@ -228,7 +247,7 @@ function psb_ddot(x, y,desc_a, info, jx, jy) result(res)
end if
! compute global sum
call psb_sum(ictxt, res)
if (global_) call psb_sum(ictxt, res)
call psb_erractionrestore(err_act)
return
@ -284,7 +303,7 @@ end function psb_ddot
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. Return code
!
function psb_ddotv(x, y,desc_a, info) result(res)
function psb_ddotv(x, y,desc_a, info,global) result(res)
use psb_base_mod, psb_protect_name => psb_ddotv
implicit none
@ -292,11 +311,13 @@ function psb_ddotv(x, y,desc_a, info) result(res)
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
real(psb_dpk_) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me, idx, ndm,&
& err_act, iix, jjx, ix, jx, iy, jy, iiy, jjy, i, m, nr, &
& lldx, lldy
logical :: global_
real(psb_dpk_) :: ddot
character(len=20) :: name, ch_err
@ -314,6 +335,12 @@ function psb_ddotv(x, y,desc_a, info) result(res)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = ione
iy = ione
jx = ione
@ -352,7 +379,7 @@ function psb_ddotv(x, y,desc_a, info) result(res)
end if
! compute global sum
call psb_sum(ictxt, res)
if (global_) call psb_sum(ictxt, res)
call psb_erractionrestore(err_act)
@ -409,7 +436,7 @@ end function psb_ddotv
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. Return code
!
subroutine psb_ddotvs(res, x, y,desc_a, info)
subroutine psb_ddotvs(res, x, y,desc_a, info,global)
use psb_base_mod, psb_protect_name => psb_ddotvs
implicit none
@ -417,11 +444,13 @@ subroutine psb_ddotvs(res, x, y,desc_a, info)
real(psb_dpk_), intent(out) :: res
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me, idx, ndm,&
& err_act, iix, jjx, ix, iy, iiy, jjy, i, m,nr, &
& lldx, lldy
logical :: global_
real(psb_dpk_) :: ddot
character(len=20) :: name, ch_err
@ -439,6 +468,12 @@ subroutine psb_ddotvs(res, x, y,desc_a, info)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = ione
iy = ione
m = desc_a%get_global_rows()
@ -475,7 +510,7 @@ subroutine psb_ddotvs(res, x, y,desc_a, info)
end if
! compute global sum
call psb_sum(ictxt, res)
if (global_) call psb_sum(ictxt, res)
call psb_erractionrestore(err_act)
return
@ -532,7 +567,7 @@ end subroutine psb_ddotvs
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. Return code
!
subroutine psb_dmdots(res, x, y, desc_a, info)
subroutine psb_dmdots(res, x, y, desc_a, info,global)
use psb_base_mod, psb_protect_name => psb_dmdots
implicit none
@ -540,11 +575,13 @@ subroutine psb_dmdots(res, x, y, desc_a, info)
real(psb_dpk_), intent(out) :: res(:)
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me, idx, ndm,&
& err_act, iix, jjx, ix, iy, iiy, jjy, i, m, j, k, nr, &
& lldx, lldy
logical :: global_
real(psb_dpk_) :: ddot
character(len=20) :: name, ch_err
@ -562,6 +599,11 @@ subroutine psb_dmdots(res, x, y, desc_a, info)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = ione
iy = ione
@ -611,7 +653,7 @@ subroutine psb_dmdots(res, x, y, desc_a, info)
! compute global sum
call psb_sum(ictxt, res(1:k))
if (global_) call psb_sum(ictxt, res(1:k))
call psb_erractionrestore(err_act)
return

@ -44,7 +44,7 @@
! info - integer. Return code
! jx - integer(optional). The column offset for sub( X ).
!
function psb_dnrm2(x, desc_a, info, jx) result(res)
function psb_dnrm2(x, desc_a, info, jx,global) result(res)
use psb_desc_mod
use psb_check_mod
use psb_error_mod
@ -56,10 +56,12 @@ function psb_dnrm2(x, desc_a, info, jx) result(res)
integer(psb_ipk_), intent(in), optional :: jx
integer(psb_ipk_), intent(out) :: info
real(psb_dpk_) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, ndim, ix, ijx, i, m, id, idx, ndm, ldx
logical :: global_
real(psb_dpk_) :: dnrm2, dd
character(len=20) :: name, ch_err
@ -84,6 +86,12 @@ function psb_dnrm2(x, desc_a, info, jx) result(res)
ijx = 1
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
m = desc_a%get_global_rows()
ldx = size(x,1)
call psb_chkvect(m,ione,ldx,ix,ijx,desc_a,info,iix,jjx)
@ -114,7 +122,7 @@ function psb_dnrm2(x, desc_a, info, jx) result(res)
res = dzero
end if
call psb_nrm2(ictxt,res)
if (global_) call psb_nrm2(ictxt,res)
call psb_erractionrestore(err_act)
return
@ -168,7 +176,7 @@ end function psb_dnrm2
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. Return code
!
function psb_dnrm2v(x, desc_a, info) result(res)
function psb_dnrm2v(x, desc_a, info,global) result(res)
use psb_desc_mod
use psb_check_mod
use psb_error_mod
@ -179,13 +187,13 @@ function psb_dnrm2v(x, desc_a, info) result(res)
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
real(psb_dpk_) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, ndim, ix, jx, i, m, id, idx, ndm, ldx
logical :: global_
real(psb_dpk_) :: dnrm2, dd
!!$ external scombnrm2
character(len=20) :: name, ch_err
name='psb_dnrm2v'
@ -202,6 +210,11 @@ function psb_dnrm2v(x, desc_a, info) result(res)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = 1
jx=1
m = desc_a%get_global_rows()
@ -233,8 +246,7 @@ function psb_dnrm2v(x, desc_a, info) result(res)
res = dzero
end if
call psb_nrm2(ictxt,res)
if (global_) call psb_nrm2(ictxt,res)
call psb_erractionrestore(err_act)
return
@ -246,7 +258,7 @@ end function psb_dnrm2v
function psb_dnrm2_vect(x, desc_a, info) result(res)
function psb_dnrm2_vect(x, desc_a, info,global) result(res)
use psb_desc_mod
use psb_check_mod
use psb_error_mod
@ -258,12 +270,13 @@ function psb_dnrm2_vect(x, desc_a, info) result(res)
type(psb_d_vect_type), intent (inout) :: x
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, ndim, ix, jx, i, m, id, idx, ndm, ldx
logical :: global_
real(psb_dpk_) :: snrm2, dd
!!$ external dcombnrm2
character(len=20) :: name, ch_err
name='psb_dnrm2v'
@ -286,6 +299,11 @@ function psb_dnrm2_vect(x, desc_a, info) result(res)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = 1
jx=1
@ -307,18 +325,21 @@ function psb_dnrm2_vect(x, desc_a, info) result(res)
if (desc_a%get_local_rows() > 0) then
ndim = desc_a%get_local_rows()
res = x%nrm2(ndim)
!!$ ! adjust because overlapped elements are computed more than once
!!$ do i=1,size(desc_a%ovrlap_elem,1)
!!$ idx = desc_a%ovrlap_elem(i,1)
!!$ ndm = desc_a%ovrlap_elem(i,2)
!!$ dd = dble(ndm-1)/dble(ndm)
!!$ nrm2 = nrm2 * sqrt(done - dd*(abs(x(idx))/nrm2)**2)
!!$ end do
! adjust because overlapped elements are computed more than once
if (size(desc_a%ovrlap_elem,1)>0) then
if (x%is_dev()) call x%sync()
do i=1,size(desc_a%ovrlap_elem,1)
idx = desc_a%ovrlap_elem(i,1)
ndm = desc_a%ovrlap_elem(i,2)
dd = dble(ndm-1)/dble(ndm)
res = res - sqrt(done - dd*(abs(x%v%v(idx))/res)**2)
end do
end if
else
res = dzero
end if
call psb_nrm2(ictxt,res)
if (global_) call psb_nrm2(ictxt,res)
call psb_erractionrestore(err_act)
return
@ -329,7 +350,6 @@ function psb_dnrm2_vect(x, desc_a, info) result(res)
end function psb_dnrm2_vect
!!$
!!$ Parallel Sparse BLAS version 3.5
!!$ (C) Copyright 2006-2018
@ -373,7 +393,7 @@ end function psb_dnrm2_vect
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. Return code
!
subroutine psb_dnrm2vs(res, x, desc_a, info)
subroutine psb_dnrm2vs(res, x, desc_a, info,global)
use psb_desc_mod
use psb_check_mod
use psb_error_mod
@ -384,13 +404,13 @@ subroutine psb_dnrm2vs(res, x, desc_a, info)
real(psb_dpk_), intent(out) :: res
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, ndim, ix, jx, i, m, id, idx, ndm, ldx
logical :: global_
real(psb_dpk_) :: nrm2, dnrm2, dd
!!$ external scombnrm2
character(len=20) :: name, ch_err
name='psb_dnrm2'
@ -407,6 +427,12 @@ subroutine psb_dnrm2vs(res, x, desc_a, info)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = 1
jx = 1
m = desc_a%get_global_rows()
@ -439,7 +465,7 @@ subroutine psb_dnrm2vs(res, x, desc_a, info)
res = dzero
end if
call psb_nrm2(ictxt,res)
if (global_) call psb_nrm2(ictxt,res)
call psb_erractionrestore(err_act)

@ -41,7 +41,7 @@
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. Return code
!
function psb_dnrmi(a,desc_a,info) result(res)
function psb_dnrmi(a,desc_a,info,global) result(res)
use psb_base_mod, psb_protect_name => psb_dnrmi
implicit none
@ -49,10 +49,12 @@ function psb_dnrmi(a,desc_a,info) result(res)
integer(psb_ipk_), intent(out) :: info
type(psb_desc_type), intent(in) :: desc_a
real(psb_dpk_) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, n, iia, jja, ia, ja, mdim, ndim, m
logical :: global_
character(len=20) :: name, ch_err
name='psb_dnrmi'
@ -69,6 +71,12 @@ function psb_dnrmi(a,desc_a,info) result(res)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ia = 1
ja = 1
m = desc_a%get_global_rows()
@ -101,7 +109,7 @@ function psb_dnrmi(a,desc_a,info) result(res)
end if
! compute global max
call psb_amx(ictxt, res)
if (global_) call psb_amx(ictxt, res)
call psb_erractionrestore(err_act)
return

@ -41,7 +41,7 @@
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. Return code
!
function psb_dspnrm1(a,desc_a,info) result(res)
function psb_dspnrm1(a,desc_a,info,global) result(res)
use psb_base_mod, psb_protect_name => psb_dspnrm1
implicit none
@ -49,10 +49,12 @@ function psb_dspnrm1(a,desc_a,info) result(res)
integer(psb_ipk_), intent(out) :: info
type(psb_desc_type), intent(in) :: desc_a
real(psb_dpk_) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me, nr,nc,&
& err_act, n, iia, jja, ia, ja, mdim, ndim, m
logical :: global_
character(len=20) :: name, ch_err
real(psb_dpk_), allocatable :: v(:)
@ -70,6 +72,12 @@ function psb_dspnrm1(a,desc_a,info) result(res)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ia = 1
ja = 1
m = desc_a%get_global_rows()
@ -119,7 +127,7 @@ function psb_dspnrm1(a,desc_a,info) result(res)
res = dzero
end if
! compute global max
call psb_amx(ictxt, res)
if (global_) call psb_amx(ictxt, res)
call psb_erractionrestore(err_act)
return

@ -44,7 +44,7 @@
! info - integer. Return code
! jx - integer(optional). The column offset.
!
function psb_samax(x,desc_a, info, jx) result(res)
function psb_samax(x,desc_a, info, jx,global) result(res)
use psb_base_mod, psb_protect_name => psb_samax
implicit none
@ -54,10 +54,12 @@ function psb_samax(x,desc_a, info, jx) result(res)
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), optional, intent(in) :: jx
real(psb_spk_) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, ix, ijx, m, ldx
logical :: global_
character(len=20) :: name, ch_err
name='psb_samax'
@ -82,6 +84,12 @@ function psb_samax(x,desc_a, info, jx) result(res)
ijx = 1
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
m = desc_a%get_global_rows()
ldx = size(x,1)
@ -107,7 +115,7 @@ function psb_samax(x,desc_a, info, jx) result(res)
end if
! compute global max
call psb_amx(ictxt, res)
if (global_) call psb_amx(ictxt, res)
call psb_erractionrestore(err_act)
return
@ -162,7 +170,7 @@ end function psb_samax
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. Return code
!
function psb_samaxv (x,desc_a, info) result(res)
function psb_samaxv (x,desc_a, info,global) result(res)
use psb_base_mod, psb_protect_name => psb_samaxv
implicit none
@ -171,11 +179,12 @@ function psb_samaxv (x,desc_a, info) result(res)
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
real(psb_spk_) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, jx, ix, m, ldx
logical :: global_
character(len=20) :: name, ch_err
name='psb_samaxv'
@ -193,6 +202,12 @@ function psb_samaxv (x,desc_a, info) result(res)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = 1
jx = 1
@ -221,7 +236,7 @@ function psb_samaxv (x,desc_a, info) result(res)
end if
! compute global max
call psb_amx(ictxt, res)
if (global_) call psb_amx(ictxt, res)
call psb_erractionrestore(err_act)
return
@ -232,7 +247,7 @@ function psb_samaxv (x,desc_a, info) result(res)
end function psb_samaxv
function psb_samax_vect(x, desc_a, info) result(res)
function psb_samax_vect(x, desc_a, info,global) result(res)
use psb_penv_mod
use psb_serial_mod
use psb_desc_mod
@ -245,10 +260,12 @@ function psb_samax_vect(x, desc_a, info) result(res)
type(psb_s_vect_type), intent (inout) :: x
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, jx, ix, m
logical :: global_
character(len=20) :: name, ch_err
name='psb_samaxv'
@ -271,6 +288,12 @@ function psb_samax_vect(x, desc_a, info) result(res)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = 1
jx = 1
@ -297,7 +320,7 @@ function psb_samax_vect(x, desc_a, info) result(res)
end if
! compute global max
call psb_amx(ictxt, res)
if (global_) call psb_amx(ictxt, res)
call psb_erractionrestore(err_act)
return
@ -355,7 +378,7 @@ end function psb_samax_vect
! info - integer. Return code
! jx - integer(optional). The column offset.
!
subroutine psb_samaxvs(res,x,desc_a, info)
subroutine psb_samaxvs(res,x,desc_a, info,global)
use psb_base_mod, psb_protect_name => psb_samaxvs
implicit none
@ -364,10 +387,12 @@ subroutine psb_samaxvs(res,x,desc_a, info)
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
real(psb_spk_), intent(out) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, ix, ijx, m, ldx
logical :: global_
character(len=20) :: name, ch_err
name='psb_samaxvs'
@ -385,6 +410,12 @@ subroutine psb_samaxvs(res,x,desc_a, info)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = 1
ijx=1
@ -412,7 +443,7 @@ subroutine psb_samaxvs(res,x,desc_a, info)
end if
! compute global max
call psb_amx(ictxt, res)
if (global_) call psb_amx(ictxt, res)
call psb_erractionrestore(err_act)
return
@ -466,7 +497,7 @@ end subroutine psb_samaxvs
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. Return code
!
subroutine psb_smamaxs(res,x,desc_a, info,jx)
subroutine psb_smamaxs(res,x,desc_a, info,jx,global)
use psb_base_mod, psb_protect_name => psb_smamaxs
implicit none
@ -476,10 +507,12 @@ subroutine psb_smamaxs(res,x,desc_a, info,jx)
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), optional, intent(in) :: jx
real(psb_spk_), intent(out) :: res(:)
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, ix, ijx, m, ldx, i, k
logical :: global_
character(len=20) :: name, ch_err
name='psb_smamaxs'
@ -503,6 +536,12 @@ subroutine psb_smamaxs(res,x,desc_a, info,jx)
ijx = 1
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
m = desc_a%get_global_rows()
k = min(size(x,2),size(res,1))
ldx = size(x,1)
@ -529,7 +568,7 @@ subroutine psb_smamaxs(res,x,desc_a, info,jx)
end if
! compute global max
call psb_amx(ictxt, res(1:k))
if (global_) call psb_amx(ictxt, res(1:k))
call psb_erractionrestore(err_act)
return

@ -44,7 +44,7 @@
! info - integer. Return code
! jx - integer(optional). The column offset.
!
function psb_sasum (x,desc_a, info, jx) result(res)
function psb_sasum (x,desc_a, info, jx,global) result(res)
use psb_base_mod, psb_protect_name => psb_sasum
implicit none
@ -54,10 +54,12 @@ function psb_sasum (x,desc_a, info, jx) result(res)
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), optional, intent(in) :: jx
real(psb_spk_) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me, &
& err_act, iix, jjx, ix, ijx, m, i, idx, ndm, ldx
logical :: global_
character(len=20) :: name, ch_err
name='psb_sasum'
@ -82,6 +84,12 @@ function psb_sasum (x,desc_a, info, jx) result(res)
ijx = 1
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
m = desc_a%get_global_rows()
ldx = size(x,1)
! check vector correctness
@ -114,7 +122,7 @@ function psb_sasum (x,desc_a, info, jx) result(res)
res = szero
end if
! compute global sum
call psb_sum(ictxt, res)
if (global_) call psb_sum(ictxt, res)
call psb_erractionrestore(err_act)
return
@ -125,7 +133,7 @@ function psb_sasum (x,desc_a, info, jx) result(res)
end function psb_sasum
function psb_sasum_vect(x, desc_a, info) result(res)
function psb_sasum_vect(x, desc_a, info,global) result(res)
use psb_base_mod, psb_protect_name => psb_sasum_vect
implicit none
@ -133,10 +141,12 @@ function psb_sasum_vect(x, desc_a, info) result(res)
type(psb_s_vect_type), intent (inout) :: x
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, jx, ix, m, imax
& err_act, iix, jjx, jx, ix, m, imax, i, idx, ndm
logical :: global_
character(len=20) :: name, ch_err
name='psb_sasumv'
@ -160,6 +170,11 @@ function psb_sasum_vect(x, desc_a, info) result(res)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = 1
jx = 1
@ -182,12 +197,21 @@ function psb_sasum_vect(x, desc_a, info) result(res)
! compute local max
if ((desc_a%get_local_rows() > 0).and.(m /= 0)) then
res = x%asum(desc_a%get_local_rows())
if (size(desc_a%ovrlap_elem,1)>0) then
if (x%is_dev()) call x%sync()
! adjust res because overlapped elements are computed more than once
do i=1,size(desc_a%ovrlap_elem,1)
idx = desc_a%ovrlap_elem(i,1)
ndm = desc_a%ovrlap_elem(i,2)
res = res - (real(ndm-1)/real(ndm))*abs(x%v%v(idx))
end do
end if
else
res = szero
end if
! compute global sum
call psb_sum(ictxt, res)
if (global_) call psb_sum(ictxt, res)
call psb_erractionrestore(err_act)
return
@ -242,7 +266,7 @@ end function psb_sasum_vect
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. Return code
!
function psb_sasumv(x,desc_a, info) result(res)
function psb_sasumv(x,desc_a, info,global) result(res)
use psb_base_mod, psb_protect_name => psb_sasumv
implicit none
@ -251,10 +275,12 @@ function psb_sasumv(x,desc_a, info) result(res)
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
real(psb_spk_) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, jx, ix, m, i, idx, ndm, ldx
logical :: global_
character(len=20) :: name, ch_err
name='psb_sasumv'
@ -271,6 +297,12 @@ function psb_sasumv(x,desc_a, info) result(res)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = 1
jx=1
@ -307,7 +339,7 @@ function psb_sasumv(x,desc_a, info) result(res)
end if
! compute global sum
call psb_sum(ictxt, res)
if (global_) call psb_sum(ictxt, res)
call psb_erractionrestore(err_act)
return
@ -362,7 +394,7 @@ end function psb_sasumv
! info - integer. Return code
! jx - integer(optional). The column offset.
!
subroutine psb_sasumvs(res,x,desc_a, info)
subroutine psb_sasumvs(res,x,desc_a, info,global)
use psb_base_mod, psb_protect_name => psb_sasumvs
implicit none
@ -371,10 +403,12 @@ subroutine psb_sasumvs(res,x,desc_a, info)
real(psb_spk_), intent(out) :: res
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, ix, jx, m, i, idx, ndm, ldx
logical :: global_
character(len=20) :: name, ch_err
name='psb_sasumvs'
@ -391,6 +425,12 @@ subroutine psb_sasumvs(res,x,desc_a, info)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = 1
jx = 1
@ -427,7 +467,7 @@ subroutine psb_sasumvs(res,x,desc_a, info)
end if
! compute global sum
call psb_sum(ictxt,res)
if (global_) call psb_sum(ictxt,res)
call psb_erractionrestore(err_act)
return

@ -48,7 +48,7 @@
! jx - integer(optional). The column offset for sub( X ).
! jy - integer(optional). The column offset for sub( Y ).
!
function psb_sdot_vect(x, y, desc_a,info) result(res)
function psb_sdot_vect(x, y, desc_a,info,global) result(res)
use psb_desc_mod
use psb_s_base_mat_mod
use psb_check_mod
@ -61,10 +61,12 @@ function psb_sdot_vect(x, y, desc_a,info) result(res)
type(psb_s_vect_type), intent(inout) :: x, y
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me, idx, ndm,&
& err_act, iix, jjx, ix, ijx, iy, ijy, iiy, jjy, i, m, nr
logical :: global_
character(len=20) :: name, ch_err
name='psb_sdot_vect'
@ -91,6 +93,11 @@ function psb_sdot_vect(x, y, desc_a,info) result(res)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = ione
ijx = ione
@ -122,17 +129,21 @@ function psb_sdot_vect(x, y, desc_a,info) result(res)
res = x%dot(nr,y)
! FIXME
! adjust dot_local because overlapped elements are computed more than once
!!$ do i=1,size(desc_a%ovrlap_elem,1)
!!$ idx = desc_a%ovrlap_elem(i,1)
!!$ ndm = desc_a%ovrlap_elem(i,2)
!!$ dot_local = dot_local - (real(ndm-1)/real(ndm))*(x(idx)*y(idx))
!!$ end do
if (size(desc_a%ovrlap_elem,1)>0) then
if (x%is_dev()) call x%sync()
if (y%is_dev()) call y%sync()
do i=1,size(desc_a%ovrlap_elem,1)
idx = desc_a%ovrlap_elem(i,1)
ndm = desc_a%ovrlap_elem(i,2)
res = res - (real(ndm-1)/real(ndm))*(x%v%v(idx)*y%v%v(idx))
end do
end if
else
res = szero
end if
! compute global sum
call psb_sum(ictxt, res)
if (global_) call psb_sum(ictxt, res)
call psb_erractionrestore(err_act)
return
@ -143,7 +154,7 @@ function psb_sdot_vect(x, y, desc_a,info) result(res)
end function psb_sdot_vect
function psb_sdot(x, y,desc_a, info, jx, jy) result(res)
function psb_sdot(x, y,desc_a, info, jx, jy,global) result(res)
use psb_base_mod, psb_protect_name => psb_sdot
implicit none
@ -152,12 +163,14 @@ function psb_sdot(x, y,desc_a, info, jx, jy) result(res)
integer(psb_ipk_), intent(in), optional :: jx, jy
integer(psb_ipk_), intent(out) :: info
real(psb_spk_) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me, idx, ndm,&
& err_act, iix, jjx, ix, ijx, iy, ijy, iiy, jjy, i, m, nr, &
& lldx, lldy
real(psb_spk_) :: sdot
logical :: global_
character(len=20) :: name, ch_err
name='psb_sdot'
@ -193,6 +206,12 @@ function psb_sdot(x, y,desc_a, info, jx, jy) result(res)
goto 9999
end if
if (present(global)) then
global_ = global
else
global_ = .true.
end if
m = desc_a%get_global_rows()
lldx = size(x,1)
lldy = size(y,1)
@ -228,7 +247,7 @@ function psb_sdot(x, y,desc_a, info, jx, jy) result(res)
end if
! compute global sum
call psb_sum(ictxt, res)
if (global_) call psb_sum(ictxt, res)
call psb_erractionrestore(err_act)
return
@ -284,7 +303,7 @@ end function psb_sdot
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. Return code
!
function psb_sdotv(x, y,desc_a, info) result(res)
function psb_sdotv(x, y,desc_a, info,global) result(res)
use psb_base_mod, psb_protect_name => psb_sdotv
implicit none
@ -292,11 +311,13 @@ function psb_sdotv(x, y,desc_a, info) result(res)
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
real(psb_spk_) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me, idx, ndm,&
& err_act, iix, jjx, ix, jx, iy, jy, iiy, jjy, i, m, nr, &
& lldx, lldy
logical :: global_
real(psb_spk_) :: sdot
character(len=20) :: name, ch_err
@ -314,6 +335,12 @@ function psb_sdotv(x, y,desc_a, info) result(res)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = ione
iy = ione
jx = ione
@ -352,7 +379,7 @@ function psb_sdotv(x, y,desc_a, info) result(res)
end if
! compute global sum
call psb_sum(ictxt, res)
if (global_) call psb_sum(ictxt, res)
call psb_erractionrestore(err_act)
@ -409,7 +436,7 @@ end function psb_sdotv
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. Return code
!
subroutine psb_sdotvs(res, x, y,desc_a, info)
subroutine psb_sdotvs(res, x, y,desc_a, info,global)
use psb_base_mod, psb_protect_name => psb_sdotvs
implicit none
@ -417,11 +444,13 @@ subroutine psb_sdotvs(res, x, y,desc_a, info)
real(psb_spk_), intent(out) :: res
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me, idx, ndm,&
& err_act, iix, jjx, ix, iy, iiy, jjy, i, m,nr, &
& lldx, lldy
logical :: global_
real(psb_spk_) :: sdot
character(len=20) :: name, ch_err
@ -439,6 +468,12 @@ subroutine psb_sdotvs(res, x, y,desc_a, info)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = ione
iy = ione
m = desc_a%get_global_rows()
@ -475,7 +510,7 @@ subroutine psb_sdotvs(res, x, y,desc_a, info)
end if
! compute global sum
call psb_sum(ictxt, res)
if (global_) call psb_sum(ictxt, res)
call psb_erractionrestore(err_act)
return
@ -532,7 +567,7 @@ end subroutine psb_sdotvs
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. Return code
!
subroutine psb_smdots(res, x, y, desc_a, info)
subroutine psb_smdots(res, x, y, desc_a, info,global)
use psb_base_mod, psb_protect_name => psb_smdots
implicit none
@ -540,11 +575,13 @@ subroutine psb_smdots(res, x, y, desc_a, info)
real(psb_spk_), intent(out) :: res(:)
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me, idx, ndm,&
& err_act, iix, jjx, ix, iy, iiy, jjy, i, m, j, k, nr, &
& lldx, lldy
logical :: global_
real(psb_spk_) :: sdot
character(len=20) :: name, ch_err
@ -562,6 +599,11 @@ subroutine psb_smdots(res, x, y, desc_a, info)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = ione
iy = ione
@ -611,7 +653,7 @@ subroutine psb_smdots(res, x, y, desc_a, info)
! compute global sum
call psb_sum(ictxt, res(1:k))
if (global_) call psb_sum(ictxt, res(1:k))
call psb_erractionrestore(err_act)
return

@ -44,7 +44,7 @@
! info - integer. Return code
! jx - integer(optional). The column offset for sub( X ).
!
function psb_snrm2(x, desc_a, info, jx) result(res)
function psb_snrm2(x, desc_a, info, jx,global) result(res)
use psb_desc_mod
use psb_check_mod
use psb_error_mod
@ -56,10 +56,12 @@ function psb_snrm2(x, desc_a, info, jx) result(res)
integer(psb_ipk_), intent(in), optional :: jx
integer(psb_ipk_), intent(out) :: info
real(psb_spk_) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, ndim, ix, ijx, i, m, id, idx, ndm, ldx
logical :: global_
real(psb_spk_) :: snrm2, dd
character(len=20) :: name, ch_err
@ -84,6 +86,12 @@ function psb_snrm2(x, desc_a, info, jx) result(res)
ijx = 1
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
m = desc_a%get_global_rows()
ldx = size(x,1)
call psb_chkvect(m,ione,ldx,ix,ijx,desc_a,info,iix,jjx)
@ -114,7 +122,7 @@ function psb_snrm2(x, desc_a, info, jx) result(res)
res = szero
end if
call psb_nrm2(ictxt,res)
if (global_) call psb_nrm2(ictxt,res)
call psb_erractionrestore(err_act)
return
@ -168,7 +176,7 @@ end function psb_snrm2
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. Return code
!
function psb_snrm2v(x, desc_a, info) result(res)
function psb_snrm2v(x, desc_a, info,global) result(res)
use psb_desc_mod
use psb_check_mod
use psb_error_mod
@ -179,13 +187,13 @@ function psb_snrm2v(x, desc_a, info) result(res)
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
real(psb_spk_) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, ndim, ix, jx, i, m, id, idx, ndm, ldx
logical :: global_
real(psb_spk_) :: snrm2, dd
!!$ external scombnrm2
character(len=20) :: name, ch_err
name='psb_snrm2v'
@ -202,6 +210,11 @@ function psb_snrm2v(x, desc_a, info) result(res)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = 1
jx=1
m = desc_a%get_global_rows()
@ -233,8 +246,7 @@ function psb_snrm2v(x, desc_a, info) result(res)
res = szero
end if
call psb_nrm2(ictxt,res)
if (global_) call psb_nrm2(ictxt,res)
call psb_erractionrestore(err_act)
return
@ -246,7 +258,7 @@ end function psb_snrm2v
function psb_snrm2_vect(x, desc_a, info) result(res)
function psb_snrm2_vect(x, desc_a, info,global) result(res)
use psb_desc_mod
use psb_check_mod
use psb_error_mod
@ -258,12 +270,13 @@ function psb_snrm2_vect(x, desc_a, info) result(res)
type(psb_s_vect_type), intent (inout) :: x
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, ndim, ix, jx, i, m, id, idx, ndm, ldx
logical :: global_
real(psb_spk_) :: snrm2, dd
!!$ external dcombnrm2
character(len=20) :: name, ch_err
name='psb_snrm2v'
@ -286,6 +299,11 @@ function psb_snrm2_vect(x, desc_a, info) result(res)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = 1
jx=1
@ -307,18 +325,21 @@ function psb_snrm2_vect(x, desc_a, info) result(res)
if (desc_a%get_local_rows() > 0) then
ndim = desc_a%get_local_rows()
res = x%nrm2(ndim)
!!$ ! adjust because overlapped elements are computed more than once
!!$ do i=1,size(desc_a%ovrlap_elem,1)
!!$ idx = desc_a%ovrlap_elem(i,1)
!!$ ndm = desc_a%ovrlap_elem(i,2)
!!$ dd = dble(ndm-1)/dble(ndm)
!!$ nrm2 = nrm2 * sqrt(done - dd*(abs(x(idx))/nrm2)**2)
!!$ end do
! adjust because overlapped elements are computed more than once
if (size(desc_a%ovrlap_elem,1)>0) then
if (x%is_dev()) call x%sync()
do i=1,size(desc_a%ovrlap_elem,1)
idx = desc_a%ovrlap_elem(i,1)
ndm = desc_a%ovrlap_elem(i,2)
dd = dble(ndm-1)/dble(ndm)
res = res - sqrt(sone - dd*(abs(x%v%v(idx))/res)**2)
end do
end if
else
res = szero
end if
call psb_nrm2(ictxt,res)
if (global_) call psb_nrm2(ictxt,res)
call psb_erractionrestore(err_act)
return
@ -329,7 +350,6 @@ function psb_snrm2_vect(x, desc_a, info) result(res)
end function psb_snrm2_vect
!!$
!!$ Parallel Sparse BLAS version 3.5
!!$ (C) Copyright 2006-2018
@ -373,7 +393,7 @@ end function psb_snrm2_vect
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. Return code
!
subroutine psb_snrm2vs(res, x, desc_a, info)
subroutine psb_snrm2vs(res, x, desc_a, info,global)
use psb_desc_mod
use psb_check_mod
use psb_error_mod
@ -384,13 +404,13 @@ subroutine psb_snrm2vs(res, x, desc_a, info)
real(psb_spk_), intent(out) :: res
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, ndim, ix, jx, i, m, id, idx, ndm, ldx
logical :: global_
real(psb_spk_) :: nrm2, snrm2, dd
!!$ external scombnrm2
character(len=20) :: name, ch_err
name='psb_snrm2'
@ -407,6 +427,12 @@ subroutine psb_snrm2vs(res, x, desc_a, info)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = 1
jx = 1
m = desc_a%get_global_rows()
@ -439,7 +465,7 @@ subroutine psb_snrm2vs(res, x, desc_a, info)
res = szero
end if
call psb_nrm2(ictxt,res)
if (global_) call psb_nrm2(ictxt,res)
call psb_erractionrestore(err_act)

@ -41,7 +41,7 @@
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. Return code
!
function psb_snrmi(a,desc_a,info) result(res)
function psb_snrmi(a,desc_a,info,global) result(res)
use psb_base_mod, psb_protect_name => psb_snrmi
implicit none
@ -49,10 +49,12 @@ function psb_snrmi(a,desc_a,info) result(res)
integer(psb_ipk_), intent(out) :: info
type(psb_desc_type), intent(in) :: desc_a
real(psb_spk_) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, n, iia, jja, ia, ja, mdim, ndim, m
logical :: global_
character(len=20) :: name, ch_err
name='psb_snrmi'
@ -69,6 +71,12 @@ function psb_snrmi(a,desc_a,info) result(res)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ia = 1
ja = 1
m = desc_a%get_global_rows()
@ -101,7 +109,7 @@ function psb_snrmi(a,desc_a,info) result(res)
end if
! compute global max
call psb_amx(ictxt, res)
if (global_) call psb_amx(ictxt, res)
call psb_erractionrestore(err_act)
return

@ -41,7 +41,7 @@
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. Return code
!
function psb_sspnrm1(a,desc_a,info) result(res)
function psb_sspnrm1(a,desc_a,info,global) result(res)
use psb_base_mod, psb_protect_name => psb_sspnrm1
implicit none
@ -49,10 +49,12 @@ function psb_sspnrm1(a,desc_a,info) result(res)
integer(psb_ipk_), intent(out) :: info
type(psb_desc_type), intent(in) :: desc_a
real(psb_spk_) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me, nr,nc,&
& err_act, n, iia, jja, ia, ja, mdim, ndim, m
logical :: global_
character(len=20) :: name, ch_err
real(psb_spk_), allocatable :: v(:)
@ -70,6 +72,12 @@ function psb_sspnrm1(a,desc_a,info) result(res)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ia = 1
ja = 1
m = desc_a%get_global_rows()
@ -119,7 +127,7 @@ function psb_sspnrm1(a,desc_a,info) result(res)
res = szero
end if
! compute global max
call psb_amx(ictxt, res)
if (global_) call psb_amx(ictxt, res)
call psb_erractionrestore(err_act)
return

@ -44,7 +44,7 @@
! info - integer. Return code
! jx - integer(optional). The column offset.
!
function psb_zamax(x,desc_a, info, jx) result(res)
function psb_zamax(x,desc_a, info, jx,global) result(res)
use psb_base_mod, psb_protect_name => psb_zamax
implicit none
@ -54,10 +54,12 @@ function psb_zamax(x,desc_a, info, jx) result(res)
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), optional, intent(in) :: jx
real(psb_dpk_) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, ix, ijx, m, ldx
logical :: global_
character(len=20) :: name, ch_err
name='psb_zamax'
@ -82,6 +84,12 @@ function psb_zamax(x,desc_a, info, jx) result(res)
ijx = 1
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
m = desc_a%get_global_rows()
ldx = size(x,1)
@ -107,7 +115,7 @@ function psb_zamax(x,desc_a, info, jx) result(res)
end if
! compute global max
call psb_amx(ictxt, res)
if (global_) call psb_amx(ictxt, res)
call psb_erractionrestore(err_act)
return
@ -162,7 +170,7 @@ end function psb_zamax
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. Return code
!
function psb_zamaxv (x,desc_a, info) result(res)
function psb_zamaxv (x,desc_a, info,global) result(res)
use psb_base_mod, psb_protect_name => psb_zamaxv
implicit none
@ -171,11 +179,12 @@ function psb_zamaxv (x,desc_a, info) result(res)
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
real(psb_dpk_) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, jx, ix, m, ldx
logical :: global_
character(len=20) :: name, ch_err
name='psb_zamaxv'
@ -193,6 +202,12 @@ function psb_zamaxv (x,desc_a, info) result(res)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = 1
jx = 1
@ -221,7 +236,7 @@ function psb_zamaxv (x,desc_a, info) result(res)
end if
! compute global max
call psb_amx(ictxt, res)
if (global_) call psb_amx(ictxt, res)
call psb_erractionrestore(err_act)
return
@ -232,7 +247,7 @@ function psb_zamaxv (x,desc_a, info) result(res)
end function psb_zamaxv
function psb_zamax_vect(x, desc_a, info) result(res)
function psb_zamax_vect(x, desc_a, info,global) result(res)
use psb_penv_mod
use psb_serial_mod
use psb_desc_mod
@ -245,10 +260,12 @@ function psb_zamax_vect(x, desc_a, info) result(res)
type(psb_z_vect_type), intent (inout) :: x
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, jx, ix, m
logical :: global_
character(len=20) :: name, ch_err
name='psb_zamaxv'
@ -271,6 +288,12 @@ function psb_zamax_vect(x, desc_a, info) result(res)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = 1
jx = 1
@ -297,7 +320,7 @@ function psb_zamax_vect(x, desc_a, info) result(res)
end if
! compute global max
call psb_amx(ictxt, res)
if (global_) call psb_amx(ictxt, res)
call psb_erractionrestore(err_act)
return
@ -355,7 +378,7 @@ end function psb_zamax_vect
! info - integer. Return code
! jx - integer(optional). The column offset.
!
subroutine psb_zamaxvs(res,x,desc_a, info)
subroutine psb_zamaxvs(res,x,desc_a, info,global)
use psb_base_mod, psb_protect_name => psb_zamaxvs
implicit none
@ -364,10 +387,12 @@ subroutine psb_zamaxvs(res,x,desc_a, info)
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
real(psb_dpk_), intent(out) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, ix, ijx, m, ldx
logical :: global_
character(len=20) :: name, ch_err
name='psb_zamaxvs'
@ -385,6 +410,12 @@ subroutine psb_zamaxvs(res,x,desc_a, info)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = 1
ijx=1
@ -412,7 +443,7 @@ subroutine psb_zamaxvs(res,x,desc_a, info)
end if
! compute global max
call psb_amx(ictxt, res)
if (global_) call psb_amx(ictxt, res)
call psb_erractionrestore(err_act)
return
@ -466,7 +497,7 @@ end subroutine psb_zamaxvs
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. Return code
!
subroutine psb_zmamaxs(res,x,desc_a, info,jx)
subroutine psb_zmamaxs(res,x,desc_a, info,jx,global)
use psb_base_mod, psb_protect_name => psb_zmamaxs
implicit none
@ -476,10 +507,12 @@ subroutine psb_zmamaxs(res,x,desc_a, info,jx)
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), optional, intent(in) :: jx
real(psb_dpk_), intent(out) :: res(:)
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, ix, ijx, m, ldx, i, k
logical :: global_
character(len=20) :: name, ch_err
name='psb_zmamaxs'
@ -503,6 +536,12 @@ subroutine psb_zmamaxs(res,x,desc_a, info,jx)
ijx = 1
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
m = desc_a%get_global_rows()
k = min(size(x,2),size(res,1))
ldx = size(x,1)
@ -529,7 +568,7 @@ subroutine psb_zmamaxs(res,x,desc_a, info,jx)
end if
! compute global max
call psb_amx(ictxt, res(1:k))
if (global_) call psb_amx(ictxt, res(1:k))
call psb_erractionrestore(err_act)
return

@ -44,7 +44,7 @@
! info - integer. Return code
! jx - integer(optional). The column offset.
!
function psb_zasum (x,desc_a, info, jx) result(res)
function psb_zasum (x,desc_a, info, jx,global) result(res)
use psb_base_mod, psb_protect_name => psb_zasum
implicit none
@ -54,10 +54,12 @@ function psb_zasum (x,desc_a, info, jx) result(res)
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), optional, intent(in) :: jx
real(psb_dpk_) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me, &
& err_act, iix, jjx, ix, ijx, m, i, idx, ndm, ldx
logical :: global_
character(len=20) :: name, ch_err
name='psb_zasum'
@ -82,6 +84,12 @@ function psb_zasum (x,desc_a, info, jx) result(res)
ijx = 1
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
m = desc_a%get_global_rows()
ldx = size(x,1)
! check vector correctness
@ -114,7 +122,7 @@ function psb_zasum (x,desc_a, info, jx) result(res)
res = dzero
end if
! compute global sum
call psb_sum(ictxt, res)
if (global_) call psb_sum(ictxt, res)
call psb_erractionrestore(err_act)
return
@ -125,7 +133,7 @@ function psb_zasum (x,desc_a, info, jx) result(res)
end function psb_zasum
function psb_zasum_vect(x, desc_a, info) result(res)
function psb_zasum_vect(x, desc_a, info,global) result(res)
use psb_base_mod, psb_protect_name => psb_zasum_vect
implicit none
@ -133,10 +141,12 @@ function psb_zasum_vect(x, desc_a, info) result(res)
type(psb_z_vect_type), intent (inout) :: x
type(psb_desc_type), intent (in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, jx, ix, m, imax
& err_act, iix, jjx, jx, ix, m, imax, i, idx, ndm
logical :: global_
character(len=20) :: name, ch_err
name='psb_zasumv'
@ -160,6 +170,11 @@ function psb_zasum_vect(x, desc_a, info) result(res)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = 1
jx = 1
@ -182,12 +197,21 @@ function psb_zasum_vect(x, desc_a, info) result(res)
! compute local max
if ((desc_a%get_local_rows() > 0).and.(m /= 0)) then
res = x%asum(desc_a%get_local_rows())
if (size(desc_a%ovrlap_elem,1)>0) then
if (x%is_dev()) call x%sync()
! adjust res because overlapped elements are computed more than once
do i=1,size(desc_a%ovrlap_elem,1)
idx = desc_a%ovrlap_elem(i,1)
ndm = desc_a%ovrlap_elem(i,2)
res = res - (real(ndm-1)/real(ndm))*abs(x%v%v(idx))
end do
end if
else
res = dzero
end if
! compute global sum
call psb_sum(ictxt, res)
if (global_) call psb_sum(ictxt, res)
call psb_erractionrestore(err_act)
return
@ -242,7 +266,7 @@ end function psb_zasum_vect
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. Return code
!
function psb_zasumv(x,desc_a, info) result(res)
function psb_zasumv(x,desc_a, info,global) result(res)
use psb_base_mod, psb_protect_name => psb_zasumv
implicit none
@ -251,10 +275,12 @@ function psb_zasumv(x,desc_a, info) result(res)
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
real(psb_dpk_) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, jx, ix, m, i, idx, ndm, ldx
logical :: global_
character(len=20) :: name, ch_err
name='psb_zasumv'
@ -271,6 +297,12 @@ function psb_zasumv(x,desc_a, info) result(res)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = 1
jx=1
@ -307,7 +339,7 @@ function psb_zasumv(x,desc_a, info) result(res)
end if
! compute global sum
call psb_sum(ictxt, res)
if (global_) call psb_sum(ictxt, res)
call psb_erractionrestore(err_act)
return
@ -362,7 +394,7 @@ end function psb_zasumv
! info - integer. Return code
! jx - integer(optional). The column offset.
!
subroutine psb_zasumvs(res,x,desc_a, info)
subroutine psb_zasumvs(res,x,desc_a, info,global)
use psb_base_mod, psb_protect_name => psb_zasumvs
implicit none
@ -371,10 +403,12 @@ subroutine psb_zasumvs(res,x,desc_a, info)
real(psb_dpk_), intent(out) :: res
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, ix, jx, m, i, idx, ndm, ldx
logical :: global_
character(len=20) :: name, ch_err
name='psb_zasumvs'
@ -391,6 +425,12 @@ subroutine psb_zasumvs(res,x,desc_a, info)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = 1
jx = 1
@ -427,7 +467,7 @@ subroutine psb_zasumvs(res,x,desc_a, info)
end if
! compute global sum
call psb_sum(ictxt,res)
if (global_) call psb_sum(ictxt,res)
call psb_erractionrestore(err_act)
return

@ -48,7 +48,7 @@
! jx - integer(optional). The column offset for sub( X ).
! jy - integer(optional). The column offset for sub( Y ).
!
function psb_zdot_vect(x, y, desc_a,info) result(res)
function psb_zdot_vect(x, y, desc_a,info,global) result(res)
use psb_desc_mod
use psb_z_base_mat_mod
use psb_check_mod
@ -61,10 +61,12 @@ function psb_zdot_vect(x, y, desc_a,info) result(res)
type(psb_z_vect_type), intent(inout) :: x, y
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me, idx, ndm,&
& err_act, iix, jjx, ix, ijx, iy, ijy, iiy, jjy, i, m, nr
logical :: global_
character(len=20) :: name, ch_err
name='psb_zdot_vect'
@ -91,6 +93,11 @@ function psb_zdot_vect(x, y, desc_a,info) result(res)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = ione
ijx = ione
@ -122,17 +129,21 @@ function psb_zdot_vect(x, y, desc_a,info) result(res)
res = x%dot(nr,y)
! FIXME
! adjust dot_local because overlapped elements are computed more than once
!!$ do i=1,size(desc_a%ovrlap_elem,1)
!!$ idx = desc_a%ovrlap_elem(i,1)
!!$ ndm = desc_a%ovrlap_elem(i,2)
!!$ dot_local = dot_local - (real(ndm-1)/real(ndm))*(x(idx)*y(idx))
!!$ end do
if (size(desc_a%ovrlap_elem,1)>0) then
if (x%is_dev()) call x%sync()
if (y%is_dev()) call y%sync()
do i=1,size(desc_a%ovrlap_elem,1)
idx = desc_a%ovrlap_elem(i,1)
ndm = desc_a%ovrlap_elem(i,2)
res = res - (real(ndm-1)/real(ndm))*(x%v%v(idx)*y%v%v(idx))
end do
end if
else
res = zzero
end if
! compute global sum
call psb_sum(ictxt, res)
if (global_) call psb_sum(ictxt, res)
call psb_erractionrestore(err_act)
return
@ -143,7 +154,7 @@ function psb_zdot_vect(x, y, desc_a,info) result(res)
end function psb_zdot_vect
function psb_zdot(x, y,desc_a, info, jx, jy) result(res)
function psb_zdot(x, y,desc_a, info, jx, jy,global) result(res)
use psb_base_mod, psb_protect_name => psb_zdot
implicit none
@ -152,12 +163,14 @@ function psb_zdot(x, y,desc_a, info, jx, jy) result(res)
integer(psb_ipk_), intent(in), optional :: jx, jy
integer(psb_ipk_), intent(out) :: info
complex(psb_dpk_) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me, idx, ndm,&
& err_act, iix, jjx, ix, ijx, iy, ijy, iiy, jjy, i, m, nr, &
& lldx, lldy
complex(psb_dpk_) :: zdotc
logical :: global_
character(len=20) :: name, ch_err
name='psb_zdot'
@ -193,6 +206,12 @@ function psb_zdot(x, y,desc_a, info, jx, jy) result(res)
goto 9999
end if
if (present(global)) then
global_ = global
else
global_ = .true.
end if
m = desc_a%get_global_rows()
lldx = size(x,1)
lldy = size(y,1)
@ -228,7 +247,7 @@ function psb_zdot(x, y,desc_a, info, jx, jy) result(res)
end if
! compute global sum
call psb_sum(ictxt, res)
if (global_) call psb_sum(ictxt, res)
call psb_erractionrestore(err_act)
return
@ -284,7 +303,7 @@ end function psb_zdot
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. Return code
!
function psb_zdotv(x, y,desc_a, info) result(res)
function psb_zdotv(x, y,desc_a, info,global) result(res)
use psb_base_mod, psb_protect_name => psb_zdotv
implicit none
@ -292,11 +311,13 @@ function psb_zdotv(x, y,desc_a, info) result(res)
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
complex(psb_dpk_) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me, idx, ndm,&
& err_act, iix, jjx, ix, jx, iy, jy, iiy, jjy, i, m, nr, &
& lldx, lldy
logical :: global_
complex(psb_dpk_) :: zdotc
character(len=20) :: name, ch_err
@ -314,6 +335,12 @@ function psb_zdotv(x, y,desc_a, info) result(res)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = ione
iy = ione
jx = ione
@ -352,7 +379,7 @@ function psb_zdotv(x, y,desc_a, info) result(res)
end if
! compute global sum
call psb_sum(ictxt, res)
if (global_) call psb_sum(ictxt, res)
call psb_erractionrestore(err_act)
@ -409,7 +436,7 @@ end function psb_zdotv
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. Return code
!
subroutine psb_zdotvs(res, x, y,desc_a, info)
subroutine psb_zdotvs(res, x, y,desc_a, info,global)
use psb_base_mod, psb_protect_name => psb_zdotvs
implicit none
@ -417,11 +444,13 @@ subroutine psb_zdotvs(res, x, y,desc_a, info)
complex(psb_dpk_), intent(out) :: res
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me, idx, ndm,&
& err_act, iix, jjx, ix, iy, iiy, jjy, i, m,nr, &
& lldx, lldy
logical :: global_
complex(psb_dpk_) :: zdotc
character(len=20) :: name, ch_err
@ -439,6 +468,12 @@ subroutine psb_zdotvs(res, x, y,desc_a, info)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = ione
iy = ione
m = desc_a%get_global_rows()
@ -475,7 +510,7 @@ subroutine psb_zdotvs(res, x, y,desc_a, info)
end if
! compute global sum
call psb_sum(ictxt, res)
if (global_) call psb_sum(ictxt, res)
call psb_erractionrestore(err_act)
return
@ -532,7 +567,7 @@ end subroutine psb_zdotvs
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. Return code
!
subroutine psb_zmdots(res, x, y, desc_a, info)
subroutine psb_zmdots(res, x, y, desc_a, info,global)
use psb_base_mod, psb_protect_name => psb_zmdots
implicit none
@ -540,11 +575,13 @@ subroutine psb_zmdots(res, x, y, desc_a, info)
complex(psb_dpk_), intent(out) :: res(:)
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me, idx, ndm,&
& err_act, iix, jjx, ix, iy, iiy, jjy, i, m, j, k, nr, &
& lldx, lldy
logical :: global_
complex(psb_dpk_) :: zdotc
character(len=20) :: name, ch_err
@ -562,6 +599,11 @@ subroutine psb_zmdots(res, x, y, desc_a, info)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = ione
iy = ione
@ -611,7 +653,7 @@ subroutine psb_zmdots(res, x, y, desc_a, info)
! compute global sum
call psb_sum(ictxt, res(1:k))
if (global_) call psb_sum(ictxt, res(1:k))
call psb_erractionrestore(err_act)
return

@ -44,7 +44,7 @@
! info - integer. Return code
! jx - integer(optional). The column offset for sub( X ).
!
function psb_znrm2(x, desc_a, info, jx) result(res)
function psb_znrm2(x, desc_a, info, jx,global) result(res)
use psb_desc_mod
use psb_check_mod
use psb_error_mod
@ -56,10 +56,12 @@ function psb_znrm2(x, desc_a, info, jx) result(res)
integer(psb_ipk_), intent(in), optional :: jx
integer(psb_ipk_), intent(out) :: info
real(psb_dpk_) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, ndim, ix, ijx, i, m, id, idx, ndm, ldx
logical :: global_
real(psb_dpk_) :: dznrm2, dd
character(len=20) :: name, ch_err
@ -84,6 +86,12 @@ function psb_znrm2(x, desc_a, info, jx) result(res)
ijx = 1
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
m = desc_a%get_global_rows()
ldx = size(x,1)
call psb_chkvect(m,ione,ldx,ix,ijx,desc_a,info,iix,jjx)
@ -114,7 +122,7 @@ function psb_znrm2(x, desc_a, info, jx) result(res)
res = dzero
end if
call psb_nrm2(ictxt,res)
if (global_) call psb_nrm2(ictxt,res)
call psb_erractionrestore(err_act)
return
@ -168,7 +176,7 @@ end function psb_znrm2
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. Return code
!
function psb_znrm2v(x, desc_a, info) result(res)
function psb_znrm2v(x, desc_a, info,global) result(res)
use psb_desc_mod
use psb_check_mod
use psb_error_mod
@ -179,13 +187,13 @@ function psb_znrm2v(x, desc_a, info) result(res)
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
real(psb_dpk_) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, ndim, ix, jx, i, m, id, idx, ndm, ldx
logical :: global_
real(psb_dpk_) :: dznrm2, dd
!!$ external scombnrm2
character(len=20) :: name, ch_err
name='psb_znrm2v'
@ -202,6 +210,11 @@ function psb_znrm2v(x, desc_a, info) result(res)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = 1
jx=1
m = desc_a%get_global_rows()
@ -233,8 +246,7 @@ function psb_znrm2v(x, desc_a, info) result(res)
res = dzero
end if
call psb_nrm2(ictxt,res)
if (global_) call psb_nrm2(ictxt,res)
call psb_erractionrestore(err_act)
return
@ -246,7 +258,7 @@ end function psb_znrm2v
function psb_znrm2_vect(x, desc_a, info) result(res)
function psb_znrm2_vect(x, desc_a, info,global) result(res)
use psb_desc_mod
use psb_check_mod
use psb_error_mod
@ -258,12 +270,13 @@ function psb_znrm2_vect(x, desc_a, info) result(res)
type(psb_z_vect_type), intent (inout) :: x
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, ndim, ix, jx, i, m, id, idx, ndm, ldx
logical :: global_
real(psb_dpk_) :: snrm2, dd
!!$ external dcombnrm2
character(len=20) :: name, ch_err
name='psb_znrm2v'
@ -286,6 +299,11 @@ function psb_znrm2_vect(x, desc_a, info) result(res)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = 1
jx=1
@ -307,18 +325,21 @@ function psb_znrm2_vect(x, desc_a, info) result(res)
if (desc_a%get_local_rows() > 0) then
ndim = desc_a%get_local_rows()
res = x%nrm2(ndim)
!!$ ! adjust because overlapped elements are computed more than once
!!$ do i=1,size(desc_a%ovrlap_elem,1)
!!$ idx = desc_a%ovrlap_elem(i,1)
!!$ ndm = desc_a%ovrlap_elem(i,2)
!!$ dd = dble(ndm-1)/dble(ndm)
!!$ nrm2 = nrm2 * sqrt(done - dd*(abs(x(idx))/nrm2)**2)
!!$ end do
! adjust because overlapped elements are computed more than once
if (size(desc_a%ovrlap_elem,1)>0) then
if (x%is_dev()) call x%sync()
do i=1,size(desc_a%ovrlap_elem,1)
idx = desc_a%ovrlap_elem(i,1)
ndm = desc_a%ovrlap_elem(i,2)
dd = dble(ndm-1)/dble(ndm)
res = res - sqrt(zone - dd*(abs(x%v%v(idx))/res)**2)
end do
end if
else
res = dzero
end if
call psb_nrm2(ictxt,res)
if (global_) call psb_nrm2(ictxt,res)
call psb_erractionrestore(err_act)
return
@ -329,7 +350,6 @@ function psb_znrm2_vect(x, desc_a, info) result(res)
end function psb_znrm2_vect
!!$
!!$ Parallel Sparse BLAS version 3.5
!!$ (C) Copyright 2006-2018
@ -373,7 +393,7 @@ end function psb_znrm2_vect
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. Return code
!
subroutine psb_znrm2vs(res, x, desc_a, info)
subroutine psb_znrm2vs(res, x, desc_a, info,global)
use psb_desc_mod
use psb_check_mod
use psb_error_mod
@ -384,13 +404,13 @@ subroutine psb_znrm2vs(res, x, desc_a, info)
real(psb_dpk_), intent(out) :: res
type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, iix, jjx, ndim, ix, jx, i, m, id, idx, ndm, ldx
logical :: global_
real(psb_dpk_) :: nrm2, dznrm2, dd
!!$ external scombnrm2
character(len=20) :: name, ch_err
name='psb_znrm2'
@ -407,6 +427,12 @@ subroutine psb_znrm2vs(res, x, desc_a, info)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ix = 1
jx = 1
m = desc_a%get_global_rows()
@ -439,7 +465,7 @@ subroutine psb_znrm2vs(res, x, desc_a, info)
res = dzero
end if
call psb_nrm2(ictxt,res)
if (global_) call psb_nrm2(ictxt,res)
call psb_erractionrestore(err_act)

@ -41,7 +41,7 @@
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. Return code
!
function psb_znrmi(a,desc_a,info) result(res)
function psb_znrmi(a,desc_a,info,global) result(res)
use psb_base_mod, psb_protect_name => psb_znrmi
implicit none
@ -49,10 +49,12 @@ function psb_znrmi(a,desc_a,info) result(res)
integer(psb_ipk_), intent(out) :: info
type(psb_desc_type), intent(in) :: desc_a
real(psb_dpk_) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me,&
& err_act, n, iia, jja, ia, ja, mdim, ndim, m
logical :: global_
character(len=20) :: name, ch_err
name='psb_znrmi'
@ -69,6 +71,12 @@ function psb_znrmi(a,desc_a,info) result(res)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ia = 1
ja = 1
m = desc_a%get_global_rows()
@ -101,7 +109,7 @@ function psb_znrmi(a,desc_a,info) result(res)
end if
! compute global max
call psb_amx(ictxt, res)
if (global_) call psb_amx(ictxt, res)
call psb_erractionrestore(err_act)
return

@ -41,7 +41,7 @@
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. Return code
!
function psb_zspnrm1(a,desc_a,info) result(res)
function psb_zspnrm1(a,desc_a,info,global) result(res)
use psb_base_mod, psb_protect_name => psb_zspnrm1
implicit none
@ -49,10 +49,12 @@ function psb_zspnrm1(a,desc_a,info) result(res)
integer(psb_ipk_), intent(out) :: info
type(psb_desc_type), intent(in) :: desc_a
real(psb_dpk_) :: res
logical, intent(in), optional :: global
! locals
integer(psb_ipk_) :: ictxt, np, me, nr,nc,&
& err_act, n, iia, jja, ia, ja, mdim, ndim, m
logical :: global_
character(len=20) :: name, ch_err
real(psb_dpk_), allocatable :: v(:)
@ -70,6 +72,12 @@ function psb_zspnrm1(a,desc_a,info) result(res)
goto 9999
endif
if (present(global)) then
global_ = global
else
global_ = .true.
end if
ia = 1
ja = 1
m = desc_a%get_global_rows()
@ -119,7 +127,7 @@ function psb_zspnrm1(a,desc_a,info) result(res)
res = dzero
end if
! compute global max
call psb_amx(ictxt, res)
if (global_) call psb_amx(ictxt, res)
call psb_erractionrestore(err_act)
return

@ -84,7 +84,8 @@ Subroutine psb_ccdbldext(a,desc_a,novr,desc_ov,info, extype)
integer(psb_ipk_) :: i, j, err_act,m,&
& lovr, lworks,lworkr, n_row,n_col, n_col_prev, &
& index_dim,elem_dim, l_tmp_ovr_idx,l_tmp_halo, nztot,nhalo
integer(psb_ipk_) :: counter,counter_h, counter_o, counter_e,idx,gidx,proc,n_elem_recv,&
integer(psb_ipk_) :: counter,counter_h, counter_o, counter_e,&
& idx,proc,n_elem_recv,&
& n_elem_send,tot_recv,tot_elem,cntov_o,&
& counter_t,n_elem,i_ovr,jj,proc_id,isz, &
& idxr, idxs, iszr, iszs, nxch, nsnd, nrcv,lidx, extype_
@ -255,12 +256,6 @@ Subroutine psb_ccdbldext(a,desc_a,novr,desc_ov,info, extype)
Do j=0,n_elem_recv-1
idx = ovrlap(counter+psb_elem_recv_+j)
call desc_ov%indxmap%l2g(idx,gidx,info)
If (gidx < 0) then
info=-3
call psb_errpush(info,name)
goto 9999
endif
call psb_ensure_size((cntov_o+3),orig_ovr,info,pad=-ione)
if (info /= psb_success_) then
info=psb_err_from_subroutine_
@ -269,7 +264,7 @@ Subroutine psb_ccdbldext(a,desc_a,novr,desc_ov,info, extype)
end if
orig_ovr(cntov_o)=proc
orig_ovr(cntov_o+1)=1
orig_ovr(cntov_o+2)=gidx
orig_ovr(cntov_o+2)=idx
orig_ovr(cntov_o+3)=-1
cntov_o=cntov_o+3
end Do
@ -356,12 +351,6 @@ Subroutine psb_ccdbldext(a,desc_a,novr,desc_ov,info, extype)
end If
idx = halo(counter+psb_elem_recv_+j)
call desc_ov%l2g(idx,gidx,info)
If (gidx < 0) then
info=-3
call psb_errpush(info,name)
goto 9999
endif
call psb_ensure_size((counter_o+3),tmp_ovr_idx,info,pad=-ione)
if (info /= psb_success_) then
info=psb_err_from_subroutine_
@ -371,7 +360,7 @@ Subroutine psb_ccdbldext(a,desc_a,novr,desc_ov,info, extype)
tmp_ovr_idx(counter_o) = proc
tmp_ovr_idx(counter_o+1) = 1
tmp_ovr_idx(counter_o+2) = gidx
tmp_ovr_idx(counter_o+2) = idx
tmp_ovr_idx(counter_o+3) = -1
counter_o=counter_o+3
call psb_ensure_size((counter_h+3),tmp_halo,info,pad=-ione)
@ -400,12 +389,6 @@ Subroutine psb_ccdbldext(a,desc_a,novr,desc_ov,info, extype)
Do j=0,n_elem_send-1
idx = halo(counter+psb_elem_send_+j)
call desc_ov%l2g(idx,gidx,info)
If (gidx < 0) then
info=-3
call psb_errpush(info,name)
goto 9999
endif
call psb_ensure_size((counter_o+3),tmp_ovr_idx,info,pad=-ione)
if (info /= psb_success_) then
info=psb_err_from_subroutine_
@ -415,7 +398,7 @@ Subroutine psb_ccdbldext(a,desc_a,novr,desc_ov,info, extype)
tmp_ovr_idx(counter_o) = proc
tmp_ovr_idx(counter_o+1) = 1
tmp_ovr_idx(counter_o+2) = gidx
tmp_ovr_idx(counter_o+2) = idx
tmp_ovr_idx(counter_o+3) = -1
counter_o=counter_o+3
@ -599,7 +582,7 @@ Subroutine psb_ccdbldext(a,desc_a,novr,desc_ov,info, extype)
write(debug_unit,*) me,' ',trim(name),':Calling Crea_index'
end if
call psi_crea_index(desc_ov,t_halo_in,t_halo_out,.false.,&
call psi_crea_index(desc_ov,t_halo_in,t_halo_out,&
& nxch,nsnd,nrcv,info)
if (debug_level >= psb_debug_outer_) then

@ -82,19 +82,15 @@ subroutine psb_cd_inloc(v, ictxt, desc, info, globalcheck,idx)
iictxt = ictxt
loc_row = size(v)
if (.false.) then
m = loc_row
call psb_sum(ictxt,m)
else
m = maxval(v)
nrt = loc_row
call psb_sum(ictxt,nrt)
call psb_max(ictxt,m)
end if
if (present(globalcheck)) then
check_ = globalcheck
else
check_ = .true.
check_ = .false.
end if
n = m
@ -138,7 +134,7 @@ subroutine psb_cd_inloc(v, ictxt, desc, info, globalcheck,idx)
if (debug_level >= psb_debug_ext_) &
& write(debug_unit,*) me,' ',trim(name),': doing global checks'
islarge = psb_cd_choose_large_state(ictxt,m)
islarge = psb_cd_is_large_size(m)
allocate(vl(loc_row),ix(loc_row),stat=info)
if (info /= psb_success_) then
@ -369,6 +365,22 @@ subroutine psb_cd_inloc(v, ictxt, desc, info, globalcheck,idx)
call aa%init(iictxt,vl(1:nlu),info)
end select
!
! Now that we have initialized indxmap we can convert the
! indices to local numbering.
!
block
integer(psb_ipk_) :: i,nprocs
i = 1
do while (temp_ovrlap(i) /= -1)
call desc%indxmap%g2lip(temp_ovrlap(i),info)
i = i + 1
nprocs = temp_ovrlap(i)
i = i + 1
i = i + nprocs
enddo
end block
call psi_bld_tmpovrl(temp_ovrlap,desc,info)
if (info == psb_success_) deallocate(temp_ovrlap,vl,ix,stat=info)

@ -61,9 +61,9 @@ Subroutine psb_cd_reinit(desc,info)
if (debug_level >= psb_debug_outer_) &
& write(debug_unit,*) me,' ',trim(name),': start'
if (desc%is_asb()) then
call psb_cd_get_recv_idx(tmp_ovr,desc,psb_comm_ovr_,info,toglob=.true.)
call psb_cd_get_recv_idx(tmp_halo,desc,psb_comm_halo_,info,toglob=.false.)
call psb_cd_get_recv_idx(tmp_ext,desc,psb_comm_ext_,info,toglob=.false.)
call psb_cd_get_recv_idx(tmp_ovr,desc,psb_comm_ovr_,info)
call psb_cd_get_recv_idx(tmp_halo,desc,psb_comm_halo_,info)
call psb_cd_get_recv_idx(tmp_ext,desc,psb_comm_ext_,info)
call psb_move_alloc(tmp_ovr,desc%ovrlap_index,info)
call psb_move_alloc(tmp_halo,desc%halo_index,info)

@ -267,7 +267,21 @@ subroutine psb_cdals(m, n, parts, ictxt, desc, info)
if (debug_level >= psb_debug_ext_) &
& write(debug_unit,*) me,' ',trim(name),': error check:' ,err
!
! Now that we have initialized indxmap we can convert the
! indices to local numbering.
!
block
integer(psb_ipk_) :: i,nprocs
i = 1
do while (temp_ovrlap(i) /= -1)
call desc%indxmap%g2lip(temp_ovrlap(i),info)
i = i + 1
nprocs = temp_ovrlap(i)
i = i + 1
i = i + nprocs
enddo
end block
call psi_bld_tmpovrl(temp_ovrlap,desc,info)
if (info == psb_success_) deallocate(prc_v,temp_ovrlap,stat=info)

@ -84,7 +84,8 @@ Subroutine psb_dcdbldext(a,desc_a,novr,desc_ov,info, extype)
integer(psb_ipk_) :: i, j, err_act,m,&
& lovr, lworks,lworkr, n_row,n_col, n_col_prev, &
& index_dim,elem_dim, l_tmp_ovr_idx,l_tmp_halo, nztot,nhalo
integer(psb_ipk_) :: counter,counter_h, counter_o, counter_e,idx,gidx,proc,n_elem_recv,&
integer(psb_ipk_) :: counter,counter_h, counter_o, counter_e,&
& idx,proc,n_elem_recv,&
& n_elem_send,tot_recv,tot_elem,cntov_o,&
& counter_t,n_elem,i_ovr,jj,proc_id,isz, &
& idxr, idxs, iszr, iszs, nxch, nsnd, nrcv,lidx, extype_
@ -255,12 +256,6 @@ Subroutine psb_dcdbldext(a,desc_a,novr,desc_ov,info, extype)
Do j=0,n_elem_recv-1
idx = ovrlap(counter+psb_elem_recv_+j)
call desc_ov%indxmap%l2g(idx,gidx,info)
If (gidx < 0) then
info=-3
call psb_errpush(info,name)
goto 9999
endif
call psb_ensure_size((cntov_o+3),orig_ovr,info,pad=-ione)
if (info /= psb_success_) then
info=psb_err_from_subroutine_
@ -269,7 +264,7 @@ Subroutine psb_dcdbldext(a,desc_a,novr,desc_ov,info, extype)
end if
orig_ovr(cntov_o)=proc
orig_ovr(cntov_o+1)=1
orig_ovr(cntov_o+2)=gidx
orig_ovr(cntov_o+2)=idx
orig_ovr(cntov_o+3)=-1
cntov_o=cntov_o+3
end Do
@ -356,12 +351,6 @@ Subroutine psb_dcdbldext(a,desc_a,novr,desc_ov,info, extype)
end If
idx = halo(counter+psb_elem_recv_+j)
call desc_ov%l2g(idx,gidx,info)
If (gidx < 0) then
info=-3
call psb_errpush(info,name)
goto 9999
endif
call psb_ensure_size((counter_o+3),tmp_ovr_idx,info,pad=-ione)
if (info /= psb_success_) then
info=psb_err_from_subroutine_
@ -371,7 +360,7 @@ Subroutine psb_dcdbldext(a,desc_a,novr,desc_ov,info, extype)
tmp_ovr_idx(counter_o) = proc
tmp_ovr_idx(counter_o+1) = 1
tmp_ovr_idx(counter_o+2) = gidx
tmp_ovr_idx(counter_o+2) = idx
tmp_ovr_idx(counter_o+3) = -1
counter_o=counter_o+3
call psb_ensure_size((counter_h+3),tmp_halo,info,pad=-ione)
@ -400,12 +389,6 @@ Subroutine psb_dcdbldext(a,desc_a,novr,desc_ov,info, extype)
Do j=0,n_elem_send-1
idx = halo(counter+psb_elem_send_+j)
call desc_ov%l2g(idx,gidx,info)
If (gidx < 0) then
info=-3
call psb_errpush(info,name)
goto 9999
endif
call psb_ensure_size((counter_o+3),tmp_ovr_idx,info,pad=-ione)
if (info /= psb_success_) then
info=psb_err_from_subroutine_
@ -415,7 +398,7 @@ Subroutine psb_dcdbldext(a,desc_a,novr,desc_ov,info, extype)
tmp_ovr_idx(counter_o) = proc
tmp_ovr_idx(counter_o+1) = 1
tmp_ovr_idx(counter_o+2) = gidx
tmp_ovr_idx(counter_o+2) = idx
tmp_ovr_idx(counter_o+3) = -1
counter_o=counter_o+3
@ -599,7 +582,7 @@ Subroutine psb_dcdbldext(a,desc_a,novr,desc_ov,info, extype)
write(debug_unit,*) me,' ',trim(name),':Calling Crea_index'
end if
call psi_crea_index(desc_ov,t_halo_in,t_halo_out,.false.,&
call psi_crea_index(desc_ov,t_halo_in,t_halo_out,&
& nxch,nsnd,nrcv,info)
if (debug_level >= psb_debug_outer_) then

@ -84,7 +84,8 @@ Subroutine psb_scdbldext(a,desc_a,novr,desc_ov,info, extype)
integer(psb_ipk_) :: i, j, err_act,m,&
& lovr, lworks,lworkr, n_row,n_col, n_col_prev, &
& index_dim,elem_dim, l_tmp_ovr_idx,l_tmp_halo, nztot,nhalo
integer(psb_ipk_) :: counter,counter_h, counter_o, counter_e,idx,gidx,proc,n_elem_recv,&
integer(psb_ipk_) :: counter,counter_h, counter_o, counter_e,&
& idx,proc,n_elem_recv,&
& n_elem_send,tot_recv,tot_elem,cntov_o,&
& counter_t,n_elem,i_ovr,jj,proc_id,isz, &
& idxr, idxs, iszr, iszs, nxch, nsnd, nrcv,lidx, extype_
@ -255,12 +256,6 @@ Subroutine psb_scdbldext(a,desc_a,novr,desc_ov,info, extype)
Do j=0,n_elem_recv-1
idx = ovrlap(counter+psb_elem_recv_+j)
call desc_ov%indxmap%l2g(idx,gidx,info)
If (gidx < 0) then
info=-3
call psb_errpush(info,name)
goto 9999
endif
call psb_ensure_size((cntov_o+3),orig_ovr,info,pad=-ione)
if (info /= psb_success_) then
info=psb_err_from_subroutine_
@ -269,7 +264,7 @@ Subroutine psb_scdbldext(a,desc_a,novr,desc_ov,info, extype)
end if
orig_ovr(cntov_o)=proc
orig_ovr(cntov_o+1)=1
orig_ovr(cntov_o+2)=gidx
orig_ovr(cntov_o+2)=idx
orig_ovr(cntov_o+3)=-1
cntov_o=cntov_o+3
end Do
@ -356,12 +351,6 @@ Subroutine psb_scdbldext(a,desc_a,novr,desc_ov,info, extype)
end If
idx = halo(counter+psb_elem_recv_+j)
call desc_ov%l2g(idx,gidx,info)
If (gidx < 0) then
info=-3
call psb_errpush(info,name)
goto 9999
endif
call psb_ensure_size((counter_o+3),tmp_ovr_idx,info,pad=-ione)
if (info /= psb_success_) then
info=psb_err_from_subroutine_
@ -371,7 +360,7 @@ Subroutine psb_scdbldext(a,desc_a,novr,desc_ov,info, extype)
tmp_ovr_idx(counter_o) = proc
tmp_ovr_idx(counter_o+1) = 1
tmp_ovr_idx(counter_o+2) = gidx
tmp_ovr_idx(counter_o+2) = idx
tmp_ovr_idx(counter_o+3) = -1
counter_o=counter_o+3
call psb_ensure_size((counter_h+3),tmp_halo,info,pad=-ione)
@ -400,12 +389,6 @@ Subroutine psb_scdbldext(a,desc_a,novr,desc_ov,info, extype)
Do j=0,n_elem_send-1
idx = halo(counter+psb_elem_send_+j)
call desc_ov%l2g(idx,gidx,info)
If (gidx < 0) then
info=-3
call psb_errpush(info,name)
goto 9999
endif
call psb_ensure_size((counter_o+3),tmp_ovr_idx,info,pad=-ione)
if (info /= psb_success_) then
info=psb_err_from_subroutine_
@ -415,7 +398,7 @@ Subroutine psb_scdbldext(a,desc_a,novr,desc_ov,info, extype)
tmp_ovr_idx(counter_o) = proc
tmp_ovr_idx(counter_o+1) = 1
tmp_ovr_idx(counter_o+2) = gidx
tmp_ovr_idx(counter_o+2) = idx
tmp_ovr_idx(counter_o+3) = -1
counter_o=counter_o+3
@ -599,7 +582,7 @@ Subroutine psb_scdbldext(a,desc_a,novr,desc_ov,info, extype)
write(debug_unit,*) me,' ',trim(name),':Calling Crea_index'
end if
call psi_crea_index(desc_ov,t_halo_in,t_halo_out,.false.,&
call psi_crea_index(desc_ov,t_halo_in,t_halo_out,&
& nxch,nsnd,nrcv,info)
if (debug_level >= psb_debug_outer_) then

@ -84,7 +84,8 @@ Subroutine psb_zcdbldext(a,desc_a,novr,desc_ov,info, extype)
integer(psb_ipk_) :: i, j, err_act,m,&
& lovr, lworks,lworkr, n_row,n_col, n_col_prev, &
& index_dim,elem_dim, l_tmp_ovr_idx,l_tmp_halo, nztot,nhalo
integer(psb_ipk_) :: counter,counter_h, counter_o, counter_e,idx,gidx,proc,n_elem_recv,&
integer(psb_ipk_) :: counter,counter_h, counter_o, counter_e,&
& idx,proc,n_elem_recv,&
& n_elem_send,tot_recv,tot_elem,cntov_o,&
& counter_t,n_elem,i_ovr,jj,proc_id,isz, &
& idxr, idxs, iszr, iszs, nxch, nsnd, nrcv,lidx, extype_
@ -255,12 +256,6 @@ Subroutine psb_zcdbldext(a,desc_a,novr,desc_ov,info, extype)
Do j=0,n_elem_recv-1
idx = ovrlap(counter+psb_elem_recv_+j)
call desc_ov%indxmap%l2g(idx,gidx,info)
If (gidx < 0) then
info=-3
call psb_errpush(info,name)
goto 9999
endif
call psb_ensure_size((cntov_o+3),orig_ovr,info,pad=-ione)
if (info /= psb_success_) then
info=psb_err_from_subroutine_
@ -269,7 +264,7 @@ Subroutine psb_zcdbldext(a,desc_a,novr,desc_ov,info, extype)
end if
orig_ovr(cntov_o)=proc
orig_ovr(cntov_o+1)=1
orig_ovr(cntov_o+2)=gidx
orig_ovr(cntov_o+2)=idx
orig_ovr(cntov_o+3)=-1
cntov_o=cntov_o+3
end Do
@ -356,12 +351,6 @@ Subroutine psb_zcdbldext(a,desc_a,novr,desc_ov,info, extype)
end If
idx = halo(counter+psb_elem_recv_+j)
call desc_ov%l2g(idx,gidx,info)
If (gidx < 0) then
info=-3
call psb_errpush(info,name)
goto 9999
endif
call psb_ensure_size((counter_o+3),tmp_ovr_idx,info,pad=-ione)
if (info /= psb_success_) then
info=psb_err_from_subroutine_
@ -371,7 +360,7 @@ Subroutine psb_zcdbldext(a,desc_a,novr,desc_ov,info, extype)
tmp_ovr_idx(counter_o) = proc
tmp_ovr_idx(counter_o+1) = 1
tmp_ovr_idx(counter_o+2) = gidx
tmp_ovr_idx(counter_o+2) = idx
tmp_ovr_idx(counter_o+3) = -1
counter_o=counter_o+3
call psb_ensure_size((counter_h+3),tmp_halo,info,pad=-ione)
@ -400,12 +389,6 @@ Subroutine psb_zcdbldext(a,desc_a,novr,desc_ov,info, extype)
Do j=0,n_elem_send-1
idx = halo(counter+psb_elem_send_+j)
call desc_ov%l2g(idx,gidx,info)
If (gidx < 0) then
info=-3
call psb_errpush(info,name)
goto 9999
endif
call psb_ensure_size((counter_o+3),tmp_ovr_idx,info,pad=-ione)
if (info /= psb_success_) then
info=psb_err_from_subroutine_
@ -415,7 +398,7 @@ Subroutine psb_zcdbldext(a,desc_a,novr,desc_ov,info, extype)
tmp_ovr_idx(counter_o) = proc
tmp_ovr_idx(counter_o+1) = 1
tmp_ovr_idx(counter_o+2) = gidx
tmp_ovr_idx(counter_o+2) = idx
tmp_ovr_idx(counter_o+3) = -1
counter_o=counter_o+3
@ -599,7 +582,7 @@ Subroutine psb_zcdbldext(a,desc_a,novr,desc_ov,info, extype)
write(debug_unit,*) me,' ',trim(name),':Calling Crea_index'
end if
call psi_crea_index(desc_ov,t_halo_in,t_halo_out,.false.,&
call psi_crea_index(desc_ov,t_halo_in,t_halo_out,&
& nxch,nsnd,nrcv,info)
if (debug_level >= psb_debug_outer_) then

@ -14,7 +14,7 @@
<LINK REL="STYLESHEET" HREF="userhtml.css">
<LINK REL="previous" HREF="node133.html">
<LINK REL="previous" HREF="node134.html">
<LINK REL="up" HREF="userhtml.html">
</HEAD>
@ -137,8 +137,8 @@ sample scatter/gather routines.
.
</PRE>
</DD>
<DT><A NAME="foot7637">... follows</A><A
HREF="node125.html#tex2html31"><SUP><SPAN CLASS="arabic">4</SPAN></SUP></A></DT>
<DT><A NAME="foot7809">... follows</A><A
HREF="node126.html#tex2html31"><SUP><SPAN CLASS="arabic">4</SPAN></SUP></A></DT>
<DD>The string is case-insensitive
<PRE>.
@ -173,12 +173,12 @@ sample scatter/gather routines.
.
</PRE>
</DD>
<DT><A NAME="foot8086">... method</A><A
HREF="node132.html#tex2html32"><SUP><SPAN CLASS="arabic">5</SPAN></SUP></A></DT>
<DT><A NAME="foot8258">... method</A><A
HREF="node133.html#tex2html32"><SUP><SPAN CLASS="arabic">5</SPAN></SUP></A></DT>
<DD>Note:
the implementation is for <SPAN CLASS="MATH"><IMG
WIDTH="62" HEIGHT="32" ALIGN="MIDDLE" BORDER="0"
SRC="img163.png"
SRC="img169.png"
ALT="$FCG(1)$"></SPAN>.
<PRE>.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 340 B

After

Width:  |  Height:  |  Size: 175 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 217 B

After

Width:  |  Height:  |  Size: 336 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 316 B

After

Width:  |  Height:  |  Size: 486 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 258 B

After

Width:  |  Height:  |  Size: 310 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 184 B

After

Width:  |  Height:  |  Size: 340 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 620 B

After

Width:  |  Height:  |  Size: 217 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 332 B

After

Width:  |  Height:  |  Size: 316 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 134 B

After

Width:  |  Height:  |  Size: 258 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 254 B

After

Width:  |  Height:  |  Size: 184 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 357 B

After

Width:  |  Height:  |  Size: 620 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 241 B

After

Width:  |  Height:  |  Size: 332 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 233 B

After

Width:  |  Height:  |  Size: 134 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 222 B

After

Width:  |  Height:  |  Size: 254 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 360 B

After

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 203 B

After

Width:  |  Height:  |  Size: 241 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 243 B

After

Width:  |  Height:  |  Size: 233 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 786 B

After

Width:  |  Height:  |  Size: 222 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 370 B

After

Width:  |  Height:  |  Size: 360 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 388 B

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 330 B

After

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 298 B

After

Width:  |  Height:  |  Size: 786 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 804 B

After

Width:  |  Height:  |  Size: 370 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 302 B

After

Width:  |  Height:  |  Size: 388 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 491 B

After

Width:  |  Height:  |  Size: 330 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 383 B

After

Width:  |  Height:  |  Size: 298 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 238 B

After

Width:  |  Height:  |  Size: 804 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 491 B

After

Width:  |  Height:  |  Size: 302 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 530 B

After

Width:  |  Height:  |  Size: 491 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

After

Width:  |  Height:  |  Size: 383 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 223 B

After

Width:  |  Height:  |  Size: 238 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 484 B

After

Width:  |  Height:  |  Size: 491 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 517 B

After

Width:  |  Height:  |  Size: 530 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 496 B

After

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 207 B

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 526 B

After

Width:  |  Height:  |  Size: 484 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 671 B

After

Width:  |  Height:  |  Size: 517 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 244 B

After

Width:  |  Height:  |  Size: 496 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 259 B

After

Width:  |  Height:  |  Size: 244 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 487 B

After

Width:  |  Height:  |  Size: 0 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 234 B

After

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 0 B

After

Width:  |  Height:  |  Size: 526 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

After

Width:  |  Height:  |  Size: 671 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 0 B

After

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 980 B

After

Width:  |  Height:  |  Size: 259 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 707 B

After

Width:  |  Height:  |  Size: 487 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 807 B

After

Width:  |  Height:  |  Size: 234 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 848 B

After

Width:  |  Height:  |  Size: 0 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 0 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 931 B

After

Width:  |  Height:  |  Size: 980 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1001 B

After

Width:  |  Height:  |  Size: 707 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 807 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1009 B

After

Width:  |  Height:  |  Size: 848 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 328 B

After

Width:  |  Height:  |  Size: 1.0 KiB

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save