psblas-3.1:

Merged trunk fixes in preparation for 3.1.1
psblas-3.1-maint
Salvatore Filippone 12 years ago
commit e5d5c4a57d

@ -1,5 +1,13 @@
Changelog. A lot less detailed than usual, at least for past
history.
2013/10/01: New desc_type methods calling into indxmap methods.
2013/09/30: Restructure index conversion methods, simplify.
2013/09/26: Simplify checks in matrix-vector products
2013/08/01: Defined new get_fmt method for vectors
2013/06/19: Fixed type match bug in daxpby/saxpby/zaxpby.
2013/06/05: Fix INTENT in APPEND methods.

@ -4,7 +4,7 @@ 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_sort_dl.o \
psi_ldsc_pre_halo.o psi_bld_tmphalo.o\
psi_sort_dl.o psi_idx_cnv.o psi_idx_ins_cnv.o \
psi_sort_dl.o \
psi_desc_impl.o psi_ovrl_restr.o psi_ovrl_save.o psi_ovrl_upd.o
FOBJS2 = psi_exist_ovr_elem.o psi_list_search.o srtlist.o

@ -39,7 +39,7 @@
! current (calling) process.
!
! Arguments:
! bndel(:) - integer(psb_ipk_), allocatable Array containing the output list
! bndel(:) - integer(psb_ipk_), allocatable Array containing the output list
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. return code.
!

@ -81,7 +81,7 @@ subroutine psi_crea_index(desc_a,index_in,index_out,glob_idx,nxch,nsnd,nrcv,info
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
ictxt = desc_a%indxmap%get_ctxt()
ictxt = desc_a%get_ctxt()
call psb_info(ictxt,me,np)
if (np == -1) then
@ -107,8 +107,8 @@ subroutine psi_crea_index(desc_a,index_in,index_out,glob_idx,nxch,nsnd,nrcv,info
& write(debug_unit,*) me,' ',trim(name),': calling extract_dep_list'
mode = 1
call psi_extract_dep_list(desc_a%indxmap%get_ctxt(),&
& desc_a%indxmap%is_bld(), desc_a%indxmap%is_upd(),&
call psi_extract_dep_list(ictxt,&
& desc_a%is_bld(), desc_a%is_upd(),&
& index_in, dep_list,length_dl,np,max(1,dl_lda),mode,info)
if (info /= psb_success_) then
call psb_errpush(psb_err_from_subroutine_,name,a_err='extrct_dl')

@ -38,7 +38,7 @@
! See also description in base/modules/psb_desc_type.f90
!
! Arguments:
! ovr_elem(:,:) - integer(psb_ipk_), allocatable Array containing the output list
! ovr_elem(:,:) - integer(psb_ipk_), allocatable Array containing the output list
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. return code.
!

@ -145,8 +145,8 @@ subroutine psi_desc_index(desc,index_in,dep_list,&
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
ictxt = desc%indxmap%get_ctxt()
icomm = desc%indxmap%get_mpic()
ictxt = desc%get_context()
icomm = desc%get_mpic()
call psb_info(ictxt,me,np)
if (np == -1) then
info = psb_err_context_error_
@ -310,14 +310,14 @@ subroutine psi_desc_index(desc,index_in,dep_list,&
i = i + 1
nerv = sdsz(proc+1)
desc_index(i) = nerv
call psi_idx_cnv(nerv,sndbuf(bsdindx(proc+1)+1:bsdindx(proc+1)+nerv),&
& desc_index(i+1:i+nerv),desc,info)
call desc%indxmap%g2l(sndbuf(bsdindx(proc+1)+1:bsdindx(proc+1)+nerv),&
& desc_index(i+1:i+nerv),info)
i = i + nerv + 1
nesd = rvsz(proc+1)
desc_index(i) = nesd
call psi_idx_cnv(nesd,rcvbuf(brvindx(proc+1)+1:brvindx(proc+1)+nesd),&
& desc_index(i+1:i+nesd),desc,info)
call desc%indxmap%g2l(rcvbuf(brvindx(proc+1)+1:brvindx(proc+1)+nesd),&
& desc_index(i+1:i+nesd),info)
i = i + nesd + 1
end do
desc_index(i) = - 1

@ -40,7 +40,8 @@
! process
! idx(:) - integer Required indices on the calling process.
! Note: the indices should be unique!
! iprc(:) - integer(psb_ipk_), allocatable Output: process identifiers for the corresponding
! iprc(:) - integer(psb_ipk_), allocatable Output: process identifiers for
! the corresponding
! indices
! desc_a - type(psb_desc_type). The communication descriptor.
! info - integer. return code.
@ -103,15 +104,15 @@ subroutine psi_fnd_owner(nv,idx,iprc,desc,info)
goto 9999
endif
if (.not.(psb_is_ok_desc(desc))) then
if (.not.(desc%is_ok())) then
call psb_errpush(psb_err_from_subroutine_,name,a_err='invalid desc')
goto 9999
end if
call desc%indxmap%fnd_owner(idx(1:nv),iprc,info)
call desc%fnd_owner(idx(1:nv),iprc,info)
if (info /= psb_success_) then
call psb_errpush(psb_err_from_subroutine_,name,a_err='indxmap%fnd_owner')
call psb_errpush(psb_err_from_subroutine_,name,a_err='desc%fnd_owner')
goto 9999
end if
call psb_erractionrestore(err_act)

@ -1,355 +0,0 @@
!!$
!!$ Parallel Sparse BLAS version 3.1
!!$ (C) Copyright 2006, 2007, 2008, 2009, 2010, 2012, 2013
!!$ Salvatore Filippone University of Rome Tor Vergata
!!$ Alfredo Buttari CNRS-IRIT, Toulouse
!!$
!!$ Redistribution and use in source and binary forms, with or without
!!$ modification, are permitted provided that the following conditions
!!$ are met:
!!$ 1. Redistributions of source code must retain the above copyright
!!$ notice, this list of conditions and the following disclaimer.
!!$ 2. Redistributions in binary form must reproduce the above copyright
!!$ notice, this list of conditions, and the following disclaimer in the
!!$ documentation and/or other materials provided with the distribution.
!!$ 3. The name of the PSBLAS group or the names of its contributors may
!!$ not be used to endorse or promote products derived from this
!!$ software without specific written permission.
!!$
!!$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!!$ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
!!$ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
!!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
!!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
!!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
!!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
!!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
!!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
!!$ POSSIBILITY OF SUCH DAMAGE.
!!$
!!$
!
! File: psi_idx_cnv.f90
!
! Subroutine: psi_idx_cnv1
! Converts a bunch of indices from global to local numbering.
!
!
! Arguments:
! nv - integer Number of indices required
! idxin(:) - integer Required indices, overwritten on output.
! desc - type(psb_desc_type). The communication descriptor.
! info - integer. return code.
! mask(:) - logical, optional Only do the conversion for specific indices.
! owned - logical,optional Restrict to local indices, no halo
! (default false)
subroutine psi_idx_cnv1(nv,idxin,desc,info,mask,owned)
use psb_desc_mod
use psb_serial_mod
use psb_const_mod
use psb_error_mod
use psb_penv_mod
use psi_mod, psb_protect_name => psi_idx_cnv1
implicit none
integer(psb_ipk_), intent(in) :: nv
integer(psb_ipk_), intent(inout) :: idxin(:)
type(psb_desc_type), intent(in) :: desc
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: mask(:)
logical, intent(in), optional :: owned
integer(psb_ipk_) :: ictxt,mglob, nglob,ip,lip,i
integer(psb_ipk_) :: np, me
integer(psb_ipk_) :: nrow,ncol, err_act
integer(psb_ipk_), allocatable :: itmp(:)
integer(psb_ipk_), parameter :: relocsz=200
character(len=20) :: name
logical :: owned_
info = psb_success_
name = 'psb_idx_cnv'
call psb_erractionsave(err_act)
ictxt = desc%get_context()
mglob = desc%get_global_rows()
nglob = desc%get_global_cols()
nrow = desc%get_local_rows()
ncol = desc%get_local_cols()
call psb_info(ictxt, me, np)
if (.not.allocated(desc%indxmap))then
info = psb_err_invalid_cd_state_
call psb_errpush(info,name)
goto 9999
endif
if (.not.psb_is_valid_desc(desc)) then
info = psb_err_invalid_cd_state_
call psb_errpush(info,name)
goto 9999
endif
if (nv < 0) then
info = 1111
call psb_errpush(info,name)
goto 9999
end if
if (nv == 0) return
if (size(idxin) < nv) then
info = 1111
call psb_errpush(info,name)
goto 9999
end if
if (present(mask)) then
if (size(mask) < nv) then
info = 1111
call psb_errpush(info,name)
goto 9999
end if
endif
call desc%indxmap%g2lip(idxin(1:nv),info,mask=mask,owned=owned)
if (info /= 0) then
call psb_errpush(psb_err_from_subroutine_,name,a_err='g2l')
goto 9999
end if
call psb_erractionrestore(err_act)
return
9999 continue
call psb_erractionrestore(err_act)
if (err_act == psb_act_ret_) then
return
else
call psb_error(ictxt)
end if
return
end subroutine psi_idx_cnv1
!!$
!!$ Parallel Sparse BLAS version 3.1
!!$ (C) Copyright 2006, 2007, 2008, 2009, 2010, 2012, 2013
!!$ Salvatore Filippone University of Rome Tor Vergata
!!$ Alfredo Buttari CNRS-IRIT, Toulouse
!!$
!!$ Redistribution and use in source and binary forms, with or without
!!$ modification, are permitted provided that the following conditions
!!$ are met:
!!$ 1. Redistributions of source code must retain the above copyright
!!$ notice, this list of conditions and the following disclaimer.
!!$ 2. Redistributions in binary form must reproduce the above copyright
!!$ notice, this list of conditions, and the following disclaimer in the
!!$ documentation and/or other materials provided with the distribution.
!!$ 3. The name of the PSBLAS group or the names of its contributors may
!!$ not be used to endorse or promote products derived from this
!!$ software without specific written permission.
!!$
!!$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!!$ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
!!$ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
!!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
!!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
!!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
!!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
!!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
!!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
!!$ POSSIBILITY OF SUCH DAMAGE.
!!$
!!$
!
!
! Subroutine: psi_idx_cnv2
! Converts a bunch of indices from global to local numbering.
!
!
! Arguments:
! nv - integer Number of indices required
! idxin(:) - integer Required indices
! idxout(:) - integer Output values, negative for invalid input.
! desc - type(psb_desc_type). The communication descriptor.
! info - integer. return code.
! mask(:) - logical, optional Only do the conversion for specific indices.
! owned - logical,optional Restrict to local indices, no halo
! (default false)
subroutine psi_idx_cnv2(nv,idxin,idxout,desc,info,mask,owned)
use psb_desc_mod
use psb_serial_mod
use psb_const_mod
use psb_error_mod
use psb_penv_mod
use psi_mod, psb_protect_name => psi_idx_cnv2
implicit none
integer(psb_ipk_), intent(in) :: nv, idxin(:)
integer(psb_ipk_), intent(out) :: idxout(:)
type(psb_desc_type), intent(in) :: desc
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: mask(:)
logical, intent(in), optional :: owned
integer(psb_ipk_) :: i,ictxt,mglob, nglob
integer(psb_ipk_) :: np, me
integer(psb_ipk_) :: nrow,ncol, err_act
integer(psb_ipk_), parameter :: relocsz=200
character(len=20) :: name
logical, pointer :: mask_(:)
logical :: owned_
info = psb_success_
name = 'psb_idx_cnv'
call psb_erractionsave(err_act)
ictxt = desc%get_context()
mglob = desc%get_global_rows()
nglob = desc%get_global_cols()
nrow = desc%get_local_rows()
ncol = desc%get_local_cols()
call psb_info(ictxt, me, np)
if (.not.psb_is_ok_desc(desc)) then
info = psb_err_invalid_cd_state_
call psb_errpush(info,name)
goto 9999
endif
if (nv < 0) then
info = 1111
call psb_errpush(info,name)
goto 9999
end if
if (nv == 0) return
if (size(idxin) < nv) then
info = 1111
call psb_errpush(info,name)
goto 9999
end if
if (size(idxout) < nv) then
info = 1111
call psb_errpush(info,name)
goto 9999
end if
idxout(1:nv) = idxin(1:nv)
call psi_idx_cnv1(nv,idxout,desc,info,mask=mask,owned=owned)
call psb_erractionrestore(err_act)
return
9999 continue
call psb_erractionrestore(err_act)
if (err_act == psb_act_ret_) then
return
else
call psb_error(ictxt)
end if
return
end subroutine psi_idx_cnv2
!!$
!!$ Parallel Sparse BLAS version 3.1
!!$ (C) Copyright 2006, 2007, 2008, 2009, 2010, 2012, 2013
!!$ Salvatore Filippone University of Rome Tor Vergata
!!$ Alfredo Buttari CNRS-IRIT, Toulouse
!!$
!!$ Redistribution and use in source and binary forms, with or without
!!$ modification, are permitted provided that the following conditions
!!$ are met:
!!$ 1. Redistributions of source code must retain the above copyright
!!$ notice, this list of conditions and the following disclaimer.
!!$ 2. Redistributions in binary form must reproduce the above copyright
!!$ notice, this list of conditions, and the following disclaimer in the
!!$ documentation and/or other materials provided with the distribution.
!!$ 3. The name of the PSBLAS group or the names of its contributors may
!!$ not be used to endorse or promote products derived from this
!!$ software without specific written permission.
!!$
!!$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!!$ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
!!$ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
!!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
!!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
!!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
!!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
!!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
!!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
!!$ POSSIBILITY OF SUCH DAMAGE.
!!$
!!$
!
!
! Subroutine: psi_idx_cnvs
! Converts an index from global to local numbering.
!
!
! Arguments:
! idxin - integer Required index
! idxout - integer Output value, negative for invalid input.
! desc - type(psb_desc_type). The communication descriptor.
! info - integer. return code.
! mask - logical, optional Only do the conversion if true.
! owned - logical,optional Restrict to local indices, no halo
! (default false)
subroutine psi_idx_cnvs(idxin,idxout,desc,info,mask,owned)
use psi_mod, psb_protect_name => psi_idx_cnvs
use psb_desc_mod
integer(psb_ipk_), intent(in) :: idxin
integer(psb_ipk_), intent(out) :: idxout
type(psb_desc_type), intent(in) :: desc
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: mask
logical, intent(in), optional :: owned
logical :: mask_(1)
integer(psb_ipk_) :: iout(1)
if (present(mask)) then
mask_ = mask
else
mask_=.true.
end if
iout = idxin
call psi_idx_cnv(ione,iout,desc,info,mask=mask_,owned=owned)
idxout=iout(1)
return
end subroutine psi_idx_cnvs
subroutine psi_idx_cnvs1(idxin,desc,info,mask,owned)
use psi_mod, psb_protect_name => psi_idx_cnvs1
use psb_desc_mod
integer(psb_ipk_), intent(inout) :: idxin
type(psb_desc_type), intent(in) :: desc
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: mask
logical, intent(in), optional :: owned
logical :: mask_(1)
integer(psb_ipk_) :: iout(1)
if (present(mask)) then
mask_ = mask
else
mask_=.true.
end if
iout(1) = idxin
call psi_idx_cnv(ione,iout,desc,info,mask=mask_,owned=owned)
idxin = iout(1)
return
end subroutine psi_idx_cnvs1

@ -1,419 +0,0 @@
!!$
!!$ Parallel Sparse BLAS version 3.1
!!$ (C) Copyright 2006, 2007, 2008, 2009, 2010, 2012, 2013
!!$ Salvatore Filippone University of Rome Tor Vergata
!!$ Alfredo Buttari CNRS-IRIT, Toulouse
!!$
!!$ Redistribution and use in source and binary forms, with or without
!!$ modification, are permitted provided that the following conditions
!!$ are met:
!!$ 1. Redistributions of source code must retain the above copyright
!!$ notice, this list of conditions and the following disclaimer.
!!$ 2. Redistributions in binary form must reproduce the above copyright
!!$ notice, this list of conditions, and the following disclaimer in the
!!$ documentation and/or other materials provided with the distribution.
!!$ 3. The name of the PSBLAS group or the names of its contributors may
!!$ not be used to endorse or promote products derived from this
!!$ software without specific written permission.
!!$
!!$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!!$ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
!!$ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
!!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
!!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
!!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
!!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
!!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
!!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
!!$ POSSIBILITY OF SUCH DAMAGE.
!!$
!!$
!
! File: psi_idx_ins_cnv.f90
!
! Subroutine: psi_idx_ins_cnv1
! Converts a bunch of indices from global to local numbering.
! This routine is called while the descriptor is in the build state;
! the idea is that if an index is not yet marked as local, it is a new
! connection to another process, i.e. a new entry into the halo.
! But we still need the mask, because we have to take out the column indices
! corresponding to row indices we do not own (see psb_cdins for how this is used).
!
! Arguments:
! nv - integer Number of indices required
! idxin(:) - integer Required indices, overwritten on output
! output is negative for masked entries
! desc - type(psb_desc_type). The communication descriptor.
! info - integer. return code.
! mask(:) - logical, optional Only do the conversion for specific indices.
!
subroutine psi_idx_ins_cnv1(nv,idxin,desc,info,mask,lidx)
use psi_mod, psb_protect_name => psi_idx_ins_cnv1
use psb_desc_mod
use psb_serial_mod
use psb_const_mod
use psb_error_mod
use psb_penv_mod
implicit none
integer(psb_ipk_), intent(in) :: nv
integer(psb_ipk_), intent(inout) :: idxin(:)
type(psb_desc_type), intent(inout) :: desc
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: mask(:)
integer(psb_ipk_), intent(in), optional :: lidx(:)
integer(psb_ipk_) :: ictxt,mglob, nglob
integer(psb_ipk_) :: np, me
integer(psb_ipk_) :: nrow,ncol, err_act
integer(psb_ipk_) :: pnt_halo, nh, ip, lip,nxt,lipf,i,k,isize
logical :: pnt_h_ok
integer(psb_ipk_), parameter :: relocsz=200
character(len=20) :: name,ch_err
info = psb_success_
name = 'psb_idx_ins_cnv'
call psb_erractionsave(err_act)
ictxt = desc%get_context()
mglob = desc%get_global_rows()
nglob = desc%get_global_cols()
nrow = desc%get_local_rows()
ncol = desc%get_local_cols()
call psb_info(ictxt, me, np)
if ((.not.allocated(desc%indxmap)).or.&
& (.not.desc%is_bld())) then
info = psb_err_invalid_cd_state_
call psb_errpush(info,name)
goto 9999
endif
if (nv < 0) then
info = 1111
call psb_errpush(info,name)
goto 9999
end if
if (nv == 0) return
if (size(idxin) < nv) then
info = 1111
call psb_errpush(info,name)
goto 9999
end if
if (present(mask)) then
if (size(mask) < nv) then
info = 1111
call psb_errpush(info,name)
goto 9999
end if
endif
call desc%indxmap%g2lip_ins(idxin(1:nv),info,mask=mask,lidx=lidx)
if (info /= 0) then
call psb_errpush(psb_err_from_subroutine_,name,a_err='g2l_ins')
goto 9999
end if
!!$ desc%matrix_data(psb_n_col_) = desc%indxmap%get_lc()
call psb_erractionrestore(err_act)
return
9999 continue
call psb_erractionrestore(err_act)
if (err_act == psb_act_ret_) then
return
else
call psb_error(ictxt)
end if
return
end subroutine psi_idx_ins_cnv1
!!$
!!$ Parallel Sparse BLAS version 3.1
!!$ (C) Copyright 2006, 2007, 2008, 2009, 2010, 2012, 2013
!!$ Salvatore Filippone University of Rome Tor Vergata
!!$ Alfredo Buttari CNRS-IRIT, Toulouse
!!$
!!$ Redistribution and use in source and binary forms, with or without
!!$ modification, are permitted provided that the following conditions
!!$ are met:
!!$ 1. Redistributions of source code must retain the above copyright
!!$ notice, this list of conditions and the following disclaimer.
!!$ 2. Redistributions in binary form must reproduce the above copyright
!!$ notice, this list of conditions, and the following disclaimer in the
!!$ documentation and/or other materials provided with the distribution.
!!$ 3. The name of the PSBLAS group or the names of its contributors may
!!$ not be used to endorse or promote products derived from this
!!$ software without specific written permission.
!!$
!!$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!!$ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
!!$ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
!!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
!!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
!!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
!!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
!!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
!!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
!!$ POSSIBILITY OF SUCH DAMAGE.
!!$
!!$
!
!
! Subroutine: psi_idx_ins_cnv2
! Converts a bunch of indices from global to local numbering.
! This routine is called while the descriptor is in the build state;
! the idea is that if an index is not yet marked as local, it is a new
! connection to another process, i.e. a new entry into the halo.
! But we still need the mask, because we have to take out the column indices
! corresponding to row indices we do not own (see psb_cdins for how this is used).
!
! Arguments:
! nv - integer Number of indices required
! idxin(:) - integer Required indices
! idxout(:) - integer Output values (negative for masked entries)
! desc - type(psb_desc_type). The communication descriptor.
! info - integer. return code.
! mask(:) - logical, optional Only do the conversion for specific indices.
!
subroutine psi_idx_ins_cnv2(nv,idxin,idxout,desc,info,mask,lidx)
use psi_mod, psb_protect_name => psi_idx_ins_cnv2
use psb_desc_mod
use psb_serial_mod
use psb_const_mod
use psb_error_mod
use psb_penv_mod
implicit none
integer(psb_ipk_), intent(in) :: nv, idxin(:)
integer(psb_ipk_), intent(out) :: idxout(:)
type(psb_desc_type), intent(inout) :: desc
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: mask(:)
integer(psb_ipk_), intent(in), optional :: lidx(:)
integer(psb_ipk_) :: i,ictxt,k,mglob, nglob
integer(psb_ipk_) :: np, me, isize
integer(psb_ipk_) :: pnt_halo,nrow,ncol, nh, ip, err_act,lip,nxt,lipf
logical :: pnt_h_ok
integer(psb_ipk_), parameter :: relocsz=200
character(len=20) :: name,ch_err
info = psb_success_
name = 'psb_idx_ins_cnv'
call psb_erractionsave(err_act)
ictxt = desc%get_context()
mglob = desc%get_global_rows()
nglob = desc%get_global_cols()
nrow = desc%get_local_rows()
ncol = desc%get_local_cols()
call psb_info(ictxt, me, np)
if ((.not.allocated(desc%indxmap)).or.&
& (.not.desc%is_bld())) then
info = psb_err_invalid_cd_state_
call psb_errpush(info,name)
goto 9999
endif
if (nv < 0) then
info = 1111
call psb_errpush(info,name)
goto 9999
end if
if (nv == 0) return
if (size(idxin) < nv) then
info = 1111
call psb_errpush(info,name)
goto 9999
end if
if (size(idxout) < nv) then
info = 1111
call psb_errpush(info,name)
goto 9999
end if
idxout(1:nv) = idxin(1:nv)
call psi_idx_ins_cnv(nv,idxout,desc,info,mask=mask,lidx=lidx)
call psb_erractionrestore(err_act)
return
9999 continue
call psb_erractionrestore(err_act)
if (err_act == psb_act_ret_) then
return
else
call psb_error(ictxt)
end if
return
end subroutine psi_idx_ins_cnv2
!!$
!!$ Parallel Sparse BLAS version 3.1
!!$ (C) Copyright 2006, 2007, 2008, 2009, 2010, 2012, 2013
!!$ Salvatore Filippone University of Rome Tor Vergata
!!$ Alfredo Buttari CNRS-IRIT, Toulouse
!!$
!!$ Redistribution and use in source and binary forms, with or without
!!$ modification, are permitted provided that the following conditions
!!$ are met:
!!$ 1. Redistributions of source code must retain the above copyright
!!$ notice, this list of conditions and the following disclaimer.
!!$ 2. Redistributions in binary form must reproduce the above copyright
!!$ notice, this list of conditions, and the following disclaimer in the
!!$ documentation and/or other materials provided with the distribution.
!!$ 3. The name of the PSBLAS group or the names of its contributors may
!!$ not be used to endorse or promote products derived from this
!!$ software without specific written permission.
!!$
!!$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!!$ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
!!$ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
!!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
!!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
!!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
!!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
!!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
!!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
!!$ POSSIBILITY OF SUCH DAMAGE.
!!$
!!$
!
!
! Subroutine: psi_idx_ins_cnvs
! Converts an index from global to local numbering.
! This routine is called while the descriptor is in the build state;
! the idea is that if an index is not yet marked as local, it is a new
! connection to another process, i.e. a new entry into the halo.
! But we still need the mask, because we have to take out the column indices
! corresponding to row indices we do not own (see psb_cdins for how this is used).
!
! Arguments:
! idxin - integer Required index s
! idxout - integer Output value (negative for masked entries)
! desc - type(psb_desc_type). The communication descriptor.
! info - integer. return code.
! mask - logical, optional Only do the conversion for specific indices.
!
subroutine psi_idx_ins_cnvs2(idxin,idxout,desc,info,mask,lidx)
use psi_mod, psb_protect_name => psi_idx_ins_cnvs2
use psb_desc_mod
integer(psb_ipk_), intent(in) :: idxin
integer(psb_ipk_), intent(out) :: idxout
type(psb_desc_type), intent(inout) :: desc
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: mask
integer(psb_ipk_), intent(in), optional :: lidx
integer(psb_ipk_) :: iout(1),lidxv(1)
logical :: mask_(1)
if (present(mask)) then
mask_ = mask
else
mask_ = .true.
end if
iout(1) = idxin
if (present(lidx)) then
lidxv(1) = lidx
call psi_idx_ins_cnv(ione,iout,desc,info,mask=mask_,lidx=lidxv)
else
call psi_idx_ins_cnv(ione,iout,desc,info,mask=mask_)
end if
idxout = iout(1)
return
end subroutine psi_idx_ins_cnvs2
!!$
!!$ Parallel Sparse BLAS version 3.1
!!$ (C) Copyright 2006, 2007, 2008, 2009, 2010, 2012, 2013
!!$ Salvatore Filippone University of Rome Tor Vergata
!!$ Alfredo Buttari CNRS-IRIT, Toulouse
!!$
!!$ Redistribution and use in source and binary forms, with or without
!!$ modification, are permitted provided that the following conditions
!!$ are met:
!!$ 1. Redistributions of source code must retain the above copyright
!!$ notice, this list of conditions and the following disclaimer.
!!$ 2. Redistributions in binary form must reproduce the above copyright
!!$ notice, this list of conditions, and the following disclaimer in the
!!$ documentation and/or other materials provided with the distribution.
!!$ 3. The name of the PSBLAS group or the names of its contributors may
!!$ not be used to endorse or promote products derived from this
!!$ software without specific written permission.
!!$
!!$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!!$ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
!!$ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
!!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
!!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
!!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
!!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
!!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
!!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
!!$ POSSIBILITY OF SUCH DAMAGE.
!!$
!!$
!
!
! Subroutine: psi_idx_ins_cnvs
! Converts an index from global to local numbering.
! This routine is called while the descriptor is in the build state;
! the idea is that if an index is not yet marked as local, it is a new
! connection to another process, i.e. a new entry into the halo.
! But we still need the mask, because we have to take out the column indices
! corresponding to row indices we do not own (see psb_cdins for how this is used).
!
! Arguments:
! idxin - integer Required index s
! idxout - integer Output value (negative for masked entries)
! desc - type(psb_desc_type). The communication descriptor.
! info - integer. return code.
! mask - logical, optional Only do the conversion for specific indices.
!
subroutine psi_idx_ins_cnvs1(idxin,desc,info,mask,lidx)
use psi_mod, psb_protect_name => psi_idx_ins_cnvs1
use psb_desc_mod
integer(psb_ipk_), intent(inout) :: idxin
type(psb_desc_type), intent(inout) :: desc
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: mask
integer(psb_ipk_), intent(in), optional :: lidx
integer(psb_ipk_) :: iout(1),lidxv(1)
logical :: mask_(1)
if (present(mask)) then
mask_ = mask
else
mask_ = .true.
end if
iout(1) = idxin
if (present(lidx)) then
lidxv(1) = lidx
call psi_idx_ins_cnv(ione,iout,desc,info,mask=mask_,lidx=lidxv)
else
call psi_idx_ins_cnv(ione,iout,desc,info,mask_)
end if
idxin = iout(1)
return
end subroutine psi_idx_ins_cnvs1

@ -97,7 +97,8 @@ module psb_c_base_vect_mod
!
! Basic info
procedure, pass(x) :: get_nrows => c_base_get_nrows
procedure, pass(x) :: sizeof => c_base_sizeof
procedure, pass(x) :: sizeof => c_base_sizeof
procedure, nopass :: get_fmt => c_base_get_fmt
!
! Set/get data from/to an external array; also
! overload assignment.
@ -550,7 +551,19 @@ contains
end function c_base_sizeof
!
!> Function base_get_fmt
!! \memberof psb_c_base_vect_type
!! \brief Format
!!
!
function c_base_get_fmt() result(res)
implicit none
character(len=5) :: res
res = 'BASE'
end function c_base_get_fmt
!
!
!

@ -46,6 +46,7 @@ module psb_c_vect_mod
contains
procedure, pass(x) :: get_nrows => c_vect_get_nrows
procedure, pass(x) :: sizeof => c_vect_sizeof
procedure, pass(x) :: get_fmt => c_vect_get_fmt
procedure, pass(x) :: dot_v => c_vect_dot_v
procedure, pass(x) :: dot_a => c_vect_dot_a
generic, public :: dot => dot_v, dot_a
@ -65,6 +66,7 @@ module psb_c_vect_mod
procedure, pass(x) :: amax => c_vect_amax
procedure, pass(x) :: asum => c_vect_asum
procedure, pass(x) :: all => c_vect_all
procedure, pass(x) :: reall => c_vect_reall
procedure, pass(x) :: zero => c_vect_zero
procedure, pass(x) :: asb => c_vect_asb
procedure, pass(x) :: sync => c_vect_sync
@ -217,6 +219,14 @@ contains
if (allocated(x%v)) res = x%v%sizeof()
end function c_vect_sizeof
function c_vect_get_fmt(x) result(res)
implicit none
class(psb_c_vect_type), intent(in) :: x
character(len=5) :: res
res = 'NULL'
if (allocated(x%v)) res = x%v%get_fmt()
end function c_vect_get_fmt
function c_vect_dot_v(n,x,y) result(res)
implicit none
class(psb_c_vect_type), intent(inout) :: x, y
@ -428,10 +438,10 @@ contains
subroutine c_vect_all(n, x, info, mold)
implicit none
integer(psb_ipk_), intent(in) :: n
integer(psb_ipk_), intent(in) :: n
class(psb_c_vect_type), intent(out) :: x
class(psb_c_base_vect_type), intent(in), optional :: mold
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(out) :: info
if (present(mold)) then
#ifdef HAVE_MOLD
@ -450,6 +460,21 @@ contains
end subroutine c_vect_all
subroutine c_vect_reall(n, x, info)
implicit none
integer(psb_ipk_), intent(in) :: n
class(psb_c_vect_type), intent(inout) :: x
integer(psb_ipk_), intent(out) :: info
info = 0
if (.not.allocated(x%v)) &
& call x%all(n,info)
if (info == 0) &
& call x%asb(n,info)
end subroutine c_vect_reall
subroutine c_vect_zero(x)
use psi_serial_mod
implicit none

@ -97,7 +97,8 @@ module psb_d_base_vect_mod
!
! Basic info
procedure, pass(x) :: get_nrows => d_base_get_nrows
procedure, pass(x) :: sizeof => d_base_sizeof
procedure, pass(x) :: sizeof => d_base_sizeof
procedure, nopass :: get_fmt => d_base_get_fmt
!
! Set/get data from/to an external array; also
! overload assignment.
@ -388,6 +389,7 @@ contains
class(psb_d_base_vect_type), intent(inout) :: x
integer(psb_ipk_), intent(out) :: info
info = 0
if (x%get_nrows() < n) &
& call psb_realloc(n,x%v,info)
if (info /= 0) &
@ -550,7 +552,19 @@ contains
end function d_base_sizeof
!
!> Function base_get_fmt
!! \memberof psb_d_base_vect_type
!! \brief Format
!!
!
function d_base_get_fmt() result(res)
implicit none
character(len=5) :: res
res = 'BASE'
end function d_base_get_fmt
!
!
!

@ -46,6 +46,7 @@ module psb_d_vect_mod
contains
procedure, pass(x) :: get_nrows => d_vect_get_nrows
procedure, pass(x) :: sizeof => d_vect_sizeof
procedure, pass(x) :: get_fmt => d_vect_get_fmt
procedure, pass(x) :: dot_v => d_vect_dot_v
procedure, pass(x) :: dot_a => d_vect_dot_a
generic, public :: dot => dot_v, dot_a
@ -65,6 +66,7 @@ module psb_d_vect_mod
procedure, pass(x) :: amax => d_vect_amax
procedure, pass(x) :: asum => d_vect_asum
procedure, pass(x) :: all => d_vect_all
procedure, pass(x) :: reall => d_vect_reall
procedure, pass(x) :: zero => d_vect_zero
procedure, pass(x) :: asb => d_vect_asb
procedure, pass(x) :: sync => d_vect_sync
@ -217,6 +219,14 @@ contains
if (allocated(x%v)) res = x%v%sizeof()
end function d_vect_sizeof
function d_vect_get_fmt(x) result(res)
implicit none
class(psb_d_vect_type), intent(in) :: x
character(len=5) :: res
res = 'NULL'
if (allocated(x%v)) res = x%v%get_fmt()
end function d_vect_get_fmt
function d_vect_dot_v(n,x,y) result(res)
implicit none
class(psb_d_vect_type), intent(inout) :: x, y
@ -428,10 +438,10 @@ contains
subroutine d_vect_all(n, x, info, mold)
implicit none
integer(psb_ipk_), intent(in) :: n
integer(psb_ipk_), intent(in) :: n
class(psb_d_vect_type), intent(out) :: x
class(psb_d_base_vect_type), intent(in), optional :: mold
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(out) :: info
if (present(mold)) then
#ifdef HAVE_MOLD
@ -450,6 +460,21 @@ contains
end subroutine d_vect_all
subroutine d_vect_reall(n, x, info)
implicit none
integer(psb_ipk_), intent(in) :: n
class(psb_d_vect_type), intent(inout) :: x
integer(psb_ipk_), intent(out) :: info
info = 0
if (.not.allocated(x%v)) &
& call x%all(n,info)
if (info == 0) &
& call x%asb(n,info)
end subroutine d_vect_reall
subroutine d_vect_zero(x)
use psi_serial_mod
implicit none

@ -219,7 +219,8 @@ module psb_desc_mod
procedure, pass(desc) :: is_repl => psb_is_repl_desc
procedure, pass(desc) :: get_mpic => psb_cd_get_mpic
procedure, pass(desc) :: get_dectype => psb_cd_get_dectype
procedure, pass(desc) :: get_context => psb_cd_get_context
procedure, pass(desc) :: get_context => psb_cd_get_context
procedure, pass(desc) :: get_ctxt => psb_cd_get_context
procedure, pass(desc) :: get_local_rows => psb_cd_get_local_rows
procedure, pass(desc) :: get_local_cols => psb_cd_get_local_cols
procedure, pass(desc) :: get_global_rows => psb_cd_get_global_rows
@ -231,8 +232,42 @@ module psb_desc_mod
procedure, pass(desc) :: destroy => psb_cd_destroy
procedure, pass(desc) :: nullify => nullify_desc
procedure, pass(desc) :: get_fmt => cd_get_fmt
procedure, pass(desc) :: fnd_owner => cd_fnd_owner
procedure, pass(desc) :: l2gs1 => cd_l2gs1
procedure, pass(desc) :: l2gs2 => cd_l2gs2
procedure, pass(desc) :: l2gv1 => cd_l2gv1
procedure, pass(desc) :: l2gv2 => cd_l2gv2
generic, public :: l2g => l2gs2, l2gv2
generic, public :: l2gip => l2gs1, l2gv1
procedure, pass(desc) :: g2ls1 => cd_g2ls1
procedure, pass(desc) :: g2ls2 => cd_g2ls2
procedure, pass(desc) :: g2lv1 => cd_g2lv1
procedure, pass(desc) :: g2lv2 => cd_g2lv2
generic, public :: g2l => g2ls2, g2lv2
generic, public :: g2lip => g2ls1, g2lv1
procedure, pass(desc) :: g2ls1_ins => cd_g2ls1_ins
procedure, pass(desc) :: g2ls2_ins => cd_g2ls2_ins
procedure, pass(desc) :: g2lv1_ins => cd_g2lv1_ins
procedure, pass(desc) :: g2lv2_ins => cd_g2lv2_ins
generic, public :: g2l_ins => g2ls2_ins, g2lv2_ins
generic, public :: g2lip_ins => g2ls1_ins, g2lv1_ins
end type psb_desc_type
interface
subroutine psb_cd_clone(desc, desc_out, info)
import psb_desc_type, psb_ipk_
class(psb_desc_type), intent(inout), target :: desc
class(psb_desc_type), intent(inout) :: desc_out
integer(psb_ipk_), intent(out) :: info
end subroutine psb_cd_clone
end interface
interface psb_sizeof
module procedure psb_cd_sizeof
end interface psb_sizeof
@ -246,7 +281,11 @@ module psb_desc_mod
end interface psb_free
private :: nullify_desc
private :: nullify_desc, cd_get_fmt,&
& cd_l2gs1, cd_l2gs2, cd_l2gv1, cd_l2gv2, cd_g2ls1,&
& cd_g2ls2, cd_g2lv1, cd_g2lv2, cd_g2ls1_ins,&
& cd_g2ls2_ins, cd_g2lv1_ins, cd_g2lv2_ins, cd_fnd_owner
integer(psb_ipk_), private, save :: cd_large_threshold=psb_default_large_threshold
@ -409,7 +448,7 @@ contains
integer(psb_ipk_) :: val
class(psb_desc_type), intent(in) :: desc
if (psb_is_ok_desc(desc)) then
if (allocated(desc%indxmap)) then
val = desc%indxmap%get_lr()
else
val = -1
@ -421,7 +460,7 @@ contains
integer(psb_ipk_) :: val
class(psb_desc_type), intent(in) :: desc
if (psb_is_ok_desc(desc)) then
if (allocated(desc%indxmap)) then
val = desc%indxmap%get_lc()
else
val = -1
@ -433,7 +472,7 @@ contains
integer(psb_ipk_) :: val
class(psb_desc_type), intent(in) :: desc
if (psb_is_ok_desc(desc)) then
if (allocated(desc%indxmap)) then
val = desc%indxmap%get_gr()
else
val = -1
@ -446,7 +485,7 @@ contains
integer(psb_ipk_) :: val
class(psb_desc_type), intent(in) :: desc
if (psb_is_ok_desc(desc)) then
if (allocated(desc%indxmap)) then
val = desc%indxmap%get_gc()
else
val = -1
@ -454,6 +493,19 @@ contains
end function psb_cd_get_global_cols
function cd_get_fmt(desc) result(val)
implicit none
character(len=5) :: val
class(psb_desc_type), intent(in) :: desc
if (allocated(desc%indxmap)) then
val = desc%indxmap%get_fmt()
else
val = 'NULL'
endif
end function cd_get_fmt
function psb_cd_get_context(desc) result(val)
use psb_error_mod
implicit none
@ -899,89 +951,529 @@ contains
end Subroutine psb_cd_get_recv_idx
subroutine psb_cd_clone(desc, desc_out, info)
subroutine cd_l2gs1(idx,desc,info,mask,owned)
use psb_error_mod
implicit none
class(psb_desc_type), intent(in) :: desc
integer(psb_ipk_), intent(inout) :: idx
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: mask
logical, intent(in), optional :: owned
integer(psb_ipk_) :: err_act
character(len=20) :: name='cd_l2g'
info = psb_success_
call psb_erractionsave(err_act)
if (allocated(desc%indxmap)) then
call desc%indxmap%l2gs1(idx,info,mask=mask,owned=owned)
else
info = psb_err_invalid_cd_state_
end if
if (info /= psb_success_) then
call psb_errpush(info,name)
goto 9999
end if
call psb_erractionrestore(err_act)
return
9999 continue
call psb_erractionrestore(err_act)
if (err_act == psb_act_abort_) then
call psb_error()
return
end if
Return
end subroutine cd_l2gs1
subroutine cd_l2gs2(idxin,idxout,desc,info,mask,owned)
use psb_error_mod
use psb_penv_mod
use psb_realloc_mod
implicit none
class(psb_desc_type), intent(in) :: desc
integer(psb_ipk_), intent(in) :: idxin
integer(psb_ipk_), intent(out) :: idxout
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: mask
logical, intent(in), optional :: owned
implicit none
!....parameters...
integer(psb_ipk_) :: err_act
character(len=20) :: name='cd_l2g'
logical, parameter :: debug=.false.
class(psb_desc_type), intent(inout), target :: desc
class(psb_desc_type), intent(inout) :: desc_out
integer(psb_ipk_), intent(out) :: info
!locals
integer(psb_ipk_) :: np,me,ictxt, err_act
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
info = psb_success_
call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
if (allocated(desc%indxmap)) then
call desc%indxmap%l2gs2(idxin,idxout,info,mask=mask,owned=owned)
else
info = psb_err_invalid_cd_state_
end if
if (info /= psb_success_) then
call psb_errpush(info,name)
goto 9999
end if
if (psb_get_errstatus() /= 0) return
info = psb_success_
call psb_erractionrestore(err_act)
return
9999 continue
call psb_erractionrestore(err_act)
if (err_act == psb_act_abort_) then
call psb_error()
return
end if
Return
end subroutine cd_l2gs2
subroutine cd_l2gv1(idx,desc,info,mask,owned)
use psb_error_mod
implicit none
class(psb_desc_type), intent(in) :: desc
integer(psb_ipk_), intent(inout) :: idx(:)
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: mask(:)
logical, intent(in), optional :: owned
integer(psb_ipk_) :: err_act
character(len=20) :: name='cd_l2g'
logical, parameter :: debug=.false.
info = psb_success_
call psb_erractionsave(err_act)
name = 'psb_cdcpy'
if (desc%is_valid()) then
ictxt = desc%get_context()
if (allocated(desc%indxmap)) then
call desc%indxmap%l2gv1(idx,info,mask=mask,owned=owned)
else
info = psb_err_invalid_cd_state_
end if
if (info /= psb_success_) then
call psb_errpush(info,name)
goto 9999
end if
! check on blacs grid
call psb_info(ictxt, me, np)
if (debug_level >= psb_debug_ext_) &
& write(debug_unit,*) me,' ',trim(name),': Entered'
if (np == -1) then
info = psb_err_context_error_
call psb_errpush(info,name)
goto 9999
endif
call psb_erractionrestore(err_act)
return
desc_out%base_desc => desc%base_desc
if (info == psb_success_)&
& call psb_safe_ab_cpy(desc%halo_index,desc_out%halo_index,info)
if (info == psb_success_)&
& call psb_safe_ab_cpy(desc%ext_index,desc_out%ext_index,info)
if (info == psb_success_)&
& call psb_safe_ab_cpy(desc%ovrlap_index,&
& desc_out%ovrlap_index,info)
if (info == psb_success_)&
& call psb_safe_ab_cpy(desc%bnd_elem,desc_out%bnd_elem,info)
if (info == psb_success_)&
& call psb_safe_ab_cpy(desc%ovrlap_elem,desc_out%ovrlap_elem,info)
if (info == psb_success_)&
& call psb_safe_ab_cpy(desc%ovr_mst_idx,desc_out%ovr_mst_idx,info)
if (info == psb_success_)&
& call psb_safe_ab_cpy(desc%lprm,desc_out%lprm,info)
if (info == psb_success_)&
& call psb_safe_ab_cpy(desc%idx_space,desc_out%idx_space,info)
if ((info == psb_success_).and.(allocated(desc%indxmap))) &
& call desc%indxmap%clone(desc_out%indxmap,info)
9999 continue
call psb_erractionrestore(err_act)
if (err_act == psb_act_abort_) then
call psb_error()
return
end if
Return
end subroutine cd_l2gv1
subroutine cd_l2gv2(idxin,idxout,desc,info,mask,owned)
use psb_error_mod
implicit none
class(psb_desc_type), intent(in) :: desc
integer(psb_ipk_), intent(in) :: idxin(:)
integer(psb_ipk_), intent(out) :: idxout(:)
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: mask(:)
logical, intent(in), optional :: owned
integer(psb_ipk_) :: err_act
character(len=20) :: name='cd_l2g'
logical, parameter :: debug=.false.
info = psb_success_
call psb_erractionsave(err_act)
if (allocated(desc%indxmap)) then
call desc%indxmap%l2gv2(idxin,idxout,info,mask=mask,owned=owned)
else
call desc_out%free(info)
info = psb_err_invalid_cd_state_
end if
if (info /= psb_success_) then
info = psb_err_from_subroutine_
if (info /= psb_success_) then
call psb_errpush(info,name)
goto 9999
endif
if (debug_level >= psb_debug_ext_) &
& write(debug_unit,*) me,' ',trim(name),': Done'
end if
call psb_erractionrestore(err_act)
return
9999 continue
call psb_erractionrestore(err_act)
if (err_act == psb_act_abort_) then
call psb_error()
return
end if
Return
end subroutine cd_l2gv2
subroutine cd_g2ls1(idx,desc,info,mask,owned)
use psb_error_mod
implicit none
class(psb_desc_type), intent(in) :: desc
integer(psb_ipk_), intent(inout) :: idx
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: mask
logical, intent(in), optional :: owned
integer(psb_ipk_) :: err_act
character(len=20) :: name='cd_g2l'
logical, parameter :: debug=.false.
info = psb_success_
call psb_erractionsave(err_act)
if (allocated(desc%indxmap)) then
call desc%indxmap%g2ls1(idx,info,mask=mask,owned=owned)
else
info = psb_err_invalid_cd_state_
end if
if (info /= psb_success_) then
call psb_errpush(info,name)
goto 9999
end if
call psb_erractionrestore(err_act)
return
if (err_act == psb_act_ret_) then
9999 continue
call psb_erractionrestore(err_act)
if (err_act == psb_act_abort_) then
call psb_error()
return
end if
Return
end subroutine cd_g2ls1
subroutine cd_g2ls2(idxin,idxout,desc,info,mask,owned)
use psb_error_mod
implicit none
class(psb_desc_type), intent(in) :: desc
integer(psb_ipk_), intent(in) :: idxin
integer(psb_ipk_), intent(out) :: idxout
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: mask
logical, intent(in), optional :: owned
integer(psb_ipk_) :: err_act
character(len=20) :: name='cd_g2l'
logical, parameter :: debug=.false.
info = psb_success_
call psb_erractionsave(err_act)
if (allocated(desc%indxmap)) then
call desc%indxmap%g2ls2(idxin,idxout,info,mask=mask,owned=owned)
else
call psb_error(ictxt)
info = psb_err_invalid_cd_state_
end if
if (info /= psb_success_) then
call psb_errpush(info,name)
goto 9999
end if
call psb_erractionrestore(err_act)
return
9999 continue
call psb_erractionrestore(err_act)
if (err_act == psb_act_abort_) then
call psb_error()
return
end if
Return
end subroutine cd_g2ls2
subroutine cd_g2lv1(idx,desc,info,mask,owned)
use psb_error_mod
implicit none
class(psb_desc_type), intent(in) :: desc
integer(psb_ipk_), intent(inout) :: idx(:)
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: mask(:)
logical, intent(in), optional :: owned
integer(psb_ipk_) :: err_act
character(len=20) :: name='cd_g2l'
logical, parameter :: debug=.false.
info = psb_success_
call psb_erractionsave(err_act)
if (allocated(desc%indxmap)) then
call desc%indxmap%g2lv1(idx,info,mask=mask,owned=owned)
else
info = psb_err_invalid_cd_state_
end if
if (info /= psb_success_) then
call psb_errpush(info,name)
goto 9999
end if
call psb_erractionrestore(err_act)
return
end subroutine psb_cd_clone
9999 continue
call psb_erractionrestore(err_act)
if (err_act == psb_act_abort_) then
call psb_error()
return
end if
Return
end subroutine cd_g2lv1
subroutine cd_g2lv2(idxin,idxout,desc,info,mask,owned)
use psb_error_mod
implicit none
class(psb_desc_type), intent(in) :: desc
integer(psb_ipk_), intent(in) :: idxin(:)
integer(psb_ipk_), intent(out) :: idxout(:)
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: mask(:)
logical, intent(in), optional :: owned
integer(psb_ipk_) :: err_act
character(len=20) :: name='cd_g2l'
logical, parameter :: debug=.false.
info = psb_success_
call psb_erractionsave(err_act)
if (allocated(desc%indxmap)) then
call desc%indxmap%g2lv2(idxin,idxout,info,mask=mask,owned=owned)
else
info = psb_err_invalid_cd_state_
end if
if (info /= psb_success_) then
call psb_errpush(info,name)
goto 9999
end if
call psb_erractionrestore(err_act)
return
9999 continue
call psb_erractionrestore(err_act)
if (err_act == psb_act_abort_) then
call psb_error()
return
end if
Return
end subroutine cd_g2lv2
subroutine cd_g2ls1_ins(idx,desc,info,mask, lidx)
use psb_error_mod
implicit none
class(psb_desc_type), intent(inout) :: desc
integer(psb_ipk_), intent(inout) :: idx
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: mask
integer(psb_ipk_), intent(in), optional :: lidx
integer(psb_ipk_) :: err_act
character(len=20) :: name='cd_g2l_ins'
logical, parameter :: debug=.false.
info = psb_success_
call psb_erractionsave(err_act)
if (allocated(desc%indxmap)) then
call desc%indxmap%g2ls1_ins(idx,info,mask=mask,lidx=lidx)
else
info = psb_err_invalid_cd_state_
end if
if (info /= psb_success_) then
call psb_errpush(info,name)
goto 9999
end if
call psb_erractionrestore(err_act)
return
9999 continue
call psb_erractionrestore(err_act)
if (err_act == psb_act_abort_) then
call psb_error()
return
end if
Return
end subroutine cd_g2ls1_ins
subroutine cd_g2ls2_ins(idxin,idxout,desc,info,mask, lidx)
use psb_error_mod
implicit none
class(psb_desc_type), intent(inout) :: desc
integer(psb_ipk_), intent(in) :: idxin
integer(psb_ipk_), intent(out) :: idxout
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: mask
integer(psb_ipk_), intent(in), optional :: lidx
integer(psb_ipk_) :: err_act
character(len=20) :: name='cd_g2l_ins'
logical, parameter :: debug=.false.
info = psb_success_
call psb_erractionsave(err_act)
if (allocated(desc%indxmap)) then
call desc%indxmap%g2ls2_ins(idxin,idxout,info,mask=mask,lidx=lidx)
else
info = psb_err_invalid_cd_state_
end if
if (info /= psb_success_) then
call psb_errpush(info,name)
goto 9999
end if
call psb_erractionrestore(err_act)
return
9999 continue
call psb_erractionrestore(err_act)
if (err_act == psb_act_abort_) then
call psb_error()
return
end if
Return
end subroutine cd_g2ls2_ins
subroutine cd_g2lv1_ins(idx,desc,info,mask, lidx)
use psb_error_mod
implicit none
class(psb_desc_type), intent(inout) :: desc
integer(psb_ipk_), intent(inout) :: idx(:)
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: mask(:)
integer(psb_ipk_), intent(in), optional :: lidx(:)
integer(psb_ipk_) :: err_act
character(len=20) :: name='cd_g2l_ins'
logical, parameter :: debug=.false.
info = psb_success_
call psb_erractionsave(err_act)
if (allocated(desc%indxmap)) then
call desc%indxmap%g2lv1_ins(idx,info,mask=mask,lidx=lidx)
else
info = psb_err_invalid_cd_state_
end if
if (info /= psb_success_) then
call psb_errpush(info,name)
goto 9999
end if
call psb_erractionrestore(err_act)
return
9999 continue
call psb_erractionrestore(err_act)
if (err_act == psb_act_abort_) then
call psb_error()
return
end if
Return
end subroutine cd_g2lv1_ins
subroutine cd_g2lv2_ins(idxin,idxout,desc,info,mask,lidx)
use psb_error_mod
implicit none
class(psb_desc_type), intent(inout) :: desc
integer(psb_ipk_), intent(in) :: idxin(:)
integer(psb_ipk_), intent(out) :: idxout(:)
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: mask(:)
integer(psb_ipk_), intent(in), optional :: lidx(:)
integer(psb_ipk_) :: err_act
character(len=20) :: name='cd_g2l_ins'
logical, parameter :: debug=.false.
info = psb_success_
call psb_erractionsave(err_act)
if (allocated(desc%indxmap)) then
call desc%indxmap%g2lv2_ins(idxin,idxout,info,mask=mask,lidx=lidx)
else
info = psb_err_invalid_cd_state_
end if
if (info /= psb_success_) then
call psb_errpush(info,name)
goto 9999
end if
call psb_erractionrestore(err_act)
return
9999 continue
call psb_erractionrestore(err_act)
if (err_act == psb_act_abort_) then
call psb_error()
return
end if
Return
end subroutine cd_g2lv2_ins
subroutine cd_fnd_owner(idx,iprc,desc,info)
use psb_error_mod
implicit none
integer(psb_ipk_), intent(in) :: idx(:)
integer(psb_ipk_), allocatable, intent(out) :: iprc(:)
class(psb_desc_type), intent(in) :: desc
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act
character(len=20) :: name='cd_fnd_owner'
logical, parameter :: debug=.false.
info = psb_success_
call psb_erractionsave(err_act)
if (allocated(desc%indxmap)) then
call desc%indxmap%fnd_owner(idx,iprc,info)
else
info = psb_err_invalid_cd_state_
end if
if (info /= psb_success_) then
call psb_errpush(info,name)
goto 9999
end if
call psb_erractionrestore(err_act)
return
9999 continue
call psb_erractionrestore(err_act)
if (err_act == psb_act_abort_) then
call psb_error()
return
end if
Return
end subroutine cd_fnd_owner
end module psb_desc_mod

@ -64,6 +64,7 @@ module psb_gen_block_map_mod
procedure, pass(idxmap) :: asb => block_asb
procedure, pass(idxmap) :: free => block_free
procedure, pass(idxmap) :: clone => block_clone
procedure, pass(idxmap) :: reinit => block_reinit
procedure, nopass :: get_fmt => block_get_fmt
procedure, pass(idxmap) :: l2gs1 => block_l2gs1
@ -89,7 +90,7 @@ module psb_gen_block_map_mod
& block_get_fmt, block_l2gs1, block_l2gs2, block_l2gv1,&
& block_l2gv2, block_g2ls1, block_g2ls2, block_g2lv1,&
& block_g2lv2, block_g2ls1_ins, block_g2ls2_ins,&
& block_g2lv1_ins, block_g2lv2_ins, block_clone
& block_g2lv1_ins, block_g2lv2_ins, block_clone, block_reinit
integer(psb_ipk_), private :: laddsz=500
@ -229,12 +230,58 @@ contains
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: mask(:)
logical, intent(in), optional :: owned
integer(psb_ipk_) :: is, im
integer(psb_ipk_) :: is, im, i
logical :: owned_
info = 0
is = size(idxin)
im = min(is,size(idxout))
idxout(1:im) = idxin(1:im)
call idxmap%l2gip(idxout(1:im),info,mask,owned)
if (present(mask)) then
if (size(mask) < im) then
info = -1
return
end if
end if
if (present(owned)) then
owned_ = owned
else
owned_ = .false.
end if
if (present(mask)) then
do i=1, im
if (mask(i)) then
if ((1<=idxin(i)).and.(idxin(i) <= idxmap%local_rows)) then
idxout(i) = idxmap%min_glob_row + idxin(i) - 1
else if ((idxmap%local_rows < idxin(i)).and.(idxin(i) <= idxmap%local_cols)&
& .and.(.not.owned_)) then
idxout(i) = idxmap%loc_to_glob(idxin(i)-idxmap%local_rows)
else
idxout(i) = -1
info = -1
end if
end if
end do
else if (.not.present(mask)) then
do i=1, im
if ((1<=idxin(i)).and.(idxin(i) <= idxmap%local_rows)) then
idxout(i) = idxmap%min_glob_row + idxin(i) - 1
else if ((idxmap%local_rows < idxin(i)).and.(idxin(i) <= idxmap%local_cols)&
& .and.(.not.owned_)) then
idxout(i) = idxmap%loc_to_glob(idxin(i)-idxmap%local_rows)
else
idxout(i) = -1
info = -1
end if
end do
end if
if (is > im) then
info = -3
end if
@ -386,6 +433,8 @@ contains
end subroutine block_g2lv1
subroutine block_g2lv2(idxin,idxout,idxmap,info,mask,owned)
use psb_penv_mod
use psb_sort_mod
implicit none
class(psb_gen_block_map), intent(in) :: idxmap
integer(psb_ipk_), intent(in) :: idxin(:)
@ -394,12 +443,104 @@ contains
logical, intent(in), optional :: mask(:)
logical, intent(in), optional :: owned
integer(psb_ipk_) :: is, im
integer(psb_ipk_) :: i, nv, is, ip, lip, im
integer(psb_mpik_) :: ictxt, iam, np
logical :: owned_
info = 0
ictxt = idxmap%get_ctxt()
call psb_info(ictxt,iam,np)
is = size(idxin)
im = min(is,size(idxout))
idxout(1:im) = idxin(1:im)
call idxmap%g2lip(idxout(1:im),info,mask,owned)
if (present(mask)) then
if (size(mask) < im) then
!!$ write(0,*) 'Block g2l: size of mask', size(mask),size(idx)
info = -1
return
end if
end if
if (present(owned)) then
owned_ = owned
else
owned_ = .false.
end if
if (present(mask)) then
if (idxmap%is_asb()) then
do i=1, im
if (mask(i)) then
if ((idxmap%min_glob_row <= idxin(i)).and.(idxin(i) <= idxmap%max_glob_row)) then
idxout(i) = idxin(i) - idxmap%min_glob_row + 1
else if ((1<= idxin(i)).and.(idxin(i) <= idxmap%global_rows)&
&.and.(.not.owned_)) then
nv = size(idxmap%srt_l2g,1)
idxout(i) = psb_ibsrch(idxin(i),nv,idxmap%srt_l2g(:,1))
if (idxout(i) > 0) idxout(i) = idxmap%srt_l2g(idxout(i),2)+idxmap%local_rows
else
idxout(i) = -1
end if
end if
end do
else if (idxmap%is_valid()) then
do i=1,im
if (mask(i)) then
if ((idxmap%min_glob_row <= idxin(i)).and.(idxin(i) <= idxmap%max_glob_row)) then
idxout(i) = idxin(i) - idxmap%min_glob_row + 1
else if ((1<= idxin(i)).and.(idxin(i) <= idxmap%global_rows)&
&.and.(.not.owned_)) then
ip = idxin(i)
call psb_hash_searchkey(ip,lip,idxmap%hash,info)
if (lip > 0) idxout(i) = lip + idxmap%local_rows
else
idxout(i) = -1
end if
end if
end do
else
!!$ write(0,*) 'Block status: invalid ',idxmap%get_state()
idxout(1:im) = -1
info = -1
end if
else if (.not.present(mask)) then
if (idxmap%is_asb()) then
do i=1, im
if ((idxmap%min_glob_row <= idxin(i)).and.(idxin(i) <= idxmap%max_glob_row)) then
idxout(i) = idxin(i) - idxmap%min_glob_row + 1
else if ((1<= idxin(i)).and.(idxin(i) <= idxmap%global_rows)&
&.and.(.not.owned_)) then
nv = size(idxmap%srt_l2g,1)
idxout(i) = psb_ibsrch(idxin(i),nv,idxmap%srt_l2g(:,1))
if (idxout(i) > 0) idxout(i) = idxmap%srt_l2g(idxout(i),2)+idxmap%local_rows
else
idxout(i) = -1
end if
end do
else if (idxmap%is_valid()) then
do i=1,im
if ((idxmap%min_glob_row <= idxin(i)).and.(idxin(i) <= idxmap%max_glob_row)) then
idxout(i) = idxin(i) - idxmap%min_glob_row + 1
else if ((1<= idxin(i)).and.(idxin(i) <= idxmap%global_rows)&
&.and.(.not.owned_)) then
ip = idxin(i)
call psb_hash_searchkey(ip,lip,idxmap%hash,info)
if (lip > 0) idxout(i) = lip + idxmap%local_rows
else
idxout(i) = -1
end if
end do
else
!!$ write(0,*) 'Block status: invalid ',idxmap%get_state()
idxout(1:im) = -1
info = -1
end if
end if
if (is > im) info = -3
end subroutine block_g2lv2
@ -646,6 +787,8 @@ contains
end subroutine block_g2lv1_ins
subroutine block_g2lv2_ins(idxin,idxout,idxmap,info,mask,lidx)
use psb_realloc_mod
use psb_sort_mod
implicit none
class(psb_gen_block_map), intent(inout) :: idxmap
integer(psb_ipk_), intent(in) :: idxin(:)
@ -654,12 +797,192 @@ contains
logical, intent(in), optional :: mask(:)
integer(psb_ipk_), intent(in), optional :: lidx(:)
integer(psb_ipk_) :: is, im
integer(psb_ipk_) :: i, nv, is, ix, im
integer(psb_ipk_) :: ip, lip, nxt
info = 0
is = size(idxin)
im = min(is,size(idxout))
idxout(1:im) = idxin(1:im)
call idxmap%g2lip_ins(idxout(1:im),info,mask=mask,lidx=lidx)
if (present(mask)) then
if (size(mask) < im) then
info = -1
return
end if
end if
if (present(lidx)) then
if (size(lidx) < im) then
info = -1
return
end if
end if
if (idxmap%is_asb()) then
! State is wrong for this one !
idxout = -1
info = -1
else if (idxmap%is_valid()) then
if (present(lidx)) then
if (present(mask)) then
do i=1, im
if (mask(i)) then
if ((idxmap%min_glob_row <= idxin(i)).and.(idxin(i) <= idxmap%max_glob_row)) then
idxout(i) = idxin(i) - idxmap%min_glob_row + 1
else if ((1<= idxin(i)).and.(idxin(i) <= idxmap%global_rows)) then
if (lidx(i) <= idxmap%local_rows) then
info = -5
return
end if
nxt = lidx(i)-idxmap%local_rows
ip = idxin(i)
call psb_hash_searchinskey(ip,lip,nxt,idxmap%hash,info)
if (info >= 0) then
if (lip == nxt) then
! We have added one item
call psb_ensure_size(nxt,idxmap%loc_to_glob,info,addsz=laddsz)
if (info /= 0) then
info = -4
return
end if
idxmap%local_cols = max(lidx(i),idxmap%local_cols)
idxmap%loc_to_glob(nxt) = idxin(i)
end if
info = psb_success_
else
info = -5
return
end if
idxout(i) = lip + idxmap%local_rows
else
idxout(i) = -1
info = -1
end if
end if
end do
else if (.not.present(mask)) then
do i=1, im
if ((idxmap%min_glob_row <= idxin(i)).and.(idxin(i) <= idxmap%max_glob_row)) then
idxout(i) = idxin(i) - idxmap%min_glob_row + 1
else if ((1<= idxin(i)).and.(idxin(i) <= idxmap%global_rows)) then
if (lidx(i) <= idxmap%local_rows) then
info = -5
return
end if
nxt = lidx(i)-idxmap%local_rows
ip = idxin(i)
call psb_hash_searchinskey(ip,lip,nxt,idxmap%hash,info)
if (info >= 0) then
if (lip == nxt) then
! We have added one item
call psb_ensure_size(nxt,idxmap%loc_to_glob,info,addsz=laddsz)
if (info /= 0) then
info = -4
return
end if
idxmap%local_cols = max(lidx(i),idxmap%local_cols)
idxmap%loc_to_glob(nxt) = idxin(i)
end if
info = psb_success_
else
info = -5
return
end if
idxout(i) = lip + idxmap%local_rows
else
idxout(i) = -1
info = -1
end if
end do
end if
else if (.not.present(lidx)) then
if (present(mask)) then
do i=1, im
if (mask(i)) then
if ((idxmap%min_glob_row <= idxin(i)).and.(idxin(i) <= idxmap%max_glob_row)) then
idxout(i) = idxin(i) - idxmap%min_glob_row + 1
else if ((1<= idxin(i)).and.(idxin(i) <= idxmap%global_rows)) then
nv = idxmap%local_cols-idxmap%local_rows
nxt = nv + 1
ip = idxin(i)
call psb_hash_searchinskey(ip,lip,nxt,idxmap%hash,info)
if (info >= 0) then
if (lip == nxt) then
! We have added one item
call psb_ensure_size(nxt,idxmap%loc_to_glob,info,addsz=laddsz)
if (info /= 0) then
info = -4
return
end if
idxmap%local_cols = nxt + idxmap%local_rows
idxmap%loc_to_glob(nxt) = idxin(i)
end if
info = psb_success_
else
info = -5
return
end if
idxout(i) = lip + idxmap%local_rows
else
idxout(i) = -1
info = -1
end if
end if
end do
else if (.not.present(mask)) then
do i=1, im
if ((idxmap%min_glob_row <= idxin(i)).and.(idxin(i) <= idxmap%max_glob_row)) then
idxout(i) = idxin(i) - idxmap%min_glob_row + 1
else if ((1<= idxin(i)).and.(idxin(i) <= idxmap%global_rows)) then
nv = idxmap%local_cols-idxmap%local_rows
nxt = nv + 1
ip = idxin(i)
call psb_hash_searchinskey(ip,lip,nxt,idxmap%hash,info)
if (info >= 0) then
if (lip == nxt) then
! We have added one item
call psb_ensure_size(nxt,idxmap%loc_to_glob,info,addsz=laddsz)
if (info /= 0) then
info = -4
return
end if
idxmap%local_cols = nxt + idxmap%local_rows
idxmap%loc_to_glob(nxt) = idxin(i)
end if
info = psb_success_
else
info = -5
return
end if
idxout(i) = lip + idxmap%local_rows
else
idxout(i) = -1
info = -1
end if
end do
end if
end if
else
idxout = -1
info = -1
end if
if (is > im) then
!!$ write(0,*) 'g2lv2_ins err -3'
info = -3
@ -696,6 +1019,7 @@ contains
subroutine block_init(idxmap,ictxt,nl,info)
use psb_penv_mod
use psb_realloc_mod
use psb_error_mod
implicit none
class(psb_gen_block_map), intent(inout) :: idxmap
@ -743,7 +1067,7 @@ contains
idxmap%min_glob_row = vnl(iam)+1
idxmap%max_glob_row = vnl(iam+1)
call move_alloc(vnl,idxmap%vnl)
allocate(idxmap%loc_to_glob(nl),stat=info)
call psb_realloc(nl,idxmap%loc_to_glob,info)
if (info /= 0) then
info = -2
return
@ -854,4 +1178,106 @@ contains
return
end subroutine block_clone
subroutine block_reinit(idxmap,info)
use psb_penv_mod
use psb_error_mod
use psb_realloc_mod
implicit none
class(psb_gen_block_map), intent(inout) :: idxmap
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act, nr,nc,k, nl, ictxt
integer(psb_ipk_), allocatable :: idx(:),lidx(:)
character(len=20) :: name='block_reinit'
logical, parameter :: debug=.false.
info = psb_success_
call psb_get_erraction(err_act)
nr = idxmap%get_lr()
nc = idxmap%get_lc()
if (nc>nr) then
lidx = (/(k,k=nr+1,nc)/)
idx = (/(k,k=nr+1,nc)/)
call idxmap%l2gip(idx,info)
end if
if (info /= 0) &
& write(0,*) 'From l2gip',info
call psb_hash_init(nr,idxmap%hash,info)
if (info /= 0) &
& write(0,*) 'From hash_init',info
call idxmap%set_state(psb_desc_bld_)
if (nc>nr) then
call idxmap%g2lip_ins(idx,info,lidx=lidx)
end if
if (info /= psb_success_) then
info = psb_err_from_subroutine_
call psb_errpush(info,name)
goto 9999
end if
call psb_erractionrestore(err_act)
return
9999 continue
call psb_erractionrestore(err_act)
if (err_act /= psb_act_ret_) then
call psb_error()
end if
return
end subroutine block_reinit
!!$
!!$ subroutine block_reinit(idxmap,info)
!!$ use psb_penv_mod
!!$ use psb_error_mod
!!$ use psb_realloc_mod
!!$ implicit none
!!$ class(psb_gen_block_map), intent(inout) :: idxmap
!!$ integer(psb_ipk_), intent(out) :: info
!!$ integer(psb_ipk_) :: err_act, nr,nc,k, nl, ictxt
!!$ integer(psb_ipk_), allocatable :: idx(:),lidx(:)
!!$ character(len=20) :: name='block_reinit'
!!$ logical, parameter :: debug=.false.
!!$
!!$ info = psb_success_
!!$ call psb_get_erraction(err_act)
!!$ ictxt = idxmap%get_ctxt()
!!$ nr = idxmap%get_lr()
!!$ nc = idxmap%get_lc()
!!$ if (nc>nr) then
!!$ lidx = (/(k,k=nr+1,nc)/)
!!$ idx = (/(k,k=nr+1,nc)/)
!!$ call idxmap%l2gip(idx,info)
!!$ end if
!!$ if (info /= 0) &
!!$ & write(0,*) 'From l2gip',info
!!$
!!$ call idxmap%init(ictxt,nr,info)
!!$ if (nc>nr) then
!!$ call idxmap%g2lip_ins(idx,info,lidx=lidx)
!!$ end if
!!$
!!$
!!$ if (info /= psb_success_) then
!!$ info = psb_err_from_subroutine_
!!$ call psb_errpush(info,name)
!!$ goto 9999
!!$ end if
!!$ call psb_erractionrestore(err_act)
!!$ return
!!$
!!$9999 continue
!!$ call psb_erractionrestore(err_act)
!!$ if (err_act /= psb_act_ret_) then
!!$ call psb_error()
!!$ end if
!!$ return
!!$ end subroutine block_reinit
!!$
end module psb_gen_block_map_mod

@ -73,6 +73,7 @@ module psb_hash_map_mod
procedure, pass(idxmap) :: asb => hash_asb
procedure, pass(idxmap) :: free => hash_free
procedure, pass(idxmap) :: clone => hash_clone
procedure, pass(idxmap) :: reinit => hash_reinit
procedure, nopass :: get_fmt => hash_get_fmt
procedure, nopass :: row_extendable => hash_row_extendable
@ -908,7 +909,7 @@ contains
call psb_get_mpicomm(ictxt,idxmap%mpic)
lc2 = int(1.5*nl)
allocate(idxmap%loc_to_glob(lc2),stat=info)
call psb_realloc(lc2,idxmap%loc_to_glob,info)
if (info /= 0) then
info = -2
return
@ -1452,5 +1453,53 @@ contains
end subroutine hash_cpy
subroutine hash_reinit(idxmap,info)
use psb_penv_mod
use psb_error_mod
use psb_realloc_mod
implicit none
class(psb_hash_map), intent(inout) :: idxmap
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act, nr,nc,k, nl, ictxt, ntot, me, np
integer(psb_ipk_), allocatable :: idx(:),lidx(:)
character(len=20) :: name='hash_reinit'
logical, parameter :: debug=.false.
info = psb_success_
call psb_get_erraction(err_act)
ictxt = idxmap%get_ctxt()
nr = idxmap%get_lr()
nc = idxmap%get_lc()
ntot = idxmap%get_gr()
lidx = (/(k,k=1,nc)/)
idx = (/(k,k=1,nc)/)
call idxmap%l2gip(idx,info)
call idxmap%free()
call hash_init_vlu(idxmap,ictxt,ntot,nr,idx(1:nr),info)
if (nc>nr) then
call idxmap%g2lip_ins(idx(nr+1:nc),info,lidx=lidx(nr+1:nc))
end if
if (info /= psb_success_) then
info = psb_err_from_subroutine_
call psb_errpush(info,name)
goto 9999
end if
call psb_erractionrestore(err_act)
return
9999 continue
call psb_erractionrestore(err_act)
if (err_act /= psb_act_ret_) then
call psb_error()
end if
return
end subroutine hash_reinit
end module psb_hash_map_mod

@ -97,7 +97,8 @@ module psb_i_base_vect_mod
!
! Basic info
procedure, pass(x) :: get_nrows => i_base_get_nrows
procedure, pass(x) :: sizeof => i_base_sizeof
procedure, pass(x) :: sizeof => i_base_sizeof
procedure, nopass :: get_fmt => i_base_get_fmt
!
! Set/get data from/to an external array; also
! overload assignment.
@ -550,7 +551,19 @@ contains
end function i_base_sizeof
!
!> Function base_get_fmt
!! \memberof psb_i_base_vect_type
!! \brief Format
!!
!
function i_base_get_fmt() result(res)
implicit none
character(len=5) :: res
res = 'BASE'
end function i_base_get_fmt
!
!
!

@ -46,6 +46,7 @@ module psb_i_vect_mod
contains
procedure, pass(x) :: get_nrows => i_vect_get_nrows
procedure, pass(x) :: sizeof => i_vect_sizeof
procedure, pass(x) :: get_fmt => i_vect_get_fmt
procedure, pass(x) :: dot_v => i_vect_dot_v
procedure, pass(x) :: dot_a => i_vect_dot_a
generic, public :: dot => dot_v, dot_a
@ -65,6 +66,7 @@ module psb_i_vect_mod
procedure, pass(x) :: amax => i_vect_amax
procedure, pass(x) :: asum => i_vect_asum
procedure, pass(x) :: all => i_vect_all
procedure, pass(x) :: reall => i_vect_reall
procedure, pass(x) :: zero => i_vect_zero
procedure, pass(x) :: asb => i_vect_asb
procedure, pass(x) :: sync => i_vect_sync
@ -217,6 +219,14 @@ contains
if (allocated(x%v)) res = x%v%sizeof()
end function i_vect_sizeof
function i_vect_get_fmt(x) result(res)
implicit none
class(psb_i_vect_type), intent(in) :: x
character(len=5) :: res
res = 'NULL'
if (allocated(x%v)) res = x%v%get_fmt()
end function i_vect_get_fmt
function i_vect_dot_v(n,x,y) result(res)
implicit none
class(psb_i_vect_type), intent(inout) :: x, y
@ -428,10 +438,10 @@ contains
subroutine i_vect_all(n, x, info, mold)
implicit none
integer(psb_ipk_), intent(in) :: n
integer(psb_ipk_), intent(in) :: n
class(psb_i_vect_type), intent(out) :: x
class(psb_i_base_vect_type), intent(in), optional :: mold
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(out) :: info
if (present(mold)) then
#ifdef HAVE_MOLD
@ -450,6 +460,21 @@ contains
end subroutine i_vect_all
subroutine i_vect_reall(n, x, info)
implicit none
integer(psb_ipk_), intent(in) :: n
class(psb_i_vect_type), intent(inout) :: x
integer(psb_ipk_), intent(out) :: info
info = 0
if (.not.allocated(x%v)) &
& call x%all(n,info)
if (info == 0) &
& call x%asb(n,info)
end subroutine i_vect_reall
subroutine i_vect_zero(x)
use psi_serial_mod
implicit none

@ -1,3 +1,4 @@
!!$
!!$ Parallel Sparse BLAS version 3.1
!!$ (C) Copyright 2006, 2007, 2008, 2009, 2010, 2012, 2013
@ -158,6 +159,7 @@ module psb_indx_map_mod
procedure, pass(idxmap) :: asb => base_asb
procedure, pass(idxmap) :: free => base_free
procedure, pass(idxmap) :: clone => base_clone
procedure, pass(idxmap) :: reinit => base_reinit
procedure, pass(idxmap) :: l2gs1 => base_l2gs1
procedure, pass(idxmap) :: l2gs2 => base_l2gs2
@ -196,7 +198,7 @@ module psb_indx_map_mod
& base_g2ls1, base_g2ls2, base_g2lv1, base_g2lv2,&
& base_g2ls1_ins, base_g2ls2_ins, base_g2lv1_ins,&
& base_g2lv2_ins, base_init_vl, base_is_null,&
& base_row_extendable, base_clone
& base_row_extendable, base_clone, base_reinit
!> Function: psb_indx_map_fnd_owner
!! \memberof psb_indx_map
@ -879,4 +881,30 @@ contains
return
end subroutine base_clone
subroutine base_reinit(idxmap,info)
use psb_penv_mod
use psb_error_mod
implicit none
class(psb_indx_map), intent(inout) :: idxmap
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act
character(len=20) :: name='base_reinit'
logical, parameter :: debug=.false.
info = psb_success_
call psb_get_erraction(err_act)
! This is the base version. If we get here
! it means the derived class is incomplete,
! so we throw an error.
call psb_errpush(psb_err_missing_override_method_,&
& name,a_err=idxmap%get_fmt())
if (err_act /= psb_act_ret_) then
call psb_error()
end if
return
end subroutine base_reinit
end module psb_indx_map_mod

@ -54,6 +54,7 @@ module psb_list_map_mod
procedure, pass(idxmap) :: asb => list_asb
procedure, pass(idxmap) :: free => list_free
procedure, pass(idxmap) :: clone => list_clone
procedure, pass(idxmap) :: reinit => list_reinit
procedure, nopass :: get_fmt => list_get_fmt
procedure, nopass :: row_extendable => list_row_extendable
@ -705,4 +706,26 @@ contains
return
end subroutine list_clone
subroutine list_reinit(idxmap,info)
use psb_penv_mod
use psb_error_mod
use psb_realloc_mod
implicit none
class(psb_list_map), intent(inout) :: idxmap
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act, nr,nc,k, nl
integer(psb_ipk_), allocatable :: idx(:),lidx(:)
character(len=20) :: name='list_reinit'
logical, parameter :: debug=.false.
info = psb_success_
call idxmap%set_state(psb_desc_bld_)
return
end subroutine list_reinit
end module psb_list_map_mod

@ -55,6 +55,7 @@ module psb_repl_map_mod
procedure, pass(idxmap) :: asb => repl_asb
procedure, pass(idxmap) :: free => repl_free
procedure, pass(idxmap) :: clone => repl_clone
procedure, pass(idxmap) :: reinit => repl_reinit
procedure, nopass :: get_fmt => repl_get_fmt
procedure, pass(idxmap) :: l2gs1 => repl_l2gs1
@ -195,11 +196,49 @@ contains
logical, intent(in), optional :: mask(:)
logical, intent(in), optional :: owned
integer(psb_ipk_) :: is, im
integer(psb_ipk_) :: i
logical :: owned_
info = 0
is = size(idxin)
im = min(is,size(idxout))
idxout(1:im) = idxin(1:im)
call idxmap%l2gip(idxout(1:im),info,mask,owned)
if (present(mask)) then
if (size(mask) < im) then
info = -1
return
end if
end if
if (present(owned)) then
owned_ = owned
else
owned_ = .false.
end if
if (present(mask)) then
do i=1, im
if (mask(i)) then
if ((1<=idxin(i)).and.(idxin(i) <= idxmap%local_rows)) then
idxout(i) = idxin(i)
else
idxout(i) = -1
end if
end if
end do
else if (.not.present(mask)) then
do i=1, im
if ((1<=idxin(i)).and.(idxin(i) <= idxmap%local_rows)) then
idxout(i) = idxin(i)
else
idxout(i) = -1
end if
end do
end if
if (is > im) info = -3
end subroutine repl_l2gv2
@ -330,12 +369,79 @@ contains
logical, intent(in), optional :: mask(:)
logical, intent(in), optional :: owned
integer(psb_ipk_) :: is, im
integer(psb_ipk_) :: is, im,i
logical :: owned_
info = 0
is = size(idxin)
im = min(is,size(idxout))
idxout(1:im) = idxin(1:im)
call idxmap%g2lip(idxout(1:im),info,mask,owned)
if (present(mask)) then
if (size(mask) < im) then
info = -1
return
end if
end if
if (present(owned)) then
owned_ = owned
else
owned_ = .false.
end if
if (present(mask)) then
if (idxmap%is_asb()) then
do i=1, im
if (mask(i)) then
if ((1<= idxin(i)).and.(idxin(i) <= idxmap%global_rows)) then
idxout(i) = idxin(i)
else
idxout(i) = -1
end if
end if
end do
else if (idxmap%is_valid()) then
do i=1,im
if (mask(i)) then
if ((1<= idxin(i)).and.(idxin(i) <= idxmap%global_rows)) then
idxout(i) = idxin(i)
else
idxout(i) = -1
end if
end if
end do
else
idxout(1:im) = -1
info = -1
end if
else if (.not.present(mask)) then
if (idxmap%is_asb()) then
do i=1, im
if ((1<= idxin(i)).and.(idxin(i) <= idxmap%global_rows)) then
idxout(i) = idxin(i)
else
idxout(i) = -1
end if
end do
else if (idxmap%is_valid()) then
do i=1,im
if ((1<= idxin(i)).and.(idxin(i) <= idxmap%global_rows)) then
idxout(i) = idxin(i)
else
idxout(i) = -1
end if
end do
else
idxout(1:im) = -1
info = -1
end if
end if
if (is > im) info = -3
end subroutine repl_g2lv2
@ -479,12 +585,82 @@ contains
logical, intent(in), optional :: mask(:)
integer(psb_ipk_), intent(in), optional :: lidx(:)
integer(psb_ipk_) :: is, im
integer(psb_ipk_) :: is, im, i
info = 0
is = size(idxin)
im = min(is,size(idxout))
idxout(1:im) = idxin(1:im)
call idxmap%g2lip_ins(idxout(1:im),info,mask=mask,lidx=lidx)
if (present(mask)) then
if (size(mask) < im) then
info = -1
return
end if
end if
if (present(lidx)) then
if (size(lidx) < im) then
info = -1
return
end if
end if
if (idxmap%is_asb()) then
! State is wrong for this one !
idxout = -1
info = -1
else if (idxmap%is_valid()) then
if (present(lidx)) then
if (present(mask)) then
do i=1, im
if (mask(i)) then
if ((1<= idxin(i)).and.(idxin(i) <= idxmap%global_rows)) then
idxout(i) = idxin(i)
else
idxout(i) = -1
end if
end if
end do
else if (.not.present(mask)) then
do i=1, im
if ((1<= idxin(i)).and.(idxin(i) <= idxmap%global_rows)) then
idxout(i) = idxin(i)
else
idxout(i) = -1
end if
end do
end if
else if (.not.present(lidx)) then
if (present(mask)) then
do i=1, im
if (mask(i)) then
if ((1<= idxin(i)).and.(idxin(i) <= idxmap%global_rows)) then
idxout(i) = idxin(i)
else
idxout(i) = -1
end if
end if
end do
else if (.not.present(mask)) then
do i=1, im
if ((1<= idxin(i)).and.(idxin(i) <= idxmap%global_rows)) then
idxout(i) = idxin(i)
else
idxout(i) = -1
end if
end do
end if
end if
else
idxout = -1
info = -1
end if
if (is > im) info = -3
end subroutine repl_g2lv2_ins
@ -629,4 +805,25 @@ contains
end if
return
end subroutine repl_clone
subroutine repl_reinit(idxmap,info)
use psb_penv_mod
use psb_error_mod
use psb_realloc_mod
implicit none
class(psb_repl_map), intent(inout) :: idxmap
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act, nr,nc,k, nl
integer(psb_ipk_), allocatable :: idx(:),lidx(:)
character(len=20) :: name='repl_reinit'
logical, parameter :: debug=.false.
info = psb_success_
call idxmap%set_state(psb_desc_bld_)
return
end subroutine repl_reinit
end module psb_repl_map_mod

@ -97,7 +97,8 @@ module psb_s_base_vect_mod
!
! Basic info
procedure, pass(x) :: get_nrows => s_base_get_nrows
procedure, pass(x) :: sizeof => s_base_sizeof
procedure, pass(x) :: sizeof => s_base_sizeof
procedure, nopass :: get_fmt => s_base_get_fmt
!
! Set/get data from/to an external array; also
! overload assignment.
@ -550,7 +551,19 @@ contains
end function s_base_sizeof
!
!> Function base_get_fmt
!! \memberof psb_s_base_vect_type
!! \brief Format
!!
!
function s_base_get_fmt() result(res)
implicit none
character(len=5) :: res
res = 'BASE'
end function s_base_get_fmt
!
!
!

@ -46,6 +46,7 @@ module psb_s_vect_mod
contains
procedure, pass(x) :: get_nrows => s_vect_get_nrows
procedure, pass(x) :: sizeof => s_vect_sizeof
procedure, pass(x) :: get_fmt => s_vect_get_fmt
procedure, pass(x) :: dot_v => s_vect_dot_v
procedure, pass(x) :: dot_a => s_vect_dot_a
generic, public :: dot => dot_v, dot_a
@ -65,6 +66,7 @@ module psb_s_vect_mod
procedure, pass(x) :: amax => s_vect_amax
procedure, pass(x) :: asum => s_vect_asum
procedure, pass(x) :: all => s_vect_all
procedure, pass(x) :: reall => s_vect_reall
procedure, pass(x) :: zero => s_vect_zero
procedure, pass(x) :: asb => s_vect_asb
procedure, pass(x) :: sync => s_vect_sync
@ -217,6 +219,14 @@ contains
if (allocated(x%v)) res = x%v%sizeof()
end function s_vect_sizeof
function s_vect_get_fmt(x) result(res)
implicit none
class(psb_s_vect_type), intent(in) :: x
character(len=5) :: res
res = 'NULL'
if (allocated(x%v)) res = x%v%get_fmt()
end function s_vect_get_fmt
function s_vect_dot_v(n,x,y) result(res)
implicit none
class(psb_s_vect_type), intent(inout) :: x, y
@ -428,10 +438,10 @@ contains
subroutine s_vect_all(n, x, info, mold)
implicit none
integer(psb_ipk_), intent(in) :: n
integer(psb_ipk_), intent(in) :: n
class(psb_s_vect_type), intent(out) :: x
class(psb_s_base_vect_type), intent(in), optional :: mold
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(out) :: info
if (present(mold)) then
#ifdef HAVE_MOLD
@ -450,6 +460,21 @@ contains
end subroutine s_vect_all
subroutine s_vect_reall(n, x, info)
implicit none
integer(psb_ipk_), intent(in) :: n
class(psb_s_vect_type), intent(inout) :: x
integer(psb_ipk_), intent(out) :: info
info = 0
if (.not.allocated(x%v)) &
& call x%all(n,info)
if (info == 0) &
& call x%asb(n,info)
end subroutine s_vect_reall
subroutine s_vect_zero(x)
use psi_serial_mod
implicit none

@ -97,7 +97,8 @@ module psb_z_base_vect_mod
!
! Basic info
procedure, pass(x) :: get_nrows => z_base_get_nrows
procedure, pass(x) :: sizeof => z_base_sizeof
procedure, pass(x) :: sizeof => z_base_sizeof
procedure, nopass :: get_fmt => z_base_get_fmt
!
! Set/get data from/to an external array; also
! overload assignment.
@ -550,7 +551,19 @@ contains
end function z_base_sizeof
!
!> Function base_get_fmt
!! \memberof psb_z_base_vect_type
!! \brief Format
!!
!
function z_base_get_fmt() result(res)
implicit none
character(len=5) :: res
res = 'BASE'
end function z_base_get_fmt
!
!
!

@ -46,6 +46,7 @@ module psb_z_vect_mod
contains
procedure, pass(x) :: get_nrows => z_vect_get_nrows
procedure, pass(x) :: sizeof => z_vect_sizeof
procedure, pass(x) :: get_fmt => z_vect_get_fmt
procedure, pass(x) :: dot_v => z_vect_dot_v
procedure, pass(x) :: dot_a => z_vect_dot_a
generic, public :: dot => dot_v, dot_a
@ -65,6 +66,7 @@ module psb_z_vect_mod
procedure, pass(x) :: amax => z_vect_amax
procedure, pass(x) :: asum => z_vect_asum
procedure, pass(x) :: all => z_vect_all
procedure, pass(x) :: reall => z_vect_reall
procedure, pass(x) :: zero => z_vect_zero
procedure, pass(x) :: asb => z_vect_asb
procedure, pass(x) :: sync => z_vect_sync
@ -217,6 +219,14 @@ contains
if (allocated(x%v)) res = x%v%sizeof()
end function z_vect_sizeof
function z_vect_get_fmt(x) result(res)
implicit none
class(psb_z_vect_type), intent(in) :: x
character(len=5) :: res
res = 'NULL'
if (allocated(x%v)) res = x%v%get_fmt()
end function z_vect_get_fmt
function z_vect_dot_v(n,x,y) result(res)
implicit none
class(psb_z_vect_type), intent(inout) :: x, y
@ -428,10 +438,10 @@ contains
subroutine z_vect_all(n, x, info, mold)
implicit none
integer(psb_ipk_), intent(in) :: n
integer(psb_ipk_), intent(in) :: n
class(psb_z_vect_type), intent(out) :: x
class(psb_z_base_vect_type), intent(in), optional :: mold
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(out) :: info
if (present(mold)) then
#ifdef HAVE_MOLD
@ -450,6 +460,21 @@ contains
end subroutine z_vect_all
subroutine z_vect_reall(n, x, info)
implicit none
integer(psb_ipk_), intent(in) :: n
class(psb_z_vect_type), intent(inout) :: x
integer(psb_ipk_), intent(out) :: info
info = 0
if (.not.allocated(x%v)) &
& call x%all(n,info)
if (info == 0) &
& call x%asb(n,info)
end subroutine z_vect_reall
subroutine z_vect_zero(x)
use psi_serial_mod
implicit none

@ -147,83 +147,6 @@ module psi_i_mod
end subroutine psi_bld_tmpovrl
end interface
interface psi_idx_cnv
subroutine psi_idx_cnv1(nv,idxin,desc,info,mask,owned)
import :: psb_desc_type, psb_ipk_
integer(psb_ipk_), intent(in) :: nv
integer(psb_ipk_), intent(inout) :: idxin(:)
type(psb_desc_type), intent(in) :: desc
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: mask(:)
logical, intent(in), optional :: owned
end subroutine psi_idx_cnv1
subroutine psi_idx_cnv2(nv,idxin,idxout,desc,info,mask,owned)
import :: psb_desc_type, psb_ipk_
integer(psb_ipk_), intent(in) :: nv, idxin(:)
integer(psb_ipk_), intent(out) :: idxout(:)
type(psb_desc_type), intent(in) :: desc
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: mask(:)
logical, intent(in), optional :: owned
end subroutine psi_idx_cnv2
subroutine psi_idx_cnvs(idxin,idxout,desc,info,mask,owned)
import :: psb_desc_type, psb_ipk_
integer(psb_ipk_), intent(in) :: idxin
integer(psb_ipk_), intent(out) :: idxout
type(psb_desc_type), intent(in) :: desc
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: mask
logical, intent(in), optional :: owned
end subroutine psi_idx_cnvs
subroutine psi_idx_cnvs1(idxin,desc,info,mask,owned)
import :: psb_desc_type, psb_ipk_
integer(psb_ipk_), intent(inout) :: idxin
type(psb_desc_type), intent(in) :: desc
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: mask
logical, intent(in), optional :: owned
end subroutine psi_idx_cnvs1
end interface
interface psi_idx_ins_cnv
subroutine psi_idx_ins_cnv1(nv,idxin,desc,info,mask,lidx)
import :: psb_desc_type, psb_ipk_
integer(psb_ipk_), intent(in) :: nv
integer(psb_ipk_), intent(inout) :: idxin(:)
type(psb_desc_type), intent(inout) :: desc
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: mask(:)
integer(psb_ipk_), intent(in), optional :: lidx(:)
end subroutine psi_idx_ins_cnv1
subroutine psi_idx_ins_cnv2(nv,idxin,idxout,desc,info,mask,lidx)
import :: psb_desc_type, psb_ipk_
integer(psb_ipk_), intent(in) :: nv, idxin(:)
integer(psb_ipk_), intent(out) :: idxout(:)
type(psb_desc_type), intent(inout) :: desc
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: mask(:)
integer(psb_ipk_), intent(in), optional :: lidx(:)
end subroutine psi_idx_ins_cnv2
subroutine psi_idx_ins_cnvs2(idxin,idxout,desc,info,mask,lidx)
import :: psb_desc_type, psb_ipk_
integer(psb_ipk_), intent(in) :: idxin
integer(psb_ipk_), intent(out) :: idxout
type(psb_desc_type), intent(inout) :: desc
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: mask
integer(psb_ipk_), intent(in), optional :: lidx
end subroutine psi_idx_ins_cnvs2
subroutine psi_idx_ins_cnvs1(idxin,desc,info,mask,lidx)
import :: psb_desc_type, psb_ipk_
integer(psb_ipk_), intent(inout) :: idxin
type(psb_desc_type), intent(inout) :: desc
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: mask
integer(psb_ipk_), intent(in), optional :: lidx
end subroutine psi_idx_ins_cnvs1
end interface
interface psi_cnv_dsc
subroutine psi_cnv_dsc(halo_in,ovrlap_in,ext_in,cdesc, info)
import :: psb_desc_type, psb_ipk_

@ -731,16 +731,6 @@ subroutine psb_cspmv_vect(alpha,a,x,beta,y,desc_a,info,&
goto 9999
endif
ia = 1
ja = 1
ix = 1
jx = 1
iy = 1
jy = 1
ik = 1
ib = 1
if (present(doswap)) then
doswap_ = doswap
else
@ -766,6 +756,15 @@ subroutine psb_cspmv_vect(alpha,a,x,beta,y,desc_a,info,&
ncol = desc_a%get_local_cols()
lldx = x%get_nrows()
lldy = y%get_nrows()
if ((info == 0).and.(lldx<ncol)) call x%reall(ncol,info)
if ((info == 0).and.(lldy<ncol)) call y%reall(ncol,info)
if (psb_errstatus_fatal()) then
info=psb_err_from_subroutine_
ch_err='reall'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
iwork => null()
! check for presence/size of a work area
@ -795,43 +794,9 @@ subroutine psb_cspmv_vect(alpha,a,x,beta,y,desc_a,info,&
if (debug_level >= psb_debug_comp_) &
& write(debug_unit,*) me,' ',trim(name),' Allocated work ', info
! checking for matrix correctness
call psb_chkmat(m,n,ia,ja,desc_a,info,iia,jja)
if(info /= psb_success_) then
info=psb_err_from_subroutine_
ch_err='psb_chkmat'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
if (debug_level >= psb_debug_comp_) &
& write(debug_unit,*) me,' ',trim(name),' Checkmat ', info
if (trans_ == 'N') then
! Matrix is not transposed
if((ja /= ix).or.(ia /= iy)) then
! this case is not yet implemented
info = psb_err_ja_nix_ia_niy_unsupported_
call psb_errpush(info,name)
goto 9999
end if
! checking for vectors correctness
call psb_chkvect(n,ik,lldx,ix,jx,desc_a,info,iix,jjx)
if (info == psb_success_) &
& call psb_chkvect(m,ik,lldy,iy,jy,desc_a,info,iiy,jjy)
if(info /= psb_success_) then
info=psb_err_from_subroutine_
ch_err='psb_chkvect'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
if((iix /= 1).or.(iiy /= 1)) then
! this case is not yet implemented
info = psb_err_ix_n1_iy_n1_unsupported_
call psb_errpush(info,name)
goto 9999
end if
if (doswap_) then
call psi_swapdata(ior(psb_swap_send_,psb_swap_recv_),&
@ -848,31 +813,6 @@ subroutine psb_cspmv_vect(alpha,a,x,beta,y,desc_a,info,&
else
! Matrix is transposed
if((ja /= iy).or.(ia /= ix)) then
! this case is not yet implemented
info = psb_err_ja_nix_ia_niy_unsupported_
call psb_errpush(info,name)
goto 9999
end if
! checking for vectors correctness
call psb_chkvect(m,ik,lldx,ix,jx,desc_a,info,iix,jjx)
if (info == psb_success_)&
& call psb_chkvect(n,ik,lldy,iy,jy,desc_a,info,iiy,jjy)
if(info /= psb_success_) then
info=psb_err_from_subroutine_
ch_err='psb_chkvect'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
if((iix /= 1).or.(iiy /= 1)) then
! this case is not yet implemented
info = psb_err_ix_n1_iy_n1_unsupported_
call psb_errpush(info,name)
goto 9999
end if
!
! Non-empty overlap, need a buffer to hold

@ -606,15 +606,6 @@ subroutine psb_cspsv_vect(alpha,a,x,beta,y,desc_a,info,&
endif
! just this case right now
ia = 1
ja = 1
ix = 1
iy = 1
ik = 1
jx = 1
jy = 1
if (present(choice)) then
choice_ = choice
else
@ -645,10 +636,13 @@ subroutine psb_cspsv_vect(alpha,a,x,beta,y,desc_a,info,&
ncol = desc_a%get_local_cols()
lldx = x%get_nrows()
lldy = y%get_nrows()
if ((info == 0).and.(lldx<ncol)) call x%reall(ncol,info)
if ((info == 0).and.(lldy<ncol)) call y%reall(ncol,info)
if((lldx < ncol).or.(lldy < ncol)) then
info=psb_err_lld_case_not_implemented_
call psb_errpush(info,name)
if (psb_errstatus_fatal()) then
info=psb_err_from_subroutine_
ch_err='reall'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
@ -680,35 +674,6 @@ subroutine psb_cspsv_vect(alpha,a,x,beta,y,desc_a,info,&
iwork(1)=0.d0
! checking for matrix correctness
call psb_chkmat(m,m,ia,ja,desc_a,info,iia,jja)
! checking for vectors correctness
if (info == psb_success_) &
& call psb_chkvect(m,ik,lldx,ix,jx,desc_a,info,iix,jjx)
if (info == psb_success_)&
& call psb_chkvect(m,ik,lldy,iy,jy,desc_a,info,iiy,jjy)
if(info /= psb_success_) then
info=psb_err_from_subroutine_
ch_err='psb_chkvect/mat'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
if(ja /= ix) then
! this case is not yet implemented
info = psb_err_ja_nix_ia_niy_unsupported_
end if
if((iix /= 1).or.(iiy /= 1)) then
! this case is not yet implemented
info = psb_err_ix_n1_iy_n1_unsupported_
end if
if(info /= psb_success_) then
call psb_errpush(info,name)
goto 9999
end if
! Perform local triangular system solve
if (present(diag)) then
call a%spsm(alpha,x,beta,y,info,scale=scale,d=diag,trans=trans)

@ -731,16 +731,6 @@ subroutine psb_dspmv_vect(alpha,a,x,beta,y,desc_a,info,&
goto 9999
endif
ia = 1
ja = 1
ix = 1
jx = 1
iy = 1
jy = 1
ik = 1
ib = 1
if (present(doswap)) then
doswap_ = doswap
else
@ -766,6 +756,15 @@ subroutine psb_dspmv_vect(alpha,a,x,beta,y,desc_a,info,&
ncol = desc_a%get_local_cols()
lldx = x%get_nrows()
lldy = y%get_nrows()
if ((info == 0).and.(lldx<ncol)) call x%reall(ncol,info)
if ((info == 0).and.(lldy<ncol)) call y%reall(ncol,info)
if (psb_errstatus_fatal()) then
info=psb_err_from_subroutine_
ch_err='reall'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
iwork => null()
! check for presence/size of a work area
@ -795,43 +794,9 @@ subroutine psb_dspmv_vect(alpha,a,x,beta,y,desc_a,info,&
if (debug_level >= psb_debug_comp_) &
& write(debug_unit,*) me,' ',trim(name),' Allocated work ', info
! checking for matrix correctness
call psb_chkmat(m,n,ia,ja,desc_a,info,iia,jja)
if(info /= psb_success_) then
info=psb_err_from_subroutine_
ch_err='psb_chkmat'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
if (debug_level >= psb_debug_comp_) &
& write(debug_unit,*) me,' ',trim(name),' Checkmat ', info
if (trans_ == 'N') then
! Matrix is not transposed
if((ja /= ix).or.(ia /= iy)) then
! this case is not yet implemented
info = psb_err_ja_nix_ia_niy_unsupported_
call psb_errpush(info,name)
goto 9999
end if
! checking for vectors correctness
call psb_chkvect(n,ik,lldx,ix,jx,desc_a,info,iix,jjx)
if (info == psb_success_) &
& call psb_chkvect(m,ik,lldy,iy,jy,desc_a,info,iiy,jjy)
if(info /= psb_success_) then
info=psb_err_from_subroutine_
ch_err='psb_chkvect'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
if((iix /= 1).or.(iiy /= 1)) then
! this case is not yet implemented
info = psb_err_ix_n1_iy_n1_unsupported_
call psb_errpush(info,name)
goto 9999
end if
if (doswap_) then
call psi_swapdata(ior(psb_swap_send_,psb_swap_recv_),&
@ -848,31 +813,6 @@ subroutine psb_dspmv_vect(alpha,a,x,beta,y,desc_a,info,&
else
! Matrix is transposed
if((ja /= iy).or.(ia /= ix)) then
! this case is not yet implemented
info = psb_err_ja_nix_ia_niy_unsupported_
call psb_errpush(info,name)
goto 9999
end if
! checking for vectors correctness
call psb_chkvect(m,ik,lldx,ix,jx,desc_a,info,iix,jjx)
if (info == psb_success_)&
& call psb_chkvect(n,ik,lldy,iy,jy,desc_a,info,iiy,jjy)
if(info /= psb_success_) then
info=psb_err_from_subroutine_
ch_err='psb_chkvect'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
if((iix /= 1).or.(iiy /= 1)) then
! this case is not yet implemented
info = psb_err_ix_n1_iy_n1_unsupported_
call psb_errpush(info,name)
goto 9999
end if
!
! Non-empty overlap, need a buffer to hold

@ -606,15 +606,6 @@ subroutine psb_dspsv_vect(alpha,a,x,beta,y,desc_a,info,&
endif
! just this case right now
ia = 1
ja = 1
ix = 1
iy = 1
ik = 1
jx = 1
jy = 1
if (present(choice)) then
choice_ = choice
else
@ -645,10 +636,13 @@ subroutine psb_dspsv_vect(alpha,a,x,beta,y,desc_a,info,&
ncol = desc_a%get_local_cols()
lldx = x%get_nrows()
lldy = y%get_nrows()
if ((info == 0).and.(lldx<ncol)) call x%reall(ncol,info)
if ((info == 0).and.(lldy<ncol)) call y%reall(ncol,info)
if((lldx < ncol).or.(lldy < ncol)) then
info=psb_err_lld_case_not_implemented_
call psb_errpush(info,name)
if (psb_errstatus_fatal()) then
info=psb_err_from_subroutine_
ch_err='reall'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
@ -680,35 +674,6 @@ subroutine psb_dspsv_vect(alpha,a,x,beta,y,desc_a,info,&
iwork(1)=0.d0
! checking for matrix correctness
call psb_chkmat(m,m,ia,ja,desc_a,info,iia,jja)
! checking for vectors correctness
if (info == psb_success_) &
& call psb_chkvect(m,ik,lldx,ix,jx,desc_a,info,iix,jjx)
if (info == psb_success_)&
& call psb_chkvect(m,ik,lldy,iy,jy,desc_a,info,iiy,jjy)
if(info /= psb_success_) then
info=psb_err_from_subroutine_
ch_err='psb_chkvect/mat'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
if(ja /= ix) then
! this case is not yet implemented
info = psb_err_ja_nix_ia_niy_unsupported_
end if
if((iix /= 1).or.(iiy /= 1)) then
! this case is not yet implemented
info = psb_err_ix_n1_iy_n1_unsupported_
end if
if(info /= psb_success_) then
call psb_errpush(info,name)
goto 9999
end if
! Perform local triangular system solve
if (present(diag)) then
call a%spsm(alpha,x,beta,y,info,scale=scale,d=diag,trans=trans)

@ -731,16 +731,6 @@ subroutine psb_sspmv_vect(alpha,a,x,beta,y,desc_a,info,&
goto 9999
endif
ia = 1
ja = 1
ix = 1
jx = 1
iy = 1
jy = 1
ik = 1
ib = 1
if (present(doswap)) then
doswap_ = doswap
else
@ -766,6 +756,15 @@ subroutine psb_sspmv_vect(alpha,a,x,beta,y,desc_a,info,&
ncol = desc_a%get_local_cols()
lldx = x%get_nrows()
lldy = y%get_nrows()
if ((info == 0).and.(lldx<ncol)) call x%reall(ncol,info)
if ((info == 0).and.(lldy<ncol)) call y%reall(ncol,info)
if (psb_errstatus_fatal()) then
info=psb_err_from_subroutine_
ch_err='reall'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
iwork => null()
! check for presence/size of a work area
@ -795,43 +794,9 @@ subroutine psb_sspmv_vect(alpha,a,x,beta,y,desc_a,info,&
if (debug_level >= psb_debug_comp_) &
& write(debug_unit,*) me,' ',trim(name),' Allocated work ', info
! checking for matrix correctness
call psb_chkmat(m,n,ia,ja,desc_a,info,iia,jja)
if(info /= psb_success_) then
info=psb_err_from_subroutine_
ch_err='psb_chkmat'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
if (debug_level >= psb_debug_comp_) &
& write(debug_unit,*) me,' ',trim(name),' Checkmat ', info
if (trans_ == 'N') then
! Matrix is not transposed
if((ja /= ix).or.(ia /= iy)) then
! this case is not yet implemented
info = psb_err_ja_nix_ia_niy_unsupported_
call psb_errpush(info,name)
goto 9999
end if
! checking for vectors correctness
call psb_chkvect(n,ik,lldx,ix,jx,desc_a,info,iix,jjx)
if (info == psb_success_) &
& call psb_chkvect(m,ik,lldy,iy,jy,desc_a,info,iiy,jjy)
if(info /= psb_success_) then
info=psb_err_from_subroutine_
ch_err='psb_chkvect'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
if((iix /= 1).or.(iiy /= 1)) then
! this case is not yet implemented
info = psb_err_ix_n1_iy_n1_unsupported_
call psb_errpush(info,name)
goto 9999
end if
if (doswap_) then
call psi_swapdata(ior(psb_swap_send_,psb_swap_recv_),&
@ -848,31 +813,6 @@ subroutine psb_sspmv_vect(alpha,a,x,beta,y,desc_a,info,&
else
! Matrix is transposed
if((ja /= iy).or.(ia /= ix)) then
! this case is not yet implemented
info = psb_err_ja_nix_ia_niy_unsupported_
call psb_errpush(info,name)
goto 9999
end if
! checking for vectors correctness
call psb_chkvect(m,ik,lldx,ix,jx,desc_a,info,iix,jjx)
if (info == psb_success_)&
& call psb_chkvect(n,ik,lldy,iy,jy,desc_a,info,iiy,jjy)
if(info /= psb_success_) then
info=psb_err_from_subroutine_
ch_err='psb_chkvect'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
if((iix /= 1).or.(iiy /= 1)) then
! this case is not yet implemented
info = psb_err_ix_n1_iy_n1_unsupported_
call psb_errpush(info,name)
goto 9999
end if
!
! Non-empty overlap, need a buffer to hold

@ -606,15 +606,6 @@ subroutine psb_sspsv_vect(alpha,a,x,beta,y,desc_a,info,&
endif
! just this case right now
ia = 1
ja = 1
ix = 1
iy = 1
ik = 1
jx = 1
jy = 1
if (present(choice)) then
choice_ = choice
else
@ -645,10 +636,13 @@ subroutine psb_sspsv_vect(alpha,a,x,beta,y,desc_a,info,&
ncol = desc_a%get_local_cols()
lldx = x%get_nrows()
lldy = y%get_nrows()
if ((info == 0).and.(lldx<ncol)) call x%reall(ncol,info)
if ((info == 0).and.(lldy<ncol)) call y%reall(ncol,info)
if((lldx < ncol).or.(lldy < ncol)) then
info=psb_err_lld_case_not_implemented_
call psb_errpush(info,name)
if (psb_errstatus_fatal()) then
info=psb_err_from_subroutine_
ch_err='reall'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
@ -680,35 +674,6 @@ subroutine psb_sspsv_vect(alpha,a,x,beta,y,desc_a,info,&
iwork(1)=0.d0
! checking for matrix correctness
call psb_chkmat(m,m,ia,ja,desc_a,info,iia,jja)
! checking for vectors correctness
if (info == psb_success_) &
& call psb_chkvect(m,ik,lldx,ix,jx,desc_a,info,iix,jjx)
if (info == psb_success_)&
& call psb_chkvect(m,ik,lldy,iy,jy,desc_a,info,iiy,jjy)
if(info /= psb_success_) then
info=psb_err_from_subroutine_
ch_err='psb_chkvect/mat'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
if(ja /= ix) then
! this case is not yet implemented
info = psb_err_ja_nix_ia_niy_unsupported_
end if
if((iix /= 1).or.(iiy /= 1)) then
! this case is not yet implemented
info = psb_err_ix_n1_iy_n1_unsupported_
end if
if(info /= psb_success_) then
call psb_errpush(info,name)
goto 9999
end if
! Perform local triangular system solve
if (present(diag)) then
call a%spsm(alpha,x,beta,y,info,scale=scale,d=diag,trans=trans)

@ -731,16 +731,6 @@ subroutine psb_zspmv_vect(alpha,a,x,beta,y,desc_a,info,&
goto 9999
endif
ia = 1
ja = 1
ix = 1
jx = 1
iy = 1
jy = 1
ik = 1
ib = 1
if (present(doswap)) then
doswap_ = doswap
else
@ -766,6 +756,15 @@ subroutine psb_zspmv_vect(alpha,a,x,beta,y,desc_a,info,&
ncol = desc_a%get_local_cols()
lldx = x%get_nrows()
lldy = y%get_nrows()
if ((info == 0).and.(lldx<ncol)) call x%reall(ncol,info)
if ((info == 0).and.(lldy<ncol)) call y%reall(ncol,info)
if (psb_errstatus_fatal()) then
info=psb_err_from_subroutine_
ch_err='reall'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
iwork => null()
! check for presence/size of a work area
@ -795,43 +794,9 @@ subroutine psb_zspmv_vect(alpha,a,x,beta,y,desc_a,info,&
if (debug_level >= psb_debug_comp_) &
& write(debug_unit,*) me,' ',trim(name),' Allocated work ', info
! checking for matrix correctness
call psb_chkmat(m,n,ia,ja,desc_a,info,iia,jja)
if(info /= psb_success_) then
info=psb_err_from_subroutine_
ch_err='psb_chkmat'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
if (debug_level >= psb_debug_comp_) &
& write(debug_unit,*) me,' ',trim(name),' Checkmat ', info
if (trans_ == 'N') then
! Matrix is not transposed
if((ja /= ix).or.(ia /= iy)) then
! this case is not yet implemented
info = psb_err_ja_nix_ia_niy_unsupported_
call psb_errpush(info,name)
goto 9999
end if
! checking for vectors correctness
call psb_chkvect(n,ik,lldx,ix,jx,desc_a,info,iix,jjx)
if (info == psb_success_) &
& call psb_chkvect(m,ik,lldy,iy,jy,desc_a,info,iiy,jjy)
if(info /= psb_success_) then
info=psb_err_from_subroutine_
ch_err='psb_chkvect'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
if((iix /= 1).or.(iiy /= 1)) then
! this case is not yet implemented
info = psb_err_ix_n1_iy_n1_unsupported_
call psb_errpush(info,name)
goto 9999
end if
if (doswap_) then
call psi_swapdata(ior(psb_swap_send_,psb_swap_recv_),&
@ -848,31 +813,6 @@ subroutine psb_zspmv_vect(alpha,a,x,beta,y,desc_a,info,&
else
! Matrix is transposed
if((ja /= iy).or.(ia /= ix)) then
! this case is not yet implemented
info = psb_err_ja_nix_ia_niy_unsupported_
call psb_errpush(info,name)
goto 9999
end if
! checking for vectors correctness
call psb_chkvect(m,ik,lldx,ix,jx,desc_a,info,iix,jjx)
if (info == psb_success_)&
& call psb_chkvect(n,ik,lldy,iy,jy,desc_a,info,iiy,jjy)
if(info /= psb_success_) then
info=psb_err_from_subroutine_
ch_err='psb_chkvect'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
if((iix /= 1).or.(iiy /= 1)) then
! this case is not yet implemented
info = psb_err_ix_n1_iy_n1_unsupported_
call psb_errpush(info,name)
goto 9999
end if
!
! Non-empty overlap, need a buffer to hold

@ -606,15 +606,6 @@ subroutine psb_zspsv_vect(alpha,a,x,beta,y,desc_a,info,&
endif
! just this case right now
ia = 1
ja = 1
ix = 1
iy = 1
ik = 1
jx = 1
jy = 1
if (present(choice)) then
choice_ = choice
else
@ -645,10 +636,13 @@ subroutine psb_zspsv_vect(alpha,a,x,beta,y,desc_a,info,&
ncol = desc_a%get_local_cols()
lldx = x%get_nrows()
lldy = y%get_nrows()
if ((info == 0).and.(lldx<ncol)) call x%reall(ncol,info)
if ((info == 0).and.(lldy<ncol)) call y%reall(ncol,info)
if((lldx < ncol).or.(lldy < ncol)) then
info=psb_err_lld_case_not_implemented_
call psb_errpush(info,name)
if (psb_errstatus_fatal()) then
info=psb_err_from_subroutine_
ch_err='reall'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
@ -680,35 +674,6 @@ subroutine psb_zspsv_vect(alpha,a,x,beta,y,desc_a,info,&
iwork(1)=0.d0
! checking for matrix correctness
call psb_chkmat(m,m,ia,ja,desc_a,info,iia,jja)
! checking for vectors correctness
if (info == psb_success_) &
& call psb_chkvect(m,ik,lldx,ix,jx,desc_a,info,iix,jjx)
if (info == psb_success_)&
& call psb_chkvect(m,ik,lldy,iy,jy,desc_a,info,iiy,jjy)
if(info /= psb_success_) then
info=psb_err_from_subroutine_
ch_err='psb_chkvect/mat'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
if(ja /= ix) then
! this case is not yet implemented
info = psb_err_ja_nix_ia_niy_unsupported_
end if
if((iix /= 1).or.(iiy /= 1)) then
! this case is not yet implemented
info = psb_err_ix_n1_iy_n1_unsupported_
end if
if(info /= psb_success_) then
call psb_errpush(info,name)
goto 9999
end if
! Perform local triangular system solve
if (present(diag)) then
call a%spsm(alpha,x,beta,y,info,scale=scale,d=diag,trans=trans)

@ -2630,8 +2630,12 @@ subroutine psb_c_coo_csput(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl)
! Build phase. Must handle reallocations in a sensible way.
if (isza < (nza+nz)) then
call a%reallocate(max(nza+nz,int(1.5*isza)))
isza = a%get_size()
endif
isza = a%get_size()
if (isza < (nza+nz)) then
info = psb_err_alloc_dealloc_; call psb_errpush(info,name)
goto 9999
end if
call psb_inner_ins(nz,ia,ja,val,nza,a%ia,a%ja,a%val,isza,&
& imin,imax,jmin,jmax,info,gtl)
@ -2696,10 +2700,6 @@ contains
ic = gtl(ic)
if ((ir >=imin).and.(ir<=imax).and.(ic>=jmin).and.(ic<=jmax)) then
nza = nza + 1
if (nza > maxsz) then
info = -91
return
endif
ia1(nza) = ir
ia2(nza) = ic
aspk(nza) = val(i)
@ -2713,10 +2713,6 @@ contains
ic = ja(i)
if ((ir >=imin).and.(ir<=imax).and.(ic>=jmin).and.(ic<=jmax)) then
nza = nza + 1
if (nza > maxsz) then
info = -92
return
endif
ia1(nza) = ir
ia2(nza) = ic
aspk(nza) = val(i)

@ -2630,8 +2630,12 @@ subroutine psb_d_coo_csput(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl)
! Build phase. Must handle reallocations in a sensible way.
if (isza < (nza+nz)) then
call a%reallocate(max(nza+nz,int(1.5*isza)))
isza = a%get_size()
endif
isza = a%get_size()
if (isza < (nza+nz)) then
info = psb_err_alloc_dealloc_; call psb_errpush(info,name)
goto 9999
end if
call psb_inner_ins(nz,ia,ja,val,nza,a%ia,a%ja,a%val,isza,&
& imin,imax,jmin,jmax,info,gtl)
@ -2696,10 +2700,6 @@ contains
ic = gtl(ic)
if ((ir >=imin).and.(ir<=imax).and.(ic>=jmin).and.(ic<=jmax)) then
nza = nza + 1
if (nza > maxsz) then
info = -91
return
endif
ia1(nza) = ir
ia2(nza) = ic
aspk(nza) = val(i)
@ -2713,10 +2713,6 @@ contains
ic = ja(i)
if ((ir >=imin).and.(ir<=imax).and.(ic>=jmin).and.(ic<=jmax)) then
nza = nza + 1
if (nza > maxsz) then
info = -92
return
endif
ia1(nza) = ir
ia2(nza) = ic
aspk(nza) = val(i)
@ -2729,7 +2725,7 @@ contains
subroutine d_coo_srch_upd(nz,ia,ja,val,a,&
& imin,imax,jmin,jmax,info,gtl)
use psb_const_mod
use psb_realloc_mod
use psb_string_mod
@ -3416,6 +3412,7 @@ subroutine psb_d_fix_coo_inner(nzin,dupl,ia,ja,val,nzout,info,idir)
use psb_d_base_mat_mod, psb_protect_name => psb_d_fix_coo_inner
use psb_string_mod
use psb_ip_reord_mod
use psb_sort_mod
implicit none
integer(psb_ipk_), intent(in) :: nzin, dupl
@ -3426,10 +3423,12 @@ subroutine psb_d_fix_coo_inner(nzin,dupl,ia,ja,val,nzout,info,idir)
!locals
integer(psb_ipk_), allocatable :: iaux(:)
integer(psb_ipk_) :: nza, nzl,iret,idir_, dupl_
integer(psb_ipk_) :: i,j, irw, icl, err_act
integer(psb_ipk_) :: i,j, irw, icl, err_act, ixp,ki,kx
integer(psb_ipk_) :: debug_level, debug_unit
integer(psb_ipk_) :: ierr(5)
character(len=20) :: name = 'psb_fixcoo'
real(psb_dpk_), allocatable :: vtx(:)
integer(psb_ipk_), allocatable :: itx(:), jtx(:)
info = psb_success_
@ -3459,6 +3458,7 @@ subroutine psb_d_fix_coo_inner(nzin,dupl,ia,ja,val,nzout,info,idir)
case(0) ! Row major order
call msort_up(nzin,ia(1:),iaux(1:),iret)
if (iret == 0) &
& call psb_ip_reord(nzin,val,ia,ja,iaux)
@ -3473,7 +3473,7 @@ subroutine psb_d_fix_coo_inner(nzin,dupl,ia,ja,val,nzout,info,idir)
call msort_up(nzl,ja(i:),iaux(1:),iret)
if (iret == 0) &
& call psb_ip_reord(nzl,val(i:i+nzl-1),&
& ia(i:i+nzl-1),ja(i:i+nzl-1),iaux)
& ja(i:i+nzl-1),iaux)
i = j
enddo
@ -3538,7 +3538,6 @@ subroutine psb_d_fix_coo_inner(nzin,dupl,ia,ja,val,nzout,info,idir)
info =-7
end select
if(debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name),': end second loop'

@ -2630,8 +2630,12 @@ subroutine psb_s_coo_csput(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl)
! Build phase. Must handle reallocations in a sensible way.
if (isza < (nza+nz)) then
call a%reallocate(max(nza+nz,int(1.5*isza)))
isza = a%get_size()
endif
isza = a%get_size()
if (isza < (nza+nz)) then
info = psb_err_alloc_dealloc_; call psb_errpush(info,name)
goto 9999
end if
call psb_inner_ins(nz,ia,ja,val,nza,a%ia,a%ja,a%val,isza,&
& imin,imax,jmin,jmax,info,gtl)
@ -2696,10 +2700,6 @@ contains
ic = gtl(ic)
if ((ir >=imin).and.(ir<=imax).and.(ic>=jmin).and.(ic<=jmax)) then
nza = nza + 1
if (nza > maxsz) then
info = -91
return
endif
ia1(nza) = ir
ia2(nza) = ic
aspk(nza) = val(i)
@ -2713,10 +2713,6 @@ contains
ic = ja(i)
if ((ir >=imin).and.(ir<=imax).and.(ic>=jmin).and.(ic<=jmax)) then
nza = nza + 1
if (nza > maxsz) then
info = -92
return
endif
ia1(nza) = ir
ia2(nza) = ic
aspk(nza) = val(i)

@ -2630,8 +2630,12 @@ subroutine psb_z_coo_csput(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl)
! Build phase. Must handle reallocations in a sensible way.
if (isza < (nza+nz)) then
call a%reallocate(max(nza+nz,int(1.5*isza)))
isza = a%get_size()
endif
isza = a%get_size()
if (isza < (nza+nz)) then
info = psb_err_alloc_dealloc_; call psb_errpush(info,name)
goto 9999
end if
call psb_inner_ins(nz,ia,ja,val,nza,a%ia,a%ja,a%val,isza,&
& imin,imax,jmin,jmax,info,gtl)
@ -2696,10 +2700,6 @@ contains
ic = gtl(ic)
if ((ir >=imin).and.(ir<=imax).and.(ic>=jmin).and.(ic<=jmax)) then
nza = nza + 1
if (nza > maxsz) then
info = -91
return
endif
ia1(nza) = ir
ia2(nza) = ic
aspk(nza) = val(i)
@ -2713,10 +2713,6 @@ contains
ic = ja(i)
if ((ir >=imin).and.(ir<=imax).and.(ic>=jmin).and.(ic<=jmax)) then
nza = nza + 1
if (nza > maxsz) then
info = -92
return
endif
ia1(nza) = ir
ia2(nza) = ic
aspk(nza) = val(i)

@ -6,7 +6,7 @@ FOBJS = psb_sallc.o psb_sasb.o \
psb_dfree.o psb_dins.o \
psb_cdall.o psb_cdals.o psb_cdalv.o psb_cd_inloc.o psb_cdins.o psb_cdprt.o \
psb_cdren.o psb_cdrep.o psb_get_overlap.o psb_cd_lstext.o\
psb_cdcpy.o psb_cd_reinit.o psb_cd_switch_ovl_indxmap.o\
psb_cdcpy.o psb_cd_reinit.o psb_cd_switch_ovl_indxmap.o psb_cd_clone.o\
psb_dspalloc.o psb_dspasb.o \
psb_dspfree.o psb_dspins.o psb_dsprn.o \
psb_sspalloc.o psb_sspasb.o \

@ -355,7 +355,7 @@ Subroutine psb_ccdbldext(a,desc_a,novr,desc_ov,info, extype)
end If
idx = halo(counter+psb_elem_recv_+j)
call desc_ov%indxmap%l2g(idx,gidx,info)
call desc_ov%l2g(idx,gidx,info)
If (gidx < 0) then
info=-3
call psb_errpush(info,name)
@ -399,7 +399,7 @@ 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%indxmap%l2g(idx,gidx,info)
call desc_ov%l2g(idx,gidx,info)
If (gidx < 0) then
info=-3
call psb_errpush(info,name)
@ -435,7 +435,7 @@ Subroutine psb_ccdbldext(a,desc_a,novr,desc_ov,info, extype)
call psb_errpush(info,name,a_err='psb_ensure_size')
goto 9999
end if
call desc_ov%indxmap%l2g(icol(1:n_elem),&
call desc_ov%l2g(icol(1:n_elem),&
& works(idxs+tot_elem+1:idxs+tot_elem+n_elem),&
& info)
@ -523,7 +523,7 @@ Subroutine psb_ccdbldext(a,desc_a,novr,desc_ov,info, extype)
& write(debug_unit,*) me,' ',trim(name),&
& ': going for first idx_cnv', desc_ov%indxmap%get_state()
call psi_idx_cnv(iszr,workr,maskr,desc_ov,info)
call desc_ov%indxmap%g2l(workr(1:iszr),maskr(1:iszr),info)
iszs = count(maskr(1:iszr)<=0)
if (iszs > size(works)) call psb_realloc(iszs,works,info)
j = 0
@ -543,7 +543,7 @@ Subroutine psb_ccdbldext(a,desc_a,novr,desc_ov,info, extype)
if (debug_level >= psb_debug_outer_) &
& write(debug_unit,*) me,' ',trim(name),&
& ': going for fnd_owner', desc_ov%indxmap%get_state()
call psi_fnd_owner(iszs,works,temp,desc_a,info)
call desc_a%fnd_owner(works(1:iszs),temp,info)
n_col = desc_ov%get_local_cols()
if (debug_level >= psb_debug_outer_) &
@ -553,7 +553,7 @@ Subroutine psb_ccdbldext(a,desc_a,novr,desc_ov,info, extype)
do i=1,iszs
idx = works(i)
n_col = desc_ov%get_local_cols()
call psi_idx_ins_cnv(idx,lidx,desc_ov,info)
call desc_ov%indxmap%g2l_ins(idx,lidx,info)
if (desc_ov%get_local_cols() > n_col ) then
!
! This is a new index. Assigning a local index as
@ -611,7 +611,6 @@ Subroutine psb_ccdbldext(a,desc_a,novr,desc_ov,info, extype)
End If
End Do
select case(extype_)
case(psb_ovt_xhal_)
!

@ -0,0 +1,90 @@
subroutine psb_cd_clone(desc, desc_out, info)
use psb_error_mod
use psb_penv_mod
use psb_realloc_mod
use psb_desc_mod, psb_protect_name => psb_cd_clone
implicit none
!....parameters...
class(psb_desc_type), intent(inout), target :: desc
class(psb_desc_type), intent(inout) :: desc_out
integer(psb_ipk_), intent(out) :: info
!locals
integer(psb_ipk_) :: np,me,ictxt, err_act
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
if (psb_get_errstatus() /= 0) return
info = psb_success_
call psb_erractionsave(err_act)
name = 'psb_cdcpy'
if (desc%is_valid()) then
ictxt = desc%get_context()
! check on blacs grid
call psb_info(ictxt, me, np)
if (debug_level >= psb_debug_ext_) &
& write(debug_unit,*) me,' ',trim(name),': Entered'
if (np == -1) then
info = psb_err_context_error_
call psb_errpush(info,name)
goto 9999
endif
desc_out%base_desc => desc%base_desc
if (info == psb_success_)&
& call psb_safe_ab_cpy(desc%halo_index,desc_out%halo_index,info)
if (info == psb_success_)&
& call psb_safe_ab_cpy(desc%ext_index,desc_out%ext_index,info)
if (info == psb_success_)&
& call psb_safe_ab_cpy(desc%ovrlap_index,&
& desc_out%ovrlap_index,info)
if (info == psb_success_)&
& call psb_safe_ab_cpy(desc%bnd_elem,desc_out%bnd_elem,info)
if (info == psb_success_)&
& call psb_safe_ab_cpy(desc%ovrlap_elem,desc_out%ovrlap_elem,info)
if (info == psb_success_)&
& call psb_safe_ab_cpy(desc%ovr_mst_idx,desc_out%ovr_mst_idx,info)
if (info == psb_success_)&
& call psb_safe_ab_cpy(desc%lprm,desc_out%lprm,info)
if (info == psb_success_)&
& call psb_safe_ab_cpy(desc%idx_space,desc_out%idx_space,info)
!!$ if ((info == psb_success_).and.(allocated(desc%indxmap))) &
!!$ & call desc%indxmap%clone(desc_out%indxmap,info)
!!$ associate(indxin => desc%indxmap)
!!$ if ((info == psb_success_).and.(allocated(desc%indxmap))) &
!!$ & call indxin%clone(desc_out%indxmap,info)
!!$ end associate
if ((info == psb_success_).and.(allocated(desc%indxmap))) &
& allocate(desc_out%indxmap,source=desc%indxmap,stat=info)
else
call desc_out%free(info)
end if
if (info /= psb_success_) then
info = psb_err_from_subroutine_
call psb_errpush(info,name)
goto 9999
endif
if (debug_level >= psb_debug_ext_) &
& write(debug_unit,*) me,' ',trim(name),': Done'
call psb_erractionrestore(err_act)
return
9999 continue
call psb_erractionrestore(err_act)
if (err_act == psb_act_ret_) then
return
else
call psb_error(ictxt)
end if
return
end subroutine psb_cd_clone

@ -235,7 +235,7 @@ subroutine psb_cd_inloc(v, ictxt, desc, info, globalcheck,idx)
end do
end if
end if
if (idx(1) == -1) then
if (ix(1) == -1) then
do i=1, loc_row
ix(i) = i
end do

@ -68,6 +68,7 @@ Subroutine psb_cd_reinit(desc,info)
call psb_move_alloc(tmp_ovr,desc%ovrlap_index,info)
call psb_move_alloc(tmp_halo,desc%halo_index,info)
call psb_move_alloc(tmp_ext,desc%ext_index,info)
call desc%indxmap%reinit(info)
call psb_cd_set_bld(desc,info)
if (debug_level >= psb_debug_outer_) &

@ -55,7 +55,6 @@ subroutine psb_cdinsrc(nz,ia,ja,desc_a,info,ila,jla)
integer(psb_ipk_), intent(in) :: nz,ia(:),ja(:)
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), optional, intent(out) :: ila(:), jla(:)
!LOCALS.....
integer(psb_ipk_) :: ictxt,dectype,mglob, nglob
@ -69,6 +68,12 @@ subroutine psb_cdinsrc(nz,ia,ja,desc_a,info,ila,jla)
info = psb_success_
name = 'psb_cdins'
call psb_erractionsave(err_act)
if (.not.desc_a%is_bld()) then
info = psb_err_invalid_cd_state_
call psb_errpush(info,name)
goto 9999
endif
ictxt = desc_a%get_context()
dectype = desc_a%get_dectype()
@ -79,12 +84,6 @@ subroutine psb_cdinsrc(nz,ia,ja,desc_a,info,ila,jla)
call psb_info(ictxt, me, np)
if (.not.desc_a%is_bld()) then
info = psb_err_invalid_cd_state_
call psb_errpush(info,name)
goto 9999
endif
if (nz < 0) then
info = 1111
call psb_errpush(info,name)
@ -119,23 +118,25 @@ subroutine psb_cdinsrc(nz,ia,ja,desc_a,info,ila,jla)
end if
if (present(ila).and.present(jla)) then
call psi_idx_cnv(nz,ia,ila,desc_a,info,owned=.true.)
call desc_a%indxmap%g2l(ia(1:nz),ila(1:nz),info,owned=.true.)
if (info == psb_success_) &
& call psb_cdins(nz,ja,desc_a,info,jla=jla,mask=(ila(1:nz)>0))
& call desc_a%indxmap%g2l_ins(ja(1:nz),jla(1:nz),info,mask=(ila(1:nz)>0))
else
if (present(ila).or.present(jla)) then
write(psb_err_unit,*) 'Inconsistent call : ',present(ila),present(jla)
endif
allocate(ila_(nz),stat=info)
allocate(ila_(nz),jla_(nz),stat=info)
if (info /= psb_success_) then
info = psb_err_alloc_dealloc_
call psb_errpush(info,name)
goto 9999
end if
call psi_idx_cnv(nz,ia,ila_,desc_a,info,owned=.true.)
if (info == psb_success_) &
& call psb_cdins(nz,ja,desc_a,info,mask=(ila_(1:nz)>0))
deallocate(ila_)
call desc_a%indxmap%g2l(ia(1:nz),ila_(1:nz),info,owned=.true.)
if (info == psb_success_) then
jla_(1:nz) = ja(1:nz)
call desc_a%indxmap%g2lip_ins(jla_(1:nz),info,mask=(ila_(1:nz)>0))
end if
deallocate(ila_,jla_,stat=info)
end if
if (info /= psb_success_) goto 9999
call psb_erractionrestore(err_act)
@ -190,14 +191,19 @@ subroutine psb_cdinsc(nz,ja,desc,info,jla,mask,lidx)
logical, parameter :: debug=.false.
integer(psb_ipk_), parameter :: relocsz=200
integer(psb_ipk_), allocatable :: ila_(:), jla_(:)
logical, allocatable, target :: mask__(:)
logical, pointer :: mask_(:)
character(len=20) :: name
info = psb_success_
name = 'psb_cdins'
call psb_erractionsave(err_act)
if (.not.desc%is_bld()) then
info = psb_err_invalid_cd_state_
call psb_errpush(info,name)
goto 9999
endif
ictxt = desc%get_context()
dectype = desc%get_dectype()
mglob = desc%get_global_rows()
@ -207,12 +213,6 @@ subroutine psb_cdinsc(nz,ja,desc,info,jla,mask,lidx)
call psb_info(ictxt, me, np)
if (.not.desc%is_bld()) then
info = psb_err_invalid_cd_state_
call psb_errpush(info,name)
goto 9999
endif
if (nz < 0) then
info = 1111
call psb_errpush(info,name)
@ -246,15 +246,10 @@ subroutine psb_cdinsc(nz,ja,desc,info,jla,mask,lidx)
call psb_errpush(info,name)
goto 9999
end if
mask_ => mask
else
allocate(mask__(nz))
mask_ => mask__
mask_ = .true.
end if
if (present(jla)) then
call psi_idx_ins_cnv(nz,ja,jla,desc,info,mask=mask_,lidx=lidx)
call desc%indxmap%g2l_ins(ja(1:nz),jla(1:nz),info,mask=mask,lidx=lidx)
else
allocate(jla_(nz),stat=info)
if (info /= psb_success_) then
@ -262,7 +257,7 @@ subroutine psb_cdinsc(nz,ja,desc,info,jla,mask,lidx)
call psb_errpush(info,name)
goto 9999
end if
call psi_idx_ins_cnv(nz,ja,jla_,desc,info,mask=mask_,lidx=lidx)
call desc%indxmap%g2l_ins(ja(1:nz),jla_(1:nz),info,mask=mask,lidx=lidx)
deallocate(jla_)
end if

@ -78,8 +78,8 @@ subroutine psb_cinsvi(m, irw, val, x, desc_a, info, dupl,local)
call psb_erractionsave(err_act)
name = 'psb_cinsvi'
if (.not.psb_is_ok_desc(desc_a)) then
int_err(1)=3110
if (.not.desc_a%is_ok()) then
info = psb_err_invalid_cd_state_
call psb_errpush(info,name)
return
end if
@ -100,11 +100,6 @@ subroutine psb_cinsvi(m, irw, val, x, desc_a, info, dupl,local)
int_err(2) = m
call psb_errpush(info,name,int_err)
goto 9999
else if (.not.psb_is_ok_desc(desc_a)) then
info = psb_err_input_matrix_unassembled_
int_err(1) = desc_a%get_dectype()
call psb_errpush(info,name,int_err)
goto 9999
else if (size(x, dim=1) < desc_a%get_local_rows()) then
info = 310
int_err(1) = 5
@ -139,7 +134,7 @@ subroutine psb_cinsvi(m, irw, val, x, desc_a, info, dupl,local)
if (local_) then
irl(1:m) = irw(1:m)
else
call psi_idx_cnv(m,irw,irl,desc_a,info,owned=.true.)
call desc_a%indxmap%g2l(irw(1:m),irl(1:m),info,owned=.true.)
end if
select case(dupl_)
case(psb_dupl_ovwrt_)
@ -285,7 +280,7 @@ subroutine psb_cins_vect(m, irw, val, x, desc_a, info, dupl,local)
if (local_) then
irl(1:m) = irw(1:m)
else
call psi_idx_cnv(m,irw,irl,desc_a,info,owned=.true.)
call desc_a%indxmap%g2l(irw(1:m),irl(1:m),info,owned=.true.)
end if
call x%ins(m,irl,val,dupl_,info)
if (info /= 0) then
@ -405,7 +400,7 @@ subroutine psb_cins_vect_r2(m, irw, val, x, desc_a, info, dupl,local)
if (local_) then
irl(1:m) = irw(1:m)
else
call psi_idx_cnv(m,irw,irl,desc_a,info,owned=.true.)
call desc_a%indxmap%g2l(irw(1:m),irl(1:m),info,owned=.true.)
end if
do i=1,n
@ -516,8 +511,8 @@ subroutine psb_cinsi(m, irw, val, x, desc_a, info, dupl,local)
call psb_erractionsave(err_act)
name = 'psb_cinsi'
if (.not.psb_is_ok_desc(desc_a)) then
int_err(1)=3110
if (.not.desc_a%is_ok()) then
info = psb_err_invalid_cd_state_
call psb_errpush(info,name)
return
end if
@ -538,11 +533,6 @@ subroutine psb_cinsi(m, irw, val, x, desc_a, info, dupl,local)
int_err(2) = m
call psb_errpush(info,name,int_err)
goto 9999
else if (.not.psb_is_ok_desc(desc_a)) then
info = psb_err_input_matrix_unassembled_
int_err(1) = desc_a%get_dectype()
call psb_errpush(info,name,int_err)
goto 9999
else if (size(x, dim=1) < desc_a%get_local_rows()) then
info = 310
int_err(1) = 5
@ -579,7 +569,7 @@ subroutine psb_cinsi(m, irw, val, x, desc_a, info, dupl,local)
if (local_) then
irl(1:m) = irw(1:m)
else
call psi_idx_cnv(m,irw,irl,desc_a,info,owned=.true.)
call desc_a%indxmap%g2l(irw(1:m),irl(1:m),info,owned=.true.)
end if
select case(dupl_)

@ -158,7 +158,7 @@ Subroutine psb_csphalo(a,desc_a,blk,info,rowcnv,colcnv,&
goto 9999
end select
call desc_a%get_list(data_,idxv,totxch,nxs,nxr,info)
call desc_a%get_list(data_,idxv,totxch,nxr,nxs,info)
l1 = 0

@ -75,12 +75,6 @@ subroutine psb_cspins(nz,ia,ja,val,a,desc_a,info,rebuild,local)
name = 'psb_cspins'
call psb_erractionsave(err_act)
if (.not.desc_a%is_ok()) then
info = psb_err_invalid_cd_state_
call psb_errpush(info,name)
goto 9999
end if
ictxt = desc_a%get_context()
call psb_info(ictxt, me, np)
@ -133,7 +127,9 @@ subroutine psb_cspins(nz,ia,ja,val,a,desc_a,info,rebuild,local)
& a_err='allocate',i_err=ierr)
goto 9999
end if
call psb_cdins(nz,ia,ja,desc_a,info,ila=ila,jla=jla)
call desc_a%indxmap%g2l(ia(1:nz),ila(1:nz),info,owned=.true.)
call desc_a%indxmap%g2l_ins(ja(1:nz),jla(1:nz),info,mask=(ila(1:nz)>0))
if (info /= psb_success_) then
ierr(1) = info
@ -178,10 +174,8 @@ subroutine psb_cspins(nz,ia,ja,val,a,desc_a,info,rebuild,local)
goto 9999
end if
ila(1:nz) = ia(1:nz)
jla(1:nz) = ja(1:nz)
call psb_glob_to_loc(ila(1:nz),desc_a,info,iact='I')
call psb_glob_to_loc(jla(1:nz),desc_a,info,iact='I')
call desc_a%indxmap%g2l(ia(1:nz),ila(1:nz),info)
call desc_a%indxmap%g2l(ja(1:nz),jla(1:nz),info)
call a%csput(nz,ila,jla,val,ione,nrow,ione,ncol,info)
if (info /= psb_success_) then
@ -282,11 +276,9 @@ subroutine psb_cspins_2desc(nz,ia,ja,val,a,desc_ar,desc_ac,info)
& a_err='allocate',i_err=ierr)
goto 9999
end if
ila(1:nz) = ia(1:nz)
call psb_glob_to_loc(ia(1:nz),ila(1:nz),desc_ar,info,iact='I',owned=.true.)
call psb_cdins(nz,ja,desc_ac,info,jla=jla, mask=(ila(1:nz)>0))
call desc_ar%indxmap%g2l(ia(1:nz),ila(1:nz),info,owned=.true.)
call desc_ac%indxmap%g2l_ins(ja(1:nz),jla(1:nz),info, mask=(ila(1:nz)>0))
if (psb_errstatus_fatal()) then
ierr(1) = info

@ -355,7 +355,7 @@ Subroutine psb_dcdbldext(a,desc_a,novr,desc_ov,info, extype)
end If
idx = halo(counter+psb_elem_recv_+j)
call desc_ov%indxmap%l2g(idx,gidx,info)
call desc_ov%l2g(idx,gidx,info)
If (gidx < 0) then
info=-3
call psb_errpush(info,name)
@ -399,7 +399,7 @@ 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%indxmap%l2g(idx,gidx,info)
call desc_ov%l2g(idx,gidx,info)
If (gidx < 0) then
info=-3
call psb_errpush(info,name)
@ -435,7 +435,7 @@ Subroutine psb_dcdbldext(a,desc_a,novr,desc_ov,info, extype)
call psb_errpush(info,name,a_err='psb_ensure_size')
goto 9999
end if
call desc_ov%indxmap%l2g(icol(1:n_elem),&
call desc_ov%l2g(icol(1:n_elem),&
& works(idxs+tot_elem+1:idxs+tot_elem+n_elem),&
& info)
@ -523,7 +523,7 @@ Subroutine psb_dcdbldext(a,desc_a,novr,desc_ov,info, extype)
& write(debug_unit,*) me,' ',trim(name),&
& ': going for first idx_cnv', desc_ov%indxmap%get_state()
call psi_idx_cnv(iszr,workr,maskr,desc_ov,info)
call desc_ov%indxmap%g2l(workr(1:iszr),maskr(1:iszr),info)
iszs = count(maskr(1:iszr)<=0)
if (iszs > size(works)) call psb_realloc(iszs,works,info)
j = 0
@ -543,7 +543,7 @@ Subroutine psb_dcdbldext(a,desc_a,novr,desc_ov,info, extype)
if (debug_level >= psb_debug_outer_) &
& write(debug_unit,*) me,' ',trim(name),&
& ': going for fnd_owner', desc_ov%indxmap%get_state()
call psi_fnd_owner(iszs,works,temp,desc_a,info)
call desc_a%fnd_owner(works(1:iszs),temp,info)
n_col = desc_ov%get_local_cols()
if (debug_level >= psb_debug_outer_) &
@ -553,7 +553,7 @@ Subroutine psb_dcdbldext(a,desc_a,novr,desc_ov,info, extype)
do i=1,iszs
idx = works(i)
n_col = desc_ov%get_local_cols()
call psi_idx_ins_cnv(idx,lidx,desc_ov,info)
call desc_ov%indxmap%g2l_ins(idx,lidx,info)
if (desc_ov%get_local_cols() > n_col ) then
!
! This is a new index. Assigning a local index as
@ -611,7 +611,6 @@ Subroutine psb_dcdbldext(a,desc_a,novr,desc_ov,info, extype)
End If
End Do
select case(extype_)
case(psb_ovt_xhal_)
!

@ -78,8 +78,8 @@ subroutine psb_dinsvi(m, irw, val, x, desc_a, info, dupl,local)
call psb_erractionsave(err_act)
name = 'psb_dinsvi'
if (.not.psb_is_ok_desc(desc_a)) then
int_err(1)=3110
if (.not.desc_a%is_ok()) then
info = psb_err_invalid_cd_state_
call psb_errpush(info,name)
return
end if
@ -100,11 +100,6 @@ subroutine psb_dinsvi(m, irw, val, x, desc_a, info, dupl,local)
int_err(2) = m
call psb_errpush(info,name,int_err)
goto 9999
else if (.not.psb_is_ok_desc(desc_a)) then
info = psb_err_input_matrix_unassembled_
int_err(1) = desc_a%get_dectype()
call psb_errpush(info,name,int_err)
goto 9999
else if (size(x, dim=1) < desc_a%get_local_rows()) then
info = 310
int_err(1) = 5
@ -139,7 +134,7 @@ subroutine psb_dinsvi(m, irw, val, x, desc_a, info, dupl,local)
if (local_) then
irl(1:m) = irw(1:m)
else
call psi_idx_cnv(m,irw,irl,desc_a,info,owned=.true.)
call desc_a%indxmap%g2l(irw(1:m),irl(1:m),info,owned=.true.)
end if
select case(dupl_)
case(psb_dupl_ovwrt_)
@ -285,7 +280,7 @@ subroutine psb_dins_vect(m, irw, val, x, desc_a, info, dupl,local)
if (local_) then
irl(1:m) = irw(1:m)
else
call psi_idx_cnv(m,irw,irl,desc_a,info,owned=.true.)
call desc_a%indxmap%g2l(irw(1:m),irl(1:m),info,owned=.true.)
end if
call x%ins(m,irl,val,dupl_,info)
if (info /= 0) then
@ -405,7 +400,7 @@ subroutine psb_dins_vect_r2(m, irw, val, x, desc_a, info, dupl,local)
if (local_) then
irl(1:m) = irw(1:m)
else
call psi_idx_cnv(m,irw,irl,desc_a,info,owned=.true.)
call desc_a%indxmap%g2l(irw(1:m),irl(1:m),info,owned=.true.)
end if
do i=1,n
@ -516,8 +511,8 @@ subroutine psb_dinsi(m, irw, val, x, desc_a, info, dupl,local)
call psb_erractionsave(err_act)
name = 'psb_dinsi'
if (.not.psb_is_ok_desc(desc_a)) then
int_err(1)=3110
if (.not.desc_a%is_ok()) then
info = psb_err_invalid_cd_state_
call psb_errpush(info,name)
return
end if
@ -538,11 +533,6 @@ subroutine psb_dinsi(m, irw, val, x, desc_a, info, dupl,local)
int_err(2) = m
call psb_errpush(info,name,int_err)
goto 9999
else if (.not.psb_is_ok_desc(desc_a)) then
info = psb_err_input_matrix_unassembled_
int_err(1) = desc_a%get_dectype()
call psb_errpush(info,name,int_err)
goto 9999
else if (size(x, dim=1) < desc_a%get_local_rows()) then
info = 310
int_err(1) = 5
@ -579,7 +569,7 @@ subroutine psb_dinsi(m, irw, val, x, desc_a, info, dupl,local)
if (local_) then
irl(1:m) = irw(1:m)
else
call psi_idx_cnv(m,irw,irl,desc_a,info,owned=.true.)
call desc_a%indxmap%g2l(irw(1:m),irl(1:m),info,owned=.true.)
end if
select case(dupl_)

@ -158,7 +158,7 @@ Subroutine psb_dsphalo(a,desc_a,blk,info,rowcnv,colcnv,&
goto 9999
end select
call desc_a%get_list(data_,idxv,totxch,nxs,nxr,info)
call desc_a%get_list(data_,idxv,totxch,nxr,nxs,info)
l1 = 0

@ -75,12 +75,6 @@ subroutine psb_dspins(nz,ia,ja,val,a,desc_a,info,rebuild,local)
name = 'psb_dspins'
call psb_erractionsave(err_act)
if (.not.desc_a%is_ok()) then
info = psb_err_invalid_cd_state_
call psb_errpush(info,name)
goto 9999
end if
ictxt = desc_a%get_context()
call psb_info(ictxt, me, np)
@ -133,7 +127,9 @@ subroutine psb_dspins(nz,ia,ja,val,a,desc_a,info,rebuild,local)
& a_err='allocate',i_err=ierr)
goto 9999
end if
call psb_cdins(nz,ia,ja,desc_a,info,ila=ila,jla=jla)
call desc_a%indxmap%g2l(ia(1:nz),ila(1:nz),info,owned=.true.)
call desc_a%indxmap%g2l_ins(ja(1:nz),jla(1:nz),info,mask=(ila(1:nz)>0))
if (info /= psb_success_) then
ierr(1) = info
@ -178,10 +174,8 @@ subroutine psb_dspins(nz,ia,ja,val,a,desc_a,info,rebuild,local)
goto 9999
end if
ila(1:nz) = ia(1:nz)
jla(1:nz) = ja(1:nz)
call psb_glob_to_loc(ila(1:nz),desc_a,info,iact='I')
call psb_glob_to_loc(jla(1:nz),desc_a,info,iact='I')
call desc_a%indxmap%g2l(ia(1:nz),ila(1:nz),info)
call desc_a%indxmap%g2l(ja(1:nz),jla(1:nz),info)
call a%csput(nz,ila,jla,val,ione,nrow,ione,ncol,info)
if (info /= psb_success_) then
@ -282,11 +276,9 @@ subroutine psb_dspins_2desc(nz,ia,ja,val,a,desc_ar,desc_ac,info)
& a_err='allocate',i_err=ierr)
goto 9999
end if
ila(1:nz) = ia(1:nz)
call psb_glob_to_loc(ia(1:nz),ila(1:nz),desc_ar,info,iact='I',owned=.true.)
call psb_cdins(nz,ja,desc_ac,info,jla=jla, mask=(ila(1:nz)>0))
call desc_ar%indxmap%g2l(ia(1:nz),ila(1:nz),info,owned=.true.)
call desc_ac%indxmap%g2l_ins(ja(1:nz),jla(1:nz),info, mask=(ila(1:nz)>0))
if (psb_errstatus_fatal()) then
ierr(1) = info

@ -59,10 +59,9 @@ subroutine psb_glob_to_loc2v(x,y,desc_a,info,iact,owned)
logical, intent(in), optional :: owned
!....locals....
integer(psb_ipk_) :: n
integer(psb_ipk_) :: n, ictxt, iam, np
character :: act
integer(psb_ipk_) :: int_err(5), err_act
logical :: owned_
integer(psb_ipk_), parameter :: zero=0
character(len=20) :: name
@ -70,6 +69,15 @@ subroutine psb_glob_to_loc2v(x,y,desc_a,info,iact,owned)
info=psb_success_
name = 'glob_to_loc'
call psb_erractionsave(err_act)
if (.not.desc_a%is_ok()) then
info = psb_err_invalid_cd_state_
call psb_errpush(info,name)
goto 9999
end if
ictxt = desc_a%get_context()
call psb_info(ictxt,iam,np)
if (present(iact)) then
act=iact
@ -77,15 +85,16 @@ subroutine psb_glob_to_loc2v(x,y,desc_a,info,iact,owned)
act='I'
endif
act = psb_toupper(act)
if (present(owned)) then
owned_=owned
if (present(iact)) then
act=iact
else
owned_=.false.
end if
int_err = 0
act='I'
endif
act = psb_toupper(act)
n = size(x)
call psi_idx_cnv(n,x,y,desc_a,info,owned=owned_)
call desc_a%indxmap%g2l(x(1:n),y(1:n),info,owned=owned)
select case(act)
case('E','I')
@ -181,7 +190,6 @@ subroutine psb_glob_to_loc1v(x,desc_a,info,iact,owned)
integer(psb_ipk_) :: n
character :: act
integer(psb_ipk_) :: err_act
logical :: owned_
integer(psb_ipk_), parameter :: zero=0
character(len=20) :: name
integer(psb_ipk_) :: ictxt, iam, np
@ -189,25 +197,27 @@ subroutine psb_glob_to_loc1v(x,desc_a,info,iact,owned)
if(psb_get_errstatus() /= 0) return
info=psb_success_
name = 'glob_to_loc'
call psb_erractionsave(err_act)
if (.not.desc_a%is_ok()) then
info = psb_err_invalid_cd_state_
call psb_errpush(info,name)
goto 9999
end if
ictxt = desc_a%get_context()
call psb_info(ictxt,iam,np)
call psb_erractionsave(err_act)
if (present(iact)) then
act=iact
else
act='I'
endif
if (present(owned)) then
owned_=owned
else
owned_=.false.
end if
act = psb_toupper(act)
n = size(x)
call psi_idx_cnv(n,x,desc_a,info,owned=owned_)
call desc_a%indxmap%g2lip(x,info,owned=owned)
select case(act)
case('E','I')

@ -77,8 +77,8 @@ subroutine psb_iinsvi(m, irw, val, x, desc_a, info, dupl,local)
call psb_erractionsave(err_act)
name = 'psb_insvi'
if (.not.psb_is_ok_desc(desc_a)) then
int_err(1)=3110
if (.not.desc_a%is_ok()) then
info = psb_err_invalid_cd_state_
call psb_errpush(info,name)
return
end if
@ -99,11 +99,6 @@ subroutine psb_iinsvi(m, irw, val, x, desc_a, info, dupl,local)
int_err(2) = m
call psb_errpush(info,name,int_err)
goto 9999
else if (.not.psb_is_ok_desc(desc_a)) then
info = psb_err_input_matrix_unassembled_
int_err(1) = desc_a%get_dectype()
call psb_errpush(info,name,int_err)
goto 9999
else if (size(x, dim=1) < desc_a%get_local_rows()) then
info = 310
int_err(1) = 5
@ -138,7 +133,7 @@ subroutine psb_iinsvi(m, irw, val, x, desc_a, info, dupl,local)
if (local_) then
irl(1:m) = irw(1:m)
else
call psi_idx_cnv(m,irw,irl,desc_a,info,owned=.true.)
call desc_a%indxmap%g2l(irw(1:m),irl(1:m),info,owned=.true.)
end if
select case(dupl_)
case(psb_dupl_ovwrt_)
@ -268,8 +263,8 @@ subroutine psb_iinsi(m, irw, val, x, desc_a, info, dupl,local)
call psb_erractionsave(err_act)
name = 'psb_iinsi'
if (.not.psb_is_ok_desc(desc_a)) then
int_err(1)=3110
if (.not.desc_a%is_ok()) then
info = psb_err_invalid_cd_state_
call psb_errpush(info,name)
return
end if
@ -290,11 +285,6 @@ subroutine psb_iinsi(m, irw, val, x, desc_a, info, dupl,local)
int_err(2) = m
call psb_errpush(info,name,int_err)
goto 9999
else if (.not.psb_is_ok_desc(desc_a)) then
info = psb_err_input_matrix_unassembled_
int_err(1) = desc_a%get_dectype()
call psb_errpush(info,name,int_err)
goto 9999
else if (size(x, dim=1) < desc_a%get_local_rows()) then
info = 310
int_err(1) = 5
@ -332,7 +322,7 @@ subroutine psb_iinsi(m, irw, val, x, desc_a, info, dupl,local)
if (local_) then
irl(1:m) = irw(1:m)
else
call psi_idx_cnv(m,irw,irl,desc_a,info,owned=.true.)
call desc_a%indxmap%g2l(irw(1:m),irl(1:m),info,owned=.true.)
end if
select case(dupl_)
@ -487,7 +477,7 @@ subroutine psb_iins_vect(m, irw, val, x, desc_a, info, dupl,local)
if (local_) then
irl(1:m) = irw(1:m)
else
call psi_idx_cnv(m,irw,irl,desc_a,info,owned=.true.)
call desc_a%indxmap%g2l(irw(1:m),irl(1:m),info,owned=.true.)
end if
call x%ins(m,irl,val,dupl_,info)
if (info /= 0) then

@ -66,6 +66,12 @@ subroutine psb_loc_to_glob2v(x,y,desc_a,info,iact)
info=psb_success_
name='psb_loc_to_glob2'
call psb_erractionsave(err_act)
if (.not.desc_a%is_valid()) then
info = psb_err_invalid_cd_state_
call psb_errpush(info,name)
goto 9999
endif
if (present(iact)) then
act=iact
@ -171,6 +177,11 @@ subroutine psb_loc_to_glob1v(x,desc_a,info,iact)
info=psb_success_
name='psb_loc_to_glob'
call psb_erractionsave(err_act)
if (.not.desc_a%is_valid()) then
info = psb_err_invalid_cd_state_
call psb_errpush(info,name)
goto 9999
endif
if (present(iact)) then
act=iact

@ -355,7 +355,7 @@ Subroutine psb_scdbldext(a,desc_a,novr,desc_ov,info, extype)
end If
idx = halo(counter+psb_elem_recv_+j)
call desc_ov%indxmap%l2g(idx,gidx,info)
call desc_ov%l2g(idx,gidx,info)
If (gidx < 0) then
info=-3
call psb_errpush(info,name)
@ -399,7 +399,7 @@ 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%indxmap%l2g(idx,gidx,info)
call desc_ov%l2g(idx,gidx,info)
If (gidx < 0) then
info=-3
call psb_errpush(info,name)
@ -435,7 +435,7 @@ Subroutine psb_scdbldext(a,desc_a,novr,desc_ov,info, extype)
call psb_errpush(info,name,a_err='psb_ensure_size')
goto 9999
end if
call desc_ov%indxmap%l2g(icol(1:n_elem),&
call desc_ov%l2g(icol(1:n_elem),&
& works(idxs+tot_elem+1:idxs+tot_elem+n_elem),&
& info)
@ -523,7 +523,7 @@ Subroutine psb_scdbldext(a,desc_a,novr,desc_ov,info, extype)
& write(debug_unit,*) me,' ',trim(name),&
& ': going for first idx_cnv', desc_ov%indxmap%get_state()
call psi_idx_cnv(iszr,workr,maskr,desc_ov,info)
call desc_ov%indxmap%g2l(workr(1:iszr),maskr(1:iszr),info)
iszs = count(maskr(1:iszr)<=0)
if (iszs > size(works)) call psb_realloc(iszs,works,info)
j = 0
@ -543,7 +543,7 @@ Subroutine psb_scdbldext(a,desc_a,novr,desc_ov,info, extype)
if (debug_level >= psb_debug_outer_) &
& write(debug_unit,*) me,' ',trim(name),&
& ': going for fnd_owner', desc_ov%indxmap%get_state()
call psi_fnd_owner(iszs,works,temp,desc_a,info)
call desc_a%fnd_owner(works(1:iszs),temp,info)
n_col = desc_ov%get_local_cols()
if (debug_level >= psb_debug_outer_) &
@ -553,7 +553,7 @@ Subroutine psb_scdbldext(a,desc_a,novr,desc_ov,info, extype)
do i=1,iszs
idx = works(i)
n_col = desc_ov%get_local_cols()
call psi_idx_ins_cnv(idx,lidx,desc_ov,info)
call desc_ov%indxmap%g2l_ins(idx,lidx,info)
if (desc_ov%get_local_cols() > n_col ) then
!
! This is a new index. Assigning a local index as
@ -611,7 +611,6 @@ Subroutine psb_scdbldext(a,desc_a,novr,desc_ov,info, extype)
End If
End Do
select case(extype_)
case(psb_ovt_xhal_)
!

@ -78,8 +78,8 @@ subroutine psb_sinsvi(m, irw, val, x, desc_a, info, dupl,local)
call psb_erractionsave(err_act)
name = 'psb_sinsvi'
if (.not.psb_is_ok_desc(desc_a)) then
int_err(1)=3110
if (.not.desc_a%is_ok()) then
info = psb_err_invalid_cd_state_
call psb_errpush(info,name)
return
end if
@ -100,11 +100,6 @@ subroutine psb_sinsvi(m, irw, val, x, desc_a, info, dupl,local)
int_err(2) = m
call psb_errpush(info,name,int_err)
goto 9999
else if (.not.psb_is_ok_desc(desc_a)) then
info = psb_err_input_matrix_unassembled_
int_err(1) = desc_a%get_dectype()
call psb_errpush(info,name,int_err)
goto 9999
else if (size(x, dim=1) < desc_a%get_local_rows()) then
info = 310
int_err(1) = 5
@ -139,7 +134,7 @@ subroutine psb_sinsvi(m, irw, val, x, desc_a, info, dupl,local)
if (local_) then
irl(1:m) = irw(1:m)
else
call psi_idx_cnv(m,irw,irl,desc_a,info,owned=.true.)
call desc_a%indxmap%g2l(irw(1:m),irl(1:m),info,owned=.true.)
end if
select case(dupl_)
case(psb_dupl_ovwrt_)
@ -285,7 +280,7 @@ subroutine psb_sins_vect(m, irw, val, x, desc_a, info, dupl,local)
if (local_) then
irl(1:m) = irw(1:m)
else
call psi_idx_cnv(m,irw,irl,desc_a,info,owned=.true.)
call desc_a%indxmap%g2l(irw(1:m),irl(1:m),info,owned=.true.)
end if
call x%ins(m,irl,val,dupl_,info)
if (info /= 0) then
@ -405,7 +400,7 @@ subroutine psb_sins_vect_r2(m, irw, val, x, desc_a, info, dupl,local)
if (local_) then
irl(1:m) = irw(1:m)
else
call psi_idx_cnv(m,irw,irl,desc_a,info,owned=.true.)
call desc_a%indxmap%g2l(irw(1:m),irl(1:m),info,owned=.true.)
end if
do i=1,n
@ -516,8 +511,8 @@ subroutine psb_sinsi(m, irw, val, x, desc_a, info, dupl,local)
call psb_erractionsave(err_act)
name = 'psb_sinsi'
if (.not.psb_is_ok_desc(desc_a)) then
int_err(1)=3110
if (.not.desc_a%is_ok()) then
info = psb_err_invalid_cd_state_
call psb_errpush(info,name)
return
end if
@ -538,11 +533,6 @@ subroutine psb_sinsi(m, irw, val, x, desc_a, info, dupl,local)
int_err(2) = m
call psb_errpush(info,name,int_err)
goto 9999
else if (.not.psb_is_ok_desc(desc_a)) then
info = psb_err_input_matrix_unassembled_
int_err(1) = desc_a%get_dectype()
call psb_errpush(info,name,int_err)
goto 9999
else if (size(x, dim=1) < desc_a%get_local_rows()) then
info = 310
int_err(1) = 5
@ -579,7 +569,7 @@ subroutine psb_sinsi(m, irw, val, x, desc_a, info, dupl,local)
if (local_) then
irl(1:m) = irw(1:m)
else
call psi_idx_cnv(m,irw,irl,desc_a,info,owned=.true.)
call desc_a%indxmap%g2l(irw(1:m),irl(1:m),info,owned=.true.)
end if
select case(dupl_)

@ -158,7 +158,7 @@ Subroutine psb_ssphalo(a,desc_a,blk,info,rowcnv,colcnv,&
goto 9999
end select
call desc_a%get_list(data_,idxv,totxch,nxs,nxr,info)
call desc_a%get_list(data_,idxv,totxch,nxr,nxs,info)
l1 = 0

@ -75,12 +75,6 @@ subroutine psb_sspins(nz,ia,ja,val,a,desc_a,info,rebuild,local)
name = 'psb_sspins'
call psb_erractionsave(err_act)
if (.not.desc_a%is_ok()) then
info = psb_err_invalid_cd_state_
call psb_errpush(info,name)
goto 9999
end if
ictxt = desc_a%get_context()
call psb_info(ictxt, me, np)
@ -133,7 +127,9 @@ subroutine psb_sspins(nz,ia,ja,val,a,desc_a,info,rebuild,local)
& a_err='allocate',i_err=ierr)
goto 9999
end if
call psb_cdins(nz,ia,ja,desc_a,info,ila=ila,jla=jla)
call desc_a%indxmap%g2l(ia(1:nz),ila(1:nz),info,owned=.true.)
call desc_a%indxmap%g2l_ins(ja(1:nz),jla(1:nz),info,mask=(ila(1:nz)>0))
if (info /= psb_success_) then
ierr(1) = info
@ -178,10 +174,8 @@ subroutine psb_sspins(nz,ia,ja,val,a,desc_a,info,rebuild,local)
goto 9999
end if
ila(1:nz) = ia(1:nz)
jla(1:nz) = ja(1:nz)
call psb_glob_to_loc(ila(1:nz),desc_a,info,iact='I')
call psb_glob_to_loc(jla(1:nz),desc_a,info,iact='I')
call desc_a%indxmap%g2l(ia(1:nz),ila(1:nz),info)
call desc_a%indxmap%g2l(ja(1:nz),jla(1:nz),info)
call a%csput(nz,ila,jla,val,ione,nrow,ione,ncol,info)
if (info /= psb_success_) then
@ -282,11 +276,9 @@ subroutine psb_sspins_2desc(nz,ia,ja,val,a,desc_ar,desc_ac,info)
& a_err='allocate',i_err=ierr)
goto 9999
end if
ila(1:nz) = ia(1:nz)
call psb_glob_to_loc(ia(1:nz),ila(1:nz),desc_ar,info,iact='I',owned=.true.)
call psb_cdins(nz,ja,desc_ac,info,jla=jla, mask=(ila(1:nz)>0))
call desc_ar%indxmap%g2l(ia(1:nz),ila(1:nz),info,owned=.true.)
call desc_ac%indxmap%g2l_ins(ja(1:nz),jla(1:nz),info, mask=(ila(1:nz)>0))
if (psb_errstatus_fatal()) then
ierr(1) = info

@ -355,7 +355,7 @@ Subroutine psb_zcdbldext(a,desc_a,novr,desc_ov,info, extype)
end If
idx = halo(counter+psb_elem_recv_+j)
call desc_ov%indxmap%l2g(idx,gidx,info)
call desc_ov%l2g(idx,gidx,info)
If (gidx < 0) then
info=-3
call psb_errpush(info,name)
@ -399,7 +399,7 @@ 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%indxmap%l2g(idx,gidx,info)
call desc_ov%l2g(idx,gidx,info)
If (gidx < 0) then
info=-3
call psb_errpush(info,name)
@ -435,7 +435,7 @@ Subroutine psb_zcdbldext(a,desc_a,novr,desc_ov,info, extype)
call psb_errpush(info,name,a_err='psb_ensure_size')
goto 9999
end if
call desc_ov%indxmap%l2g(icol(1:n_elem),&
call desc_ov%l2g(icol(1:n_elem),&
& works(idxs+tot_elem+1:idxs+tot_elem+n_elem),&
& info)
@ -523,7 +523,7 @@ Subroutine psb_zcdbldext(a,desc_a,novr,desc_ov,info, extype)
& write(debug_unit,*) me,' ',trim(name),&
& ': going for first idx_cnv', desc_ov%indxmap%get_state()
call psi_idx_cnv(iszr,workr,maskr,desc_ov,info)
call desc_ov%indxmap%g2l(workr(1:iszr),maskr(1:iszr),info)
iszs = count(maskr(1:iszr)<=0)
if (iszs > size(works)) call psb_realloc(iszs,works,info)
j = 0
@ -543,7 +543,7 @@ Subroutine psb_zcdbldext(a,desc_a,novr,desc_ov,info, extype)
if (debug_level >= psb_debug_outer_) &
& write(debug_unit,*) me,' ',trim(name),&
& ': going for fnd_owner', desc_ov%indxmap%get_state()
call psi_fnd_owner(iszs,works,temp,desc_a,info)
call desc_a%fnd_owner(works(1:iszs),temp,info)
n_col = desc_ov%get_local_cols()
if (debug_level >= psb_debug_outer_) &
@ -553,7 +553,7 @@ Subroutine psb_zcdbldext(a,desc_a,novr,desc_ov,info, extype)
do i=1,iszs
idx = works(i)
n_col = desc_ov%get_local_cols()
call psi_idx_ins_cnv(idx,lidx,desc_ov,info)
call desc_ov%indxmap%g2l_ins(idx,lidx,info)
if (desc_ov%get_local_cols() > n_col ) then
!
! This is a new index. Assigning a local index as
@ -611,7 +611,6 @@ Subroutine psb_zcdbldext(a,desc_a,novr,desc_ov,info, extype)
End If
End Do
select case(extype_)
case(psb_ovt_xhal_)
!

@ -78,8 +78,8 @@ subroutine psb_zinsvi(m, irw, val, x, desc_a, info, dupl,local)
call psb_erractionsave(err_act)
name = 'psb_zinsvi'
if (.not.psb_is_ok_desc(desc_a)) then
int_err(1)=3110
if (.not.desc_a%is_ok()) then
info = psb_err_invalid_cd_state_
call psb_errpush(info,name)
return
end if
@ -100,11 +100,6 @@ subroutine psb_zinsvi(m, irw, val, x, desc_a, info, dupl,local)
int_err(2) = m
call psb_errpush(info,name,int_err)
goto 9999
else if (.not.psb_is_ok_desc(desc_a)) then
info = psb_err_input_matrix_unassembled_
int_err(1) = desc_a%get_dectype()
call psb_errpush(info,name,int_err)
goto 9999
else if (size(x, dim=1) < desc_a%get_local_rows()) then
info = 310
int_err(1) = 5
@ -139,7 +134,7 @@ subroutine psb_zinsvi(m, irw, val, x, desc_a, info, dupl,local)
if (local_) then
irl(1:m) = irw(1:m)
else
call psi_idx_cnv(m,irw,irl,desc_a,info,owned=.true.)
call desc_a%indxmap%g2l(irw(1:m),irl(1:m),info,owned=.true.)
end if
select case(dupl_)
case(psb_dupl_ovwrt_)
@ -285,7 +280,7 @@ subroutine psb_zins_vect(m, irw, val, x, desc_a, info, dupl,local)
if (local_) then
irl(1:m) = irw(1:m)
else
call psi_idx_cnv(m,irw,irl,desc_a,info,owned=.true.)
call desc_a%indxmap%g2l(irw(1:m),irl(1:m),info,owned=.true.)
end if
call x%ins(m,irl,val,dupl_,info)
if (info /= 0) then
@ -405,7 +400,7 @@ subroutine psb_zins_vect_r2(m, irw, val, x, desc_a, info, dupl,local)
if (local_) then
irl(1:m) = irw(1:m)
else
call psi_idx_cnv(m,irw,irl,desc_a,info,owned=.true.)
call desc_a%indxmap%g2l(irw(1:m),irl(1:m),info,owned=.true.)
end if
do i=1,n
@ -516,8 +511,8 @@ subroutine psb_zinsi(m, irw, val, x, desc_a, info, dupl,local)
call psb_erractionsave(err_act)
name = 'psb_zinsi'
if (.not.psb_is_ok_desc(desc_a)) then
int_err(1)=3110
if (.not.desc_a%is_ok()) then
info = psb_err_invalid_cd_state_
call psb_errpush(info,name)
return
end if
@ -538,11 +533,6 @@ subroutine psb_zinsi(m, irw, val, x, desc_a, info, dupl,local)
int_err(2) = m
call psb_errpush(info,name,int_err)
goto 9999
else if (.not.psb_is_ok_desc(desc_a)) then
info = psb_err_input_matrix_unassembled_
int_err(1) = desc_a%get_dectype()
call psb_errpush(info,name,int_err)
goto 9999
else if (size(x, dim=1) < desc_a%get_local_rows()) then
info = 310
int_err(1) = 5
@ -579,7 +569,7 @@ subroutine psb_zinsi(m, irw, val, x, desc_a, info, dupl,local)
if (local_) then
irl(1:m) = irw(1:m)
else
call psi_idx_cnv(m,irw,irl,desc_a,info,owned=.true.)
call desc_a%indxmap%g2l(irw(1:m),irl(1:m),info,owned=.true.)
end if
select case(dupl_)

@ -158,7 +158,7 @@ Subroutine psb_zsphalo(a,desc_a,blk,info,rowcnv,colcnv,&
goto 9999
end select
call desc_a%get_list(data_,idxv,totxch,nxs,nxr,info)
call desc_a%get_list(data_,idxv,totxch,nxr,nxs,info)
l1 = 0

@ -75,12 +75,6 @@ subroutine psb_zspins(nz,ia,ja,val,a,desc_a,info,rebuild,local)
name = 'psb_zspins'
call psb_erractionsave(err_act)
if (.not.desc_a%is_ok()) then
info = psb_err_invalid_cd_state_
call psb_errpush(info,name)
goto 9999
end if
ictxt = desc_a%get_context()
call psb_info(ictxt, me, np)
@ -133,7 +127,9 @@ subroutine psb_zspins(nz,ia,ja,val,a,desc_a,info,rebuild,local)
& a_err='allocate',i_err=ierr)
goto 9999
end if
call psb_cdins(nz,ia,ja,desc_a,info,ila=ila,jla=jla)
call desc_a%indxmap%g2l(ia(1:nz),ila(1:nz),info,owned=.true.)
call desc_a%indxmap%g2l_ins(ja(1:nz),jla(1:nz),info,mask=(ila(1:nz)>0))
if (info /= psb_success_) then
ierr(1) = info
@ -178,10 +174,8 @@ subroutine psb_zspins(nz,ia,ja,val,a,desc_a,info,rebuild,local)
goto 9999
end if
ila(1:nz) = ia(1:nz)
jla(1:nz) = ja(1:nz)
call psb_glob_to_loc(ila(1:nz),desc_a,info,iact='I')
call psb_glob_to_loc(jla(1:nz),desc_a,info,iact='I')
call desc_a%indxmap%g2l(ia(1:nz),ila(1:nz),info)
call desc_a%indxmap%g2l(ja(1:nz),jla(1:nz),info)
call a%csput(nz,ila,jla,val,ione,nrow,ione,ncol,info)
if (info /= psb_success_) then
@ -282,11 +276,9 @@ subroutine psb_zspins_2desc(nz,ia,ja,val,a,desc_ar,desc_ac,info)
& a_err='allocate',i_err=ierr)
goto 9999
end if
ila(1:nz) = ia(1:nz)
call psb_glob_to_loc(ia(1:nz),ila(1:nz),desc_ar,info,iact='I',owned=.true.)
call psb_cdins(nz,ja,desc_ac,info,jla=jla, mask=(ila(1:nz)>0))
call desc_ar%indxmap%g2l(ia(1:nz),ila(1:nz),info,owned=.true.)
call desc_ac%indxmap%g2l_ins(ja(1:nz),jla(1:nz),info, mask=(ila(1:nz)>0))
if (psb_errstatus_fatal()) then
ierr(1) = info

@ -283,7 +283,7 @@ program cf_sample
write(psb_out_unit,'("Total memory occupation for PREC: ",i12)')precsize
write(psb_out_unit,'("Total memory occupation for DESC_A: ",i12)')descsize
write(psb_out_unit,'("Storage type for DESC_A : ",a)')&
& desc_a%indxmap%get_fmt()
& desc_a%get_fmt()
end if
call psb_gather(x_col_glob,x_col,desc_a,info,root=psb_root_)

@ -289,7 +289,7 @@ program df_sample
write(psb_out_unit,'("Total memory occupation for PREC: ",i12)')precsize
write(psb_out_unit,'("Total memory occupation for DESC_A: ",i12)')descsize
write(psb_out_unit,'("Storage type for DESC_A : ",a)')&
& desc_a%indxmap%get_fmt()
& desc_a%get_fmt()
end if
!!$ call psb_precdump(prec,info,prefix=trim(mtrx_file)//'_')

@ -286,7 +286,7 @@ program sf_sample
write(psb_out_unit,'("Total memory occupation for PREC: ",i12)')precsize
write(psb_out_unit,'("Total memory occupation for DESC_A: ",i12)')descsize
write(psb_out_unit,'("Storage type for DESC_A : ",a)')&
& desc_a%indxmap%get_fmt()
& desc_a%get_fmt()
end if
!!$ call psb_precdump(prec,info,prefix=trim(mtrx_file)//'_')

@ -283,7 +283,7 @@ program zf_sample
write(psb_out_unit,'("Total memory occupation for PREC: ",i12)')precsize
write(psb_out_unit,'("Total memory occupation for DESC_A: ",i12)')descsize
write(psb_out_unit,'("Storage type for DESC_A : ",a)')&
& desc_a%indxmap%get_fmt()
& desc_a%get_fmt()
end if
call psb_gather(x_col_glob,x_col,desc_a,info,root=psb_root_)

@ -275,7 +275,7 @@ program d_file_spmv
write(psb_out_unit,'("MBYTES/S : ",F20.3)') bdwdth
bdwdth = times*nbytes/(tt2*1.d6)
write(psb_out_unit,'("MBYTES/S (trans): ",F20.3)') bdwdth
write(psb_out_unit,'("Storage type for DESC_A: ",a)') desc_a%indxmap%get_fmt()
write(psb_out_unit,'("Storage type for DESC_A: ",a)') desc_a%get_fmt()
end if

@ -169,7 +169,7 @@ program pdgenspmv
write(psb_out_unit,'("MBYTES/S : ",F20.3)') bdwdth
bdwdth = times*nbytes/(tt2*1.d6)
write(psb_out_unit,'("MBYTES/S (trans): ",F20.3)') bdwdth
write(psb_out_unit,'("Storage type for DESC_A: ",a)') desc_a%indxmap%get_fmt()
write(psb_out_unit,'("Storage type for DESC_A: ",a)') desc_a%get_fmt()
write(psb_out_unit,'("Total memory occupation for DESC_A: ",i12)')descsize
end if

@ -243,7 +243,7 @@ program ppde2d
write(psb_out_unit,'("Total memory occupation for A: ",i12)')amatsize
write(psb_out_unit,'("Total memory occupation for PREC: ",i12)')precsize
write(psb_out_unit,'("Total memory occupation for DESC_A: ",i12)')descsize
write(psb_out_unit,'("Storage type for DESC_A: ",a)') desc_a%indxmap%get_fmt()
write(psb_out_unit,'("Storage type for DESC_A: ",a)') desc_a%get_fmt()
end if

@ -256,7 +256,7 @@ program ppde3d
write(psb_out_unit,'("Total memory occupation for A: ",i12)')amatsize
write(psb_out_unit,'("Total memory occupation for PREC: ",i12)')precsize
write(psb_out_unit,'("Total memory occupation for DESC_A: ",i12)')descsize
write(psb_out_unit,'("Storage type for DESC_A: ",a)') desc_a%indxmap%get_fmt()
write(psb_out_unit,'("Storage type for DESC_A: ",a)') desc_a%get_fmt()
end if

@ -242,7 +242,7 @@ program spde2d
write(psb_out_unit,'("Total memory occupation for A: ",i12)')amatsize
write(psb_out_unit,'("Total memory occupation for PREC: ",i12)')precsize
write(psb_out_unit,'("Total memory occupation for DESC_A: ",i12)')descsize
write(psb_out_unit,'("Storage type for DESC_A: ",a)') desc_a%indxmap%get_fmt()
write(psb_out_unit,'("Storage type for DESC_A: ",a)') desc_a%get_fmt()
end if

@ -256,7 +256,7 @@ program spde3d
write(psb_out_unit,'("Total memory occupation for A: ",i12)')amatsize
write(psb_out_unit,'("Total memory occupation for PREC: ",i12)')precsize
write(psb_out_unit,'("Total memory occupation for DESC_A: ",i12)')descsize
write(psb_out_unit,'("Storage type for DESC_A: ",a)') desc_a%indxmap%get_fmt()
write(psb_out_unit,'("Storage type for DESC_A: ",a)') desc_a%get_fmt()
end if

Loading…
Cancel
Save