Merge branch 'development' into remap-coarse

new-context
Salvatore Filippone 4 years ago
commit 6e09f745ce

@ -186,9 +186,7 @@ subroutine psi_cswapidxm(iictxt,iicomm,flag,n,beta,y,idx, &
logical, parameter :: usersend=.false.
complex(psb_spk_), pointer, dimension(:) :: sndbuf, rcvbuf
#ifdef HAVE_VOLATILE
volatile :: sndbuf, rcvbuf
#endif
character(len=20) :: name
info=psb_success_
@ -672,9 +670,7 @@ subroutine psi_cswapidxv(iictxt,iicomm,flag,beta,y,idx, &
logical, parameter :: usersend=.false.
complex(psb_spk_), pointer, dimension(:) :: sndbuf, rcvbuf
#ifdef HAVE_VOLATILE
volatile :: sndbuf, rcvbuf
#endif
character(len=20) :: name
info=psb_success_

@ -191,9 +191,7 @@ subroutine psi_ctranidxm(iictxt,iicomm,flag,n,beta,y,idx,&
logical, parameter :: usersend=.false.
complex(psb_spk_), pointer, dimension(:) :: sndbuf, rcvbuf
#ifdef HAVE_VOLATILE
volatile :: sndbuf, rcvbuf
#endif
character(len=20) :: name
info=psb_success_
@ -685,9 +683,7 @@ subroutine psi_ctranidxv(iictxt,iicomm,flag,beta,y,idx,&
logical, parameter :: usersend=.false.
complex(psb_spk_), pointer, dimension(:) :: sndbuf, rcvbuf
#ifdef HAVE_VOLATILE
volatile :: sndbuf, rcvbuf
#endif
character(len=20) :: name
info=psb_success_

@ -186,9 +186,7 @@ subroutine psi_dswapidxm(iictxt,iicomm,flag,n,beta,y,idx, &
logical, parameter :: usersend=.false.
real(psb_dpk_), pointer, dimension(:) :: sndbuf, rcvbuf
#ifdef HAVE_VOLATILE
volatile :: sndbuf, rcvbuf
#endif
character(len=20) :: name
info=psb_success_
@ -672,9 +670,7 @@ subroutine psi_dswapidxv(iictxt,iicomm,flag,beta,y,idx, &
logical, parameter :: usersend=.false.
real(psb_dpk_), pointer, dimension(:) :: sndbuf, rcvbuf
#ifdef HAVE_VOLATILE
volatile :: sndbuf, rcvbuf
#endif
character(len=20) :: name
info=psb_success_

@ -191,9 +191,7 @@ subroutine psi_dtranidxm(iictxt,iicomm,flag,n,beta,y,idx,&
logical, parameter :: usersend=.false.
real(psb_dpk_), pointer, dimension(:) :: sndbuf, rcvbuf
#ifdef HAVE_VOLATILE
volatile :: sndbuf, rcvbuf
#endif
character(len=20) :: name
info=psb_success_
@ -685,9 +683,7 @@ subroutine psi_dtranidxv(iictxt,iicomm,flag,beta,y,idx,&
logical, parameter :: usersend=.false.
real(psb_dpk_), pointer, dimension(:) :: sndbuf, rcvbuf
#ifdef HAVE_VOLATILE
volatile :: sndbuf, rcvbuf
#endif
character(len=20) :: name
info=psb_success_

@ -186,9 +186,7 @@ subroutine psi_eswapidxm(iictxt,iicomm,flag,n,beta,y,idx, &
logical, parameter :: usersend=.false.
integer(psb_epk_), pointer, dimension(:) :: sndbuf, rcvbuf
#ifdef HAVE_VOLATILE
volatile :: sndbuf, rcvbuf
#endif
character(len=20) :: name
info=psb_success_
@ -672,9 +670,7 @@ subroutine psi_eswapidxv(iictxt,iicomm,flag,beta,y,idx, &
logical, parameter :: usersend=.false.
integer(psb_epk_), pointer, dimension(:) :: sndbuf, rcvbuf
#ifdef HAVE_VOLATILE
volatile :: sndbuf, rcvbuf
#endif
character(len=20) :: name
info=psb_success_

@ -191,9 +191,7 @@ subroutine psi_etranidxm(iictxt,iicomm,flag,n,beta,y,idx,&
logical, parameter :: usersend=.false.
integer(psb_epk_), pointer, dimension(:) :: sndbuf, rcvbuf
#ifdef HAVE_VOLATILE
volatile :: sndbuf, rcvbuf
#endif
character(len=20) :: name
info=psb_success_
@ -685,9 +683,7 @@ subroutine psi_etranidxv(iictxt,iicomm,flag,beta,y,idx,&
logical, parameter :: usersend=.false.
integer(psb_epk_), pointer, dimension(:) :: sndbuf, rcvbuf
#ifdef HAVE_VOLATILE
volatile :: sndbuf, rcvbuf
#endif
character(len=20) :: name
info=psb_success_

@ -186,9 +186,7 @@ subroutine psi_i2swapidxm(iictxt,iicomm,flag,n,beta,y,idx, &
logical, parameter :: usersend=.false.
integer(psb_i2pk_), pointer, dimension(:) :: sndbuf, rcvbuf
#ifdef HAVE_VOLATILE
volatile :: sndbuf, rcvbuf
#endif
character(len=20) :: name
info=psb_success_
@ -672,9 +670,7 @@ subroutine psi_i2swapidxv(iictxt,iicomm,flag,beta,y,idx, &
logical, parameter :: usersend=.false.
integer(psb_i2pk_), pointer, dimension(:) :: sndbuf, rcvbuf
#ifdef HAVE_VOLATILE
volatile :: sndbuf, rcvbuf
#endif
character(len=20) :: name
info=psb_success_

@ -191,9 +191,7 @@ subroutine psi_i2tranidxm(iictxt,iicomm,flag,n,beta,y,idx,&
logical, parameter :: usersend=.false.
integer(psb_i2pk_), pointer, dimension(:) :: sndbuf, rcvbuf
#ifdef HAVE_VOLATILE
volatile :: sndbuf, rcvbuf
#endif
character(len=20) :: name
info=psb_success_
@ -685,9 +683,7 @@ subroutine psi_i2tranidxv(iictxt,iicomm,flag,beta,y,idx,&
logical, parameter :: usersend=.false.
integer(psb_i2pk_), pointer, dimension(:) :: sndbuf, rcvbuf
#ifdef HAVE_VOLATILE
volatile :: sndbuf, rcvbuf
#endif
character(len=20) :: name
info=psb_success_

@ -186,9 +186,7 @@ subroutine psi_mswapidxm(iictxt,iicomm,flag,n,beta,y,idx, &
logical, parameter :: usersend=.false.
integer(psb_mpk_), pointer, dimension(:) :: sndbuf, rcvbuf
#ifdef HAVE_VOLATILE
volatile :: sndbuf, rcvbuf
#endif
character(len=20) :: name
info=psb_success_
@ -672,9 +670,7 @@ subroutine psi_mswapidxv(iictxt,iicomm,flag,beta,y,idx, &
logical, parameter :: usersend=.false.
integer(psb_mpk_), pointer, dimension(:) :: sndbuf, rcvbuf
#ifdef HAVE_VOLATILE
volatile :: sndbuf, rcvbuf
#endif
character(len=20) :: name
info=psb_success_

@ -191,9 +191,7 @@ subroutine psi_mtranidxm(iictxt,iicomm,flag,n,beta,y,idx,&
logical, parameter :: usersend=.false.
integer(psb_mpk_), pointer, dimension(:) :: sndbuf, rcvbuf
#ifdef HAVE_VOLATILE
volatile :: sndbuf, rcvbuf
#endif
character(len=20) :: name
info=psb_success_
@ -685,9 +683,7 @@ subroutine psi_mtranidxv(iictxt,iicomm,flag,beta,y,idx,&
logical, parameter :: usersend=.false.
integer(psb_mpk_), pointer, dimension(:) :: sndbuf, rcvbuf
#ifdef HAVE_VOLATILE
volatile :: sndbuf, rcvbuf
#endif
character(len=20) :: name
info=psb_success_

@ -186,9 +186,7 @@ subroutine psi_sswapidxm(iictxt,iicomm,flag,n,beta,y,idx, &
logical, parameter :: usersend=.false.
real(psb_spk_), pointer, dimension(:) :: sndbuf, rcvbuf
#ifdef HAVE_VOLATILE
volatile :: sndbuf, rcvbuf
#endif
character(len=20) :: name
info=psb_success_
@ -672,9 +670,7 @@ subroutine psi_sswapidxv(iictxt,iicomm,flag,beta,y,idx, &
logical, parameter :: usersend=.false.
real(psb_spk_), pointer, dimension(:) :: sndbuf, rcvbuf
#ifdef HAVE_VOLATILE
volatile :: sndbuf, rcvbuf
#endif
character(len=20) :: name
info=psb_success_

@ -191,9 +191,7 @@ subroutine psi_stranidxm(iictxt,iicomm,flag,n,beta,y,idx,&
logical, parameter :: usersend=.false.
real(psb_spk_), pointer, dimension(:) :: sndbuf, rcvbuf
#ifdef HAVE_VOLATILE
volatile :: sndbuf, rcvbuf
#endif
character(len=20) :: name
info=psb_success_
@ -685,9 +683,7 @@ subroutine psi_stranidxv(iictxt,iicomm,flag,beta,y,idx,&
logical, parameter :: usersend=.false.
real(psb_spk_), pointer, dimension(:) :: sndbuf, rcvbuf
#ifdef HAVE_VOLATILE
volatile :: sndbuf, rcvbuf
#endif
character(len=20) :: name
info=psb_success_

@ -186,9 +186,7 @@ subroutine psi_zswapidxm(iictxt,iicomm,flag,n,beta,y,idx, &
logical, parameter :: usersend=.false.
complex(psb_dpk_), pointer, dimension(:) :: sndbuf, rcvbuf
#ifdef HAVE_VOLATILE
volatile :: sndbuf, rcvbuf
#endif
character(len=20) :: name
info=psb_success_
@ -672,9 +670,7 @@ subroutine psi_zswapidxv(iictxt,iicomm,flag,beta,y,idx, &
logical, parameter :: usersend=.false.
complex(psb_dpk_), pointer, dimension(:) :: sndbuf, rcvbuf
#ifdef HAVE_VOLATILE
volatile :: sndbuf, rcvbuf
#endif
character(len=20) :: name
info=psb_success_

@ -191,9 +191,7 @@ subroutine psi_ztranidxm(iictxt,iicomm,flag,n,beta,y,idx,&
logical, parameter :: usersend=.false.
complex(psb_dpk_), pointer, dimension(:) :: sndbuf, rcvbuf
#ifdef HAVE_VOLATILE
volatile :: sndbuf, rcvbuf
#endif
character(len=20) :: name
info=psb_success_
@ -685,9 +683,7 @@ subroutine psi_ztranidxv(iictxt,iicomm,flag,beta,y,idx,&
logical, parameter :: usersend=.false.
complex(psb_dpk_), pointer, dimension(:) :: sndbuf, rcvbuf
#ifdef HAVE_VOLATILE
volatile :: sndbuf, rcvbuf
#endif
character(len=20) :: name
info=psb_success_

@ -42,9 +42,7 @@
!
!
subroutine psb_csp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,keeploc)
#if defined(HAVE_ISO_FORTRAN_ENV)
use iso_fortran_env
#endif
use psb_desc_mod
use psb_error_mod
use psb_penv_mod
@ -136,12 +134,10 @@ subroutine psb_csp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,keep
info = psb_err_mpi_int_ovflw_
call psb_errpush(info,name); goto 9999
end if
#if defined(HAVE_ISO_FORTRAN_ENV)
if (nrg > HUGE(1_psb_mpk_)) then
info = psb_err_mpi_int_ovflw_
call psb_errpush(info,name); goto 9999
end if
#endif
if ((root_ == -1).or.(root_ == me)) then
if (info == psb_success_) call psb_realloc(nzg,glbia,info)
if (info == psb_success_) call psb_realloc(nzg,glbja,info)
@ -228,9 +224,7 @@ end subroutine psb_csp_allgather
subroutine psb_lcsp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,keeploc)
#if defined(HAVE_ISO_FORTRAN_ENV)
use iso_fortran_env
#endif
use psb_desc_mod
use psb_error_mod
use psb_penv_mod
@ -321,13 +315,11 @@ subroutine psb_lcsp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,kee
info = psb_err_mpi_int_ovflw_
call psb_errpush(info,name); goto 9999
end if
#if defined(HAVE_ISO_FORTRAN_ENV)
if ((nrg > HUGE(1_psb_mpk_)).or.(nzg > HUGE(1_psb_mpk_))&
& .or.(sum(lnzbr) > HUGE(1_psb_mpk_))) then
info = psb_err_mpi_int_ovflw_
call psb_errpush(info,name); goto 9999
end if
#endif
if ((root_ == -1).or.(root_ == me)) then
if (info == psb_success_) call glob_coo%allocate(nrg,ncg,nzg)
else
@ -403,9 +395,7 @@ subroutine psb_lcsp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,kee
end subroutine psb_lcsp_allgather
subroutine psb_lclcsp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,keeploc)
#if defined(HAVE_ISO_FORTRAN_ENV)
use iso_fortran_env
#endif
use psb_desc_mod
use psb_error_mod
use psb_penv_mod
@ -496,13 +486,11 @@ subroutine psb_lclcsp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,k
info = psb_err_mpi_int_ovflw_
call psb_errpush(info,name); goto 9999
end if
#if defined(HAVE_ISO_FORTRAN_ENV)
if ((nrg > HUGE(1_psb_mpk_)).or.(nzg > HUGE(1_psb_mpk_))&
& .or.(sum(lnzbr) > HUGE(1_psb_mpk_))) then
info = psb_err_mpi_int_ovflw_
call psb_errpush(info,name); goto 9999
end if
#endif
if ((root_ == -1).or.(root_ == me)) then
if (info == psb_success_) call glob_coo%allocate(nrg,ncg,nzg)
else

@ -42,9 +42,7 @@
!
!
subroutine psb_dsp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,keeploc)
#if defined(HAVE_ISO_FORTRAN_ENV)
use iso_fortran_env
#endif
use psb_desc_mod
use psb_error_mod
use psb_penv_mod
@ -136,12 +134,10 @@ subroutine psb_dsp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,keep
info = psb_err_mpi_int_ovflw_
call psb_errpush(info,name); goto 9999
end if
#if defined(HAVE_ISO_FORTRAN_ENV)
if (nrg > HUGE(1_psb_mpk_)) then
info = psb_err_mpi_int_ovflw_
call psb_errpush(info,name); goto 9999
end if
#endif
if ((root_ == -1).or.(root_ == me)) then
if (info == psb_success_) call psb_realloc(nzg,glbia,info)
if (info == psb_success_) call psb_realloc(nzg,glbja,info)
@ -228,9 +224,7 @@ end subroutine psb_dsp_allgather
subroutine psb_ldsp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,keeploc)
#if defined(HAVE_ISO_FORTRAN_ENV)
use iso_fortran_env
#endif
use psb_desc_mod
use psb_error_mod
use psb_penv_mod
@ -321,13 +315,11 @@ subroutine psb_ldsp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,kee
info = psb_err_mpi_int_ovflw_
call psb_errpush(info,name); goto 9999
end if
#if defined(HAVE_ISO_FORTRAN_ENV)
if ((nrg > HUGE(1_psb_mpk_)).or.(nzg > HUGE(1_psb_mpk_))&
& .or.(sum(lnzbr) > HUGE(1_psb_mpk_))) then
info = psb_err_mpi_int_ovflw_
call psb_errpush(info,name); goto 9999
end if
#endif
if ((root_ == -1).or.(root_ == me)) then
if (info == psb_success_) call glob_coo%allocate(nrg,ncg,nzg)
else
@ -403,9 +395,7 @@ subroutine psb_ldsp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,kee
end subroutine psb_ldsp_allgather
subroutine psb_ldldsp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,keeploc)
#if defined(HAVE_ISO_FORTRAN_ENV)
use iso_fortran_env
#endif
use psb_desc_mod
use psb_error_mod
use psb_penv_mod
@ -496,13 +486,11 @@ subroutine psb_ldldsp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,k
info = psb_err_mpi_int_ovflw_
call psb_errpush(info,name); goto 9999
end if
#if defined(HAVE_ISO_FORTRAN_ENV)
if ((nrg > HUGE(1_psb_mpk_)).or.(nzg > HUGE(1_psb_mpk_))&
& .or.(sum(lnzbr) > HUGE(1_psb_mpk_))) then
info = psb_err_mpi_int_ovflw_
call psb_errpush(info,name); goto 9999
end if
#endif
if ((root_ == -1).or.(root_ == me)) then
if (info == psb_success_) call glob_coo%allocate(nrg,ncg,nzg)
else

@ -42,9 +42,7 @@
!
!
subroutine psb_isp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,keeploc)
#if defined(HAVE_ISO_FORTRAN_ENV)
use iso_fortran_env
#endif
use psb_desc_mod
use psb_error_mod
use psb_penv_mod
@ -136,12 +134,10 @@ subroutine psb_isp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,keep
info = psb_err_mpi_int_ovflw_
call psb_errpush(info,name); goto 9999
end if
#if defined(HAVE_ISO_FORTRAN_ENV)
if (nrg > HUGE(1_psb_mpk_)) then
info = psb_err_mpi_int_ovflw_
call psb_errpush(info,name); goto 9999
end if
#endif
if ((root_ == -1).or.(root_ == me)) then
if (info == psb_success_) call psb_realloc(nzg,glbia,info)
if (info == psb_success_) call psb_realloc(nzg,glbja,info)
@ -228,9 +224,7 @@ end subroutine psb_isp_allgather
subroutine psb_@LX@sp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,keeploc)
#if defined(HAVE_ISO_FORTRAN_ENV)
use iso_fortran_env
#endif
use psb_desc_mod
use psb_error_mod
use psb_penv_mod
@ -321,13 +315,11 @@ subroutine psb_@LX@sp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,k
info = psb_err_mpi_int_ovflw_
call psb_errpush(info,name); goto 9999
end if
#if defined(HAVE_ISO_FORTRAN_ENV)
if ((nrg > HUGE(1_psb_mpk_)).or.(nzg > HUGE(1_psb_mpk_))&
& .or.(sum(lnzbr) > HUGE(1_psb_mpk_))) then
info = psb_err_mpi_int_ovflw_
call psb_errpush(info,name); goto 9999
end if
#endif
if ((root_ == -1).or.(root_ == me)) then
if (info == psb_success_) call glob_coo%allocate(nrg,ncg,nzg)
else
@ -403,9 +395,7 @@ subroutine psb_@LX@sp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,k
end subroutine psb_@LX@sp_allgather
subroutine psb_@LX@@LX@sp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,keeploc)
#if defined(HAVE_ISO_FORTRAN_ENV)
use iso_fortran_env
#endif
use psb_desc_mod
use psb_error_mod
use psb_penv_mod
@ -496,13 +486,11 @@ subroutine psb_@LX@@LX@sp_allgather(globa, loca, desc_a, info, root, dupl,keepn
info = psb_err_mpi_int_ovflw_
call psb_errpush(info,name); goto 9999
end if
#if defined(HAVE_ISO_FORTRAN_ENV)
if ((nrg > HUGE(1_psb_mpk_)).or.(nzg > HUGE(1_psb_mpk_))&
& .or.(sum(lnzbr) > HUGE(1_psb_mpk_))) then
info = psb_err_mpi_int_ovflw_
call psb_errpush(info,name); goto 9999
end if
#endif
if ((root_ == -1).or.(root_ == me)) then
if (info == psb_success_) call glob_coo%allocate(nrg,ncg,nzg)
else

@ -42,9 +42,7 @@
!
!
subroutine psb_lsp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,keeploc)
#if defined(HAVE_ISO_FORTRAN_ENV)
use iso_fortran_env
#endif
use psb_desc_mod
use psb_error_mod
use psb_penv_mod
@ -136,12 +134,10 @@ subroutine psb_lsp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,keep
info = psb_err_mpi_int_ovflw_
call psb_errpush(info,name); goto 9999
end if
#if defined(HAVE_ISO_FORTRAN_ENV)
if (nrg > HUGE(1_psb_mpk_)) then
info = psb_err_mpi_int_ovflw_
call psb_errpush(info,name); goto 9999
end if
#endif
if ((root_ == -1).or.(root_ == me)) then
if (info == psb_success_) call psb_realloc(nzg,glbia,info)
if (info == psb_success_) call psb_realloc(nzg,glbja,info)
@ -228,9 +224,7 @@ end subroutine psb_lsp_allgather
subroutine psb_@LX@sp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,keeploc)
#if defined(HAVE_ISO_FORTRAN_ENV)
use iso_fortran_env
#endif
use psb_desc_mod
use psb_error_mod
use psb_penv_mod
@ -321,13 +315,11 @@ subroutine psb_@LX@sp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,k
info = psb_err_mpi_int_ovflw_
call psb_errpush(info,name); goto 9999
end if
#if defined(HAVE_ISO_FORTRAN_ENV)
if ((nrg > HUGE(1_psb_mpk_)).or.(nzg > HUGE(1_psb_mpk_))&
& .or.(sum(lnzbr) > HUGE(1_psb_mpk_))) then
info = psb_err_mpi_int_ovflw_
call psb_errpush(info,name); goto 9999
end if
#endif
if ((root_ == -1).or.(root_ == me)) then
if (info == psb_success_) call glob_coo%allocate(nrg,ncg,nzg)
else
@ -403,9 +395,7 @@ subroutine psb_@LX@sp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,k
end subroutine psb_@LX@sp_allgather
subroutine psb_@LX@@LX@sp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,keeploc)
#if defined(HAVE_ISO_FORTRAN_ENV)
use iso_fortran_env
#endif
use psb_desc_mod
use psb_error_mod
use psb_penv_mod
@ -496,13 +486,11 @@ subroutine psb_@LX@@LX@sp_allgather(globa, loca, desc_a, info, root, dupl,keepn
info = psb_err_mpi_int_ovflw_
call psb_errpush(info,name); goto 9999
end if
#if defined(HAVE_ISO_FORTRAN_ENV)
if ((nrg > HUGE(1_psb_mpk_)).or.(nzg > HUGE(1_psb_mpk_))&
& .or.(sum(lnzbr) > HUGE(1_psb_mpk_))) then
info = psb_err_mpi_int_ovflw_
call psb_errpush(info,name); goto 9999
end if
#endif
if ((root_ == -1).or.(root_ == me)) then
if (info == psb_success_) call glob_coo%allocate(nrg,ncg,nzg)
else

@ -42,9 +42,7 @@
!
!
subroutine psb_ssp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,keeploc)
#if defined(HAVE_ISO_FORTRAN_ENV)
use iso_fortran_env
#endif
use psb_desc_mod
use psb_error_mod
use psb_penv_mod
@ -136,12 +134,10 @@ subroutine psb_ssp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,keep
info = psb_err_mpi_int_ovflw_
call psb_errpush(info,name); goto 9999
end if
#if defined(HAVE_ISO_FORTRAN_ENV)
if (nrg > HUGE(1_psb_mpk_)) then
info = psb_err_mpi_int_ovflw_
call psb_errpush(info,name); goto 9999
end if
#endif
if ((root_ == -1).or.(root_ == me)) then
if (info == psb_success_) call psb_realloc(nzg,glbia,info)
if (info == psb_success_) call psb_realloc(nzg,glbja,info)
@ -228,9 +224,7 @@ end subroutine psb_ssp_allgather
subroutine psb_lssp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,keeploc)
#if defined(HAVE_ISO_FORTRAN_ENV)
use iso_fortran_env
#endif
use psb_desc_mod
use psb_error_mod
use psb_penv_mod
@ -321,13 +315,11 @@ subroutine psb_lssp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,kee
info = psb_err_mpi_int_ovflw_
call psb_errpush(info,name); goto 9999
end if
#if defined(HAVE_ISO_FORTRAN_ENV)
if ((nrg > HUGE(1_psb_mpk_)).or.(nzg > HUGE(1_psb_mpk_))&
& .or.(sum(lnzbr) > HUGE(1_psb_mpk_))) then
info = psb_err_mpi_int_ovflw_
call psb_errpush(info,name); goto 9999
end if
#endif
if ((root_ == -1).or.(root_ == me)) then
if (info == psb_success_) call glob_coo%allocate(nrg,ncg,nzg)
else
@ -403,9 +395,7 @@ subroutine psb_lssp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,kee
end subroutine psb_lssp_allgather
subroutine psb_lslssp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,keeploc)
#if defined(HAVE_ISO_FORTRAN_ENV)
use iso_fortran_env
#endif
use psb_desc_mod
use psb_error_mod
use psb_penv_mod
@ -496,13 +486,11 @@ subroutine psb_lslssp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,k
info = psb_err_mpi_int_ovflw_
call psb_errpush(info,name); goto 9999
end if
#if defined(HAVE_ISO_FORTRAN_ENV)
if ((nrg > HUGE(1_psb_mpk_)).or.(nzg > HUGE(1_psb_mpk_))&
& .or.(sum(lnzbr) > HUGE(1_psb_mpk_))) then
info = psb_err_mpi_int_ovflw_
call psb_errpush(info,name); goto 9999
end if
#endif
if ((root_ == -1).or.(root_ == me)) then
if (info == psb_success_) call glob_coo%allocate(nrg,ncg,nzg)
else

@ -42,9 +42,7 @@
!
!
subroutine psb_zsp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,keeploc)
#if defined(HAVE_ISO_FORTRAN_ENV)
use iso_fortran_env
#endif
use psb_desc_mod
use psb_error_mod
use psb_penv_mod
@ -136,12 +134,10 @@ subroutine psb_zsp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,keep
info = psb_err_mpi_int_ovflw_
call psb_errpush(info,name); goto 9999
end if
#if defined(HAVE_ISO_FORTRAN_ENV)
if (nrg > HUGE(1_psb_mpk_)) then
info = psb_err_mpi_int_ovflw_
call psb_errpush(info,name); goto 9999
end if
#endif
if ((root_ == -1).or.(root_ == me)) then
if (info == psb_success_) call psb_realloc(nzg,glbia,info)
if (info == psb_success_) call psb_realloc(nzg,glbja,info)
@ -228,9 +224,7 @@ end subroutine psb_zsp_allgather
subroutine psb_lzsp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,keeploc)
#if defined(HAVE_ISO_FORTRAN_ENV)
use iso_fortran_env
#endif
use psb_desc_mod
use psb_error_mod
use psb_penv_mod
@ -321,13 +315,11 @@ subroutine psb_lzsp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,kee
info = psb_err_mpi_int_ovflw_
call psb_errpush(info,name); goto 9999
end if
#if defined(HAVE_ISO_FORTRAN_ENV)
if ((nrg > HUGE(1_psb_mpk_)).or.(nzg > HUGE(1_psb_mpk_))&
& .or.(sum(lnzbr) > HUGE(1_psb_mpk_))) then
info = psb_err_mpi_int_ovflw_
call psb_errpush(info,name); goto 9999
end if
#endif
if ((root_ == -1).or.(root_ == me)) then
if (info == psb_success_) call glob_coo%allocate(nrg,ncg,nzg)
else
@ -403,9 +395,7 @@ subroutine psb_lzsp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,kee
end subroutine psb_lzsp_allgather
subroutine psb_lzlzsp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,keeploc)
#if defined(HAVE_ISO_FORTRAN_ENV)
use iso_fortran_env
#endif
use psb_desc_mod
use psb_error_mod
use psb_penv_mod
@ -496,13 +486,11 @@ subroutine psb_lzlzsp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,k
info = psb_err_mpi_int_ovflw_
call psb_errpush(info,name); goto 9999
end if
#if defined(HAVE_ISO_FORTRAN_ENV)
if ((nrg > HUGE(1_psb_mpk_)).or.(nzg > HUGE(1_psb_mpk_))&
& .or.(sum(lnzbr) > HUGE(1_psb_mpk_))) then
info = psb_err_mpi_int_ovflw_
call psb_errpush(info,name); goto 9999
end if
#endif
if ((root_ == -1).or.(root_ == me)) then
if (info == psb_success_) call glob_coo%allocate(nrg,ncg,nzg)
else

@ -92,7 +92,7 @@ Contains
! ...Local Variables
integer(psb_ipk_) :: err_act,err
character(len=20) :: name
character(len=30) :: name
logical, parameter :: debug=.false.
name='psb_r_c_s'
@ -133,7 +133,7 @@ Contains
complex(psb_spk_),allocatable :: tmp(:)
integer(psb_mpk_) :: dim, lb_, lbi,ub_
integer(psb_ipk_) :: err_act,err
character(len=20) :: name
character(len=30) :: name
logical, parameter :: debug=.false.
name='psb_r_m_c_rk1'
@ -205,7 +205,7 @@ Contains
complex(psb_spk_),allocatable :: tmp(:,:)
integer(psb_ipk_) :: err_act,err
integer(psb_mpk_) :: dim,dim2,lb1_, lb2_, ub1_, ub2_,lbi1, lbi2
character(len=20) :: name
character(len=30) :: name
name='psb_r_m_c_rk2'
call psb_erractionsave(err_act)
@ -294,9 +294,8 @@ Contains
! ...Local Variables
complex(psb_spk_),allocatable :: tmp(:)
integer(psb_epk_) :: dim, lb_, lbi,ub_
integer(psb_ipk_) :: iplen
integer(psb_ipk_) :: err_act,err
character(len=20) :: name
character(len=30) :: name
logical, parameter :: debug=.false.
name='psb_r_m_c_rk1'
@ -311,8 +310,7 @@ Contains
endif
if ((len<0)) then
err=4025
iplen = len
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len/), &
& a_err='complex(psb_spk_)')
goto 9999
end if
@ -325,8 +323,7 @@ Contains
Allocate(tmp(lb_:ub_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len/), &
& a_err='complex(psb_spk_)')
goto 9999
end if
@ -338,8 +335,7 @@ Contains
Allocate(rrax(lb_:ub_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len/), &
& a_err='complex(psb_spk_)')
goto 9999
end if
@ -369,9 +365,9 @@ Contains
! ...Local Variables
complex(psb_spk_),allocatable :: tmp(:,:)
integer(psb_ipk_) :: err_act,err, iplen
integer(psb_ipk_) :: err_act,err
integer(psb_epk_) :: dim,dim2,lb1_, lb2_, ub1_, ub2_,lbi1, lbi2
character(len=20) :: name
character(len=30) :: name
name='psb_r_e_c_rk2'
call psb_erractionsave(err_act)
@ -391,15 +387,13 @@ Contains
if (len1 < 0) then
err=4025
iplen = len1
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len1/), &
& a_err='complex(psb_spk_)')
goto 9999
end if
if (len2 < 0) then
err=4025
iplen = len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len2/), &
& a_err='complex(psb_spk_)')
goto 9999
end if
@ -415,8 +409,7 @@ Contains
Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len1*len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/(len1*len2)/), &
& a_err='complex(psb_spk_)')
goto 9999
end if
@ -430,8 +423,7 @@ Contains
Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len1*len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/(len1*len2)/), &
& a_err='complex(psb_spk_)')
goto 9999
end if
@ -463,10 +455,10 @@ Contains
! ...Local Variables
complex(psb_spk_),allocatable :: tmp(:,:)
integer(psb_ipk_) :: err_act,err, iplen
integer(psb_mpk_) :: dim,lb1_, lb2_, ub1_, ub2_,lbi1, lbi2
integer(psb_ipk_) :: err_act,err
integer(psb_epk_) :: dim,lb1_, lb2_, ub1_, ub2_,lbi1, lbi2
integer(psb_epk_) :: dim2
character(len=20) :: name
character(len=30) :: name
name='psb_r_me_c_rk2'
call psb_erractionsave(err_act)
@ -486,15 +478,13 @@ Contains
if (len1 < 0) then
err=4025
iplen = len1
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, m_err=(/len1/), &
& a_err='complex(psb_spk_)')
goto 9999
end if
if (len2 < 0) then
err=4025
iplen = len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len2/), &
& a_err='complex(psb_spk_)')
goto 9999
end if
@ -510,8 +500,7 @@ Contains
Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len1*len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len1*len2/), &
& a_err='complex(psb_spk_)')
goto 9999
end if
@ -525,8 +514,7 @@ Contains
Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len1*len2
call psb_errpush(err,name,i_err=(/iplen/),&
call psb_errpush(err,name,e_err=(/len1*len2/),&
& a_err='complex(psb_spk_)')
goto 9999
end if
@ -558,10 +546,10 @@ Contains
! ...Local Variables
complex(psb_spk_),allocatable :: tmp(:,:)
integer(psb_ipk_) :: err_act,err, iplen
integer(psb_mpk_) :: dim2,lb1_, lb2_, ub1_, ub2_,lbi1, lbi2
integer(psb_ipk_) :: err_act,err
integer(psb_epk_) :: dim2,lb1_, lb2_, ub1_, ub2_,lbi1, lbi2
integer(psb_epk_) :: dim
character(len=20) :: name
character(len=30) :: name
name='psb_r_me_c_rk2'
call psb_erractionsave(err_act)
@ -581,15 +569,13 @@ Contains
if (len1 < 0) then
err=4025
iplen = len1
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len1/), &
& a_err='complex(psb_spk_)')
goto 9999
end if
if (len2 < 0) then
err=4025
iplen = len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, m_err=(/len2/), &
& a_err='complex(psb_spk_)')
goto 9999
end if
@ -605,8 +591,7 @@ Contains
Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len1*len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len1*len2/), &
& a_err='complex(psb_spk_)')
goto 9999
end if
@ -620,8 +605,7 @@ Contains
Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len1*len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len1*len2/), &
& a_err='complex(psb_spk_)')
goto 9999
end if
@ -648,7 +632,7 @@ Contains
complex(psb_spk_),allocatable, intent(inout) :: rrax(:),y(:)
integer(psb_ipk_) :: info
complex(psb_spk_), optional, intent(in) :: pad
character(len=20) :: name
character(len=30) :: name
integer(psb_ipk_) :: err_act, err
name='psb_r_m_2_c_rk1'
@ -689,7 +673,7 @@ Contains
complex(psb_spk_),allocatable, intent(inout) :: rrax(:),y(:)
integer(psb_ipk_) :: info
complex(psb_spk_), optional, intent(in) :: pad
character(len=20) :: name
character(len=30) :: name
integer(psb_ipk_) :: err_act, err
name='psb_r_m_2_c_rk1'
@ -733,8 +717,8 @@ Contains
integer(psb_ipk_) :: info
! ...Local Variables
integer(psb_ipk_) :: isz,err_act,lb
character(len=20) :: name, char_err
integer(psb_ipk_) :: err_act
character(len=30) :: name, char_err
logical, parameter :: debug=.false.
name='psb_ab_cpy_c_s'
@ -776,7 +760,7 @@ Contains
! ...Local Variables
integer(psb_ipk_) :: isz,err_act,lb
character(len=20) :: name, char_err
character(len=30) :: name, char_err
logical, parameter :: debug=.false.
name='psb_ab_cpy_c_rk1'
@ -820,7 +804,7 @@ Contains
! ...Local Variables
integer(psb_ipk_) :: isz1, isz2,err_act, lb1, lb2
character(len=20) :: name, char_err
character(len=30) :: name, char_err
logical, parameter :: debug=.false.
name='psb_ab_cpy_c_rk2'
@ -867,7 +851,7 @@ Contains
! ...Local Variables
integer(psb_ipk_) :: isz,err_act,lb
character(len=20) :: name, char_err
character(len=30) :: name, char_err
logical, parameter :: debug=.false.
name='psb_cpy_c_rk1'
@ -908,7 +892,7 @@ Contains
! ...Local Variables
integer(psb_ipk_) :: isz1, isz2,err_act, lb1, lb2
character(len=20) :: name, char_err
character(len=30) :: name, char_err
logical, parameter :: debug=.false.
name='psb_safe_cpy'
@ -984,7 +968,7 @@ Contains
integer(psb_mpk_), optional, intent(in) :: addsz,newsz
complex(psb_spk_), optional, intent(in) :: pad
! ...Local Variables
character(len=20) :: name
character(len=30) :: name
logical, parameter :: debug=.false.
integer(psb_ipk_) :: err_act
integer(psb_mpk_) :: isz
@ -1037,7 +1021,7 @@ Contains
integer(psb_epk_), optional, intent(in) :: addsz,newsz
complex(psb_spk_), optional, intent(in) :: pad
! ...Local Variables
character(len=20) :: name
character(len=30) :: name
logical, parameter :: debug=.false.
integer(psb_ipk_) :: err_act
integer(psb_epk_) :: isz

@ -92,7 +92,7 @@ Contains
! ...Local Variables
integer(psb_ipk_) :: err_act,err
character(len=20) :: name
character(len=30) :: name
logical, parameter :: debug=.false.
name='psb_r_d_s'
@ -133,7 +133,7 @@ Contains
real(psb_dpk_),allocatable :: tmp(:)
integer(psb_mpk_) :: dim, lb_, lbi,ub_
integer(psb_ipk_) :: err_act,err
character(len=20) :: name
character(len=30) :: name
logical, parameter :: debug=.false.
name='psb_r_m_d_rk1'
@ -205,7 +205,7 @@ Contains
real(psb_dpk_),allocatable :: tmp(:,:)
integer(psb_ipk_) :: err_act,err
integer(psb_mpk_) :: dim,dim2,lb1_, lb2_, ub1_, ub2_,lbi1, lbi2
character(len=20) :: name
character(len=30) :: name
name='psb_r_m_d_rk2'
call psb_erractionsave(err_act)
@ -294,9 +294,8 @@ Contains
! ...Local Variables
real(psb_dpk_),allocatable :: tmp(:)
integer(psb_epk_) :: dim, lb_, lbi,ub_
integer(psb_ipk_) :: iplen
integer(psb_ipk_) :: err_act,err
character(len=20) :: name
character(len=30) :: name
logical, parameter :: debug=.false.
name='psb_r_m_d_rk1'
@ -311,8 +310,7 @@ Contains
endif
if ((len<0)) then
err=4025
iplen = len
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len/), &
& a_err='real(psb_dpk_)')
goto 9999
end if
@ -325,8 +323,7 @@ Contains
Allocate(tmp(lb_:ub_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len/), &
& a_err='real(psb_dpk_)')
goto 9999
end if
@ -338,8 +335,7 @@ Contains
Allocate(rrax(lb_:ub_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len/), &
& a_err='real(psb_dpk_)')
goto 9999
end if
@ -369,9 +365,9 @@ Contains
! ...Local Variables
real(psb_dpk_),allocatable :: tmp(:,:)
integer(psb_ipk_) :: err_act,err, iplen
integer(psb_ipk_) :: err_act,err
integer(psb_epk_) :: dim,dim2,lb1_, lb2_, ub1_, ub2_,lbi1, lbi2
character(len=20) :: name
character(len=30) :: name
name='psb_r_e_d_rk2'
call psb_erractionsave(err_act)
@ -391,15 +387,13 @@ Contains
if (len1 < 0) then
err=4025
iplen = len1
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len1/), &
& a_err='real(psb_dpk_)')
goto 9999
end if
if (len2 < 0) then
err=4025
iplen = len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len2/), &
& a_err='real(psb_dpk_)')
goto 9999
end if
@ -415,8 +409,7 @@ Contains
Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len1*len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/(len1*len2)/), &
& a_err='real(psb_dpk_)')
goto 9999
end if
@ -430,8 +423,7 @@ Contains
Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len1*len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/(len1*len2)/), &
& a_err='real(psb_dpk_)')
goto 9999
end if
@ -463,10 +455,10 @@ Contains
! ...Local Variables
real(psb_dpk_),allocatable :: tmp(:,:)
integer(psb_ipk_) :: err_act,err, iplen
integer(psb_mpk_) :: dim,lb1_, lb2_, ub1_, ub2_,lbi1, lbi2
integer(psb_ipk_) :: err_act,err
integer(psb_epk_) :: dim,lb1_, lb2_, ub1_, ub2_,lbi1, lbi2
integer(psb_epk_) :: dim2
character(len=20) :: name
character(len=30) :: name
name='psb_r_me_d_rk2'
call psb_erractionsave(err_act)
@ -486,15 +478,13 @@ Contains
if (len1 < 0) then
err=4025
iplen = len1
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, m_err=(/len1/), &
& a_err='real(psb_dpk_)')
goto 9999
end if
if (len2 < 0) then
err=4025
iplen = len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len2/), &
& a_err='real(psb_dpk_)')
goto 9999
end if
@ -510,8 +500,7 @@ Contains
Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len1*len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len1*len2/), &
& a_err='real(psb_dpk_)')
goto 9999
end if
@ -525,8 +514,7 @@ Contains
Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len1*len2
call psb_errpush(err,name,i_err=(/iplen/),&
call psb_errpush(err,name,e_err=(/len1*len2/),&
& a_err='real(psb_dpk_)')
goto 9999
end if
@ -558,10 +546,10 @@ Contains
! ...Local Variables
real(psb_dpk_),allocatable :: tmp(:,:)
integer(psb_ipk_) :: err_act,err, iplen
integer(psb_mpk_) :: dim2,lb1_, lb2_, ub1_, ub2_,lbi1, lbi2
integer(psb_ipk_) :: err_act,err
integer(psb_epk_) :: dim2,lb1_, lb2_, ub1_, ub2_,lbi1, lbi2
integer(psb_epk_) :: dim
character(len=20) :: name
character(len=30) :: name
name='psb_r_me_d_rk2'
call psb_erractionsave(err_act)
@ -581,15 +569,13 @@ Contains
if (len1 < 0) then
err=4025
iplen = len1
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len1/), &
& a_err='real(psb_dpk_)')
goto 9999
end if
if (len2 < 0) then
err=4025
iplen = len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, m_err=(/len2/), &
& a_err='real(psb_dpk_)')
goto 9999
end if
@ -605,8 +591,7 @@ Contains
Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len1*len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len1*len2/), &
& a_err='real(psb_dpk_)')
goto 9999
end if
@ -620,8 +605,7 @@ Contains
Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len1*len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len1*len2/), &
& a_err='real(psb_dpk_)')
goto 9999
end if
@ -648,7 +632,7 @@ Contains
real(psb_dpk_),allocatable, intent(inout) :: rrax(:),y(:)
integer(psb_ipk_) :: info
real(psb_dpk_), optional, intent(in) :: pad
character(len=20) :: name
character(len=30) :: name
integer(psb_ipk_) :: err_act, err
name='psb_r_m_2_d_rk1'
@ -689,7 +673,7 @@ Contains
real(psb_dpk_),allocatable, intent(inout) :: rrax(:),y(:)
integer(psb_ipk_) :: info
real(psb_dpk_), optional, intent(in) :: pad
character(len=20) :: name
character(len=30) :: name
integer(psb_ipk_) :: err_act, err
name='psb_r_m_2_d_rk1'
@ -733,8 +717,8 @@ Contains
integer(psb_ipk_) :: info
! ...Local Variables
integer(psb_ipk_) :: isz,err_act,lb
character(len=20) :: name, char_err
integer(psb_ipk_) :: err_act
character(len=30) :: name, char_err
logical, parameter :: debug=.false.
name='psb_ab_cpy_d_s'
@ -776,7 +760,7 @@ Contains
! ...Local Variables
integer(psb_ipk_) :: isz,err_act,lb
character(len=20) :: name, char_err
character(len=30) :: name, char_err
logical, parameter :: debug=.false.
name='psb_ab_cpy_d_rk1'
@ -820,7 +804,7 @@ Contains
! ...Local Variables
integer(psb_ipk_) :: isz1, isz2,err_act, lb1, lb2
character(len=20) :: name, char_err
character(len=30) :: name, char_err
logical, parameter :: debug=.false.
name='psb_ab_cpy_d_rk2'
@ -867,7 +851,7 @@ Contains
! ...Local Variables
integer(psb_ipk_) :: isz,err_act,lb
character(len=20) :: name, char_err
character(len=30) :: name, char_err
logical, parameter :: debug=.false.
name='psb_cpy_d_rk1'
@ -908,7 +892,7 @@ Contains
! ...Local Variables
integer(psb_ipk_) :: isz1, isz2,err_act, lb1, lb2
character(len=20) :: name, char_err
character(len=30) :: name, char_err
logical, parameter :: debug=.false.
name='psb_safe_cpy'
@ -984,7 +968,7 @@ Contains
integer(psb_mpk_), optional, intent(in) :: addsz,newsz
real(psb_dpk_), optional, intent(in) :: pad
! ...Local Variables
character(len=20) :: name
character(len=30) :: name
logical, parameter :: debug=.false.
integer(psb_ipk_) :: err_act
integer(psb_mpk_) :: isz
@ -1037,7 +1021,7 @@ Contains
integer(psb_epk_), optional, intent(in) :: addsz,newsz
real(psb_dpk_), optional, intent(in) :: pad
! ...Local Variables
character(len=20) :: name
character(len=30) :: name
logical, parameter :: debug=.false.
integer(psb_ipk_) :: err_act
integer(psb_epk_) :: isz

@ -92,7 +92,7 @@ Contains
! ...Local Variables
integer(psb_ipk_) :: err_act,err
character(len=20) :: name
character(len=30) :: name
logical, parameter :: debug=.false.
name='psb_r_e_s'
@ -133,7 +133,7 @@ Contains
integer(psb_epk_),allocatable :: tmp(:)
integer(psb_mpk_) :: dim, lb_, lbi,ub_
integer(psb_ipk_) :: err_act,err
character(len=20) :: name
character(len=30) :: name
logical, parameter :: debug=.false.
name='psb_r_m_e_rk1'
@ -205,7 +205,7 @@ Contains
integer(psb_epk_),allocatable :: tmp(:,:)
integer(psb_ipk_) :: err_act,err
integer(psb_mpk_) :: dim,dim2,lb1_, lb2_, ub1_, ub2_,lbi1, lbi2
character(len=20) :: name
character(len=30) :: name
name='psb_r_m_e_rk2'
call psb_erractionsave(err_act)
@ -294,9 +294,8 @@ Contains
! ...Local Variables
integer(psb_epk_),allocatable :: tmp(:)
integer(psb_epk_) :: dim, lb_, lbi,ub_
integer(psb_ipk_) :: iplen
integer(psb_ipk_) :: err_act,err
character(len=20) :: name
character(len=30) :: name
logical, parameter :: debug=.false.
name='psb_r_m_e_rk1'
@ -311,8 +310,7 @@ Contains
endif
if ((len<0)) then
err=4025
iplen = len
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len/), &
& a_err='integer(psb_epk_)')
goto 9999
end if
@ -325,8 +323,7 @@ Contains
Allocate(tmp(lb_:ub_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len/), &
& a_err='integer(psb_epk_)')
goto 9999
end if
@ -338,8 +335,7 @@ Contains
Allocate(rrax(lb_:ub_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len/), &
& a_err='integer(psb_epk_)')
goto 9999
end if
@ -369,9 +365,9 @@ Contains
! ...Local Variables
integer(psb_epk_),allocatable :: tmp(:,:)
integer(psb_ipk_) :: err_act,err, iplen
integer(psb_ipk_) :: err_act,err
integer(psb_epk_) :: dim,dim2,lb1_, lb2_, ub1_, ub2_,lbi1, lbi2
character(len=20) :: name
character(len=30) :: name
name='psb_r_e_e_rk2'
call psb_erractionsave(err_act)
@ -391,15 +387,13 @@ Contains
if (len1 < 0) then
err=4025
iplen = len1
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len1/), &
& a_err='integer(psb_epk_)')
goto 9999
end if
if (len2 < 0) then
err=4025
iplen = len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len2/), &
& a_err='integer(psb_epk_)')
goto 9999
end if
@ -415,8 +409,7 @@ Contains
Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len1*len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/(len1*len2)/), &
& a_err='integer(psb_epk_)')
goto 9999
end if
@ -430,8 +423,7 @@ Contains
Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len1*len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/(len1*len2)/), &
& a_err='integer(psb_epk_)')
goto 9999
end if
@ -463,10 +455,10 @@ Contains
! ...Local Variables
integer(psb_epk_),allocatable :: tmp(:,:)
integer(psb_ipk_) :: err_act,err, iplen
integer(psb_mpk_) :: dim,lb1_, lb2_, ub1_, ub2_,lbi1, lbi2
integer(psb_ipk_) :: err_act,err
integer(psb_epk_) :: dim,lb1_, lb2_, ub1_, ub2_,lbi1, lbi2
integer(psb_epk_) :: dim2
character(len=20) :: name
character(len=30) :: name
name='psb_r_me_e_rk2'
call psb_erractionsave(err_act)
@ -486,15 +478,13 @@ Contains
if (len1 < 0) then
err=4025
iplen = len1
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, m_err=(/len1/), &
& a_err='integer(psb_epk_)')
goto 9999
end if
if (len2 < 0) then
err=4025
iplen = len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len2/), &
& a_err='integer(psb_epk_)')
goto 9999
end if
@ -510,8 +500,7 @@ Contains
Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len1*len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len1*len2/), &
& a_err='integer(psb_epk_)')
goto 9999
end if
@ -525,8 +514,7 @@ Contains
Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len1*len2
call psb_errpush(err,name,i_err=(/iplen/),&
call psb_errpush(err,name,e_err=(/len1*len2/),&
& a_err='integer(psb_epk_)')
goto 9999
end if
@ -558,10 +546,10 @@ Contains
! ...Local Variables
integer(psb_epk_),allocatable :: tmp(:,:)
integer(psb_ipk_) :: err_act,err, iplen
integer(psb_mpk_) :: dim2,lb1_, lb2_, ub1_, ub2_,lbi1, lbi2
integer(psb_ipk_) :: err_act,err
integer(psb_epk_) :: dim2,lb1_, lb2_, ub1_, ub2_,lbi1, lbi2
integer(psb_epk_) :: dim
character(len=20) :: name
character(len=30) :: name
name='psb_r_me_e_rk2'
call psb_erractionsave(err_act)
@ -581,15 +569,13 @@ Contains
if (len1 < 0) then
err=4025
iplen = len1
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len1/), &
& a_err='integer(psb_epk_)')
goto 9999
end if
if (len2 < 0) then
err=4025
iplen = len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, m_err=(/len2/), &
& a_err='integer(psb_epk_)')
goto 9999
end if
@ -605,8 +591,7 @@ Contains
Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len1*len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len1*len2/), &
& a_err='integer(psb_epk_)')
goto 9999
end if
@ -620,8 +605,7 @@ Contains
Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len1*len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len1*len2/), &
& a_err='integer(psb_epk_)')
goto 9999
end if
@ -648,7 +632,7 @@ Contains
integer(psb_epk_),allocatable, intent(inout) :: rrax(:),y(:)
integer(psb_ipk_) :: info
integer(psb_epk_), optional, intent(in) :: pad
character(len=20) :: name
character(len=30) :: name
integer(psb_ipk_) :: err_act, err
name='psb_r_m_2_e_rk1'
@ -689,7 +673,7 @@ Contains
integer(psb_epk_),allocatable, intent(inout) :: rrax(:),y(:)
integer(psb_ipk_) :: info
integer(psb_epk_), optional, intent(in) :: pad
character(len=20) :: name
character(len=30) :: name
integer(psb_ipk_) :: err_act, err
name='psb_r_m_2_e_rk1'
@ -733,8 +717,8 @@ Contains
integer(psb_ipk_) :: info
! ...Local Variables
integer(psb_ipk_) :: isz,err_act,lb
character(len=20) :: name, char_err
integer(psb_ipk_) :: err_act
character(len=30) :: name, char_err
logical, parameter :: debug=.false.
name='psb_ab_cpy_e_s'
@ -776,7 +760,7 @@ Contains
! ...Local Variables
integer(psb_ipk_) :: isz,err_act,lb
character(len=20) :: name, char_err
character(len=30) :: name, char_err
logical, parameter :: debug=.false.
name='psb_ab_cpy_e_rk1'
@ -820,7 +804,7 @@ Contains
! ...Local Variables
integer(psb_ipk_) :: isz1, isz2,err_act, lb1, lb2
character(len=20) :: name, char_err
character(len=30) :: name, char_err
logical, parameter :: debug=.false.
name='psb_ab_cpy_e_rk2'
@ -867,7 +851,7 @@ Contains
! ...Local Variables
integer(psb_ipk_) :: isz,err_act,lb
character(len=20) :: name, char_err
character(len=30) :: name, char_err
logical, parameter :: debug=.false.
name='psb_cpy_e_rk1'
@ -908,7 +892,7 @@ Contains
! ...Local Variables
integer(psb_ipk_) :: isz1, isz2,err_act, lb1, lb2
character(len=20) :: name, char_err
character(len=30) :: name, char_err
logical, parameter :: debug=.false.
name='psb_safe_cpy'
@ -984,7 +968,7 @@ Contains
integer(psb_mpk_), optional, intent(in) :: addsz,newsz
integer(psb_epk_), optional, intent(in) :: pad
! ...Local Variables
character(len=20) :: name
character(len=30) :: name
logical, parameter :: debug=.false.
integer(psb_ipk_) :: err_act
integer(psb_mpk_) :: isz
@ -1037,7 +1021,7 @@ Contains
integer(psb_epk_), optional, intent(in) :: addsz,newsz
integer(psb_epk_), optional, intent(in) :: pad
! ...Local Variables
character(len=20) :: name
character(len=30) :: name
logical, parameter :: debug=.false.
integer(psb_ipk_) :: err_act
integer(psb_epk_) :: isz

@ -92,7 +92,7 @@ Contains
! ...Local Variables
integer(psb_ipk_) :: err_act,err
character(len=20) :: name
character(len=30) :: name
logical, parameter :: debug=.false.
name='psb_r_i2_s'
@ -133,7 +133,7 @@ Contains
integer(psb_i2pk_),allocatable :: tmp(:)
integer(psb_mpk_) :: dim, lb_, lbi,ub_
integer(psb_ipk_) :: err_act,err
character(len=20) :: name
character(len=30) :: name
logical, parameter :: debug=.false.
name='psb_r_m_i2_rk1'
@ -205,7 +205,7 @@ Contains
integer(psb_i2pk_),allocatable :: tmp(:,:)
integer(psb_ipk_) :: err_act,err
integer(psb_mpk_) :: dim,dim2,lb1_, lb2_, ub1_, ub2_,lbi1, lbi2
character(len=20) :: name
character(len=30) :: name
name='psb_r_m_i2_rk2'
call psb_erractionsave(err_act)
@ -294,9 +294,8 @@ Contains
! ...Local Variables
integer(psb_i2pk_),allocatable :: tmp(:)
integer(psb_epk_) :: dim, lb_, lbi,ub_
integer(psb_ipk_) :: iplen
integer(psb_ipk_) :: err_act,err
character(len=20) :: name
character(len=30) :: name
logical, parameter :: debug=.false.
name='psb_r_m_i2_rk1'
@ -311,8 +310,7 @@ Contains
endif
if ((len<0)) then
err=4025
iplen = len
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len/), &
& a_err='integer(psb_i2pk_)')
goto 9999
end if
@ -325,8 +323,7 @@ Contains
Allocate(tmp(lb_:ub_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len/), &
& a_err='integer(psb_i2pk_)')
goto 9999
end if
@ -338,8 +335,7 @@ Contains
Allocate(rrax(lb_:ub_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len/), &
& a_err='integer(psb_i2pk_)')
goto 9999
end if
@ -369,9 +365,9 @@ Contains
! ...Local Variables
integer(psb_i2pk_),allocatable :: tmp(:,:)
integer(psb_ipk_) :: err_act,err, iplen
integer(psb_ipk_) :: err_act,err
integer(psb_epk_) :: dim,dim2,lb1_, lb2_, ub1_, ub2_,lbi1, lbi2
character(len=20) :: name
character(len=30) :: name
name='psb_r_e_i2_rk2'
call psb_erractionsave(err_act)
@ -391,15 +387,13 @@ Contains
if (len1 < 0) then
err=4025
iplen = len1
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len1/), &
& a_err='integer(psb_i2pk_)')
goto 9999
end if
if (len2 < 0) then
err=4025
iplen = len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len2/), &
& a_err='integer(psb_i2pk_)')
goto 9999
end if
@ -415,8 +409,7 @@ Contains
Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len1*len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/(len1*len2)/), &
& a_err='integer(psb_i2pk_)')
goto 9999
end if
@ -430,8 +423,7 @@ Contains
Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len1*len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/(len1*len2)/), &
& a_err='integer(psb_i2pk_)')
goto 9999
end if
@ -463,10 +455,10 @@ Contains
! ...Local Variables
integer(psb_i2pk_),allocatable :: tmp(:,:)
integer(psb_ipk_) :: err_act,err, iplen
integer(psb_mpk_) :: dim,lb1_, lb2_, ub1_, ub2_,lbi1, lbi2
integer(psb_ipk_) :: err_act,err
integer(psb_epk_) :: dim,lb1_, lb2_, ub1_, ub2_,lbi1, lbi2
integer(psb_epk_) :: dim2
character(len=20) :: name
character(len=30) :: name
name='psb_r_me_i2_rk2'
call psb_erractionsave(err_act)
@ -486,15 +478,13 @@ Contains
if (len1 < 0) then
err=4025
iplen = len1
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, m_err=(/len1/), &
& a_err='integer(psb_i2pk_)')
goto 9999
end if
if (len2 < 0) then
err=4025
iplen = len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len2/), &
& a_err='integer(psb_i2pk_)')
goto 9999
end if
@ -510,8 +500,7 @@ Contains
Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len1*len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len1*len2/), &
& a_err='integer(psb_i2pk_)')
goto 9999
end if
@ -525,8 +514,7 @@ Contains
Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len1*len2
call psb_errpush(err,name,i_err=(/iplen/),&
call psb_errpush(err,name,e_err=(/len1*len2/),&
& a_err='integer(psb_i2pk_)')
goto 9999
end if
@ -558,10 +546,10 @@ Contains
! ...Local Variables
integer(psb_i2pk_),allocatable :: tmp(:,:)
integer(psb_ipk_) :: err_act,err, iplen
integer(psb_mpk_) :: dim2,lb1_, lb2_, ub1_, ub2_,lbi1, lbi2
integer(psb_ipk_) :: err_act,err
integer(psb_epk_) :: dim2,lb1_, lb2_, ub1_, ub2_,lbi1, lbi2
integer(psb_epk_) :: dim
character(len=20) :: name
character(len=30) :: name
name='psb_r_me_i2_rk2'
call psb_erractionsave(err_act)
@ -581,15 +569,13 @@ Contains
if (len1 < 0) then
err=4025
iplen = len1
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len1/), &
& a_err='integer(psb_i2pk_)')
goto 9999
end if
if (len2 < 0) then
err=4025
iplen = len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, m_err=(/len2/), &
& a_err='integer(psb_i2pk_)')
goto 9999
end if
@ -605,8 +591,7 @@ Contains
Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len1*len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len1*len2/), &
& a_err='integer(psb_i2pk_)')
goto 9999
end if
@ -620,8 +605,7 @@ Contains
Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len1*len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len1*len2/), &
& a_err='integer(psb_i2pk_)')
goto 9999
end if
@ -648,7 +632,7 @@ Contains
integer(psb_i2pk_),allocatable, intent(inout) :: rrax(:),y(:)
integer(psb_ipk_) :: info
integer(psb_i2pk_), optional, intent(in) :: pad
character(len=20) :: name
character(len=30) :: name
integer(psb_ipk_) :: err_act, err
name='psb_r_m_2_i2_rk1'
@ -689,7 +673,7 @@ Contains
integer(psb_i2pk_),allocatable, intent(inout) :: rrax(:),y(:)
integer(psb_ipk_) :: info
integer(psb_i2pk_), optional, intent(in) :: pad
character(len=20) :: name
character(len=30) :: name
integer(psb_ipk_) :: err_act, err
name='psb_r_m_2_i2_rk1'
@ -733,8 +717,8 @@ Contains
integer(psb_ipk_) :: info
! ...Local Variables
integer(psb_ipk_) :: isz,err_act,lb
character(len=20) :: name, char_err
integer(psb_ipk_) :: err_act
character(len=30) :: name, char_err
logical, parameter :: debug=.false.
name='psb_ab_cpy_i2_s'
@ -776,7 +760,7 @@ Contains
! ...Local Variables
integer(psb_ipk_) :: isz,err_act,lb
character(len=20) :: name, char_err
character(len=30) :: name, char_err
logical, parameter :: debug=.false.
name='psb_ab_cpy_i2_rk1'
@ -820,7 +804,7 @@ Contains
! ...Local Variables
integer(psb_ipk_) :: isz1, isz2,err_act, lb1, lb2
character(len=20) :: name, char_err
character(len=30) :: name, char_err
logical, parameter :: debug=.false.
name='psb_ab_cpy_i2_rk2'
@ -867,7 +851,7 @@ Contains
! ...Local Variables
integer(psb_ipk_) :: isz,err_act,lb
character(len=20) :: name, char_err
character(len=30) :: name, char_err
logical, parameter :: debug=.false.
name='psb_cpy_i2_rk1'
@ -908,7 +892,7 @@ Contains
! ...Local Variables
integer(psb_ipk_) :: isz1, isz2,err_act, lb1, lb2
character(len=20) :: name, char_err
character(len=30) :: name, char_err
logical, parameter :: debug=.false.
name='psb_safe_cpy'
@ -984,7 +968,7 @@ Contains
integer(psb_mpk_), optional, intent(in) :: addsz,newsz
integer(psb_i2pk_), optional, intent(in) :: pad
! ...Local Variables
character(len=20) :: name
character(len=30) :: name
logical, parameter :: debug=.false.
integer(psb_ipk_) :: err_act
integer(psb_mpk_) :: isz
@ -1037,7 +1021,7 @@ Contains
integer(psb_epk_), optional, intent(in) :: addsz,newsz
integer(psb_i2pk_), optional, intent(in) :: pad
! ...Local Variables
character(len=20) :: name
character(len=30) :: name
logical, parameter :: debug=.false.
integer(psb_ipk_) :: err_act
integer(psb_epk_) :: isz

@ -92,7 +92,7 @@ Contains
! ...Local Variables
integer(psb_ipk_) :: err_act,err
character(len=20) :: name
character(len=30) :: name
logical, parameter :: debug=.false.
name='psb_r_m_s'
@ -133,7 +133,7 @@ Contains
integer(psb_mpk_),allocatable :: tmp(:)
integer(psb_mpk_) :: dim, lb_, lbi,ub_
integer(psb_ipk_) :: err_act,err
character(len=20) :: name
character(len=30) :: name
logical, parameter :: debug=.false.
name='psb_r_m_m_rk1'
@ -205,7 +205,7 @@ Contains
integer(psb_mpk_),allocatable :: tmp(:,:)
integer(psb_ipk_) :: err_act,err
integer(psb_mpk_) :: dim,dim2,lb1_, lb2_, ub1_, ub2_,lbi1, lbi2
character(len=20) :: name
character(len=30) :: name
name='psb_r_m_m_rk2'
call psb_erractionsave(err_act)
@ -294,9 +294,8 @@ Contains
! ...Local Variables
integer(psb_mpk_),allocatable :: tmp(:)
integer(psb_epk_) :: dim, lb_, lbi,ub_
integer(psb_ipk_) :: iplen
integer(psb_ipk_) :: err_act,err
character(len=20) :: name
character(len=30) :: name
logical, parameter :: debug=.false.
name='psb_r_m_m_rk1'
@ -311,8 +310,7 @@ Contains
endif
if ((len<0)) then
err=4025
iplen = len
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len/), &
& a_err='integer(psb_mpk_)')
goto 9999
end if
@ -325,8 +323,7 @@ Contains
Allocate(tmp(lb_:ub_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len/), &
& a_err='integer(psb_mpk_)')
goto 9999
end if
@ -338,8 +335,7 @@ Contains
Allocate(rrax(lb_:ub_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len/), &
& a_err='integer(psb_mpk_)')
goto 9999
end if
@ -369,9 +365,9 @@ Contains
! ...Local Variables
integer(psb_mpk_),allocatable :: tmp(:,:)
integer(psb_ipk_) :: err_act,err, iplen
integer(psb_ipk_) :: err_act,err
integer(psb_epk_) :: dim,dim2,lb1_, lb2_, ub1_, ub2_,lbi1, lbi2
character(len=20) :: name
character(len=30) :: name
name='psb_r_e_m_rk2'
call psb_erractionsave(err_act)
@ -391,15 +387,13 @@ Contains
if (len1 < 0) then
err=4025
iplen = len1
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len1/), &
& a_err='integer(psb_mpk_)')
goto 9999
end if
if (len2 < 0) then
err=4025
iplen = len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len2/), &
& a_err='integer(psb_mpk_)')
goto 9999
end if
@ -415,8 +409,7 @@ Contains
Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len1*len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/(len1*len2)/), &
& a_err='integer(psb_mpk_)')
goto 9999
end if
@ -430,8 +423,7 @@ Contains
Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len1*len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/(len1*len2)/), &
& a_err='integer(psb_mpk_)')
goto 9999
end if
@ -463,10 +455,10 @@ Contains
! ...Local Variables
integer(psb_mpk_),allocatable :: tmp(:,:)
integer(psb_ipk_) :: err_act,err, iplen
integer(psb_mpk_) :: dim,lb1_, lb2_, ub1_, ub2_,lbi1, lbi2
integer(psb_ipk_) :: err_act,err
integer(psb_epk_) :: dim,lb1_, lb2_, ub1_, ub2_,lbi1, lbi2
integer(psb_epk_) :: dim2
character(len=20) :: name
character(len=30) :: name
name='psb_r_me_m_rk2'
call psb_erractionsave(err_act)
@ -486,15 +478,13 @@ Contains
if (len1 < 0) then
err=4025
iplen = len1
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, m_err=(/len1/), &
& a_err='integer(psb_mpk_)')
goto 9999
end if
if (len2 < 0) then
err=4025
iplen = len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len2/), &
& a_err='integer(psb_mpk_)')
goto 9999
end if
@ -510,8 +500,7 @@ Contains
Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len1*len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len1*len2/), &
& a_err='integer(psb_mpk_)')
goto 9999
end if
@ -525,8 +514,7 @@ Contains
Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len1*len2
call psb_errpush(err,name,i_err=(/iplen/),&
call psb_errpush(err,name,e_err=(/len1*len2/),&
& a_err='integer(psb_mpk_)')
goto 9999
end if
@ -558,10 +546,10 @@ Contains
! ...Local Variables
integer(psb_mpk_),allocatable :: tmp(:,:)
integer(psb_ipk_) :: err_act,err, iplen
integer(psb_mpk_) :: dim2,lb1_, lb2_, ub1_, ub2_,lbi1, lbi2
integer(psb_ipk_) :: err_act,err
integer(psb_epk_) :: dim2,lb1_, lb2_, ub1_, ub2_,lbi1, lbi2
integer(psb_epk_) :: dim
character(len=20) :: name
character(len=30) :: name
name='psb_r_me_m_rk2'
call psb_erractionsave(err_act)
@ -581,15 +569,13 @@ Contains
if (len1 < 0) then
err=4025
iplen = len1
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len1/), &
& a_err='integer(psb_mpk_)')
goto 9999
end if
if (len2 < 0) then
err=4025
iplen = len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, m_err=(/len2/), &
& a_err='integer(psb_mpk_)')
goto 9999
end if
@ -605,8 +591,7 @@ Contains
Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len1*len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len1*len2/), &
& a_err='integer(psb_mpk_)')
goto 9999
end if
@ -620,8 +605,7 @@ Contains
Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len1*len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len1*len2/), &
& a_err='integer(psb_mpk_)')
goto 9999
end if
@ -648,7 +632,7 @@ Contains
integer(psb_mpk_),allocatable, intent(inout) :: rrax(:),y(:)
integer(psb_ipk_) :: info
integer(psb_mpk_), optional, intent(in) :: pad
character(len=20) :: name
character(len=30) :: name
integer(psb_ipk_) :: err_act, err
name='psb_r_m_2_m_rk1'
@ -689,7 +673,7 @@ Contains
integer(psb_mpk_),allocatable, intent(inout) :: rrax(:),y(:)
integer(psb_ipk_) :: info
integer(psb_mpk_), optional, intent(in) :: pad
character(len=20) :: name
character(len=30) :: name
integer(psb_ipk_) :: err_act, err
name='psb_r_m_2_m_rk1'
@ -733,8 +717,8 @@ Contains
integer(psb_ipk_) :: info
! ...Local Variables
integer(psb_ipk_) :: isz,err_act,lb
character(len=20) :: name, char_err
integer(psb_ipk_) :: err_act
character(len=30) :: name, char_err
logical, parameter :: debug=.false.
name='psb_ab_cpy_m_s'
@ -776,7 +760,7 @@ Contains
! ...Local Variables
integer(psb_ipk_) :: isz,err_act,lb
character(len=20) :: name, char_err
character(len=30) :: name, char_err
logical, parameter :: debug=.false.
name='psb_ab_cpy_m_rk1'
@ -820,7 +804,7 @@ Contains
! ...Local Variables
integer(psb_ipk_) :: isz1, isz2,err_act, lb1, lb2
character(len=20) :: name, char_err
character(len=30) :: name, char_err
logical, parameter :: debug=.false.
name='psb_ab_cpy_m_rk2'
@ -867,7 +851,7 @@ Contains
! ...Local Variables
integer(psb_ipk_) :: isz,err_act,lb
character(len=20) :: name, char_err
character(len=30) :: name, char_err
logical, parameter :: debug=.false.
name='psb_cpy_m_rk1'
@ -908,7 +892,7 @@ Contains
! ...Local Variables
integer(psb_ipk_) :: isz1, isz2,err_act, lb1, lb2
character(len=20) :: name, char_err
character(len=30) :: name, char_err
logical, parameter :: debug=.false.
name='psb_safe_cpy'
@ -984,7 +968,7 @@ Contains
integer(psb_mpk_), optional, intent(in) :: addsz,newsz
integer(psb_mpk_), optional, intent(in) :: pad
! ...Local Variables
character(len=20) :: name
character(len=30) :: name
logical, parameter :: debug=.false.
integer(psb_ipk_) :: err_act
integer(psb_mpk_) :: isz
@ -1037,7 +1021,7 @@ Contains
integer(psb_epk_), optional, intent(in) :: addsz,newsz
integer(psb_mpk_), optional, intent(in) :: pad
! ...Local Variables
character(len=20) :: name
character(len=30) :: name
logical, parameter :: debug=.false.
integer(psb_ipk_) :: err_act
integer(psb_epk_) :: isz

@ -92,7 +92,7 @@ Contains
! ...Local Variables
integer(psb_ipk_) :: err_act,err
character(len=20) :: name
character(len=30) :: name
logical, parameter :: debug=.false.
name='psb_r_s_s'
@ -133,7 +133,7 @@ Contains
real(psb_spk_),allocatable :: tmp(:)
integer(psb_mpk_) :: dim, lb_, lbi,ub_
integer(psb_ipk_) :: err_act,err
character(len=20) :: name
character(len=30) :: name
logical, parameter :: debug=.false.
name='psb_r_m_s_rk1'
@ -205,7 +205,7 @@ Contains
real(psb_spk_),allocatable :: tmp(:,:)
integer(psb_ipk_) :: err_act,err
integer(psb_mpk_) :: dim,dim2,lb1_, lb2_, ub1_, ub2_,lbi1, lbi2
character(len=20) :: name
character(len=30) :: name
name='psb_r_m_s_rk2'
call psb_erractionsave(err_act)
@ -294,9 +294,8 @@ Contains
! ...Local Variables
real(psb_spk_),allocatable :: tmp(:)
integer(psb_epk_) :: dim, lb_, lbi,ub_
integer(psb_ipk_) :: iplen
integer(psb_ipk_) :: err_act,err
character(len=20) :: name
character(len=30) :: name
logical, parameter :: debug=.false.
name='psb_r_m_s_rk1'
@ -311,8 +310,7 @@ Contains
endif
if ((len<0)) then
err=4025
iplen = len
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len/), &
& a_err='real(psb_spk_)')
goto 9999
end if
@ -325,8 +323,7 @@ Contains
Allocate(tmp(lb_:ub_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len/), &
& a_err='real(psb_spk_)')
goto 9999
end if
@ -338,8 +335,7 @@ Contains
Allocate(rrax(lb_:ub_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len/), &
& a_err='real(psb_spk_)')
goto 9999
end if
@ -369,9 +365,9 @@ Contains
! ...Local Variables
real(psb_spk_),allocatable :: tmp(:,:)
integer(psb_ipk_) :: err_act,err, iplen
integer(psb_ipk_) :: err_act,err
integer(psb_epk_) :: dim,dim2,lb1_, lb2_, ub1_, ub2_,lbi1, lbi2
character(len=20) :: name
character(len=30) :: name
name='psb_r_e_s_rk2'
call psb_erractionsave(err_act)
@ -391,15 +387,13 @@ Contains
if (len1 < 0) then
err=4025
iplen = len1
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len1/), &
& a_err='real(psb_spk_)')
goto 9999
end if
if (len2 < 0) then
err=4025
iplen = len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len2/), &
& a_err='real(psb_spk_)')
goto 9999
end if
@ -415,8 +409,7 @@ Contains
Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len1*len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/(len1*len2)/), &
& a_err='real(psb_spk_)')
goto 9999
end if
@ -430,8 +423,7 @@ Contains
Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len1*len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/(len1*len2)/), &
& a_err='real(psb_spk_)')
goto 9999
end if
@ -463,10 +455,10 @@ Contains
! ...Local Variables
real(psb_spk_),allocatable :: tmp(:,:)
integer(psb_ipk_) :: err_act,err, iplen
integer(psb_mpk_) :: dim,lb1_, lb2_, ub1_, ub2_,lbi1, lbi2
integer(psb_ipk_) :: err_act,err
integer(psb_epk_) :: dim,lb1_, lb2_, ub1_, ub2_,lbi1, lbi2
integer(psb_epk_) :: dim2
character(len=20) :: name
character(len=30) :: name
name='psb_r_me_s_rk2'
call psb_erractionsave(err_act)
@ -486,15 +478,13 @@ Contains
if (len1 < 0) then
err=4025
iplen = len1
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, m_err=(/len1/), &
& a_err='real(psb_spk_)')
goto 9999
end if
if (len2 < 0) then
err=4025
iplen = len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len2/), &
& a_err='real(psb_spk_)')
goto 9999
end if
@ -510,8 +500,7 @@ Contains
Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len1*len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len1*len2/), &
& a_err='real(psb_spk_)')
goto 9999
end if
@ -525,8 +514,7 @@ Contains
Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len1*len2
call psb_errpush(err,name,i_err=(/iplen/),&
call psb_errpush(err,name,e_err=(/len1*len2/),&
& a_err='real(psb_spk_)')
goto 9999
end if
@ -558,10 +546,10 @@ Contains
! ...Local Variables
real(psb_spk_),allocatable :: tmp(:,:)
integer(psb_ipk_) :: err_act,err, iplen
integer(psb_mpk_) :: dim2,lb1_, lb2_, ub1_, ub2_,lbi1, lbi2
integer(psb_ipk_) :: err_act,err
integer(psb_epk_) :: dim2,lb1_, lb2_, ub1_, ub2_,lbi1, lbi2
integer(psb_epk_) :: dim
character(len=20) :: name
character(len=30) :: name
name='psb_r_me_s_rk2'
call psb_erractionsave(err_act)
@ -581,15 +569,13 @@ Contains
if (len1 < 0) then
err=4025
iplen = len1
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len1/), &
& a_err='real(psb_spk_)')
goto 9999
end if
if (len2 < 0) then
err=4025
iplen = len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, m_err=(/len2/), &
& a_err='real(psb_spk_)')
goto 9999
end if
@ -605,8 +591,7 @@ Contains
Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len1*len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len1*len2/), &
& a_err='real(psb_spk_)')
goto 9999
end if
@ -620,8 +605,7 @@ Contains
Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len1*len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len1*len2/), &
& a_err='real(psb_spk_)')
goto 9999
end if
@ -648,7 +632,7 @@ Contains
real(psb_spk_),allocatable, intent(inout) :: rrax(:),y(:)
integer(psb_ipk_) :: info
real(psb_spk_), optional, intent(in) :: pad
character(len=20) :: name
character(len=30) :: name
integer(psb_ipk_) :: err_act, err
name='psb_r_m_2_s_rk1'
@ -689,7 +673,7 @@ Contains
real(psb_spk_),allocatable, intent(inout) :: rrax(:),y(:)
integer(psb_ipk_) :: info
real(psb_spk_), optional, intent(in) :: pad
character(len=20) :: name
character(len=30) :: name
integer(psb_ipk_) :: err_act, err
name='psb_r_m_2_s_rk1'
@ -733,8 +717,8 @@ Contains
integer(psb_ipk_) :: info
! ...Local Variables
integer(psb_ipk_) :: isz,err_act,lb
character(len=20) :: name, char_err
integer(psb_ipk_) :: err_act
character(len=30) :: name, char_err
logical, parameter :: debug=.false.
name='psb_ab_cpy_s_s'
@ -776,7 +760,7 @@ Contains
! ...Local Variables
integer(psb_ipk_) :: isz,err_act,lb
character(len=20) :: name, char_err
character(len=30) :: name, char_err
logical, parameter :: debug=.false.
name='psb_ab_cpy_s_rk1'
@ -820,7 +804,7 @@ Contains
! ...Local Variables
integer(psb_ipk_) :: isz1, isz2,err_act, lb1, lb2
character(len=20) :: name, char_err
character(len=30) :: name, char_err
logical, parameter :: debug=.false.
name='psb_ab_cpy_s_rk2'
@ -867,7 +851,7 @@ Contains
! ...Local Variables
integer(psb_ipk_) :: isz,err_act,lb
character(len=20) :: name, char_err
character(len=30) :: name, char_err
logical, parameter :: debug=.false.
name='psb_cpy_s_rk1'
@ -908,7 +892,7 @@ Contains
! ...Local Variables
integer(psb_ipk_) :: isz1, isz2,err_act, lb1, lb2
character(len=20) :: name, char_err
character(len=30) :: name, char_err
logical, parameter :: debug=.false.
name='psb_safe_cpy'
@ -984,7 +968,7 @@ Contains
integer(psb_mpk_), optional, intent(in) :: addsz,newsz
real(psb_spk_), optional, intent(in) :: pad
! ...Local Variables
character(len=20) :: name
character(len=30) :: name
logical, parameter :: debug=.false.
integer(psb_ipk_) :: err_act
integer(psb_mpk_) :: isz
@ -1037,7 +1021,7 @@ Contains
integer(psb_epk_), optional, intent(in) :: addsz,newsz
real(psb_spk_), optional, intent(in) :: pad
! ...Local Variables
character(len=20) :: name
character(len=30) :: name
logical, parameter :: debug=.false.
integer(psb_ipk_) :: err_act
integer(psb_epk_) :: isz

@ -92,7 +92,7 @@ Contains
! ...Local Variables
integer(psb_ipk_) :: err_act,err
character(len=20) :: name
character(len=30) :: name
logical, parameter :: debug=.false.
name='psb_r_z_s'
@ -133,7 +133,7 @@ Contains
complex(psb_dpk_),allocatable :: tmp(:)
integer(psb_mpk_) :: dim, lb_, lbi,ub_
integer(psb_ipk_) :: err_act,err
character(len=20) :: name
character(len=30) :: name
logical, parameter :: debug=.false.
name='psb_r_m_z_rk1'
@ -205,7 +205,7 @@ Contains
complex(psb_dpk_),allocatable :: tmp(:,:)
integer(psb_ipk_) :: err_act,err
integer(psb_mpk_) :: dim,dim2,lb1_, lb2_, ub1_, ub2_,lbi1, lbi2
character(len=20) :: name
character(len=30) :: name
name='psb_r_m_z_rk2'
call psb_erractionsave(err_act)
@ -294,9 +294,8 @@ Contains
! ...Local Variables
complex(psb_dpk_),allocatable :: tmp(:)
integer(psb_epk_) :: dim, lb_, lbi,ub_
integer(psb_ipk_) :: iplen
integer(psb_ipk_) :: err_act,err
character(len=20) :: name
character(len=30) :: name
logical, parameter :: debug=.false.
name='psb_r_m_z_rk1'
@ -311,8 +310,7 @@ Contains
endif
if ((len<0)) then
err=4025
iplen = len
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len/), &
& a_err='complex(psb_dpk_)')
goto 9999
end if
@ -325,8 +323,7 @@ Contains
Allocate(tmp(lb_:ub_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len/), &
& a_err='complex(psb_dpk_)')
goto 9999
end if
@ -338,8 +335,7 @@ Contains
Allocate(rrax(lb_:ub_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len/), &
& a_err='complex(psb_dpk_)')
goto 9999
end if
@ -369,9 +365,9 @@ Contains
! ...Local Variables
complex(psb_dpk_),allocatable :: tmp(:,:)
integer(psb_ipk_) :: err_act,err, iplen
integer(psb_ipk_) :: err_act,err
integer(psb_epk_) :: dim,dim2,lb1_, lb2_, ub1_, ub2_,lbi1, lbi2
character(len=20) :: name
character(len=30) :: name
name='psb_r_e_z_rk2'
call psb_erractionsave(err_act)
@ -391,15 +387,13 @@ Contains
if (len1 < 0) then
err=4025
iplen = len1
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len1/), &
& a_err='complex(psb_dpk_)')
goto 9999
end if
if (len2 < 0) then
err=4025
iplen = len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len2/), &
& a_err='complex(psb_dpk_)')
goto 9999
end if
@ -415,8 +409,7 @@ Contains
Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len1*len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/(len1*len2)/), &
& a_err='complex(psb_dpk_)')
goto 9999
end if
@ -430,8 +423,7 @@ Contains
Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len1*len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/(len1*len2)/), &
& a_err='complex(psb_dpk_)')
goto 9999
end if
@ -463,10 +455,10 @@ Contains
! ...Local Variables
complex(psb_dpk_),allocatable :: tmp(:,:)
integer(psb_ipk_) :: err_act,err, iplen
integer(psb_mpk_) :: dim,lb1_, lb2_, ub1_, ub2_,lbi1, lbi2
integer(psb_ipk_) :: err_act,err
integer(psb_epk_) :: dim,lb1_, lb2_, ub1_, ub2_,lbi1, lbi2
integer(psb_epk_) :: dim2
character(len=20) :: name
character(len=30) :: name
name='psb_r_me_z_rk2'
call psb_erractionsave(err_act)
@ -486,15 +478,13 @@ Contains
if (len1 < 0) then
err=4025
iplen = len1
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, m_err=(/len1/), &
& a_err='complex(psb_dpk_)')
goto 9999
end if
if (len2 < 0) then
err=4025
iplen = len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len2/), &
& a_err='complex(psb_dpk_)')
goto 9999
end if
@ -510,8 +500,7 @@ Contains
Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len1*len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len1*len2/), &
& a_err='complex(psb_dpk_)')
goto 9999
end if
@ -525,8 +514,7 @@ Contains
Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len1*len2
call psb_errpush(err,name,i_err=(/iplen/),&
call psb_errpush(err,name,e_err=(/len1*len2/),&
& a_err='complex(psb_dpk_)')
goto 9999
end if
@ -558,10 +546,10 @@ Contains
! ...Local Variables
complex(psb_dpk_),allocatable :: tmp(:,:)
integer(psb_ipk_) :: err_act,err, iplen
integer(psb_mpk_) :: dim2,lb1_, lb2_, ub1_, ub2_,lbi1, lbi2
integer(psb_ipk_) :: err_act,err
integer(psb_epk_) :: dim2,lb1_, lb2_, ub1_, ub2_,lbi1, lbi2
integer(psb_epk_) :: dim
character(len=20) :: name
character(len=30) :: name
name='psb_r_me_z_rk2'
call psb_erractionsave(err_act)
@ -581,15 +569,13 @@ Contains
if (len1 < 0) then
err=4025
iplen = len1
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len1/), &
& a_err='complex(psb_dpk_)')
goto 9999
end if
if (len2 < 0) then
err=4025
iplen = len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, m_err=(/len2/), &
& a_err='complex(psb_dpk_)')
goto 9999
end if
@ -605,8 +591,7 @@ Contains
Allocate(tmp(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len1*len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len1*len2/), &
& a_err='complex(psb_dpk_)')
goto 9999
end if
@ -620,8 +605,7 @@ Contains
Allocate(rrax(lb1_:ub1_,lb2_:ub2_),stat=info)
if (info /= psb_success_) then
err=4025
iplen = len1*len2
call psb_errpush(err,name, i_err=(/iplen/), &
call psb_errpush(err,name, e_err=(/len1*len2/), &
& a_err='complex(psb_dpk_)')
goto 9999
end if
@ -648,7 +632,7 @@ Contains
complex(psb_dpk_),allocatable, intent(inout) :: rrax(:),y(:)
integer(psb_ipk_) :: info
complex(psb_dpk_), optional, intent(in) :: pad
character(len=20) :: name
character(len=30) :: name
integer(psb_ipk_) :: err_act, err
name='psb_r_m_2_z_rk1'
@ -689,7 +673,7 @@ Contains
complex(psb_dpk_),allocatable, intent(inout) :: rrax(:),y(:)
integer(psb_ipk_) :: info
complex(psb_dpk_), optional, intent(in) :: pad
character(len=20) :: name
character(len=30) :: name
integer(psb_ipk_) :: err_act, err
name='psb_r_m_2_z_rk1'
@ -733,8 +717,8 @@ Contains
integer(psb_ipk_) :: info
! ...Local Variables
integer(psb_ipk_) :: isz,err_act,lb
character(len=20) :: name, char_err
integer(psb_ipk_) :: err_act
character(len=30) :: name, char_err
logical, parameter :: debug=.false.
name='psb_ab_cpy_z_s'
@ -776,7 +760,7 @@ Contains
! ...Local Variables
integer(psb_ipk_) :: isz,err_act,lb
character(len=20) :: name, char_err
character(len=30) :: name, char_err
logical, parameter :: debug=.false.
name='psb_ab_cpy_z_rk1'
@ -820,7 +804,7 @@ Contains
! ...Local Variables
integer(psb_ipk_) :: isz1, isz2,err_act, lb1, lb2
character(len=20) :: name, char_err
character(len=30) :: name, char_err
logical, parameter :: debug=.false.
name='psb_ab_cpy_z_rk2'
@ -867,7 +851,7 @@ Contains
! ...Local Variables
integer(psb_ipk_) :: isz,err_act,lb
character(len=20) :: name, char_err
character(len=30) :: name, char_err
logical, parameter :: debug=.false.
name='psb_cpy_z_rk1'
@ -908,7 +892,7 @@ Contains
! ...Local Variables
integer(psb_ipk_) :: isz1, isz2,err_act, lb1, lb2
character(len=20) :: name, char_err
character(len=30) :: name, char_err
logical, parameter :: debug=.false.
name='psb_safe_cpy'
@ -984,7 +968,7 @@ Contains
integer(psb_mpk_), optional, intent(in) :: addsz,newsz
complex(psb_dpk_), optional, intent(in) :: pad
! ...Local Variables
character(len=20) :: name
character(len=30) :: name
logical, parameter :: debug=.false.
integer(psb_ipk_) :: err_act
integer(psb_mpk_) :: isz
@ -1037,7 +1021,7 @@ Contains
integer(psb_epk_), optional, intent(in) :: addsz,newsz
complex(psb_dpk_), optional, intent(in) :: pad
! ...Local Variables
character(len=20) :: name
character(len=30) :: name
logical, parameter :: debug=.false.
integer(psb_ipk_) :: err_act
integer(psb_epk_) :: isz

@ -387,8 +387,6 @@ contains
integer(psb_mpk_), optional :: m_err(:)
integer(psb_epk_), optional :: e_err(:)
type(psb_errstack_node), pointer :: new_node
call psb_set_errstatus(psb_err_fatal_)
call psb_stackpush(err_c, r_name, a_err, i_err, l_err, m_err, e_err)
@ -405,9 +403,6 @@ contains
integer(psb_mpk_), optional :: m_err(:)
integer(psb_epk_), optional :: e_err(:)
type(psb_errstack_node), pointer :: new_node
if (.not.psb_errstatus_fatal())&
& call psb_set_errstatus( psb_err_warning_)
call psb_stackpush(err_c, r_name, a_err, i_err, l_err, m_err, e_err)

@ -128,6 +128,7 @@ module psb_c_base_vect_mod
procedure, pass(x) :: set_scal => c_base_set_scal
procedure, pass(x) :: set_vect => c_base_set_vect
generic, public :: set => set_vect, set_scal
procedure, pass(x) :: get_entry=> c_base_get_entry
!
! Gather/scatter. These are needed for MPI interfacing.
! May have to be reworked.
@ -445,7 +446,7 @@ contains
class(psb_c_base_vect_type), intent(inout) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: i, isz
integer(psb_ipk_) :: isz
info = 0
if (psb_errstatus_fatal()) return
@ -811,7 +812,7 @@ contains
complex(psb_spk_), intent(in) :: val
integer(psb_ipk_), optional :: first, last
integer(psb_ipk_) :: info, first_, last_
integer(psb_ipk_) :: first_, last_
first_=1
last_=size(x%v)
@ -837,7 +838,7 @@ contains
complex(psb_spk_), intent(in) :: val(:)
integer(psb_ipk_), optional :: first, last
integer(psb_ipk_) :: info, first_, last_, nr
integer(psb_ipk_) :: first_, last_
first_ = 1
if (present(first)) first_ = max(1,first)
@ -855,6 +856,26 @@ contains
end subroutine c_base_set_vect
!
! Get entry.
!
!
!> Function base_get_entry
!! \memberof psb_c_base_vect_type
!! \brief Get one entry from the vector
!!
!
function c_base_get_entry(x, index) result(res)
implicit none
class(psb_c_base_vect_type), intent(in) :: x
integer(psb_ipk_), intent(in) :: index
complex(psb_spk_) :: res
res = 0
if (allocated(x%v)) res = x%v(index)
end function c_base_get_entry
!
! Overwrite with absolute value
!

@ -80,6 +80,8 @@ module psb_c_vect_mod
procedure, pass(x) :: set_dev => c_vect_set_dev
procedure, pass(x) :: set_sync => c_vect_set_sync
procedure, pass(x) :: get_entry => c_vect_get_entry
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
@ -603,6 +605,15 @@ contains
end function c_vect_is_dev
function c_vect_get_entry(x,index) result(res)
implicit none
class(psb_c_vect_type), intent(in) :: x
integer(psb_ipk_), intent(in) :: index
complex(psb_spk_) :: res
res = 0
if (allocated(x%v)) res = x%v%get_entry(index)
end function c_vect_get_entry
function c_vect_dot_v(n,x,y) result(res)
implicit none
class(psb_c_vect_type), intent(inout) :: x, y

@ -128,6 +128,7 @@ module psb_d_base_vect_mod
procedure, pass(x) :: set_scal => d_base_set_scal
procedure, pass(x) :: set_vect => d_base_set_vect
generic, public :: set => set_vect, set_scal
procedure, pass(x) :: get_entry=> d_base_get_entry
!
! Gather/scatter. These are needed for MPI interfacing.
! May have to be reworked.
@ -452,7 +453,7 @@ contains
class(psb_d_base_vect_type), intent(inout) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: i, isz
integer(psb_ipk_) :: isz
info = 0
if (psb_errstatus_fatal()) return
@ -818,7 +819,7 @@ contains
real(psb_dpk_), intent(in) :: val
integer(psb_ipk_), optional :: first, last
integer(psb_ipk_) :: info, first_, last_
integer(psb_ipk_) :: first_, last_
first_=1
last_=size(x%v)
@ -844,7 +845,7 @@ contains
real(psb_dpk_), intent(in) :: val(:)
integer(psb_ipk_), optional :: first, last
integer(psb_ipk_) :: info, first_, last_, nr
integer(psb_ipk_) :: first_, last_
first_ = 1
if (present(first)) first_ = max(1,first)
@ -862,6 +863,26 @@ contains
end subroutine d_base_set_vect
!
! Get entry.
!
!
!> Function base_get_entry
!! \memberof psb_d_base_vect_type
!! \brief Get one entry from the vector
!!
!
function d_base_get_entry(x, index) result(res)
implicit none
class(psb_d_base_vect_type), intent(in) :: x
integer(psb_ipk_), intent(in) :: index
real(psb_dpk_) :: res
res = 0
if (allocated(x%v)) res = x%v(index)
end function d_base_get_entry
!
! Overwrite with absolute value
!

@ -80,6 +80,8 @@ module psb_d_vect_mod
procedure, pass(x) :: set_dev => d_vect_set_dev
procedure, pass(x) :: set_sync => d_vect_set_sync
procedure, pass(x) :: get_entry => d_vect_get_entry
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
@ -610,6 +612,15 @@ contains
end function d_vect_is_dev
function d_vect_get_entry(x,index) result(res)
implicit none
class(psb_d_vect_type), intent(in) :: x
integer(psb_ipk_), intent(in) :: index
real(psb_dpk_) :: res
res = 0
if (allocated(x%v)) res = x%v%get_entry(index)
end function d_vect_get_entry
function d_vect_dot_v(n,x,y) result(res)
implicit none
class(psb_d_vect_type), intent(inout) :: x, y

@ -382,7 +382,7 @@ contains
class(psb_i_base_vect_type), intent(inout) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: i, isz
integer(psb_ipk_) :: isz
info = 0
if (psb_errstatus_fatal()) return
@ -748,7 +748,7 @@ contains
integer(psb_ipk_), intent(in) :: val
integer(psb_ipk_), optional :: first, last
integer(psb_ipk_) :: info, first_, last_
integer(psb_ipk_) :: first_, last_
first_=1
last_=size(x%v)
@ -774,7 +774,7 @@ contains
integer(psb_ipk_), intent(in) :: val(:)
integer(psb_ipk_), optional :: first, last
integer(psb_ipk_) :: info, first_, last_, nr
integer(psb_ipk_) :: first_, last_
first_ = 1
if (present(first)) first_ = max(1,first)
@ -793,7 +793,6 @@ contains
!
! Gather: Y = beta * Y + alpha * X(IDX(:))
!

@ -383,7 +383,7 @@ contains
class(psb_l_base_vect_type), intent(inout) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: i, isz
integer(psb_ipk_) :: isz
info = 0
if (psb_errstatus_fatal()) return
@ -749,7 +749,7 @@ contains
integer(psb_lpk_), intent(in) :: val
integer(psb_ipk_), optional :: first, last
integer(psb_ipk_) :: info, first_, last_
integer(psb_ipk_) :: first_, last_
first_=1
last_=size(x%v)
@ -775,7 +775,7 @@ contains
integer(psb_lpk_), intent(in) :: val(:)
integer(psb_ipk_), optional :: first, last
integer(psb_ipk_) :: info, first_, last_, nr
integer(psb_ipk_) :: first_, last_
first_ = 1
if (present(first)) first_ = max(1,first)
@ -794,7 +794,6 @@ contains
!
! Gather: Y = beta * Y + alpha * X(IDX(:))
!

@ -128,6 +128,7 @@ module psb_s_base_vect_mod
procedure, pass(x) :: set_scal => s_base_set_scal
procedure, pass(x) :: set_vect => s_base_set_vect
generic, public :: set => set_vect, set_scal
procedure, pass(x) :: get_entry=> s_base_get_entry
!
! Gather/scatter. These are needed for MPI interfacing.
! May have to be reworked.
@ -452,7 +453,7 @@ contains
class(psb_s_base_vect_type), intent(inout) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: i, isz
integer(psb_ipk_) :: isz
info = 0
if (psb_errstatus_fatal()) return
@ -818,7 +819,7 @@ contains
real(psb_spk_), intent(in) :: val
integer(psb_ipk_), optional :: first, last
integer(psb_ipk_) :: info, first_, last_
integer(psb_ipk_) :: first_, last_
first_=1
last_=size(x%v)
@ -844,7 +845,7 @@ contains
real(psb_spk_), intent(in) :: val(:)
integer(psb_ipk_), optional :: first, last
integer(psb_ipk_) :: info, first_, last_, nr
integer(psb_ipk_) :: first_, last_
first_ = 1
if (present(first)) first_ = max(1,first)
@ -862,6 +863,26 @@ contains
end subroutine s_base_set_vect
!
! Get entry.
!
!
!> Function base_get_entry
!! \memberof psb_s_base_vect_type
!! \brief Get one entry from the vector
!!
!
function s_base_get_entry(x, index) result(res)
implicit none
class(psb_s_base_vect_type), intent(in) :: x
integer(psb_ipk_), intent(in) :: index
real(psb_spk_) :: res
res = 0
if (allocated(x%v)) res = x%v(index)
end function s_base_get_entry
!
! Overwrite with absolute value
!

@ -80,6 +80,8 @@ module psb_s_vect_mod
procedure, pass(x) :: set_dev => s_vect_set_dev
procedure, pass(x) :: set_sync => s_vect_set_sync
procedure, pass(x) :: get_entry => s_vect_get_entry
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
@ -610,6 +612,15 @@ contains
end function s_vect_is_dev
function s_vect_get_entry(x,index) result(res)
implicit none
class(psb_s_vect_type), intent(in) :: x
integer(psb_ipk_), intent(in) :: index
real(psb_spk_) :: res
res = 0
if (allocated(x%v)) res = x%v%get_entry(index)
end function s_vect_get_entry
function s_vect_dot_v(n,x,y) result(res)
implicit none
class(psb_s_vect_type), intent(inout) :: x, y

@ -128,6 +128,7 @@ module psb_z_base_vect_mod
procedure, pass(x) :: set_scal => z_base_set_scal
procedure, pass(x) :: set_vect => z_base_set_vect
generic, public :: set => set_vect, set_scal
procedure, pass(x) :: get_entry=> z_base_get_entry
!
! Gather/scatter. These are needed for MPI interfacing.
! May have to be reworked.
@ -445,7 +446,7 @@ contains
class(psb_z_base_vect_type), intent(inout) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: i, isz
integer(psb_ipk_) :: isz
info = 0
if (psb_errstatus_fatal()) return
@ -811,7 +812,7 @@ contains
complex(psb_dpk_), intent(in) :: val
integer(psb_ipk_), optional :: first, last
integer(psb_ipk_) :: info, first_, last_
integer(psb_ipk_) :: first_, last_
first_=1
last_=size(x%v)
@ -837,7 +838,7 @@ contains
complex(psb_dpk_), intent(in) :: val(:)
integer(psb_ipk_), optional :: first, last
integer(psb_ipk_) :: info, first_, last_, nr
integer(psb_ipk_) :: first_, last_
first_ = 1
if (present(first)) first_ = max(1,first)
@ -855,6 +856,26 @@ contains
end subroutine z_base_set_vect
!
! Get entry.
!
!
!> Function base_get_entry
!! \memberof psb_z_base_vect_type
!! \brief Get one entry from the vector
!!
!
function z_base_get_entry(x, index) result(res)
implicit none
class(psb_z_base_vect_type), intent(in) :: x
integer(psb_ipk_), intent(in) :: index
complex(psb_dpk_) :: res
res = 0
if (allocated(x%v)) res = x%v(index)
end function z_base_get_entry
!
! Overwrite with absolute value
!

@ -80,6 +80,8 @@ module psb_z_vect_mod
procedure, pass(x) :: set_dev => z_vect_set_dev
procedure, pass(x) :: set_sync => z_vect_set_sync
procedure, pass(x) :: get_entry => z_vect_get_entry
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
@ -603,6 +605,15 @@ contains
end function z_vect_is_dev
function z_vect_get_entry(x,index) result(res)
implicit none
class(psb_z_vect_type), intent(in) :: x
integer(psb_ipk_), intent(in) :: index
complex(psb_dpk_) :: res
res = 0
if (allocated(x%v)) res = x%v%get_entry(index)
end function z_vect_get_entry
function z_vect_dot_v(n,x,y) result(res)
implicit none
class(psb_z_vect_type), intent(inout) :: x, y

@ -37,6 +37,7 @@ Module psb_c_tools_mod
& psb_c_csr_sparse_mat, psb_c_coo_sparse_mat
use psb_l_vect_mod, only : psb_l_vect_type
use psb_c_multivect_mod, only : psb_c_base_multivect_type, psb_c_multivect_type
use psi_mod, only : psb_snd, psb_rcv ! Needed only for psb_getelem
interface psb_geall
subroutine psb_calloc_vect(x, desc_a,info)
@ -419,6 +420,16 @@ Module psb_c_tools_mod
end subroutine psb_c_simple_glob_transpose_ip
end interface psb_glob_transpose
interface psb_getelem
function psb_c_getelem(x,index,desc_a,info) result(res)
import
type(psb_c_vect_type), intent(inout) :: x
integer(psb_lpk_), intent(in) :: index
type(psb_desc_type), intent(inout) :: desc_a
integer(psb_ipk_), intent(out) :: info
complex(psb_spk_) :: res
end function
end interface
end module psb_c_tools_mod

@ -37,6 +37,7 @@ Module psb_d_tools_mod
& psb_d_csr_sparse_mat, psb_d_coo_sparse_mat
use psb_l_vect_mod, only : psb_l_vect_type
use psb_d_multivect_mod, only : psb_d_base_multivect_type, psb_d_multivect_type
use psi_mod, only : psb_snd, psb_rcv ! Needed only for psb_getelem
interface psb_geall
subroutine psb_dalloc_vect(x, desc_a,info)
@ -419,6 +420,16 @@ Module psb_d_tools_mod
end subroutine psb_d_simple_glob_transpose_ip
end interface psb_glob_transpose
interface psb_getelem
function psb_d_getelem(x,index,desc_a,info) result(res)
import
type(psb_d_vect_type), intent(inout) :: x
integer(psb_lpk_), intent(in) :: index
type(psb_desc_type), intent(inout) :: desc_a
integer(psb_ipk_), intent(out) :: info
real(psb_dpk_) :: res
end function
end interface
end module psb_d_tools_mod

@ -34,6 +34,7 @@ Module psb_i_tools_mod
use psb_i_vect_mod, only : psb_i_base_vect_type, psb_i_vect_type
use psb_l_vect_mod, only : psb_l_vect_type
use psb_i_multivect_mod, only : psb_i_base_multivect_type, psb_i_multivect_type
use psi_mod, only : psb_snd, psb_rcv ! Needed only for psb_getelem
interface psb_geall
subroutine psb_ialloc_vect(x, desc_a,info)

@ -34,6 +34,7 @@ Module psb_l_tools_mod
use psb_l_vect_mod, only : psb_l_base_vect_type, psb_l_vect_type
! use psb_i_vect_mod, only : psb_i_vect_type
use psb_l_multivect_mod, only : psb_l_base_multivect_type, psb_l_multivect_type
use psi_mod, only : psb_snd, psb_rcv ! Needed only for psb_getelem
interface psb_geall
subroutine psb_lalloc_vect(x, desc_a,info)

@ -37,6 +37,7 @@ Module psb_s_tools_mod
& psb_s_csr_sparse_mat, psb_s_coo_sparse_mat
use psb_l_vect_mod, only : psb_l_vect_type
use psb_s_multivect_mod, only : psb_s_base_multivect_type, psb_s_multivect_type
use psi_mod, only : psb_snd, psb_rcv ! Needed only for psb_getelem
interface psb_geall
subroutine psb_salloc_vect(x, desc_a,info)
@ -419,6 +420,16 @@ Module psb_s_tools_mod
end subroutine psb_s_simple_glob_transpose_ip
end interface psb_glob_transpose
interface psb_getelem
function psb_s_getelem(x,index,desc_a,info) result(res)
import
type(psb_s_vect_type), intent(inout) :: x
integer(psb_lpk_), intent(in) :: index
type(psb_desc_type), intent(inout) :: desc_a
integer(psb_ipk_), intent(out) :: info
real(psb_spk_) :: res
end function
end interface
end module psb_s_tools_mod

@ -37,6 +37,7 @@ Module psb_z_tools_mod
& psb_z_csr_sparse_mat, psb_z_coo_sparse_mat
use psb_l_vect_mod, only : psb_l_vect_type
use psb_z_multivect_mod, only : psb_z_base_multivect_type, psb_z_multivect_type
use psi_mod, only : psb_snd, psb_rcv ! Needed only for psb_getelem
interface psb_geall
subroutine psb_zalloc_vect(x, desc_a,info)
@ -419,6 +420,16 @@ Module psb_z_tools_mod
end subroutine psb_z_simple_glob_transpose_ip
end interface psb_glob_transpose
interface psb_getelem
function psb_z_getelem(x,index,desc_a,info) result(res)
import
type(psb_z_vect_type), intent(inout) :: x
integer(psb_lpk_), intent(in) :: index
type(psb_desc_type), intent(inout) :: desc_a
integer(psb_ipk_), intent(out) :: info
complex(psb_dpk_) :: res
end function
end interface
end module psb_z_tools_mod

@ -2379,7 +2379,7 @@ subroutine psb_c_csc_clean_zeros(a, info)
info = 0
call a%sync()
nc = a%get_ncols()
ilcp = a%icp(:)
ilcp = a%icp
a%icp(1) = 1
j = a%icp(1)
do i=1, nc
@ -4263,7 +4263,7 @@ subroutine psb_lc_csc_clean_zeros(a, info)
info = 0
call a%sync()
nc = a%get_ncols()
ilcp = a%icp(:)
ilcp = a%icp
a%icp(1) = 1
j = a%icp(1)
do i=1, nc

@ -55,8 +55,7 @@ subroutine psb_c_csr_csmv(alpha,a,x,beta,y,info,trans)
character, optional, intent(in) :: trans
character :: trans_
integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc
complex(psb_spk_) :: acc
integer(psb_ipk_) :: m, n
logical :: tra, ctra
integer(psb_ipk_) :: err_act
integer(psb_ipk_) :: ierr(5)
@ -126,7 +125,7 @@ contains
logical, intent(in) :: is_triangle,is_unit,tra, ctra
integer(psb_ipk_) :: i,j,k, ir, jc
integer(psb_ipk_) :: i,j,ir
complex(psb_spk_) :: acc
if (alpha == czero) then
@ -400,7 +399,7 @@ subroutine psb_c_csr_csmm(alpha,a,x,beta,y,info,trans)
character, optional, intent(in) :: trans
character :: trans_
integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc, nc
integer(psb_ipk_) :: j,m,n, nc
complex(psb_spk_), allocatable :: acc(:)
logical :: tra, ctra
integer(psb_ipk_) :: err_act
@ -478,7 +477,7 @@ contains
logical, intent(in) :: is_triangle,is_unit,tra,ctra
complex(psb_spk_), intent(inout) :: acc(*)
integer(psb_ipk_) :: i,j,k, ir, jc
integer(psb_ipk_) :: i,j, ir
if (alpha == czero) then
@ -749,8 +748,7 @@ subroutine psb_c_csr_cssv(alpha,a,x,beta,y,info,trans)
character, optional, intent(in) :: trans
character :: trans_
integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc
complex(psb_spk_) :: acc
integer(psb_ipk_) :: i,k,m
complex(psb_spk_), allocatable :: tmp(:)
logical :: tra,ctra
integer(psb_ipk_) :: err_act
@ -854,7 +852,7 @@ contains
complex(psb_spk_), intent(in) :: x(*)
complex(psb_spk_), intent(out) :: y(*)
integer(psb_ipk_) :: i,j,k,m, ir, jc
integer(psb_ipk_) :: i,j, jc
complex(psb_spk_) :: acc
if ((.not.tra).and.(.not.ctra)) then
@ -1013,8 +1011,7 @@ subroutine psb_c_csr_cssm(alpha,a,x,beta,y,info,trans)
character, optional, intent(in) :: trans
character :: trans_
integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc, nc
complex(psb_spk_) :: acc
integer(psb_ipk_) :: i,k,m, nc
complex(psb_spk_), allocatable :: tmp(:,:)
logical :: tra, ctra
integer(psb_ipk_) :: err_act
@ -1109,7 +1106,7 @@ contains
complex(psb_spk_), intent(in) :: val(*), x(ldx,*)
complex(psb_spk_), intent(out) :: y(ldy,*)
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: i,j,k,m, ir, jc
integer(psb_ipk_) :: i,j, jc
complex(psb_spk_), allocatable :: acc(:)
info = psb_success_
@ -1268,7 +1265,7 @@ function psb_c_csr_maxval(a) result(res)
class(psb_c_csr_sparse_mat), intent(in) :: a
real(psb_spk_) :: res
integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc, nc
integer(psb_ipk_) :: nnz, nc
integer(psb_ipk_) :: info
character(len=20) :: name='c_csr_maxval'
logical, parameter :: debug=.false.
@ -1290,10 +1287,9 @@ function psb_c_csr_csnmi(a) result(res)
class(psb_c_csr_sparse_mat), intent(in) :: a
real(psb_spk_) :: res
integer(psb_ipk_) :: i,j,k,m,n, nr, ir, jc, nc
integer(psb_ipk_) :: i,j
real(psb_spk_) :: acc
logical :: tra
integer(psb_ipk_) :: err_act
character(len=20) :: name='c_csnmi'
logical, parameter :: debug=.false.
@ -1318,10 +1314,7 @@ subroutine psb_c_csr_rowsum(d,a)
class(psb_c_csr_sparse_mat), intent(in) :: a
complex(psb_spk_), intent(out) :: d(:)
integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc, nc
complex(psb_spk_) :: acc
complex(psb_spk_), allocatable :: vt(:)
logical :: tra
integer(psb_ipk_) :: i,j,k,m
integer(psb_ipk_) :: err_act, info
integer(psb_ipk_) :: ierr(5)
character(len=20) :: name='rowsum'
@ -1368,9 +1361,7 @@ subroutine psb_c_csr_arwsum(d,a)
class(psb_c_csr_sparse_mat), intent(in) :: a
real(psb_spk_), intent(out) :: d(:)
integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc, nc
real(psb_spk_) :: acc
real(psb_spk_), allocatable :: vt(:)
integer(psb_ipk_) :: i,j,m
logical :: tra
integer(psb_ipk_) :: err_act, info
integer(psb_ipk_) :: ierr(5)
@ -1418,10 +1409,7 @@ subroutine psb_c_csr_colsum(d,a)
class(psb_c_csr_sparse_mat), intent(in) :: a
complex(psb_spk_), intent(out) :: d(:)
integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc, nc
complex(psb_spk_) :: acc
complex(psb_spk_), allocatable :: vt(:)
logical :: tra
integer(psb_ipk_) :: i,j,k,m,n
integer(psb_ipk_) :: err_act, info
integer(psb_ipk_) :: ierr(5)
character(len=20) :: name='colsum'
@ -1471,10 +1459,7 @@ subroutine psb_c_csr_aclsum(d,a)
class(psb_c_csr_sparse_mat), intent(in) :: a
real(psb_spk_), intent(out) :: d(:)
integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc, nc
real(psb_spk_) :: acc
real(psb_spk_), allocatable :: vt(:)
logical :: tra
integer(psb_ipk_) :: i,j,k,m,n, nnz
integer(psb_ipk_) :: err_act, info
integer(psb_ipk_) :: ierr(5)
character(len=20) :: name='aclsum'
@ -1581,7 +1566,7 @@ subroutine psb_c_csr_scal(d,a,info,side)
integer(psb_ipk_), intent(out) :: info
character, intent(in), optional :: side
integer(psb_ipk_) :: err_act,mnm, i, j, m
integer(psb_ipk_) :: err_act, i, j, m
integer(psb_ipk_) :: ierr(5)
character(len=20) :: name='scal'
character :: side_
@ -1652,7 +1637,7 @@ subroutine psb_c_csr_scals(d,a,info)
complex(psb_spk_), intent(in) :: d
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act,mnm, i, j, m
integer(psb_ipk_) :: err_act, i
character(len=20) :: name='scal'
logical, parameter :: debug=.false.
@ -1928,7 +1913,7 @@ contains
logical, intent(in) :: append
integer(psb_ipk_) :: info
integer(psb_ipk_), optional :: iren(:)
integer(psb_ipk_) :: nzin_, nza, idx,i,j,k, nzt, irw, lrw, icl,lcl,nrd,ncd
integer(psb_ipk_) :: nzin_, nza,i,j, nzt, irw, lrw, icl,lcl
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name='csr_getptn'
@ -2109,7 +2094,7 @@ contains
logical, intent(in) :: append, chksz
integer(psb_ipk_) :: info
integer(psb_ipk_), optional :: iren(:)
integer(psb_ipk_) :: nzin_, nza, idx,i,j,k, nzt, irw, lrw, icl,lcl, nrd, ncd
integer(psb_ipk_) :: nzin_, nza,i,j, nzt, irw, lrw, icl,lcl
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name='coo_getrow'
@ -2198,7 +2183,6 @@ subroutine psb_c_csr_tril(a,l,info,&
integer(psb_ipk_) :: err_act, nzin, nzout, i, j, k
integer(psb_ipk_) :: imin_, imax_, jmin_, jmax_, mb,nb, diag_, nzlin, nzuin, nz
integer(psb_ipk_) :: ierr(5)
character(len=20) :: name='tril'
logical :: rscale_, cscale_
logical, parameter :: debug=.false.
@ -2352,7 +2336,6 @@ subroutine psb_c_csr_triu(a,u,info,&
integer(psb_ipk_) :: err_act, nzin, nzout, i, j, k
integer(psb_ipk_) :: imin_, imax_, jmin_, jmax_, mb,nb, diag_, nzlin, nzuin, nz
integer(psb_ipk_) :: ierr(5)
character(len=20) :: name='triu'
logical :: rscale_, cscale_
logical, parameter :: debug=.false.
@ -2503,7 +2486,7 @@ subroutine psb_c_csr_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info)
integer(psb_ipk_) :: err_act
character(len=20) :: name='c_csr_csput_a'
logical, parameter :: debug=.false.
integer(psb_ipk_) :: nza, i,j,k, nzl, isza, debug_level, debug_unit
integer(psb_ipk_) :: nza, i, debug_level, debug_unit
call psb_erractionsave(err_act)
@ -2764,7 +2747,7 @@ subroutine psb_c_csr_print(iout,a,iv,head,ivr,ivc)
character(len=20) :: name='c_csr_print'
logical, parameter :: debug=.false.
character(len=80) :: frmt
integer(psb_ipk_) :: irs,ics,i,j, ni, nr, nc, nz
integer(psb_ipk_) :: i,j, nr, nc, nz
write(iout,'(a)') '%%MatrixMarket matrix coordinate complex general'
@ -2832,7 +2815,7 @@ subroutine psb_c_cp_csr_from_coo(a,b,info)
integer(psb_ipk_), allocatable :: itemp(:)
!locals
logical :: rwshr_
integer(psb_ipk_) :: nza, nr, nc, i,j,k,ip,irw, err_act, ncl
integer(psb_ipk_) :: nza, nr, nc, i,k,ip, ncl
integer(psb_ipk_), Parameter :: maxtry=8
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name='c_cp_csr_from_coo'
@ -3228,7 +3211,7 @@ subroutine psb_c_csr_clean_zeros(a, info)
info = 0
call a%sync()
nr = a%get_nrows()
ilrp = a%irp(:)
ilrp = a%irp
a%irp(1) = 1
j = a%irp(1)
do i=1, nr
@ -5343,7 +5326,7 @@ subroutine psb_lc_csr_clean_zeros(a, info)
info = 0
call a%sync()
nr = a%get_nrows()
ilrp = a%irp(:)
ilrp = a%irp
a%irp(1) = 1
j = a%irp(1)
do i=1, nr

@ -2379,7 +2379,7 @@ subroutine psb_d_csc_clean_zeros(a, info)
info = 0
call a%sync()
nc = a%get_ncols()
ilcp = a%icp(:)
ilcp = a%icp
a%icp(1) = 1
j = a%icp(1)
do i=1, nc
@ -4263,7 +4263,7 @@ subroutine psb_ld_csc_clean_zeros(a, info)
info = 0
call a%sync()
nc = a%get_ncols()
ilcp = a%icp(:)
ilcp = a%icp
a%icp(1) = 1
j = a%icp(1)
do i=1, nc

@ -55,8 +55,7 @@ subroutine psb_d_csr_csmv(alpha,a,x,beta,y,info,trans)
character, optional, intent(in) :: trans
character :: trans_
integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc
real(psb_dpk_) :: acc
integer(psb_ipk_) :: m, n
logical :: tra, ctra
integer(psb_ipk_) :: err_act
integer(psb_ipk_) :: ierr(5)
@ -126,7 +125,7 @@ contains
logical, intent(in) :: is_triangle,is_unit,tra, ctra
integer(psb_ipk_) :: i,j,k, ir, jc
integer(psb_ipk_) :: i,j,ir
real(psb_dpk_) :: acc
if (alpha == dzero) then
@ -400,7 +399,7 @@ subroutine psb_d_csr_csmm(alpha,a,x,beta,y,info,trans)
character, optional, intent(in) :: trans
character :: trans_
integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc, nc
integer(psb_ipk_) :: j,m,n, nc
real(psb_dpk_), allocatable :: acc(:)
logical :: tra, ctra
integer(psb_ipk_) :: err_act
@ -478,7 +477,7 @@ contains
logical, intent(in) :: is_triangle,is_unit,tra,ctra
real(psb_dpk_), intent(inout) :: acc(*)
integer(psb_ipk_) :: i,j,k, ir, jc
integer(psb_ipk_) :: i,j, ir
if (alpha == dzero) then
@ -749,8 +748,7 @@ subroutine psb_d_csr_cssv(alpha,a,x,beta,y,info,trans)
character, optional, intent(in) :: trans
character :: trans_
integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc
real(psb_dpk_) :: acc
integer(psb_ipk_) :: i,k,m
real(psb_dpk_), allocatable :: tmp(:)
logical :: tra,ctra
integer(psb_ipk_) :: err_act
@ -854,7 +852,7 @@ contains
real(psb_dpk_), intent(in) :: x(*)
real(psb_dpk_), intent(out) :: y(*)
integer(psb_ipk_) :: i,j,k,m, ir, jc
integer(psb_ipk_) :: i,j, jc
real(psb_dpk_) :: acc
if ((.not.tra).and.(.not.ctra)) then
@ -1013,8 +1011,7 @@ subroutine psb_d_csr_cssm(alpha,a,x,beta,y,info,trans)
character, optional, intent(in) :: trans
character :: trans_
integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc, nc
real(psb_dpk_) :: acc
integer(psb_ipk_) :: i,k,m, nc
real(psb_dpk_), allocatable :: tmp(:,:)
logical :: tra, ctra
integer(psb_ipk_) :: err_act
@ -1109,7 +1106,7 @@ contains
real(psb_dpk_), intent(in) :: val(*), x(ldx,*)
real(psb_dpk_), intent(out) :: y(ldy,*)
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: i,j,k,m, ir, jc
integer(psb_ipk_) :: i,j, jc
real(psb_dpk_), allocatable :: acc(:)
info = psb_success_
@ -1268,7 +1265,7 @@ function psb_d_csr_maxval(a) result(res)
class(psb_d_csr_sparse_mat), intent(in) :: a
real(psb_dpk_) :: res
integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc, nc
integer(psb_ipk_) :: nnz, nc
integer(psb_ipk_) :: info
character(len=20) :: name='d_csr_maxval'
logical, parameter :: debug=.false.
@ -1290,10 +1287,9 @@ function psb_d_csr_csnmi(a) result(res)
class(psb_d_csr_sparse_mat), intent(in) :: a
real(psb_dpk_) :: res
integer(psb_ipk_) :: i,j,k,m,n, nr, ir, jc, nc
integer(psb_ipk_) :: i,j
real(psb_dpk_) :: acc
logical :: tra
integer(psb_ipk_) :: err_act
character(len=20) :: name='d_csnmi'
logical, parameter :: debug=.false.
@ -1318,10 +1314,7 @@ subroutine psb_d_csr_rowsum(d,a)
class(psb_d_csr_sparse_mat), intent(in) :: a
real(psb_dpk_), intent(out) :: d(:)
integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc, nc
real(psb_dpk_) :: acc
real(psb_dpk_), allocatable :: vt(:)
logical :: tra
integer(psb_ipk_) :: i,j,k,m
integer(psb_ipk_) :: err_act, info
integer(psb_ipk_) :: ierr(5)
character(len=20) :: name='rowsum'
@ -1368,9 +1361,7 @@ subroutine psb_d_csr_arwsum(d,a)
class(psb_d_csr_sparse_mat), intent(in) :: a
real(psb_dpk_), intent(out) :: d(:)
integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc, nc
real(psb_dpk_) :: acc
real(psb_dpk_), allocatable :: vt(:)
integer(psb_ipk_) :: i,j,m
logical :: tra
integer(psb_ipk_) :: err_act, info
integer(psb_ipk_) :: ierr(5)
@ -1418,10 +1409,7 @@ subroutine psb_d_csr_colsum(d,a)
class(psb_d_csr_sparse_mat), intent(in) :: a
real(psb_dpk_), intent(out) :: d(:)
integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc, nc
real(psb_dpk_) :: acc
real(psb_dpk_), allocatable :: vt(:)
logical :: tra
integer(psb_ipk_) :: i,j,k,m,n
integer(psb_ipk_) :: err_act, info
integer(psb_ipk_) :: ierr(5)
character(len=20) :: name='colsum'
@ -1471,10 +1459,7 @@ subroutine psb_d_csr_aclsum(d,a)
class(psb_d_csr_sparse_mat), intent(in) :: a
real(psb_dpk_), intent(out) :: d(:)
integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc, nc
real(psb_dpk_) :: acc
real(psb_dpk_), allocatable :: vt(:)
logical :: tra
integer(psb_ipk_) :: i,j,k,m,n, nnz
integer(psb_ipk_) :: err_act, info
integer(psb_ipk_) :: ierr(5)
character(len=20) :: name='aclsum'
@ -1581,7 +1566,7 @@ subroutine psb_d_csr_scal(d,a,info,side)
integer(psb_ipk_), intent(out) :: info
character, intent(in), optional :: side
integer(psb_ipk_) :: err_act,mnm, i, j, m
integer(psb_ipk_) :: err_act, i, j, m
integer(psb_ipk_) :: ierr(5)
character(len=20) :: name='scal'
character :: side_
@ -1652,7 +1637,7 @@ subroutine psb_d_csr_scals(d,a,info)
real(psb_dpk_), intent(in) :: d
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act,mnm, i, j, m
integer(psb_ipk_) :: err_act, i
character(len=20) :: name='scal'
logical, parameter :: debug=.false.
@ -1928,7 +1913,7 @@ contains
logical, intent(in) :: append
integer(psb_ipk_) :: info
integer(psb_ipk_), optional :: iren(:)
integer(psb_ipk_) :: nzin_, nza, idx,i,j,k, nzt, irw, lrw, icl,lcl,nrd,ncd
integer(psb_ipk_) :: nzin_, nza,i,j, nzt, irw, lrw, icl,lcl
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name='csr_getptn'
@ -2109,7 +2094,7 @@ contains
logical, intent(in) :: append, chksz
integer(psb_ipk_) :: info
integer(psb_ipk_), optional :: iren(:)
integer(psb_ipk_) :: nzin_, nza, idx,i,j,k, nzt, irw, lrw, icl,lcl, nrd, ncd
integer(psb_ipk_) :: nzin_, nza,i,j, nzt, irw, lrw, icl,lcl
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name='coo_getrow'
@ -2198,7 +2183,6 @@ subroutine psb_d_csr_tril(a,l,info,&
integer(psb_ipk_) :: err_act, nzin, nzout, i, j, k
integer(psb_ipk_) :: imin_, imax_, jmin_, jmax_, mb,nb, diag_, nzlin, nzuin, nz
integer(psb_ipk_) :: ierr(5)
character(len=20) :: name='tril'
logical :: rscale_, cscale_
logical, parameter :: debug=.false.
@ -2352,7 +2336,6 @@ subroutine psb_d_csr_triu(a,u,info,&
integer(psb_ipk_) :: err_act, nzin, nzout, i, j, k
integer(psb_ipk_) :: imin_, imax_, jmin_, jmax_, mb,nb, diag_, nzlin, nzuin, nz
integer(psb_ipk_) :: ierr(5)
character(len=20) :: name='triu'
logical :: rscale_, cscale_
logical, parameter :: debug=.false.
@ -2503,7 +2486,7 @@ subroutine psb_d_csr_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info)
integer(psb_ipk_) :: err_act
character(len=20) :: name='d_csr_csput_a'
logical, parameter :: debug=.false.
integer(psb_ipk_) :: nza, i,j,k, nzl, isza, debug_level, debug_unit
integer(psb_ipk_) :: nza, i, debug_level, debug_unit
call psb_erractionsave(err_act)
@ -2764,7 +2747,7 @@ subroutine psb_d_csr_print(iout,a,iv,head,ivr,ivc)
character(len=20) :: name='d_csr_print'
logical, parameter :: debug=.false.
character(len=80) :: frmt
integer(psb_ipk_) :: irs,ics,i,j, ni, nr, nc, nz
integer(psb_ipk_) :: i,j, nr, nc, nz
write(iout,'(a)') '%%MatrixMarket matrix coordinate real general'
@ -2832,7 +2815,7 @@ subroutine psb_d_cp_csr_from_coo(a,b,info)
integer(psb_ipk_), allocatable :: itemp(:)
!locals
logical :: rwshr_
integer(psb_ipk_) :: nza, nr, nc, i,j,k,ip,irw, err_act, ncl
integer(psb_ipk_) :: nza, nr, nc, i,k,ip, ncl
integer(psb_ipk_), Parameter :: maxtry=8
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name='d_cp_csr_from_coo'
@ -3228,7 +3211,7 @@ subroutine psb_d_csr_clean_zeros(a, info)
info = 0
call a%sync()
nr = a%get_nrows()
ilrp = a%irp(:)
ilrp = a%irp
a%irp(1) = 1
j = a%irp(1)
do i=1, nr
@ -5343,7 +5326,7 @@ subroutine psb_ld_csr_clean_zeros(a, info)
info = 0
call a%sync()
nr = a%get_nrows()
ilrp = a%irp(:)
ilrp = a%irp
a%irp(1) = 1
j = a%irp(1)
do i=1, nr

@ -2379,7 +2379,7 @@ subroutine psb_s_csc_clean_zeros(a, info)
info = 0
call a%sync()
nc = a%get_ncols()
ilcp = a%icp(:)
ilcp = a%icp
a%icp(1) = 1
j = a%icp(1)
do i=1, nc
@ -4263,7 +4263,7 @@ subroutine psb_ls_csc_clean_zeros(a, info)
info = 0
call a%sync()
nc = a%get_ncols()
ilcp = a%icp(:)
ilcp = a%icp
a%icp(1) = 1
j = a%icp(1)
do i=1, nc

@ -55,8 +55,7 @@ subroutine psb_s_csr_csmv(alpha,a,x,beta,y,info,trans)
character, optional, intent(in) :: trans
character :: trans_
integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc
real(psb_spk_) :: acc
integer(psb_ipk_) :: m, n
logical :: tra, ctra
integer(psb_ipk_) :: err_act
integer(psb_ipk_) :: ierr(5)
@ -126,7 +125,7 @@ contains
logical, intent(in) :: is_triangle,is_unit,tra, ctra
integer(psb_ipk_) :: i,j,k, ir, jc
integer(psb_ipk_) :: i,j,ir
real(psb_spk_) :: acc
if (alpha == szero) then
@ -400,7 +399,7 @@ subroutine psb_s_csr_csmm(alpha,a,x,beta,y,info,trans)
character, optional, intent(in) :: trans
character :: trans_
integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc, nc
integer(psb_ipk_) :: j,m,n, nc
real(psb_spk_), allocatable :: acc(:)
logical :: tra, ctra
integer(psb_ipk_) :: err_act
@ -478,7 +477,7 @@ contains
logical, intent(in) :: is_triangle,is_unit,tra,ctra
real(psb_spk_), intent(inout) :: acc(*)
integer(psb_ipk_) :: i,j,k, ir, jc
integer(psb_ipk_) :: i,j, ir
if (alpha == szero) then
@ -749,8 +748,7 @@ subroutine psb_s_csr_cssv(alpha,a,x,beta,y,info,trans)
character, optional, intent(in) :: trans
character :: trans_
integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc
real(psb_spk_) :: acc
integer(psb_ipk_) :: i,k,m
real(psb_spk_), allocatable :: tmp(:)
logical :: tra,ctra
integer(psb_ipk_) :: err_act
@ -854,7 +852,7 @@ contains
real(psb_spk_), intent(in) :: x(*)
real(psb_spk_), intent(out) :: y(*)
integer(psb_ipk_) :: i,j,k,m, ir, jc
integer(psb_ipk_) :: i,j, jc
real(psb_spk_) :: acc
if ((.not.tra).and.(.not.ctra)) then
@ -1013,8 +1011,7 @@ subroutine psb_s_csr_cssm(alpha,a,x,beta,y,info,trans)
character, optional, intent(in) :: trans
character :: trans_
integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc, nc
real(psb_spk_) :: acc
integer(psb_ipk_) :: i,k,m, nc
real(psb_spk_), allocatable :: tmp(:,:)
logical :: tra, ctra
integer(psb_ipk_) :: err_act
@ -1109,7 +1106,7 @@ contains
real(psb_spk_), intent(in) :: val(*), x(ldx,*)
real(psb_spk_), intent(out) :: y(ldy,*)
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: i,j,k,m, ir, jc
integer(psb_ipk_) :: i,j, jc
real(psb_spk_), allocatable :: acc(:)
info = psb_success_
@ -1268,7 +1265,7 @@ function psb_s_csr_maxval(a) result(res)
class(psb_s_csr_sparse_mat), intent(in) :: a
real(psb_spk_) :: res
integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc, nc
integer(psb_ipk_) :: nnz, nc
integer(psb_ipk_) :: info
character(len=20) :: name='s_csr_maxval'
logical, parameter :: debug=.false.
@ -1290,10 +1287,9 @@ function psb_s_csr_csnmi(a) result(res)
class(psb_s_csr_sparse_mat), intent(in) :: a
real(psb_spk_) :: res
integer(psb_ipk_) :: i,j,k,m,n, nr, ir, jc, nc
integer(psb_ipk_) :: i,j
real(psb_spk_) :: acc
logical :: tra
integer(psb_ipk_) :: err_act
character(len=20) :: name='s_csnmi'
logical, parameter :: debug=.false.
@ -1318,10 +1314,7 @@ subroutine psb_s_csr_rowsum(d,a)
class(psb_s_csr_sparse_mat), intent(in) :: a
real(psb_spk_), intent(out) :: d(:)
integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc, nc
real(psb_spk_) :: acc
real(psb_spk_), allocatable :: vt(:)
logical :: tra
integer(psb_ipk_) :: i,j,k,m
integer(psb_ipk_) :: err_act, info
integer(psb_ipk_) :: ierr(5)
character(len=20) :: name='rowsum'
@ -1368,9 +1361,7 @@ subroutine psb_s_csr_arwsum(d,a)
class(psb_s_csr_sparse_mat), intent(in) :: a
real(psb_spk_), intent(out) :: d(:)
integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc, nc
real(psb_spk_) :: acc
real(psb_spk_), allocatable :: vt(:)
integer(psb_ipk_) :: i,j,m
logical :: tra
integer(psb_ipk_) :: err_act, info
integer(psb_ipk_) :: ierr(5)
@ -1418,10 +1409,7 @@ subroutine psb_s_csr_colsum(d,a)
class(psb_s_csr_sparse_mat), intent(in) :: a
real(psb_spk_), intent(out) :: d(:)
integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc, nc
real(psb_spk_) :: acc
real(psb_spk_), allocatable :: vt(:)
logical :: tra
integer(psb_ipk_) :: i,j,k,m,n
integer(psb_ipk_) :: err_act, info
integer(psb_ipk_) :: ierr(5)
character(len=20) :: name='colsum'
@ -1471,10 +1459,7 @@ subroutine psb_s_csr_aclsum(d,a)
class(psb_s_csr_sparse_mat), intent(in) :: a
real(psb_spk_), intent(out) :: d(:)
integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc, nc
real(psb_spk_) :: acc
real(psb_spk_), allocatable :: vt(:)
logical :: tra
integer(psb_ipk_) :: i,j,k,m,n, nnz
integer(psb_ipk_) :: err_act, info
integer(psb_ipk_) :: ierr(5)
character(len=20) :: name='aclsum'
@ -1581,7 +1566,7 @@ subroutine psb_s_csr_scal(d,a,info,side)
integer(psb_ipk_), intent(out) :: info
character, intent(in), optional :: side
integer(psb_ipk_) :: err_act,mnm, i, j, m
integer(psb_ipk_) :: err_act, i, j, m
integer(psb_ipk_) :: ierr(5)
character(len=20) :: name='scal'
character :: side_
@ -1652,7 +1637,7 @@ subroutine psb_s_csr_scals(d,a,info)
real(psb_spk_), intent(in) :: d
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act,mnm, i, j, m
integer(psb_ipk_) :: err_act, i
character(len=20) :: name='scal'
logical, parameter :: debug=.false.
@ -1928,7 +1913,7 @@ contains
logical, intent(in) :: append
integer(psb_ipk_) :: info
integer(psb_ipk_), optional :: iren(:)
integer(psb_ipk_) :: nzin_, nza, idx,i,j,k, nzt, irw, lrw, icl,lcl,nrd,ncd
integer(psb_ipk_) :: nzin_, nza,i,j, nzt, irw, lrw, icl,lcl
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name='csr_getptn'
@ -2109,7 +2094,7 @@ contains
logical, intent(in) :: append, chksz
integer(psb_ipk_) :: info
integer(psb_ipk_), optional :: iren(:)
integer(psb_ipk_) :: nzin_, nza, idx,i,j,k, nzt, irw, lrw, icl,lcl, nrd, ncd
integer(psb_ipk_) :: nzin_, nza,i,j, nzt, irw, lrw, icl,lcl
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name='coo_getrow'
@ -2198,7 +2183,6 @@ subroutine psb_s_csr_tril(a,l,info,&
integer(psb_ipk_) :: err_act, nzin, nzout, i, j, k
integer(psb_ipk_) :: imin_, imax_, jmin_, jmax_, mb,nb, diag_, nzlin, nzuin, nz
integer(psb_ipk_) :: ierr(5)
character(len=20) :: name='tril'
logical :: rscale_, cscale_
logical, parameter :: debug=.false.
@ -2352,7 +2336,6 @@ subroutine psb_s_csr_triu(a,u,info,&
integer(psb_ipk_) :: err_act, nzin, nzout, i, j, k
integer(psb_ipk_) :: imin_, imax_, jmin_, jmax_, mb,nb, diag_, nzlin, nzuin, nz
integer(psb_ipk_) :: ierr(5)
character(len=20) :: name='triu'
logical :: rscale_, cscale_
logical, parameter :: debug=.false.
@ -2503,7 +2486,7 @@ subroutine psb_s_csr_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info)
integer(psb_ipk_) :: err_act
character(len=20) :: name='s_csr_csput_a'
logical, parameter :: debug=.false.
integer(psb_ipk_) :: nza, i,j,k, nzl, isza, debug_level, debug_unit
integer(psb_ipk_) :: nza, i, debug_level, debug_unit
call psb_erractionsave(err_act)
@ -2764,7 +2747,7 @@ subroutine psb_s_csr_print(iout,a,iv,head,ivr,ivc)
character(len=20) :: name='s_csr_print'
logical, parameter :: debug=.false.
character(len=80) :: frmt
integer(psb_ipk_) :: irs,ics,i,j, ni, nr, nc, nz
integer(psb_ipk_) :: i,j, nr, nc, nz
write(iout,'(a)') '%%MatrixMarket matrix coordinate real general'
@ -2832,7 +2815,7 @@ subroutine psb_s_cp_csr_from_coo(a,b,info)
integer(psb_ipk_), allocatable :: itemp(:)
!locals
logical :: rwshr_
integer(psb_ipk_) :: nza, nr, nc, i,j,k,ip,irw, err_act, ncl
integer(psb_ipk_) :: nza, nr, nc, i,k,ip, ncl
integer(psb_ipk_), Parameter :: maxtry=8
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name='s_cp_csr_from_coo'
@ -3228,7 +3211,7 @@ subroutine psb_s_csr_clean_zeros(a, info)
info = 0
call a%sync()
nr = a%get_nrows()
ilrp = a%irp(:)
ilrp = a%irp
a%irp(1) = 1
j = a%irp(1)
do i=1, nr
@ -5343,7 +5326,7 @@ subroutine psb_ls_csr_clean_zeros(a, info)
info = 0
call a%sync()
nr = a%get_nrows()
ilrp = a%irp(:)
ilrp = a%irp
a%irp(1) = 1
j = a%irp(1)
do i=1, nr

@ -2379,7 +2379,7 @@ subroutine psb_z_csc_clean_zeros(a, info)
info = 0
call a%sync()
nc = a%get_ncols()
ilcp = a%icp(:)
ilcp = a%icp
a%icp(1) = 1
j = a%icp(1)
do i=1, nc
@ -4263,7 +4263,7 @@ subroutine psb_lz_csc_clean_zeros(a, info)
info = 0
call a%sync()
nc = a%get_ncols()
ilcp = a%icp(:)
ilcp = a%icp
a%icp(1) = 1
j = a%icp(1)
do i=1, nc

@ -55,8 +55,7 @@ subroutine psb_z_csr_csmv(alpha,a,x,beta,y,info,trans)
character, optional, intent(in) :: trans
character :: trans_
integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc
complex(psb_dpk_) :: acc
integer(psb_ipk_) :: m, n
logical :: tra, ctra
integer(psb_ipk_) :: err_act
integer(psb_ipk_) :: ierr(5)
@ -126,7 +125,7 @@ contains
logical, intent(in) :: is_triangle,is_unit,tra, ctra
integer(psb_ipk_) :: i,j,k, ir, jc
integer(psb_ipk_) :: i,j,ir
complex(psb_dpk_) :: acc
if (alpha == zzero) then
@ -400,7 +399,7 @@ subroutine psb_z_csr_csmm(alpha,a,x,beta,y,info,trans)
character, optional, intent(in) :: trans
character :: trans_
integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc, nc
integer(psb_ipk_) :: j,m,n, nc
complex(psb_dpk_), allocatable :: acc(:)
logical :: tra, ctra
integer(psb_ipk_) :: err_act
@ -478,7 +477,7 @@ contains
logical, intent(in) :: is_triangle,is_unit,tra,ctra
complex(psb_dpk_), intent(inout) :: acc(*)
integer(psb_ipk_) :: i,j,k, ir, jc
integer(psb_ipk_) :: i,j, ir
if (alpha == zzero) then
@ -749,8 +748,7 @@ subroutine psb_z_csr_cssv(alpha,a,x,beta,y,info,trans)
character, optional, intent(in) :: trans
character :: trans_
integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc
complex(psb_dpk_) :: acc
integer(psb_ipk_) :: i,k,m
complex(psb_dpk_), allocatable :: tmp(:)
logical :: tra,ctra
integer(psb_ipk_) :: err_act
@ -854,7 +852,7 @@ contains
complex(psb_dpk_), intent(in) :: x(*)
complex(psb_dpk_), intent(out) :: y(*)
integer(psb_ipk_) :: i,j,k,m, ir, jc
integer(psb_ipk_) :: i,j, jc
complex(psb_dpk_) :: acc
if ((.not.tra).and.(.not.ctra)) then
@ -1013,8 +1011,7 @@ subroutine psb_z_csr_cssm(alpha,a,x,beta,y,info,trans)
character, optional, intent(in) :: trans
character :: trans_
integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc, nc
complex(psb_dpk_) :: acc
integer(psb_ipk_) :: i,k,m, nc
complex(psb_dpk_), allocatable :: tmp(:,:)
logical :: tra, ctra
integer(psb_ipk_) :: err_act
@ -1109,7 +1106,7 @@ contains
complex(psb_dpk_), intent(in) :: val(*), x(ldx,*)
complex(psb_dpk_), intent(out) :: y(ldy,*)
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: i,j,k,m, ir, jc
integer(psb_ipk_) :: i,j, jc
complex(psb_dpk_), allocatable :: acc(:)
info = psb_success_
@ -1268,7 +1265,7 @@ function psb_z_csr_maxval(a) result(res)
class(psb_z_csr_sparse_mat), intent(in) :: a
real(psb_dpk_) :: res
integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc, nc
integer(psb_ipk_) :: nnz, nc
integer(psb_ipk_) :: info
character(len=20) :: name='z_csr_maxval'
logical, parameter :: debug=.false.
@ -1290,10 +1287,9 @@ function psb_z_csr_csnmi(a) result(res)
class(psb_z_csr_sparse_mat), intent(in) :: a
real(psb_dpk_) :: res
integer(psb_ipk_) :: i,j,k,m,n, nr, ir, jc, nc
integer(psb_ipk_) :: i,j
real(psb_dpk_) :: acc
logical :: tra
integer(psb_ipk_) :: err_act
character(len=20) :: name='z_csnmi'
logical, parameter :: debug=.false.
@ -1318,10 +1314,7 @@ subroutine psb_z_csr_rowsum(d,a)
class(psb_z_csr_sparse_mat), intent(in) :: a
complex(psb_dpk_), intent(out) :: d(:)
integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc, nc
complex(psb_dpk_) :: acc
complex(psb_dpk_), allocatable :: vt(:)
logical :: tra
integer(psb_ipk_) :: i,j,k,m
integer(psb_ipk_) :: err_act, info
integer(psb_ipk_) :: ierr(5)
character(len=20) :: name='rowsum'
@ -1368,9 +1361,7 @@ subroutine psb_z_csr_arwsum(d,a)
class(psb_z_csr_sparse_mat), intent(in) :: a
real(psb_dpk_), intent(out) :: d(:)
integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc, nc
real(psb_dpk_) :: acc
real(psb_dpk_), allocatable :: vt(:)
integer(psb_ipk_) :: i,j,m
logical :: tra
integer(psb_ipk_) :: err_act, info
integer(psb_ipk_) :: ierr(5)
@ -1418,10 +1409,7 @@ subroutine psb_z_csr_colsum(d,a)
class(psb_z_csr_sparse_mat), intent(in) :: a
complex(psb_dpk_), intent(out) :: d(:)
integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc, nc
complex(psb_dpk_) :: acc
complex(psb_dpk_), allocatable :: vt(:)
logical :: tra
integer(psb_ipk_) :: i,j,k,m,n
integer(psb_ipk_) :: err_act, info
integer(psb_ipk_) :: ierr(5)
character(len=20) :: name='colsum'
@ -1471,10 +1459,7 @@ subroutine psb_z_csr_aclsum(d,a)
class(psb_z_csr_sparse_mat), intent(in) :: a
real(psb_dpk_), intent(out) :: d(:)
integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc, nc
real(psb_dpk_) :: acc
real(psb_dpk_), allocatable :: vt(:)
logical :: tra
integer(psb_ipk_) :: i,j,k,m,n, nnz
integer(psb_ipk_) :: err_act, info
integer(psb_ipk_) :: ierr(5)
character(len=20) :: name='aclsum'
@ -1581,7 +1566,7 @@ subroutine psb_z_csr_scal(d,a,info,side)
integer(psb_ipk_), intent(out) :: info
character, intent(in), optional :: side
integer(psb_ipk_) :: err_act,mnm, i, j, m
integer(psb_ipk_) :: err_act, i, j, m
integer(psb_ipk_) :: ierr(5)
character(len=20) :: name='scal'
character :: side_
@ -1652,7 +1637,7 @@ subroutine psb_z_csr_scals(d,a,info)
complex(psb_dpk_), intent(in) :: d
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act,mnm, i, j, m
integer(psb_ipk_) :: err_act, i
character(len=20) :: name='scal'
logical, parameter :: debug=.false.
@ -1928,7 +1913,7 @@ contains
logical, intent(in) :: append
integer(psb_ipk_) :: info
integer(psb_ipk_), optional :: iren(:)
integer(psb_ipk_) :: nzin_, nza, idx,i,j,k, nzt, irw, lrw, icl,lcl,nrd,ncd
integer(psb_ipk_) :: nzin_, nza,i,j, nzt, irw, lrw, icl,lcl
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name='csr_getptn'
@ -2109,7 +2094,7 @@ contains
logical, intent(in) :: append, chksz
integer(psb_ipk_) :: info
integer(psb_ipk_), optional :: iren(:)
integer(psb_ipk_) :: nzin_, nza, idx,i,j,k, nzt, irw, lrw, icl,lcl, nrd, ncd
integer(psb_ipk_) :: nzin_, nza,i,j, nzt, irw, lrw, icl,lcl
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name='coo_getrow'
@ -2198,7 +2183,6 @@ subroutine psb_z_csr_tril(a,l,info,&
integer(psb_ipk_) :: err_act, nzin, nzout, i, j, k
integer(psb_ipk_) :: imin_, imax_, jmin_, jmax_, mb,nb, diag_, nzlin, nzuin, nz
integer(psb_ipk_) :: ierr(5)
character(len=20) :: name='tril'
logical :: rscale_, cscale_
logical, parameter :: debug=.false.
@ -2352,7 +2336,6 @@ subroutine psb_z_csr_triu(a,u,info,&
integer(psb_ipk_) :: err_act, nzin, nzout, i, j, k
integer(psb_ipk_) :: imin_, imax_, jmin_, jmax_, mb,nb, diag_, nzlin, nzuin, nz
integer(psb_ipk_) :: ierr(5)
character(len=20) :: name='triu'
logical :: rscale_, cscale_
logical, parameter :: debug=.false.
@ -2503,7 +2486,7 @@ subroutine psb_z_csr_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info)
integer(psb_ipk_) :: err_act
character(len=20) :: name='z_csr_csput_a'
logical, parameter :: debug=.false.
integer(psb_ipk_) :: nza, i,j,k, nzl, isza, debug_level, debug_unit
integer(psb_ipk_) :: nza, i, debug_level, debug_unit
call psb_erractionsave(err_act)
@ -2764,7 +2747,7 @@ subroutine psb_z_csr_print(iout,a,iv,head,ivr,ivc)
character(len=20) :: name='z_csr_print'
logical, parameter :: debug=.false.
character(len=80) :: frmt
integer(psb_ipk_) :: irs,ics,i,j, ni, nr, nc, nz
integer(psb_ipk_) :: i,j, nr, nc, nz
write(iout,'(a)') '%%MatrixMarket matrix coordinate complex general'
@ -2832,7 +2815,7 @@ subroutine psb_z_cp_csr_from_coo(a,b,info)
integer(psb_ipk_), allocatable :: itemp(:)
!locals
logical :: rwshr_
integer(psb_ipk_) :: nza, nr, nc, i,j,k,ip,irw, err_act, ncl
integer(psb_ipk_) :: nza, nr, nc, i,k,ip, ncl
integer(psb_ipk_), Parameter :: maxtry=8
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name='z_cp_csr_from_coo'
@ -3228,7 +3211,7 @@ subroutine psb_z_csr_clean_zeros(a, info)
info = 0
call a%sync()
nr = a%get_nrows()
ilrp = a%irp(:)
ilrp = a%irp
a%irp(1) = 1
j = a%irp(1)
do i=1, nr
@ -5343,7 +5326,7 @@ subroutine psb_lz_csr_clean_zeros(a, info)
info = 0
call a%sync()
nr = a%get_nrows()
ilrp = a%irp(:)
ilrp = a%irp
a%irp(1) = 1
j = a%irp(1)
do i=1, nr

@ -26,7 +26,8 @@ FOBJS = psb_cdall.o psb_cdals.o psb_cdalv.o psb_cd_inloc.o psb_cdins.o psb_cdprt
psb_cspins.o psb_csprn.o psb_cd_set_bld.o \
psb_s_map.o psb_d_map.o psb_c_map.o psb_z_map.o \
psb_s_par_csr_spspmm.o psb_d_par_csr_spspmm.o psb_c_par_csr_spspmm.o psb_z_par_csr_spspmm.o \
psb_s_glob_transpose.o psb_d_glob_transpose.o psb_c_glob_transpose.o psb_z_glob_transpose.o
psb_s_glob_transpose.o psb_d_glob_transpose.o psb_c_glob_transpose.o psb_z_glob_transpose.o \
psb_cgetelem.o psb_dgetelem.o psb_sgetelem.o psb_zgetelem.o
# psb_lallc.o psb_lasb.o psb_lfree.o psb_lins.o \
MPFOBJS = psb_icdasb.o psb_ssphalo.o psb_dsphalo.o psb_csphalo.o psb_zsphalo.o \

@ -0,0 +1,103 @@
!
! Parallel Sparse BLAS version 3.5
! (C) Copyright 2006-2018
! Salvatore Filippone
! Alfredo Buttari
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the PSBLAS group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
! Function: psb_c_getelem
! Extract entries from a dense vector. Note: the row indices in index
! are assumed to be in global numbering and are converted on the fly.
! Row indices not belonging to the current process have to be in the halo,
! othewise failure is ensured.
!
! Arguments:
! x - type(psb_c_vect_type) The source vector
! desc_a - type(psb_desc_type). The communication descriptor.
! index - integer. Row index of x of the value to extract
! iam - integer. Index of the process requesting the value
! info - integer. return code
function psb_c_getelem(x,index,desc_a,info) result(res)
use psb_base_mod, psb_protect_name => psb_c_getelem
use psi_mod
implicit none
type(psb_c_vect_type), intent(inout) :: x
type(psb_desc_type), intent(inout) :: desc_a
integer(psb_lpk_), intent(in) :: index
integer(psb_ipk_), intent(out) :: info
complex(psb_spk_) :: res
!locals
integer(psb_ipk_) :: localindex(1)
integer(psb_ipk_) :: ictxt, np, me, err_act
integer(psb_lpk_) :: gindex(1)
integer(psb_lpk_), allocatable :: myidx(:),mylocal(:)
character(len=20) :: name
logical, parameter :: debug = .false.
gindex(1) = index
res = -1.0
if (psb_errstatus_fatal()) return
info=psb_success_
call psb_erractionsave(err_act)
name = 'psb_c_getelem'
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)
if (np == -1) then
info = psb_err_context_error_
call psb_errpush(info,name)
goto 9999
endif
call desc_a%indxmap%g2l(gindex,localindex,info,owned=.false.)
if(debug.and.(localindex(1) < 1)) then
write(*,*)"Process ",me," owns ",desc_a%get_local_rows()," rows"," Global index is ",gindex,"Local index is ",localindex
myidx = desc_a%get_global_indices(owned=.false.)
mylocal = desc_a%get_global_indices(owned=.true.)
write(*,*)"My (local+halo) indexes are: ",myidx
write(*,*)"My (local) indexes are: ",mylocal
end if
res = x%get_entry(localindex(1))
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(ictxt,err_act)
return
end function

@ -0,0 +1,103 @@
!
! Parallel Sparse BLAS version 3.5
! (C) Copyright 2006-2018
! Salvatore Filippone
! Alfredo Buttari
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the PSBLAS group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
! Function: psb_d_getelem
! Extract entries from a dense vector. Note: the row indices in index
! are assumed to be in global numbering and are converted on the fly.
! Row indices not belonging to the current process have to be in the halo,
! othewise failure is ensured.
!
! Arguments:
! x - type(psb_d_vect_type) The source vector
! desc_a - type(psb_desc_type). The communication descriptor.
! index - integer. Row index of x of the value to extract
! iam - integer. Index of the process requesting the value
! info - integer. return code
function psb_d_getelem(x,index,desc_a,info) result(res)
use psb_base_mod, psb_protect_name => psb_d_getelem
use psi_mod
implicit none
type(psb_d_vect_type), intent(inout) :: x
type(psb_desc_type), intent(inout) :: desc_a
integer(psb_lpk_), intent(in) :: index
integer(psb_ipk_), intent(out) :: info
real(psb_dpk_) :: res
!locals
integer(psb_ipk_) :: localindex(1)
integer(psb_ipk_) :: ictxt, np, me, err_act
integer(psb_lpk_) :: gindex(1)
integer(psb_lpk_), allocatable :: myidx(:),mylocal(:)
character(len=20) :: name
logical, parameter :: debug = .false.
gindex(1) = index
res = -1.0
if (psb_errstatus_fatal()) return
info=psb_success_
call psb_erractionsave(err_act)
name = 'psb_d_getelem'
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)
if (np == -1) then
info = psb_err_context_error_
call psb_errpush(info,name)
goto 9999
endif
call desc_a%indxmap%g2l(gindex,localindex,info,owned=.false.)
if(debug.and.(localindex(1) < 1)) then
write(*,*)"Process ",me," owns ",desc_a%get_local_rows()," rows"," Global index is ",gindex,"Local index is ",localindex
myidx = desc_a%get_global_indices(owned=.false.)
mylocal = desc_a%get_global_indices(owned=.true.)
write(*,*)"My (local+halo) indexes are: ",myidx
write(*,*)"My (local) indexes are: ",mylocal
end if
res = x%get_entry(localindex(1))
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(ictxt,err_act)
return
end function

@ -0,0 +1,103 @@
!
! Parallel Sparse BLAS version 3.5
! (C) Copyright 2006-2018
! Salvatore Filippone
! Alfredo Buttari
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the PSBLAS group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
! Function: psb_s_getelem
! Extract entries from a dense vector. Note: the row indices in index
! are assumed to be in global numbering and are converted on the fly.
! Row indices not belonging to the current process have to be in the halo,
! othewise failure is ensured.
!
! Arguments:
! x - type(psb_s_vect_type) The source vector
! desc_a - type(psb_desc_type). The communication descriptor.
! index - integer. Row index of x of the value to extract
! iam - integer. Index of the process requesting the value
! info - integer. return code
function psb_s_getelem(x,index,desc_a,info) result(res)
use psb_base_mod, psb_protect_name => psb_s_getelem
use psi_mod
implicit none
type(psb_s_vect_type), intent(inout) :: x
type(psb_desc_type), intent(inout) :: desc_a
integer(psb_lpk_), intent(in) :: index
integer(psb_ipk_), intent(out) :: info
real(psb_spk_) :: res
!locals
integer(psb_ipk_) :: localindex(1)
integer(psb_ipk_) :: ictxt, np, me, err_act
integer(psb_lpk_) :: gindex(1)
integer(psb_lpk_), allocatable :: myidx(:),mylocal(:)
character(len=20) :: name
logical, parameter :: debug = .false.
gindex(1) = index
res = -1.0
if (psb_errstatus_fatal()) return
info=psb_success_
call psb_erractionsave(err_act)
name = 'psb_s_getelem'
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)
if (np == -1) then
info = psb_err_context_error_
call psb_errpush(info,name)
goto 9999
endif
call desc_a%indxmap%g2l(gindex,localindex,info,owned=.false.)
if(debug.and.(localindex(1) < 1)) then
write(*,*)"Process ",me," owns ",desc_a%get_local_rows()," rows"," Global index is ",gindex,"Local index is ",localindex
myidx = desc_a%get_global_indices(owned=.false.)
mylocal = desc_a%get_global_indices(owned=.true.)
write(*,*)"My (local+halo) indexes are: ",myidx
write(*,*)"My (local) indexes are: ",mylocal
end if
res = x%get_entry(localindex(1))
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(ictxt,err_act)
return
end function

@ -0,0 +1,103 @@
!
! Parallel Sparse BLAS version 3.5
! (C) Copyright 2006-2018
! Salvatore Filippone
! Alfredo Buttari
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the PSBLAS group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
! Function: psb_z_getelem
! Extract entries from a dense vector. Note: the row indices in index
! are assumed to be in global numbering and are converted on the fly.
! Row indices not belonging to the current process have to be in the halo,
! othewise failure is ensured.
!
! Arguments:
! x - type(psb_z_vect_type) The source vector
! desc_a - type(psb_desc_type). The communication descriptor.
! index - integer. Row index of x of the value to extract
! iam - integer. Index of the process requesting the value
! info - integer. return code
function psb_z_getelem(x,index,desc_a,info) result(res)
use psb_base_mod, psb_protect_name => psb_z_getelem
use psi_mod
implicit none
type(psb_z_vect_type), intent(inout) :: x
type(psb_desc_type), intent(inout) :: desc_a
integer(psb_lpk_), intent(in) :: index
integer(psb_ipk_), intent(out) :: info
complex(psb_dpk_) :: res
!locals
integer(psb_ipk_) :: localindex(1)
integer(psb_ipk_) :: ictxt, np, me, err_act
integer(psb_lpk_) :: gindex(1)
integer(psb_lpk_), allocatable :: myidx(:),mylocal(:)
character(len=20) :: name
logical, parameter :: debug = .false.
gindex(1) = index
res = -1.0
if (psb_errstatus_fatal()) return
info=psb_success_
call psb_erractionsave(err_act)
name = 'psb_z_getelem'
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)
if (np == -1) then
info = psb_err_context_error_
call psb_errpush(info,name)
goto 9999
endif
call desc_a%indxmap%g2l(gindex,localindex,info,owned=.false.)
if(debug.and.(localindex(1) < 1)) then
write(*,*)"Process ",me," owns ",desc_a%get_local_rows()," rows"," Global index is ",gindex,"Local index is ",localindex
myidx = desc_a%get_global_indices(owned=.false.)
mylocal = desc_a%get_global_indices(owned=.true.)
write(*,*)"My (local+halo) indexes are: ",myidx
write(*,*)"My (local) indexes are: ",mylocal
end if
res = x%get_entry(localindex(1))
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(ictxt,err_act)
return
end function

@ -90,7 +90,6 @@ extern "C" {
psb_i_t psb_c_cd_get_local_rows(psb_c_descriptor *cd);
psb_i_t psb_c_cd_get_local_cols(psb_c_descriptor *cd);
psb_l_t psb_c_cd_get_global_rows(psb_c_descriptor *cd);
psb_l_t psb_c_cd_get_global_rows(psb_c_descriptor *cd);
psb_i_t psb_c_cd_get_global_indices(psb_l_t idx[], psb_i_t nidx, bool owned, psb_c_descriptor *cd);
/* legal values for upd argument */

@ -30,6 +30,7 @@ psb_i_t psb_c_cgeins_add(psb_i_t nz, const psb_l_t *irw, const psb_c_t *val,
psb_c_cvector *xh, psb_c_descriptor *cdh);
psb_i_t psb_c_cgeasb(psb_c_cvector *xh, psb_c_descriptor *cdh);
psb_i_t psb_c_cgefree(psb_c_cvector *xh, psb_c_descriptor *cdh);
psb_c_t psb_c_cgetelem(psb_c_cvector *xh,psb_l_t index,psb_c_descriptor *cd);
/* sparse matrices*/
psb_c_cspmat* psb_c_new_cspmat();

@ -24,7 +24,6 @@ psb_d_t* psb_c_dvect_get_cpy(psb_c_dvector *xh)
if ((temp=(psb_d_t *)malloc(vsize*sizeof(psb_d_t)))!=NULL)
psb_c_dvect_f_get_cpy(temp,xh);
fprintf(stderr,"dvect_get_cpy: %lf\n",temp[0]);
return(temp);
}

@ -30,6 +30,7 @@ psb_i_t psb_c_dgeins_add(psb_i_t nz, const psb_l_t *irw, const psb_d_t *val,
psb_c_dvector *xh, psb_c_descriptor *cdh);
psb_i_t psb_c_dgeasb(psb_c_dvector *xh, psb_c_descriptor *cdh);
psb_i_t psb_c_dgefree(psb_c_dvector *xh, psb_c_descriptor *cdh);
psb_d_t psb_c_dgetelem(psb_c_dvector *xh,psb_l_t index,psb_c_descriptor *cd);
/* sparse matrices*/
psb_c_dspmat* psb_c_new_dspmat();

@ -30,6 +30,7 @@ psb_i_t psb_c_sgeins_add(psb_i_t nz, const psb_l_t *irw, const psb_s_t *val,
psb_c_svector *xh, psb_c_descriptor *cdh);
psb_i_t psb_c_sgeasb(psb_c_svector *xh, psb_c_descriptor *cdh);
psb_i_t psb_c_sgefree(psb_c_svector *xh, psb_c_descriptor *cdh);
psb_s_t psb_c_sgetelem(psb_c_svector *xh,psb_l_t index,psb_c_descriptor *cd);
/* sparse matrices*/
psb_c_sspmat* psb_c_new_sspmat();

@ -398,6 +398,39 @@ contains
!!$ return
!!$ end function psb_c_cspprint
function psb_c_cgetelem(xh,index,cdh) bind(c) result(res)
implicit none
end module psb_c_tools_cbind_mod
type(psb_c_cvector) :: xh
integer(psb_c_lpk_), value :: index
type(psb_c_descriptor) :: cdh
complex(c_float_complex) :: res
type(psb_c_vect_type), pointer :: xp
type(psb_desc_type), pointer :: descp
integer(psb_c_ipk_) :: info, ixb
res = -1
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
end if
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
end if
ixb = psb_c_get_index_base()
if (ixb == 1) then
res = psb_getelem(xp,index,descp,info)
else
res = psb_getelem(xp,index+(1-ixb),descp,info)
end if
return
end function psb_c_cgetelem
end module psb_c_tools_cbind_mod

@ -30,6 +30,7 @@ psb_i_t psb_c_zgeins_add(psb_i_t nz, const psb_l_t *irw, const psb_z_t *val,
psb_c_zvector *xh, psb_c_descriptor *cdh);
psb_i_t psb_c_zgeasb(psb_c_zvector *xh, psb_c_descriptor *cdh);
psb_i_t psb_c_zgefree(psb_c_zvector *xh, psb_c_descriptor *cdh);
psb_z_t psb_c_zgetelem(psb_c_zvector *xh,psb_l_t index,psb_c_descriptor *cd);
/* sparse matrices*/
psb_c_zspmat* psb_c_new_zspmat();

@ -398,6 +398,39 @@ contains
!!$ return
!!$ end function psb_c_dspprint
function psb_c_dgetelem(xh,index,cdh) bind(c) result(res)
implicit none
end module psb_d_tools_cbind_mod
type(psb_c_dvector) :: xh
integer(psb_c_lpk_), value :: index
type(psb_c_descriptor) :: cdh
real(c_double) :: res
type(psb_d_vect_type), pointer :: xp
type(psb_desc_type), pointer :: descp
integer(psb_c_ipk_) :: info, ixb
res = -1
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
end if
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
end if
ixb = psb_c_get_index_base()
if (ixb == 1) then
res = psb_getelem(xp,index,descp,info)
else
res = psb_getelem(xp,index+(1-ixb),descp,info)
end if
return
end function psb_c_dgetelem
end module psb_d_tools_cbind_mod

@ -398,6 +398,39 @@ contains
!!$ return
!!$ end function psb_c_sspprint
function psb_c_sgetelem(xh,index,cdh) bind(c) result(res)
implicit none
end module psb_s_tools_cbind_mod
type(psb_c_svector) :: xh
integer(psb_c_lpk_), value :: index
type(psb_c_descriptor) :: cdh
real(c_float) :: res
type(psb_s_vect_type), pointer :: xp
type(psb_desc_type), pointer :: descp
integer(psb_c_ipk_) :: info, ixb
res = -1
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
end if
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
end if
ixb = psb_c_get_index_base()
if (ixb == 1) then
res = psb_getelem(xp,index,descp,info)
else
res = psb_getelem(xp,index+(1-ixb),descp,info)
end if
return
end function psb_c_sgetelem
end module psb_s_tools_cbind_mod

@ -398,6 +398,39 @@ contains
!!$ return
!!$ end function psb_c_zspprint
function psb_c_zgetelem(xh,index,cdh) bind(c) result(res)
implicit none
end module psb_z_tools_cbind_mod
type(psb_c_zvector) :: xh
integer(psb_c_lpk_), value :: index
type(psb_c_descriptor) :: cdh
complex(c_double_complex) :: res
type(psb_z_vect_type), pointer :: xp
type(psb_desc_type), pointer :: descp
integer(psb_c_ipk_) :: info, ixb
res = -1
if (c_associated(cdh%item)) then
call c_f_pointer(cdh%item,descp)
else
return
end if
if (c_associated(xh%item)) then
call c_f_pointer(xh%item,xp)
else
return
end if
ixb = psb_c_get_index_base()
if (ixb == 1) then
res = psb_getelem(xp,index,descp,info)
else
res = psb_getelem(xp,index+(1-ixb),descp,info)
end if
return
end function psb_c_zgetelem
end module psb_z_tools_cbind_mod

@ -48,7 +48,6 @@ contains
integer(psb_c_ipk_) :: iter
real(c_double) :: err
character(c_char) :: methd(*)
type(solveroptions) :: options
type(psb_desc_type), pointer :: descp
type(psb_cspmat_type), pointer :: ap
type(psb_cprec_type), pointer :: precp

@ -48,7 +48,6 @@ contains
integer(psb_c_ipk_) :: iter
real(c_double) :: err
character(c_char) :: methd(*)
type(solveroptions) :: options
type(psb_desc_type), pointer :: descp
type(psb_dspmat_type), pointer :: ap
type(psb_dprec_type), pointer :: precp

@ -48,7 +48,6 @@ contains
integer(psb_c_ipk_) :: iter
real(c_double) :: err
character(c_char) :: methd(*)
type(solveroptions) :: options
type(psb_desc_type), pointer :: descp
type(psb_sspmat_type), pointer :: ap
type(psb_sprec_type), pointer :: precp

@ -48,7 +48,6 @@ contains
integer(psb_c_ipk_) :: iter
real(c_double) :: err
character(c_char) :: methd(*)
type(solveroptions) :: options
type(psb_desc_type), pointer :: descp
type(psb_zspmat_type), pointer :: ap
type(psb_zprec_type), pointer :: precp

@ -1865,7 +1865,7 @@ if test "x$pac_metis_header_ok" == "xyes" ; then
AC_LANG_POP()
fi
if test "x$pac_metis_header_ok" == "xyes" ; then
if test "x$pac_metis_header_ok" = "xyes" ; then
psblas_cv_metis_includes="$METIS_INCLUDES"
METIS_LIBS="$psblas_cv_metis $METIS_LIBDIR"
LIBS="$METIS_LIBS -lm $LIBS";
@ -1874,7 +1874,7 @@ if test "x$pac_metis_header_ok" == "xyes" ; then
[psblas_cv_have_metis=yes;pac_metis_lib_ok=yes; ],
[psblas_cv_have_metis=no;pac_metis_lib_ok=no; METIS_LIBS=""])
AC_MSG_RESULT($pac_metis_lib_ok)
if test "x$pac_metis_lib_ok" == "xno" ; then
if test "x$pac_metis_lib_ok" = "xno" ; then
dnl Maybe Lib or lib?
METIS_LIBDIR="-L$psblas_cv_metisdir/Lib -L$psblas_cv_metisdir/lib"
METIS_LIBS="$psblas_cv_metis $METIS_LIBDIR"
@ -1886,24 +1886,29 @@ if test "x$pac_metis_header_ok" == "xyes" ; then
[psblas_cv_have_metis=no;pac_metis_lib_ok=no; METIS_LIBS=""])
AC_MSG_RESULT($pac_metis_lib_ok)
fi
if test "x$pac_metis_lib_ok" == "xno" ; then
if test "x$pac_metis_lib_ok" = "xno" ; then
dnl Maybe METIS/Lib?
METIS_LIBDIR="-L$psblas_cv_metisdir/METIS/Lib -L$psblas_cv_metisdir/METIS/Lib"
METIS_LIBS="$psblas_cv_metis $METIS_LIBDIR"
LIBS="$METIS_LIBS -lm $SAVE_LIBS"
AC_MSG_CHECKING([for METIS_PartGraphKway in $METIS_LIBS])
AC_TRY_LINK_FUNC(METIS_PartGraphKway,
[psblas_cv_have_metis=yes;pac_metis_lib_ok=yes; ],
[psblas_cv_have_metis=no;pac_metis_lib_ok=no; METIS_LIBS=""])
[psblas_cv_have_metis=yes;pac_metis_lib_ok="yes"; ],
[psblas_cv_have_metis=no;pac_metis_lib_ok="no"; METIS_LIBS=""])
AC_MSG_RESULT($pac_metis_lib_ok)
fi
fi
if test "x$pac_metis_lib_ok" == "xyes" ; then
fi
dnl AC_MSG_NOTICE([ metis lib ok $pac_metis_lib_ok])
if test "x$pac_metis_lib_ok" = "xyes" ; then
AC_MSG_CHECKING([for METIS_SetDefaultOptions in $LIBS])
AC_TRY_LINK_FUNC(METIS_SetDefaultOptions,
[psblas_cv_have_metis=yes;pac_metis_lib_ok=yes; ],
[psblas_cv_have_metis=no;pac_metis_lib_ok="no. Unusable METIS version, sorry."; METIS_LIBS=""])
[psblas_cv_have_metis=no;pac_metis_lib_ok="no. Unusable METIS version, sorry."; METIS_LIBS=""
])
AC_MSG_RESULT($pac_metis_lib_ok)
fi
LIBS="$SAVE_LIBS";

51
configure vendored

@ -6873,10 +6873,10 @@ fi
# Defaults for IPK/LPK
if test x"$pac_cv_ipk_size" == x"" ; then
pac_cv_ipk_size=4;
pac_cv_ipk_size=4
fi
if test x"$pac_cv_lpk_size" == x"" ; then
pac_cv_lpk_size=8;
pac_cv_lpk_size=8
fi
# Enforce sensible combination
if (( $pac_cv_lpk_size < $pac_cv_ipk_size )); then
@ -9017,7 +9017,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
fi
if test "x$pac_metis_header_ok" == "xyes" ; then
if test "x$pac_metis_header_ok" = "xyes" ; then
psblas_cv_metis_includes="$METIS_INCLUDES"
METIS_LIBS="$psblas_cv_metis $METIS_LIBDIR"
LIBS="$METIS_LIBS -lm $LIBS";
@ -9050,7 +9050,7 @@ rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pac_metis_lib_ok" >&5
$as_echo "$pac_metis_lib_ok" >&6; }
if test "x$pac_metis_lib_ok" == "xno" ; then
if test "x$pac_metis_lib_ok" = "xno" ; then
METIS_LIBDIR="-L$psblas_cv_metisdir/Lib -L$psblas_cv_metisdir/lib"
METIS_LIBS="$psblas_cv_metis $METIS_LIBDIR"
LIBS="$METIS_LIBS -lm $SAVE_LIBS"
@ -9085,7 +9085,8 @@ rm -f core conftest.err conftest.$ac_objext \
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pac_metis_lib_ok" >&5
$as_echo "$pac_metis_lib_ok" >&6; }
fi
if test "x$pac_metis_lib_ok" == "xno" ; then
if test "x$pac_metis_lib_ok" = "xno" ; then
METIS_LIBDIR="-L$psblas_cv_metisdir/METIS/Lib -L$psblas_cv_metisdir/METIS/Lib"
METIS_LIBS="$psblas_cv_metis $METIS_LIBDIR"
LIBS="$METIS_LIBS -lm $SAVE_LIBS"
@ -9110,17 +9111,18 @@ return METIS_PartGraphKway ();
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
psblas_cv_have_metis=yes;pac_metis_lib_ok=yes;
psblas_cv_have_metis=yes;pac_metis_lib_ok="yes";
else
psblas_cv_have_metis=no;pac_metis_lib_ok=no; METIS_LIBS=""
psblas_cv_have_metis=no;pac_metis_lib_ok="no"; METIS_LIBS=""
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pac_metis_lib_ok" >&5
$as_echo "$pac_metis_lib_ok" >&6; }
fi
fi
if test "x$pac_metis_lib_ok" == "xyes" ; then
fi
if test "x$pac_metis_lib_ok" = "xyes" ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for METIS_SetDefaultOptions in $LIBS" >&5
$as_echo_n "checking for METIS_SetDefaultOptions in $LIBS... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@ -9145,19 +9147,40 @@ if ac_fn_c_try_link "$LINENO"; then :
psblas_cv_have_metis=yes;pac_metis_lib_ok=yes;
else
psblas_cv_have_metis=no;pac_metis_lib_ok="no. Unusable METIS version, sorry."; METIS_LIBS=""
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pac_metis_lib_ok" >&5
$as_echo "$pac_metis_lib_ok" >&6; }
fi
LIBS="$SAVE_LIBS";
CPPFLAGS="$SAVE_CPPFLAGS";
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Compatibility between metis and LPK" >&5
$as_echo_n "checking Compatibility between metis and LPK... " >&6; }
if test "x$pac_cv_lpk_size" == "x4" ; then
if test "x$pac_cv_metis_idx" == "x64" ; then
psblas_cv_have_metis="no";
fi
fi
if test "x$pac_cv_lpk_size" == "x8" ; then
if test "x$pac_cv_metis_idx" == "x32" ; then
psblas_cv_have_metis="no";
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $psblas_cv_have_metis" >&5
$as_echo "$psblas_cv_have_metis" >&6; }
if test "x$pac_cv_metis_idx" == "xunknown" ; then
true ; # do nothing
elif test "x$psblas_cv_have_metis" == "xyes" ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Unknown METIS bitsize." >&5
$as_echo "$as_me: Unknown METIS bitsize." >&6;}
$psblas_cv_have_metis = "no";
fi
if test "x$psblas_cv_have_metis" == "xyes" ; then
FDEFINES="$psblas_cv_define_prepend-DHAVE_METIS $psblas_cv_define_prepend-DMETIS_$pac_cv_metis_idx $FDEFINES"
CDEFINES="-DHAVE_METIS_ $psblas_cv_metis_includes $CDEFINES -DMETIS_$pac_cv_metis_idx"
METISINCFILE=$psblas_cv_metisincfile
@ -10782,7 +10805,8 @@ fi
BLAS : ${BLAS_LIBS}
METIS detected : ${psblas_cv_have_metis}
METIS usable : ${psblas_cv_have_metis}
METIS bitsize : ${pac_cv_metis_idx}
AMD detected : ${psblas_cv_have_amd}
LIBS : ${LIBS}
LDLIBS : ${LDLIBS}
@ -10810,7 +10834,8 @@ $as_echo "$as_me:
BLAS : ${BLAS_LIBS}
METIS detected : ${psblas_cv_have_metis}
METIS usable : ${psblas_cv_have_metis}
METIS bitsize : ${pac_cv_metis_idx}
AMD detected : ${psblas_cv_have_amd}
LIBS : ${LIBS}
LDLIBS : ${LDLIBS}

@ -483,10 +483,10 @@ PAC_ARG_WITH_IPK
PAC_ARG_WITH_LPK
# Defaults for IPK/LPK
if test x"$pac_cv_ipk_size" == x"" ; then
pac_cv_ipk_size=4;
pac_cv_ipk_size=4
fi
if test x"$pac_cv_lpk_size" == x"" ; then
pac_cv_lpk_size=8;
pac_cv_lpk_size=8
fi
# Enforce sensible combination
if (( $pac_cv_lpk_size < $pac_cv_ipk_size )); then
@ -694,9 +694,29 @@ LIBS="$RSB_LIBS ${LIBS}"
dnl AC_CHECK_HEADERS([rsb.h], [ LIBS="${LIBS} $want_rsb_libs"], [])
PAC_CHECK_METIS
AC_MSG_CHECKING([Compatibility between metis and LPK])
if test "x$pac_cv_lpk_size" == "x4" ; then
if test "x$pac_cv_metis_idx" == "x64" ; then
dnl mismatch between metis size and PSBLAS LPK
psblas_cv_have_metis="no";
dnl
fi
fi
if test "x$pac_cv_lpk_size" == "x8" ; then
if test "x$pac_cv_metis_idx" == "x32" ; then
dnl mismatch between metis size and PSBLAS LPK
psblas_cv_have_metis="no";
fi
fi
AC_MSG_RESULT([$psblas_cv_have_metis])
if test "x$pac_cv_metis_idx" == "xunknown" ; then
true ; # do nothing
elif test "x$psblas_cv_have_metis" == "xyes" ; then
dnl mismatch between metis size and PSBLAS LPK
AC_MSG_NOTICE([Unknown METIS bitsize.])
$psblas_cv_have_metis = "no";
fi
if test "x$psblas_cv_have_metis" == "xyes" ; then
FDEFINES="$psblas_cv_define_prepend-DHAVE_METIS $psblas_cv_define_prepend-DMETIS_$pac_cv_metis_idx $FDEFINES"
CDEFINES="-DHAVE_METIS_ $psblas_cv_metis_includes $CDEFINES -DMETIS_$pac_cv_metis_idx"
METISINCFILE=$psblas_cv_metisincfile
@ -814,7 +834,8 @@ AC_MSG_NOTICE([
BLAS : ${BLAS_LIBS}
METIS detected : ${psblas_cv_have_metis}
METIS usable : ${psblas_cv_have_metis}
METIS bitsize : ${pac_cv_metis_idx}
AMD detected : ${psblas_cv_have_amd}
LIBS : ${LIBS}
dnl Note : we should use LDLIBS sooner or later!

@ -9,10 +9,10 @@ MODOBJS=psb_prec_const_mod.o\
psb_s_base_prec_mod.o psb_d_base_prec_mod.o psb_c_base_prec_mod.o psb_z_base_prec_mod.o \
psb_prec_type.o \
psb_prec_mod.o psb_s_prec_mod.o psb_d_prec_mod.o psb_c_prec_mod.o psb_z_prec_mod.o \
psb_d_diagprec.o psb_d_nullprec.o psb_d_bjacprec.o \
psb_s_diagprec.o psb_s_nullprec.o psb_s_bjacprec.o \
psb_c_diagprec.o psb_c_nullprec.o psb_c_bjacprec.o \
psb_z_diagprec.o psb_z_nullprec.o psb_z_bjacprec.o
psb_d_diagprec.o psb_d_nullprec.o psb_d_bjacprec.o psb_s_ilu_fact_mod.o \
psb_s_diagprec.o psb_s_nullprec.o psb_s_bjacprec.o psb_d_ilu_fact_mod.o \
psb_c_diagprec.o psb_c_nullprec.o psb_c_bjacprec.o psb_c_ilu_fact_mod.o \
psb_z_diagprec.o psb_z_nullprec.o psb_z_bjacprec.o psb_z_ilu_fact_mod.o
LIBNAME=$(PRECLIBNAME)
@ -32,7 +32,8 @@ impld: $(OBJS)
$(OBJS): $(MODDIR)/$(BASEMODNAME)$(.mod)
psb_s_base_prec_mod.o psb_d_base_prec_mod.o psb_c_base_prec_mod.o psb_z_base_prec_mod.o: psb_prec_const_mod.o
psb_s_base_prec_mod.o psb_d_base_prec_mod.o psb_c_base_prec_mod.o psb_z_base_prec_mod.o \
psb_s_ilu_fact_mod.o psb_d_ilu_fact_mod.o psb_c_ilu_fact_mod.o psb_z_ilu_fact_mod.o : psb_prec_const_mod.o
psb_s_prec_type.o: psb_s_base_prec_mod.o
psb_d_prec_type.o: psb_d_base_prec_mod.o
psb_c_prec_type.o: psb_c_base_prec_mod.o
@ -47,6 +48,10 @@ psb_s_bjacprec.o psb_s_diagprec.o psb_s_nullprec.o: psb_prec_mod.o psb_s_base_pr
psb_d_bjacprec.o psb_d_diagprec.o psb_d_nullprec.o: psb_prec_mod.o psb_d_base_prec_mod.o
psb_c_bjacprec.o psb_c_diagprec.o psb_c_nullprec.o: psb_prec_mod.o psb_c_base_prec_mod.o
psb_z_bjacprec.o psb_z_diagprec.o psb_z_nullprec.o: psb_prec_mod.o psb_z_base_prec_mod.o
psb_s_bjacprec.o: psb_s_ilu_fact_mod.o
psb_d_bjacprec.o: psb_d_ilu_fact_mod.o
psb_c_bjacprec.o: psb_c_ilu_fact_mod.o
psb_z_bjacprec.o: psb_z_ilu_fact_mod.o
veryclean: clean
/bin/rm -f $(LIBNAME) *$(.mod)

@ -7,16 +7,16 @@ HERE=..
OBJS=psb_s_prec_type_impl.o psb_d_prec_type_impl.o \
psb_c_prec_type_impl.o psb_z_prec_type_impl.o \
psb_d_diagprec_impl.o psb_d_bjacprec_impl.o psb_d_nullprec_impl.o \
psb_dilu_fct.o\
psb_dilu_fct.o psb_d_ilu0_fact.o psb_d_iluk_fact.o psb_d_ilut_fact.o \
psb_dprecbld.o psb_dprecset.o psb_dprecinit.o \
psb_s_diagprec_impl.o psb_s_bjacprec_impl.o psb_s_nullprec_impl.o \
psb_silu_fct.o\
psb_silu_fct.o psb_s_ilu0_fact.o psb_s_iluk_fact.o psb_s_ilut_fact.o \
psb_sprecbld.o psb_sprecset.o psb_sprecinit.o \
psb_c_diagprec_impl.o psb_c_bjacprec_impl.o psb_c_nullprec_impl.o \
psb_cilu_fct.o\
psb_cilu_fct.o psb_c_ilu0_fact.o psb_c_iluk_fact.o psb_c_ilut_fact.o \
psb_cprecbld.o psb_cprecset.o psb_cprecinit.o \
psb_z_diagprec_impl.o psb_z_bjacprec_impl.o psb_z_nullprec_impl.o \
psb_zilu_fct.o\
psb_zilu_fct.o psb_z_ilu0_fact.o psb_z_iluk_fact.o psb_z_ilut_fact.o \
psb_zprecbld.o psb_zprecset.o psb_zprecinit.o
LIBNAME=$(PRECLIBNAME)

@ -0,0 +1,698 @@
!
! Parallel Sparse BLAS version 3.5
! (C) Copyright 2006-2018
! Salvatore Filippone
! Alfredo Buttari
!
! 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.
!
! Moved here from MLD2P4, original copyright below.
!
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! 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 MLD2P4 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 MLD2P4 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: psb_cilu0_fact.f90
!
! Subroutine: psb_cilu0_fact
! Version: complex
! Contains: psb_cilu0_factint, ilu_copyin
!
! This routine computes either the ILU(0) or the MILU(0) factorization of
! the diagonal blocks of a distributed matrix. These factorizations are used
! to build the 'base preconditioner' (block-Jacobi preconditioner/solver,
! Additive Schwarz preconditioner) corresponding to a given level of a
! multilevel preconditioner.
!
! Details on the above factorizations can be found in
! Y. Saad, Iterative Methods for Sparse Linear Systems, Second Edition,
! SIAM, 2003, Chapter 10.
!
! The local matrix is stored into a and blck, as specified in the description
! of the arguments below. The storage format for both the L and U factors is CSR.
! The diagonal of the U factor is stored separately (actually, the inverse of the
! diagonal entries is stored; this is then managed in the solve stage associated
! to the ILU(0)/MILU(0) factorization).
!
! The routine copies and factors "on the fly" from a and blck into l (L factor),
! u (U factor, except its diagonal) and d (diagonal of U).
!
! This implementation of ILU(0)/MILU(0) is faster than the implementation in
! psb_ziluk_fct (the latter routine performs the more general ILU(k)/MILU(k)).
!
!
! Arguments:
! ialg - integer, input.
! The type of incomplete factorization to be performed.
! The MILU(0) factorization is computed if ialg = 2 (= psb_milu_n_);
! the ILU(0) factorization otherwise.
! a - type(psb_cspmat_type), input.
! The sparse matrix structure containing the local matrix.
! Note that if the 'base' Additive Schwarz preconditioner
! has overlap greater than 0 and the matrix has not been reordered
! (see psb_as_bld), then a contains only the 'original' local part
! of the distributed matrix, i.e. the rows of the matrix held
! by the calling process according to the initial data distribution.
! l - type(psb_cspmat_type), input/output.
! The L factor in the incomplete factorization.
! Note: its allocation is managed by the calling routine psb_ilu_bld,
! hence it cannot be only intent(out).
! u - type(psb_cspmat_type), input/output.
! The U factor (except its diagonal) in the incomplete factorization.
! Note: its allocation is managed by the calling routine psb_ilu_bld,
! hence it cannot be only intent(out).
! d - complex(psb_spk_), dimension(:), input/output.
! The inverse of the diagonal entries of the U factor in the incomplete
! factorization.
! Note: its allocation is managed by the calling routine psb_ilu_bld,
! hence it cannot be only intent(out).
! info - integer, output.
! Error code.
! blck - type(psb_cspmat_type), input, optional, target.
! The sparse matrix structure containing the remote rows of the
! distributed matrix, that have been retrieved by psb_as_bld
! to build an Additive Schwarz base preconditioner with overlap
! greater than 0. If the overlap is 0 or the matrix has been reordered
! (see psb_fact_bld), then blck is empty.
!
subroutine psb_cilu0_fact(ialg,a,l,u,d,info,blck, upd)
use psb_base_mod
use psb_c_ilu_fact_mod, psb_protect_name => psb_cilu0_fact
implicit none
! Arguments
integer(psb_ipk_), intent(in) :: ialg
type(psb_cspmat_type),intent(in) :: a
type(psb_cspmat_type),intent(inout) :: l,u
complex(psb_spk_), intent(inout) :: d(:)
integer(psb_ipk_), intent(out) :: info
type(psb_cspmat_type),intent(in), optional, target :: blck
character, intent(in), optional :: upd
! Local variables
integer(psb_ipk_) :: l1, l2, m, err_act
type(psb_cspmat_type), pointer :: blck_
type(psb_c_csr_sparse_mat) :: ll, uu
character :: upd_
character(len=20) :: name, ch_err
name='psb_cilu0_fact'
info = psb_success_
call psb_erractionsave(err_act)
!
! Point to / allocate memory for the incomplete factorization
!
if (present(blck)) then
blck_ => blck
else
allocate(blck_,stat=info)
if (info == psb_success_) call blck_%csall(izero,izero,info,ione)
if (info /= psb_success_) then
info=psb_err_from_subroutine_
ch_err='csall'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
endif
if (present(upd)) then
upd_ = psb_toupper(upd)
else
upd_ = 'F'
end if
m = a%get_nrows() + blck_%get_nrows()
if ((m /= l%get_nrows()).or.(m /= u%get_nrows()).or.&
& (m > size(d)) ) then
write(0,*) 'Wrong allocation status for L,D,U? ',&
& l%get_nrows(),size(d),u%get_nrows()
info = -1
return
end if
call l%mv_to(ll)
call u%mv_to(uu)
!
! Compute the ILU(0) or the MILU(0) factorization, depending on ialg
!
call psb_cilu0_factint(ialg,a,blck_,&
& d,ll%val,ll%ja,ll%irp,uu%val,uu%ja,uu%irp,l1,l2,upd_,info)
if(info.ne.0) then
info=psb_err_from_subroutine_
ch_err='psb_cilu0_factint'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
!
! Store information on the L and U sparse matrices
!
call l%mv_from(ll)
call l%set_triangle()
call l%set_unit()
call l%set_lower()
call u%mv_from(uu)
call u%set_triangle()
call u%set_unit()
call u%set_upper()
!
! Nullify pointer / deallocate memory
!
if (present(blck)) then
blck_ => null()
else
call blck_%free()
if(info.ne.0) then
info=psb_err_from_subroutine_
ch_err='psb_sp_free'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
deallocate(blck_)
endif
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
contains
!
! Subroutine: psb_cilu0_factint
! Version: complex
! Note: internal subroutine of psb_cilu0_fact.
!
! This routine computes either the ILU(0) or the MILU(0) factorization of the
! diagonal blocks of a distributed matrix.
! These factorizations are used to build the 'base preconditioner'
! (block-Jacobi preconditioner/solver, Additive Schwarz
! preconditioner) corresponding to a given level of a multilevel preconditioner.
!
! The local matrix is stored into a and b, as specified in the
! description of the arguments below. The storage format for both the L and U
! factors is CSR. The diagonal of the U factor is stored separately (actually,
! the inverse of the diagonal entries is stored; this is then managed in the
! solve stage associated to the ILU(0)/MILU(0) factorization).
!
! The routine copies and factors "on the fly" from the sparse matrix structures a
! and b into the arrays lval, uval, d (L, U without its diagonal, diagonal of U).
!
!
! Arguments:
! ialg - integer, input.
! The type of incomplete factorization to be performed.
! The ILU(0) factorization is computed if ialg = 1 (= psb_ilu_n_),
! the MILU(0) one if ialg = 2 (= psb_milu_n_); other values
! are not allowed.
! m - integer, output.
! The total number of rows of the local matrix to be factorized,
! i.e. ma+mb.
! ma - integer, input
! The number of rows of the local submatrix stored into a.
! a - type(psb_cspmat_type), input.
! The sparse matrix structure containing the local matrix.
! Note that, if the 'base' Additive Schwarz preconditioner
! has overlap greater than 0 and the matrix has not been reordered
! (see psb_fact_bld), then a contains only the 'original' local part
! of the distributed matrix, i.e. the rows of the matrix held
! by the calling process according to the initial data distribution.
! mb - integer, input.
! The number of rows of the local submatrix stored into b.
! b - type(psb_cspmat_type), input.
! The sparse matrix structure containing the remote rows of the
! distributed matrix, that have been retrieved by psb_as_bld
! to build an Additive Schwarz base preconditioner with overlap
! greater than 0. If the overlap is 0 or the matrix has been
! reordered (see psb_fact_bld), then b does not contain any row.
! d - complex(psb_spk_), dimension(:), output.
! The inverse of the diagonal entries of the U factor in the
! incomplete factorization.
! lval - complex(psb_spk_), dimension(:), input/output.
! The entries of U are stored according to the CSR format.
! The L factor in the incomplete factorization.
! lja - integer, dimension(:), input/output.
! The column indices of the nonzero entries of the L factor,
! according to the CSR storage format.
! lirp - integer, dimension(:), input/output.
! The indices identifying the first nonzero entry of each row
! of the L factor in lval, according to the CSR storage format.
! uval - complex(psb_spk_), dimension(:), input/output.
! The U factor in the incomplete factorization.
! The entries of U are stored according to the CSR format.
! uja - integer, dimension(:), input/output.
! The column indices of the nonzero entries of the U factor,
! according to the CSR storage format.
! uirp - integer, dimension(:), input/output.
! The indices identifying the first nonzero entry of each row
! of the U factor in uval, according to the CSR storage format.
! l1 - integer, output.
! The number of nonzero entries in lval.
! l2 - integer, output.
! The number of nonzero entries in uval.
! info - integer, output.
! Error code.
!
subroutine psb_cilu0_factint(ialg,a,b,&
& d,lval,lja,lirp,uval,uja,uirp,l1,l2,upd,info)
implicit none
! Arguments
integer(psb_ipk_), intent(in) :: ialg
type(psb_cspmat_type),intent(in) :: a,b
integer(psb_ipk_),intent(inout) :: l1,l2,info
integer(psb_ipk_), intent(inout) :: lja(:),lirp(:),uja(:),uirp(:)
complex(psb_spk_), intent(inout) :: lval(:),uval(:),d(:)
character, intent(in) :: upd
! Local variables
integer(psb_ipk_) :: i,j,k,l,low1,low2,kk,jj,ll, ktrw,err_act, m
integer(psb_ipk_) :: ma,mb
complex(psb_spk_) :: dia,temp
integer(psb_ipk_), parameter :: nrb=16
type(psb_c_coo_sparse_mat) :: trw
integer(psb_ipk_) :: int_err(5)
character(len=20) :: name, ch_err
name='psb_cilu0_factint'
info=psb_success_
call psb_erractionsave(err_act)
if (psb_errstatus_fatal()) then
info = psb_err_internal_error_; goto 9999
end if
ma = a%get_nrows()
mb = b%get_nrows()
select case(ialg)
case(psb_ilu_n_,psb_milu_n_)
! Ok
case default
info=psb_err_input_asize_invalid_i_
call psb_errpush(info,name,&
& i_err=(/ione,ialg,izero,izero,izero/))
goto 9999
end select
call trw%allocate(izero,izero,ione)
if(info /= psb_success_) then
info=psb_err_from_subroutine_
ch_err='psb_sp_all'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
m = ma+mb
if (psb_toupper(upd) == 'F' ) then
lirp(1) = 1
uirp(1) = 1
l1 = 0
l2 = 0
!
! Cycle over the matrix rows
!
do i = 1, m
d(i) = czero
if (i <= ma) then
!
! Copy the i-th local row of the matrix, stored in a,
! into lval/d(i)/uval
!
call ilu_copyin(i,ma,a,i,ione,m,l1,lja,lval,&
& d(i),l2,uja,uval,ktrw,trw,upd)
else
!
! Copy the i-th local row of the matrix, stored in b
! (as (i-ma)-th row), into lval/d(i)/uval
!
call ilu_copyin(i-ma,mb,b,i,ione,m,l1,lja,lval,&
& d(i),l2,uja,uval,ktrw,trw,upd)
endif
lirp(i+1) = l1 + 1
uirp(i+1) = l2 + 1
dia = d(i)
do kk = lirp(i), lirp(i+1) - 1
!
! Compute entry l(i,k) (lower factor L) of the incomplete
! factorization
!
temp = lval(kk)
k = lja(kk)
lval(kk) = temp*d(k)
!
! Update the rest of row i (lower and upper factors L and U)
! using l(i,k)
!
low1 = kk + 1
low2 = uirp(i)
!
updateloop: do jj = uirp(k), uirp(k+1) - 1
!
j = uja(jj)
!
if (j < i) then
!
! search l(i,*) (i-th row of L) for a matching index j
!
do ll = low1, lirp(i+1) - 1
l = lja(ll)
if (l > j) then
low1 = ll
exit
else if (l == j) then
lval(ll) = lval(ll) - temp*uval(jj)
low1 = ll + 1
cycle updateloop
end if
enddo
else if (j == i) then
!
! j=i: update the diagonal
!
dia = dia - temp*uval(jj)
cycle updateloop
!
else if (j > i) then
!
! search u(i,*) (i-th row of U) for a matching index j
!
do ll = low2, uirp(i+1) - 1
l = uja(ll)
if (l > j) then
low2 = ll
exit
else if (l == j) then
uval(ll) = uval(ll) - temp*uval(jj)
low2 = ll + 1
cycle updateloop
end if
enddo
end if
!
! If we get here we missed the cycle updateloop, which means
! that this entry does not match; thus we accumulate on the
! diagonal for MILU(0).
!
if (ialg == psb_milu_n_) then
dia = dia - temp*uval(jj)
end if
enddo updateloop
enddo
!
! Check the pivot size
!
if (abs(dia) < s_epstol) then
!
! Too small pivot: unstable factorization
!
info = psb_err_pivot_too_small_
int_err(1) = i
write(ch_err,'(g20.10)') abs(dia)
call psb_errpush(info,name,i_err=int_err,a_err=ch_err)
goto 9999
else
!
! Compute 1/pivot
!
dia = cone/dia
end if
d(i) = dia
!
! Scale row i of upper triangle
!
do kk = uirp(i), uirp(i+1) - 1
uval(kk) = uval(kk)*dia
enddo
enddo
else
write(0,*) 'Update not implemented '
info = 31
call psb_errpush(info,name,&
& i_err=(/ione*13,izero,izero,izero,izero/),a_err=upd)
goto 9999
end if
call trw%free()
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_cilu0_factint
!
! Subroutine: ilu_copyin
! Version: complex
! Note: internal subroutine of psb_cilu0_fact
!
! This routine copies a row of a sparse matrix A, stored in the psb_cspmat_type
! data structure a, into the arrays lval and uval and into the scalar variable
! dia, corresponding to the lower and upper triangles of A and to the diagonal
! entry of the row, respectively. The entries in lval and uval are stored
! according to the CSR format; the corresponding column indices are stored in
! the arrays lja and uja.
!
! If the sparse matrix is in CSR format, a 'straight' copy is performed;
! otherwise psb_sp_getblk is used to extract a block of rows, which is then
! copied into lval, dia, uval row by row, through successive calls to
! ilu_copyin.
!
! The routine is used by psb_cilu0_factint in the computation of the ILU(0)/MILU(0)
! factorization of a local sparse matrix.
!
! TODO: modify the routine to allow copying into output L and U that are
! already filled with indices; this would allow computing an ILU(k) pattern,
! then use the ILU(0) internal for subsequent calls with the same pattern.
!
! Arguments:
! i - integer, input.
! The local index of the row to be extracted from the
! sparse matrix structure a.
! m - integer, input.
! The number of rows of the local matrix stored into a.
! a - type(psb_cspmat_type), input.
! The sparse matrix structure containing the row to be copied.
! jd - integer, input.
! The column index of the diagonal entry of the row to be
! copied.
! jmin - integer, input.
! Minimum valid column index.
! jmax - integer, input.
! Maximum valid column index.
! The output matrix will contain a clipped copy taken from
! a(1:m,jmin:jmax).
! l1 - integer, input/output.
! Pointer to the last occupied entry of lval.
! lja - integer, dimension(:), input/output.
! The column indices of the nonzero entries of the lower triangle
! copied in lval row by row (see psb_cilu0_factint), according
! to the CSR storage format.
! lval - complex(psb_spk_), dimension(:), input/output.
! The array where the entries of the row corresponding to the
! lower triangle are copied.
! dia - complex(psb_spk_), output.
! The diagonal entry of the copied row.
! l2 - integer, input/output.
! Pointer to the last occupied entry of uval.
! uja - integer, dimension(:), input/output.
! The column indices of the nonzero entries of the upper triangle
! copied in uval row by row (see psb_cilu0_factint), according
! to the CSR storage format.
! uval - complex(psb_spk_), dimension(:), input/output.
! The array where the entries of the row corresponding to the
! upper triangle are copied.
! ktrw - integer, input/output.
! The index identifying the last entry taken from the
! staging buffer trw. See below.
! trw - type(psb_cspmat_type), input/output.
! A staging buffer. If the matrix A is not in CSR format, we use
! the psb_sp_getblk routine and store its output in trw; when we
! need to call psb_sp_getblk we do it for a block of rows, and then
! we consume them from trw in successive calls to this routine,
! until we empty the buffer. Thus we will make a call to psb_sp_getblk
! every nrb calls to copyin. If A is in CSR format it is unused.
!
subroutine ilu_copyin(i,m,a,jd,jmin,jmax,l1,lja,lval,&
& dia,l2,uja,uval,ktrw,trw,upd)
use psb_base_mod
implicit none
! Arguments
type(psb_cspmat_type), intent(in) :: a
type(psb_c_coo_sparse_mat), intent(inout) :: trw
integer(psb_ipk_), intent(in) :: i,m,jd,jmin,jmax
integer(psb_ipk_), intent(inout) :: ktrw,l1,l2
integer(psb_ipk_), intent(inout) :: lja(:), uja(:)
complex(psb_spk_), intent(inout) :: lval(:), uval(:), dia
character, intent(in) :: upd
! Local variables
integer(psb_ipk_) :: k,j,info,irb, nz
integer(psb_ipk_), parameter :: nrb=40
character(len=20), parameter :: name='ilu_copyin'
character(len=20) :: ch_err
info=psb_success_
call psb_erractionsave(err_act)
if (psb_errstatus_fatal()) then
info = psb_err_internal_error_; goto 9999
end if
if (psb_toupper(upd) == 'F') then
select type(aa => a%a)
type is (psb_c_csr_sparse_mat)
!
! Take a fast shortcut if the matrix is stored in CSR format
!
do j = aa%irp(i), aa%irp(i+1) - 1
k = aa%ja(j)
! write(0,*)'KKKKK',k
if ((k < jd).and.(k >= jmin)) then
l1 = l1 + 1
lval(l1) = aa%val(j)
lja(l1) = k
else if (k == jd) then
dia = aa%val(j)
else if ((k > jd).and.(k <= jmax)) then
l2 = l2 + 1
uval(l2) = aa%val(j)
uja(l2) = k
end if
enddo
class default
!
! Otherwise use psb_sp_getblk, slower but able (in principle) of
! handling any format. In this case, a block of rows is extracted
! instead of a single row, for performance reasons, and these
! rows are copied one by one into lval, dia, uval, through
! successive calls to ilu_copyin.
!
if ((mod(i,nrb) == 1).or.(nrb == 1)) then
irb = min(m-i+1,nrb)
call aa%csget(i,i+irb-1,trw,info)
if(info /= psb_success_) then
info=psb_err_from_subroutine_
ch_err='csget'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
ktrw=1
end if
nz = trw%get_nzeros()
do
if (ktrw > nz) exit
if (trw%ia(ktrw) > i) exit
k = trw%ja(ktrw)
if ((k < jd).and.(k >= jmin)) then
l1 = l1 + 1
lval(l1) = trw%val(ktrw)
lja(l1) = k
else if (k == jd) then
dia = trw%val(ktrw)
else if ((k > jd).and.(k <= jmax)) then
l2 = l2 + 1
uval(l2) = trw%val(ktrw)
uja(l2) = k
end if
ktrw = ktrw + 1
enddo
end select
else
write(0,*) 'Update not implemented '
info = 31
call psb_errpush(info,name,&
& i_err=(/ione*13,izero,izero,izero,izero/),a_err=upd)
goto 9999
end if
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine ilu_copyin
end subroutine psb_cilu0_fact

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -0,0 +1,698 @@
!
! Parallel Sparse BLAS version 3.5
! (C) Copyright 2006-2018
! Salvatore Filippone
! Alfredo Buttari
!
! 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.
!
! Moved here from MLD2P4, original copyright below.
!
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! 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 MLD2P4 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 MLD2P4 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: psb_dilu0_fact.f90
!
! Subroutine: psb_dilu0_fact
! Version: real
! Contains: psb_dilu0_factint, ilu_copyin
!
! This routine computes either the ILU(0) or the MILU(0) factorization of
! the diagonal blocks of a distributed matrix. These factorizations are used
! to build the 'base preconditioner' (block-Jacobi preconditioner/solver,
! Additive Schwarz preconditioner) corresponding to a given level of a
! multilevel preconditioner.
!
! Details on the above factorizations can be found in
! Y. Saad, Iterative Methods for Sparse Linear Systems, Second Edition,
! SIAM, 2003, Chapter 10.
!
! The local matrix is stored into a and blck, as specified in the description
! of the arguments below. The storage format for both the L and U factors is CSR.
! The diagonal of the U factor is stored separately (actually, the inverse of the
! diagonal entries is stored; this is then managed in the solve stage associated
! to the ILU(0)/MILU(0) factorization).
!
! The routine copies and factors "on the fly" from a and blck into l (L factor),
! u (U factor, except its diagonal) and d (diagonal of U).
!
! This implementation of ILU(0)/MILU(0) is faster than the implementation in
! psb_ziluk_fct (the latter routine performs the more general ILU(k)/MILU(k)).
!
!
! Arguments:
! ialg - integer, input.
! The type of incomplete factorization to be performed.
! The MILU(0) factorization is computed if ialg = 2 (= psb_milu_n_);
! the ILU(0) factorization otherwise.
! a - type(psb_dspmat_type), input.
! The sparse matrix structure containing the local matrix.
! Note that if the 'base' Additive Schwarz preconditioner
! has overlap greater than 0 and the matrix has not been reordered
! (see psb_as_bld), then a contains only the 'original' local part
! of the distributed matrix, i.e. the rows of the matrix held
! by the calling process according to the initial data distribution.
! l - type(psb_dspmat_type), input/output.
! The L factor in the incomplete factorization.
! Note: its allocation is managed by the calling routine psb_ilu_bld,
! hence it cannot be only intent(out).
! u - type(psb_dspmat_type), input/output.
! The U factor (except its diagonal) in the incomplete factorization.
! Note: its allocation is managed by the calling routine psb_ilu_bld,
! hence it cannot be only intent(out).
! d - real(psb_dpk_), dimension(:), input/output.
! The inverse of the diagonal entries of the U factor in the incomplete
! factorization.
! Note: its allocation is managed by the calling routine psb_ilu_bld,
! hence it cannot be only intent(out).
! info - integer, output.
! Error code.
! blck - type(psb_dspmat_type), input, optional, target.
! The sparse matrix structure containing the remote rows of the
! distributed matrix, that have been retrieved by psb_as_bld
! to build an Additive Schwarz base preconditioner with overlap
! greater than 0. If the overlap is 0 or the matrix has been reordered
! (see psb_fact_bld), then blck is empty.
!
subroutine psb_dilu0_fact(ialg,a,l,u,d,info,blck, upd)
use psb_base_mod
use psb_d_ilu_fact_mod, psb_protect_name => psb_dilu0_fact
implicit none
! Arguments
integer(psb_ipk_), intent(in) :: ialg
type(psb_dspmat_type),intent(in) :: a
type(psb_dspmat_type),intent(inout) :: l,u
real(psb_dpk_), intent(inout) :: d(:)
integer(psb_ipk_), intent(out) :: info
type(psb_dspmat_type),intent(in), optional, target :: blck
character, intent(in), optional :: upd
! Local variables
integer(psb_ipk_) :: l1, l2, m, err_act
type(psb_dspmat_type), pointer :: blck_
type(psb_d_csr_sparse_mat) :: ll, uu
character :: upd_
character(len=20) :: name, ch_err
name='psb_dilu0_fact'
info = psb_success_
call psb_erractionsave(err_act)
!
! Point to / allocate memory for the incomplete factorization
!
if (present(blck)) then
blck_ => blck
else
allocate(blck_,stat=info)
if (info == psb_success_) call blck_%csall(izero,izero,info,ione)
if (info /= psb_success_) then
info=psb_err_from_subroutine_
ch_err='csall'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
endif
if (present(upd)) then
upd_ = psb_toupper(upd)
else
upd_ = 'F'
end if
m = a%get_nrows() + blck_%get_nrows()
if ((m /= l%get_nrows()).or.(m /= u%get_nrows()).or.&
& (m > size(d)) ) then
write(0,*) 'Wrong allocation status for L,D,U? ',&
& l%get_nrows(),size(d),u%get_nrows()
info = -1
return
end if
call l%mv_to(ll)
call u%mv_to(uu)
!
! Compute the ILU(0) or the MILU(0) factorization, depending on ialg
!
call psb_dilu0_factint(ialg,a,blck_,&
& d,ll%val,ll%ja,ll%irp,uu%val,uu%ja,uu%irp,l1,l2,upd_,info)
if(info.ne.0) then
info=psb_err_from_subroutine_
ch_err='psb_dilu0_factint'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
!
! Store information on the L and U sparse matrices
!
call l%mv_from(ll)
call l%set_triangle()
call l%set_unit()
call l%set_lower()
call u%mv_from(uu)
call u%set_triangle()
call u%set_unit()
call u%set_upper()
!
! Nullify pointer / deallocate memory
!
if (present(blck)) then
blck_ => null()
else
call blck_%free()
if(info.ne.0) then
info=psb_err_from_subroutine_
ch_err='psb_sp_free'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
deallocate(blck_)
endif
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
contains
!
! Subroutine: psb_dilu0_factint
! Version: real
! Note: internal subroutine of psb_dilu0_fact.
!
! This routine computes either the ILU(0) or the MILU(0) factorization of the
! diagonal blocks of a distributed matrix.
! These factorizations are used to build the 'base preconditioner'
! (block-Jacobi preconditioner/solver, Additive Schwarz
! preconditioner) corresponding to a given level of a multilevel preconditioner.
!
! The local matrix is stored into a and b, as specified in the
! description of the arguments below. The storage format for both the L and U
! factors is CSR. The diagonal of the U factor is stored separately (actually,
! the inverse of the diagonal entries is stored; this is then managed in the
! solve stage associated to the ILU(0)/MILU(0) factorization).
!
! The routine copies and factors "on the fly" from the sparse matrix structures a
! and b into the arrays lval, uval, d (L, U without its diagonal, diagonal of U).
!
!
! Arguments:
! ialg - integer, input.
! The type of incomplete factorization to be performed.
! The ILU(0) factorization is computed if ialg = 1 (= psb_ilu_n_),
! the MILU(0) one if ialg = 2 (= psb_milu_n_); other values
! are not allowed.
! m - integer, output.
! The total number of rows of the local matrix to be factorized,
! i.e. ma+mb.
! ma - integer, input
! The number of rows of the local submatrix stored into a.
! a - type(psb_dspmat_type), input.
! The sparse matrix structure containing the local matrix.
! Note that, if the 'base' Additive Schwarz preconditioner
! has overlap greater than 0 and the matrix has not been reordered
! (see psb_fact_bld), then a contains only the 'original' local part
! of the distributed matrix, i.e. the rows of the matrix held
! by the calling process according to the initial data distribution.
! mb - integer, input.
! The number of rows of the local submatrix stored into b.
! b - type(psb_dspmat_type), input.
! The sparse matrix structure containing the remote rows of the
! distributed matrix, that have been retrieved by psb_as_bld
! to build an Additive Schwarz base preconditioner with overlap
! greater than 0. If the overlap is 0 or the matrix has been
! reordered (see psb_fact_bld), then b does not contain any row.
! d - real(psb_dpk_), dimension(:), output.
! The inverse of the diagonal entries of the U factor in the
! incomplete factorization.
! lval - real(psb_dpk_), dimension(:), input/output.
! The entries of U are stored according to the CSR format.
! The L factor in the incomplete factorization.
! lja - integer, dimension(:), input/output.
! The column indices of the nonzero entries of the L factor,
! according to the CSR storage format.
! lirp - integer, dimension(:), input/output.
! The indices identifying the first nonzero entry of each row
! of the L factor in lval, according to the CSR storage format.
! uval - real(psb_dpk_), dimension(:), input/output.
! The U factor in the incomplete factorization.
! The entries of U are stored according to the CSR format.
! uja - integer, dimension(:), input/output.
! The column indices of the nonzero entries of the U factor,
! according to the CSR storage format.
! uirp - integer, dimension(:), input/output.
! The indices identifying the first nonzero entry of each row
! of the U factor in uval, according to the CSR storage format.
! l1 - integer, output.
! The number of nonzero entries in lval.
! l2 - integer, output.
! The number of nonzero entries in uval.
! info - integer, output.
! Error code.
!
subroutine psb_dilu0_factint(ialg,a,b,&
& d,lval,lja,lirp,uval,uja,uirp,l1,l2,upd,info)
implicit none
! Arguments
integer(psb_ipk_), intent(in) :: ialg
type(psb_dspmat_type),intent(in) :: a,b
integer(psb_ipk_),intent(inout) :: l1,l2,info
integer(psb_ipk_), intent(inout) :: lja(:),lirp(:),uja(:),uirp(:)
real(psb_dpk_), intent(inout) :: lval(:),uval(:),d(:)
character, intent(in) :: upd
! Local variables
integer(psb_ipk_) :: i,j,k,l,low1,low2,kk,jj,ll, ktrw,err_act, m
integer(psb_ipk_) :: ma,mb
real(psb_dpk_) :: dia,temp
integer(psb_ipk_), parameter :: nrb=16
type(psb_d_coo_sparse_mat) :: trw
integer(psb_ipk_) :: int_err(5)
character(len=20) :: name, ch_err
name='psb_dilu0_factint'
info=psb_success_
call psb_erractionsave(err_act)
if (psb_errstatus_fatal()) then
info = psb_err_internal_error_; goto 9999
end if
ma = a%get_nrows()
mb = b%get_nrows()
select case(ialg)
case(psb_ilu_n_,psb_milu_n_)
! Ok
case default
info=psb_err_input_asize_invalid_i_
call psb_errpush(info,name,&
& i_err=(/ione,ialg,izero,izero,izero/))
goto 9999
end select
call trw%allocate(izero,izero,ione)
if(info /= psb_success_) then
info=psb_err_from_subroutine_
ch_err='psb_sp_all'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
m = ma+mb
if (psb_toupper(upd) == 'F' ) then
lirp(1) = 1
uirp(1) = 1
l1 = 0
l2 = 0
!
! Cycle over the matrix rows
!
do i = 1, m
d(i) = dzero
if (i <= ma) then
!
! Copy the i-th local row of the matrix, stored in a,
! into lval/d(i)/uval
!
call ilu_copyin(i,ma,a,i,ione,m,l1,lja,lval,&
& d(i),l2,uja,uval,ktrw,trw,upd)
else
!
! Copy the i-th local row of the matrix, stored in b
! (as (i-ma)-th row), into lval/d(i)/uval
!
call ilu_copyin(i-ma,mb,b,i,ione,m,l1,lja,lval,&
& d(i),l2,uja,uval,ktrw,trw,upd)
endif
lirp(i+1) = l1 + 1
uirp(i+1) = l2 + 1
dia = d(i)
do kk = lirp(i), lirp(i+1) - 1
!
! Compute entry l(i,k) (lower factor L) of the incomplete
! factorization
!
temp = lval(kk)
k = lja(kk)
lval(kk) = temp*d(k)
!
! Update the rest of row i (lower and upper factors L and U)
! using l(i,k)
!
low1 = kk + 1
low2 = uirp(i)
!
updateloop: do jj = uirp(k), uirp(k+1) - 1
!
j = uja(jj)
!
if (j < i) then
!
! search l(i,*) (i-th row of L) for a matching index j
!
do ll = low1, lirp(i+1) - 1
l = lja(ll)
if (l > j) then
low1 = ll
exit
else if (l == j) then
lval(ll) = lval(ll) - temp*uval(jj)
low1 = ll + 1
cycle updateloop
end if
enddo
else if (j == i) then
!
! j=i: update the diagonal
!
dia = dia - temp*uval(jj)
cycle updateloop
!
else if (j > i) then
!
! search u(i,*) (i-th row of U) for a matching index j
!
do ll = low2, uirp(i+1) - 1
l = uja(ll)
if (l > j) then
low2 = ll
exit
else if (l == j) then
uval(ll) = uval(ll) - temp*uval(jj)
low2 = ll + 1
cycle updateloop
end if
enddo
end if
!
! If we get here we missed the cycle updateloop, which means
! that this entry does not match; thus we accumulate on the
! diagonal for MILU(0).
!
if (ialg == psb_milu_n_) then
dia = dia - temp*uval(jj)
end if
enddo updateloop
enddo
!
! Check the pivot size
!
if (abs(dia) < d_epstol) then
!
! Too small pivot: unstable factorization
!
info = psb_err_pivot_too_small_
int_err(1) = i
write(ch_err,'(g20.10)') abs(dia)
call psb_errpush(info,name,i_err=int_err,a_err=ch_err)
goto 9999
else
!
! Compute 1/pivot
!
dia = done/dia
end if
d(i) = dia
!
! Scale row i of upper triangle
!
do kk = uirp(i), uirp(i+1) - 1
uval(kk) = uval(kk)*dia
enddo
enddo
else
write(0,*) 'Update not implemented '
info = 31
call psb_errpush(info,name,&
& i_err=(/ione*13,izero,izero,izero,izero/),a_err=upd)
goto 9999
end if
call trw%free()
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_dilu0_factint
!
! Subroutine: ilu_copyin
! Version: real
! Note: internal subroutine of psb_dilu0_fact
!
! This routine copies a row of a sparse matrix A, stored in the psb_dspmat_type
! data structure a, into the arrays lval and uval and into the scalar variable
! dia, corresponding to the lower and upper triangles of A and to the diagonal
! entry of the row, respectively. The entries in lval and uval are stored
! according to the CSR format; the corresponding column indices are stored in
! the arrays lja and uja.
!
! If the sparse matrix is in CSR format, a 'straight' copy is performed;
! otherwise psb_sp_getblk is used to extract a block of rows, which is then
! copied into lval, dia, uval row by row, through successive calls to
! ilu_copyin.
!
! The routine is used by psb_dilu0_factint in the computation of the ILU(0)/MILU(0)
! factorization of a local sparse matrix.
!
! TODO: modify the routine to allow copying into output L and U that are
! already filled with indices; this would allow computing an ILU(k) pattern,
! then use the ILU(0) internal for subsequent calls with the same pattern.
!
! Arguments:
! i - integer, input.
! The local index of the row to be extracted from the
! sparse matrix structure a.
! m - integer, input.
! The number of rows of the local matrix stored into a.
! a - type(psb_dspmat_type), input.
! The sparse matrix structure containing the row to be copied.
! jd - integer, input.
! The column index of the diagonal entry of the row to be
! copied.
! jmin - integer, input.
! Minimum valid column index.
! jmax - integer, input.
! Maximum valid column index.
! The output matrix will contain a clipped copy taken from
! a(1:m,jmin:jmax).
! l1 - integer, input/output.
! Pointer to the last occupied entry of lval.
! lja - integer, dimension(:), input/output.
! The column indices of the nonzero entries of the lower triangle
! copied in lval row by row (see psb_dilu0_factint), according
! to the CSR storage format.
! lval - real(psb_dpk_), dimension(:), input/output.
! The array where the entries of the row corresponding to the
! lower triangle are copied.
! dia - real(psb_dpk_), output.
! The diagonal entry of the copied row.
! l2 - integer, input/output.
! Pointer to the last occupied entry of uval.
! uja - integer, dimension(:), input/output.
! The column indices of the nonzero entries of the upper triangle
! copied in uval row by row (see psb_dilu0_factint), according
! to the CSR storage format.
! uval - real(psb_dpk_), dimension(:), input/output.
! The array where the entries of the row corresponding to the
! upper triangle are copied.
! ktrw - integer, input/output.
! The index identifying the last entry taken from the
! staging buffer trw. See below.
! trw - type(psb_dspmat_type), input/output.
! A staging buffer. If the matrix A is not in CSR format, we use
! the psb_sp_getblk routine and store its output in trw; when we
! need to call psb_sp_getblk we do it for a block of rows, and then
! we consume them from trw in successive calls to this routine,
! until we empty the buffer. Thus we will make a call to psb_sp_getblk
! every nrb calls to copyin. If A is in CSR format it is unused.
!
subroutine ilu_copyin(i,m,a,jd,jmin,jmax,l1,lja,lval,&
& dia,l2,uja,uval,ktrw,trw,upd)
use psb_base_mod
implicit none
! Arguments
type(psb_dspmat_type), intent(in) :: a
type(psb_d_coo_sparse_mat), intent(inout) :: trw
integer(psb_ipk_), intent(in) :: i,m,jd,jmin,jmax
integer(psb_ipk_), intent(inout) :: ktrw,l1,l2
integer(psb_ipk_), intent(inout) :: lja(:), uja(:)
real(psb_dpk_), intent(inout) :: lval(:), uval(:), dia
character, intent(in) :: upd
! Local variables
integer(psb_ipk_) :: k,j,info,irb, nz
integer(psb_ipk_), parameter :: nrb=40
character(len=20), parameter :: name='ilu_copyin'
character(len=20) :: ch_err
info=psb_success_
call psb_erractionsave(err_act)
if (psb_errstatus_fatal()) then
info = psb_err_internal_error_; goto 9999
end if
if (psb_toupper(upd) == 'F') then
select type(aa => a%a)
type is (psb_d_csr_sparse_mat)
!
! Take a fast shortcut if the matrix is stored in CSR format
!
do j = aa%irp(i), aa%irp(i+1) - 1
k = aa%ja(j)
! write(0,*)'KKKKK',k
if ((k < jd).and.(k >= jmin)) then
l1 = l1 + 1
lval(l1) = aa%val(j)
lja(l1) = k
else if (k == jd) then
dia = aa%val(j)
else if ((k > jd).and.(k <= jmax)) then
l2 = l2 + 1
uval(l2) = aa%val(j)
uja(l2) = k
end if
enddo
class default
!
! Otherwise use psb_sp_getblk, slower but able (in principle) of
! handling any format. In this case, a block of rows is extracted
! instead of a single row, for performance reasons, and these
! rows are copied one by one into lval, dia, uval, through
! successive calls to ilu_copyin.
!
if ((mod(i,nrb) == 1).or.(nrb == 1)) then
irb = min(m-i+1,nrb)
call aa%csget(i,i+irb-1,trw,info)
if(info /= psb_success_) then
info=psb_err_from_subroutine_
ch_err='csget'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
ktrw=1
end if
nz = trw%get_nzeros()
do
if (ktrw > nz) exit
if (trw%ia(ktrw) > i) exit
k = trw%ja(ktrw)
if ((k < jd).and.(k >= jmin)) then
l1 = l1 + 1
lval(l1) = trw%val(ktrw)
lja(l1) = k
else if (k == jd) then
dia = trw%val(ktrw)
else if ((k > jd).and.(k <= jmax)) then
l2 = l2 + 1
uval(l2) = trw%val(ktrw)
uja(l2) = k
end if
ktrw = ktrw + 1
enddo
end select
else
write(0,*) 'Update not implemented '
info = 31
call psb_errpush(info,name,&
& i_err=(/ione*13,izero,izero,izero,izero/),a_err=upd)
goto 9999
end if
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine ilu_copyin
end subroutine psb_dilu0_fact

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -0,0 +1,698 @@
!
! Parallel Sparse BLAS version 3.5
! (C) Copyright 2006-2018
! Salvatore Filippone
! Alfredo Buttari
!
! 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.
!
! Moved here from MLD2P4, original copyright below.
!
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! 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 MLD2P4 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 MLD2P4 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: psb_silu0_fact.f90
!
! Subroutine: psb_silu0_fact
! Version: real
! Contains: psb_silu0_factint, ilu_copyin
!
! This routine computes either the ILU(0) or the MILU(0) factorization of
! the diagonal blocks of a distributed matrix. These factorizations are used
! to build the 'base preconditioner' (block-Jacobi preconditioner/solver,
! Additive Schwarz preconditioner) corresponding to a given level of a
! multilevel preconditioner.
!
! Details on the above factorizations can be found in
! Y. Saad, Iterative Methods for Sparse Linear Systems, Second Edition,
! SIAM, 2003, Chapter 10.
!
! The local matrix is stored into a and blck, as specified in the description
! of the arguments below. The storage format for both the L and U factors is CSR.
! The diagonal of the U factor is stored separately (actually, the inverse of the
! diagonal entries is stored; this is then managed in the solve stage associated
! to the ILU(0)/MILU(0) factorization).
!
! The routine copies and factors "on the fly" from a and blck into l (L factor),
! u (U factor, except its diagonal) and d (diagonal of U).
!
! This implementation of ILU(0)/MILU(0) is faster than the implementation in
! psb_ziluk_fct (the latter routine performs the more general ILU(k)/MILU(k)).
!
!
! Arguments:
! ialg - integer, input.
! The type of incomplete factorization to be performed.
! The MILU(0) factorization is computed if ialg = 2 (= psb_milu_n_);
! the ILU(0) factorization otherwise.
! a - type(psb_sspmat_type), input.
! The sparse matrix structure containing the local matrix.
! Note that if the 'base' Additive Schwarz preconditioner
! has overlap greater than 0 and the matrix has not been reordered
! (see psb_as_bld), then a contains only the 'original' local part
! of the distributed matrix, i.e. the rows of the matrix held
! by the calling process according to the initial data distribution.
! l - type(psb_sspmat_type), input/output.
! The L factor in the incomplete factorization.
! Note: its allocation is managed by the calling routine psb_ilu_bld,
! hence it cannot be only intent(out).
! u - type(psb_sspmat_type), input/output.
! The U factor (except its diagonal) in the incomplete factorization.
! Note: its allocation is managed by the calling routine psb_ilu_bld,
! hence it cannot be only intent(out).
! d - real(psb_spk_), dimension(:), input/output.
! The inverse of the diagonal entries of the U factor in the incomplete
! factorization.
! Note: its allocation is managed by the calling routine psb_ilu_bld,
! hence it cannot be only intent(out).
! info - integer, output.
! Error code.
! blck - type(psb_sspmat_type), input, optional, target.
! The sparse matrix structure containing the remote rows of the
! distributed matrix, that have been retrieved by psb_as_bld
! to build an Additive Schwarz base preconditioner with overlap
! greater than 0. If the overlap is 0 or the matrix has been reordered
! (see psb_fact_bld), then blck is empty.
!
subroutine psb_silu0_fact(ialg,a,l,u,d,info,blck, upd)
use psb_base_mod
use psb_s_ilu_fact_mod, psb_protect_name => psb_silu0_fact
implicit none
! Arguments
integer(psb_ipk_), intent(in) :: ialg
type(psb_sspmat_type),intent(in) :: a
type(psb_sspmat_type),intent(inout) :: l,u
real(psb_spk_), intent(inout) :: d(:)
integer(psb_ipk_), intent(out) :: info
type(psb_sspmat_type),intent(in), optional, target :: blck
character, intent(in), optional :: upd
! Local variables
integer(psb_ipk_) :: l1, l2, m, err_act
type(psb_sspmat_type), pointer :: blck_
type(psb_s_csr_sparse_mat) :: ll, uu
character :: upd_
character(len=20) :: name, ch_err
name='psb_silu0_fact'
info = psb_success_
call psb_erractionsave(err_act)
!
! Point to / allocate memory for the incomplete factorization
!
if (present(blck)) then
blck_ => blck
else
allocate(blck_,stat=info)
if (info == psb_success_) call blck_%csall(izero,izero,info,ione)
if (info /= psb_success_) then
info=psb_err_from_subroutine_
ch_err='csall'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
endif
if (present(upd)) then
upd_ = psb_toupper(upd)
else
upd_ = 'F'
end if
m = a%get_nrows() + blck_%get_nrows()
if ((m /= l%get_nrows()).or.(m /= u%get_nrows()).or.&
& (m > size(d)) ) then
write(0,*) 'Wrong allocation status for L,D,U? ',&
& l%get_nrows(),size(d),u%get_nrows()
info = -1
return
end if
call l%mv_to(ll)
call u%mv_to(uu)
!
! Compute the ILU(0) or the MILU(0) factorization, depending on ialg
!
call psb_silu0_factint(ialg,a,blck_,&
& d,ll%val,ll%ja,ll%irp,uu%val,uu%ja,uu%irp,l1,l2,upd_,info)
if(info.ne.0) then
info=psb_err_from_subroutine_
ch_err='psb_silu0_factint'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
!
! Store information on the L and U sparse matrices
!
call l%mv_from(ll)
call l%set_triangle()
call l%set_unit()
call l%set_lower()
call u%mv_from(uu)
call u%set_triangle()
call u%set_unit()
call u%set_upper()
!
! Nullify pointer / deallocate memory
!
if (present(blck)) then
blck_ => null()
else
call blck_%free()
if(info.ne.0) then
info=psb_err_from_subroutine_
ch_err='psb_sp_free'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
deallocate(blck_)
endif
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
contains
!
! Subroutine: psb_silu0_factint
! Version: real
! Note: internal subroutine of psb_silu0_fact.
!
! This routine computes either the ILU(0) or the MILU(0) factorization of the
! diagonal blocks of a distributed matrix.
! These factorizations are used to build the 'base preconditioner'
! (block-Jacobi preconditioner/solver, Additive Schwarz
! preconditioner) corresponding to a given level of a multilevel preconditioner.
!
! The local matrix is stored into a and b, as specified in the
! description of the arguments below. The storage format for both the L and U
! factors is CSR. The diagonal of the U factor is stored separately (actually,
! the inverse of the diagonal entries is stored; this is then managed in the
! solve stage associated to the ILU(0)/MILU(0) factorization).
!
! The routine copies and factors "on the fly" from the sparse matrix structures a
! and b into the arrays lval, uval, d (L, U without its diagonal, diagonal of U).
!
!
! Arguments:
! ialg - integer, input.
! The type of incomplete factorization to be performed.
! The ILU(0) factorization is computed if ialg = 1 (= psb_ilu_n_),
! the MILU(0) one if ialg = 2 (= psb_milu_n_); other values
! are not allowed.
! m - integer, output.
! The total number of rows of the local matrix to be factorized,
! i.e. ma+mb.
! ma - integer, input
! The number of rows of the local submatrix stored into a.
! a - type(psb_sspmat_type), input.
! The sparse matrix structure containing the local matrix.
! Note that, if the 'base' Additive Schwarz preconditioner
! has overlap greater than 0 and the matrix has not been reordered
! (see psb_fact_bld), then a contains only the 'original' local part
! of the distributed matrix, i.e. the rows of the matrix held
! by the calling process according to the initial data distribution.
! mb - integer, input.
! The number of rows of the local submatrix stored into b.
! b - type(psb_sspmat_type), input.
! The sparse matrix structure containing the remote rows of the
! distributed matrix, that have been retrieved by psb_as_bld
! to build an Additive Schwarz base preconditioner with overlap
! greater than 0. If the overlap is 0 or the matrix has been
! reordered (see psb_fact_bld), then b does not contain any row.
! d - real(psb_spk_), dimension(:), output.
! The inverse of the diagonal entries of the U factor in the
! incomplete factorization.
! lval - real(psb_spk_), dimension(:), input/output.
! The entries of U are stored according to the CSR format.
! The L factor in the incomplete factorization.
! lja - integer, dimension(:), input/output.
! The column indices of the nonzero entries of the L factor,
! according to the CSR storage format.
! lirp - integer, dimension(:), input/output.
! The indices identifying the first nonzero entry of each row
! of the L factor in lval, according to the CSR storage format.
! uval - real(psb_spk_), dimension(:), input/output.
! The U factor in the incomplete factorization.
! The entries of U are stored according to the CSR format.
! uja - integer, dimension(:), input/output.
! The column indices of the nonzero entries of the U factor,
! according to the CSR storage format.
! uirp - integer, dimension(:), input/output.
! The indices identifying the first nonzero entry of each row
! of the U factor in uval, according to the CSR storage format.
! l1 - integer, output.
! The number of nonzero entries in lval.
! l2 - integer, output.
! The number of nonzero entries in uval.
! info - integer, output.
! Error code.
!
subroutine psb_silu0_factint(ialg,a,b,&
& d,lval,lja,lirp,uval,uja,uirp,l1,l2,upd,info)
implicit none
! Arguments
integer(psb_ipk_), intent(in) :: ialg
type(psb_sspmat_type),intent(in) :: a,b
integer(psb_ipk_),intent(inout) :: l1,l2,info
integer(psb_ipk_), intent(inout) :: lja(:),lirp(:),uja(:),uirp(:)
real(psb_spk_), intent(inout) :: lval(:),uval(:),d(:)
character, intent(in) :: upd
! Local variables
integer(psb_ipk_) :: i,j,k,l,low1,low2,kk,jj,ll, ktrw,err_act, m
integer(psb_ipk_) :: ma,mb
real(psb_spk_) :: dia,temp
integer(psb_ipk_), parameter :: nrb=16
type(psb_s_coo_sparse_mat) :: trw
integer(psb_ipk_) :: int_err(5)
character(len=20) :: name, ch_err
name='psb_silu0_factint'
info=psb_success_
call psb_erractionsave(err_act)
if (psb_errstatus_fatal()) then
info = psb_err_internal_error_; goto 9999
end if
ma = a%get_nrows()
mb = b%get_nrows()
select case(ialg)
case(psb_ilu_n_,psb_milu_n_)
! Ok
case default
info=psb_err_input_asize_invalid_i_
call psb_errpush(info,name,&
& i_err=(/ione,ialg,izero,izero,izero/))
goto 9999
end select
call trw%allocate(izero,izero,ione)
if(info /= psb_success_) then
info=psb_err_from_subroutine_
ch_err='psb_sp_all'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
m = ma+mb
if (psb_toupper(upd) == 'F' ) then
lirp(1) = 1
uirp(1) = 1
l1 = 0
l2 = 0
!
! Cycle over the matrix rows
!
do i = 1, m
d(i) = szero
if (i <= ma) then
!
! Copy the i-th local row of the matrix, stored in a,
! into lval/d(i)/uval
!
call ilu_copyin(i,ma,a,i,ione,m,l1,lja,lval,&
& d(i),l2,uja,uval,ktrw,trw,upd)
else
!
! Copy the i-th local row of the matrix, stored in b
! (as (i-ma)-th row), into lval/d(i)/uval
!
call ilu_copyin(i-ma,mb,b,i,ione,m,l1,lja,lval,&
& d(i),l2,uja,uval,ktrw,trw,upd)
endif
lirp(i+1) = l1 + 1
uirp(i+1) = l2 + 1
dia = d(i)
do kk = lirp(i), lirp(i+1) - 1
!
! Compute entry l(i,k) (lower factor L) of the incomplete
! factorization
!
temp = lval(kk)
k = lja(kk)
lval(kk) = temp*d(k)
!
! Update the rest of row i (lower and upper factors L and U)
! using l(i,k)
!
low1 = kk + 1
low2 = uirp(i)
!
updateloop: do jj = uirp(k), uirp(k+1) - 1
!
j = uja(jj)
!
if (j < i) then
!
! search l(i,*) (i-th row of L) for a matching index j
!
do ll = low1, lirp(i+1) - 1
l = lja(ll)
if (l > j) then
low1 = ll
exit
else if (l == j) then
lval(ll) = lval(ll) - temp*uval(jj)
low1 = ll + 1
cycle updateloop
end if
enddo
else if (j == i) then
!
! j=i: update the diagonal
!
dia = dia - temp*uval(jj)
cycle updateloop
!
else if (j > i) then
!
! search u(i,*) (i-th row of U) for a matching index j
!
do ll = low2, uirp(i+1) - 1
l = uja(ll)
if (l > j) then
low2 = ll
exit
else if (l == j) then
uval(ll) = uval(ll) - temp*uval(jj)
low2 = ll + 1
cycle updateloop
end if
enddo
end if
!
! If we get here we missed the cycle updateloop, which means
! that this entry does not match; thus we accumulate on the
! diagonal for MILU(0).
!
if (ialg == psb_milu_n_) then
dia = dia - temp*uval(jj)
end if
enddo updateloop
enddo
!
! Check the pivot size
!
if (abs(dia) < s_epstol) then
!
! Too small pivot: unstable factorization
!
info = psb_err_pivot_too_small_
int_err(1) = i
write(ch_err,'(g20.10)') abs(dia)
call psb_errpush(info,name,i_err=int_err,a_err=ch_err)
goto 9999
else
!
! Compute 1/pivot
!
dia = sone/dia
end if
d(i) = dia
!
! Scale row i of upper triangle
!
do kk = uirp(i), uirp(i+1) - 1
uval(kk) = uval(kk)*dia
enddo
enddo
else
write(0,*) 'Update not implemented '
info = 31
call psb_errpush(info,name,&
& i_err=(/ione*13,izero,izero,izero,izero/),a_err=upd)
goto 9999
end if
call trw%free()
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_silu0_factint
!
! Subroutine: ilu_copyin
! Version: real
! Note: internal subroutine of psb_silu0_fact
!
! This routine copies a row of a sparse matrix A, stored in the psb_sspmat_type
! data structure a, into the arrays lval and uval and into the scalar variable
! dia, corresponding to the lower and upper triangles of A and to the diagonal
! entry of the row, respectively. The entries in lval and uval are stored
! according to the CSR format; the corresponding column indices are stored in
! the arrays lja and uja.
!
! If the sparse matrix is in CSR format, a 'straight' copy is performed;
! otherwise psb_sp_getblk is used to extract a block of rows, which is then
! copied into lval, dia, uval row by row, through successive calls to
! ilu_copyin.
!
! The routine is used by psb_silu0_factint in the computation of the ILU(0)/MILU(0)
! factorization of a local sparse matrix.
!
! TODO: modify the routine to allow copying into output L and U that are
! already filled with indices; this would allow computing an ILU(k) pattern,
! then use the ILU(0) internal for subsequent calls with the same pattern.
!
! Arguments:
! i - integer, input.
! The local index of the row to be extracted from the
! sparse matrix structure a.
! m - integer, input.
! The number of rows of the local matrix stored into a.
! a - type(psb_sspmat_type), input.
! The sparse matrix structure containing the row to be copied.
! jd - integer, input.
! The column index of the diagonal entry of the row to be
! copied.
! jmin - integer, input.
! Minimum valid column index.
! jmax - integer, input.
! Maximum valid column index.
! The output matrix will contain a clipped copy taken from
! a(1:m,jmin:jmax).
! l1 - integer, input/output.
! Pointer to the last occupied entry of lval.
! lja - integer, dimension(:), input/output.
! The column indices of the nonzero entries of the lower triangle
! copied in lval row by row (see psb_silu0_factint), according
! to the CSR storage format.
! lval - real(psb_spk_), dimension(:), input/output.
! The array where the entries of the row corresponding to the
! lower triangle are copied.
! dia - real(psb_spk_), output.
! The diagonal entry of the copied row.
! l2 - integer, input/output.
! Pointer to the last occupied entry of uval.
! uja - integer, dimension(:), input/output.
! The column indices of the nonzero entries of the upper triangle
! copied in uval row by row (see psb_silu0_factint), according
! to the CSR storage format.
! uval - real(psb_spk_), dimension(:), input/output.
! The array where the entries of the row corresponding to the
! upper triangle are copied.
! ktrw - integer, input/output.
! The index identifying the last entry taken from the
! staging buffer trw. See below.
! trw - type(psb_sspmat_type), input/output.
! A staging buffer. If the matrix A is not in CSR format, we use
! the psb_sp_getblk routine and store its output in trw; when we
! need to call psb_sp_getblk we do it for a block of rows, and then
! we consume them from trw in successive calls to this routine,
! until we empty the buffer. Thus we will make a call to psb_sp_getblk
! every nrb calls to copyin. If A is in CSR format it is unused.
!
subroutine ilu_copyin(i,m,a,jd,jmin,jmax,l1,lja,lval,&
& dia,l2,uja,uval,ktrw,trw,upd)
use psb_base_mod
implicit none
! Arguments
type(psb_sspmat_type), intent(in) :: a
type(psb_s_coo_sparse_mat), intent(inout) :: trw
integer(psb_ipk_), intent(in) :: i,m,jd,jmin,jmax
integer(psb_ipk_), intent(inout) :: ktrw,l1,l2
integer(psb_ipk_), intent(inout) :: lja(:), uja(:)
real(psb_spk_), intent(inout) :: lval(:), uval(:), dia
character, intent(in) :: upd
! Local variables
integer(psb_ipk_) :: k,j,info,irb, nz
integer(psb_ipk_), parameter :: nrb=40
character(len=20), parameter :: name='ilu_copyin'
character(len=20) :: ch_err
info=psb_success_
call psb_erractionsave(err_act)
if (psb_errstatus_fatal()) then
info = psb_err_internal_error_; goto 9999
end if
if (psb_toupper(upd) == 'F') then
select type(aa => a%a)
type is (psb_s_csr_sparse_mat)
!
! Take a fast shortcut if the matrix is stored in CSR format
!
do j = aa%irp(i), aa%irp(i+1) - 1
k = aa%ja(j)
! write(0,*)'KKKKK',k
if ((k < jd).and.(k >= jmin)) then
l1 = l1 + 1
lval(l1) = aa%val(j)
lja(l1) = k
else if (k == jd) then
dia = aa%val(j)
else if ((k > jd).and.(k <= jmax)) then
l2 = l2 + 1
uval(l2) = aa%val(j)
uja(l2) = k
end if
enddo
class default
!
! Otherwise use psb_sp_getblk, slower but able (in principle) of
! handling any format. In this case, a block of rows is extracted
! instead of a single row, for performance reasons, and these
! rows are copied one by one into lval, dia, uval, through
! successive calls to ilu_copyin.
!
if ((mod(i,nrb) == 1).or.(nrb == 1)) then
irb = min(m-i+1,nrb)
call aa%csget(i,i+irb-1,trw,info)
if(info /= psb_success_) then
info=psb_err_from_subroutine_
ch_err='csget'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
ktrw=1
end if
nz = trw%get_nzeros()
do
if (ktrw > nz) exit
if (trw%ia(ktrw) > i) exit
k = trw%ja(ktrw)
if ((k < jd).and.(k >= jmin)) then
l1 = l1 + 1
lval(l1) = trw%val(ktrw)
lja(l1) = k
else if (k == jd) then
dia = trw%val(ktrw)
else if ((k > jd).and.(k <= jmax)) then
l2 = l2 + 1
uval(l2) = trw%val(ktrw)
uja(l2) = k
end if
ktrw = ktrw + 1
enddo
end select
else
write(0,*) 'Update not implemented '
info = 31
call psb_errpush(info,name,&
& i_err=(/ione*13,izero,izero,izero,izero/),a_err=upd)
goto 9999
end if
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine ilu_copyin
end subroutine psb_silu0_fact

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -0,0 +1,698 @@
!
! Parallel Sparse BLAS version 3.5
! (C) Copyright 2006-2018
! Salvatore Filippone
! Alfredo Buttari
!
! 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.
!
! Moved here from MLD2P4, original copyright below.
!
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! 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 MLD2P4 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 MLD2P4 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: psb_zilu0_fact.f90
!
! Subroutine: psb_zilu0_fact
! Version: complex
! Contains: psb_zilu0_factint, ilu_copyin
!
! This routine computes either the ILU(0) or the MILU(0) factorization of
! the diagonal blocks of a distributed matrix. These factorizations are used
! to build the 'base preconditioner' (block-Jacobi preconditioner/solver,
! Additive Schwarz preconditioner) corresponding to a given level of a
! multilevel preconditioner.
!
! Details on the above factorizations can be found in
! Y. Saad, Iterative Methods for Sparse Linear Systems, Second Edition,
! SIAM, 2003, Chapter 10.
!
! The local matrix is stored into a and blck, as specified in the description
! of the arguments below. The storage format for both the L and U factors is CSR.
! The diagonal of the U factor is stored separately (actually, the inverse of the
! diagonal entries is stored; this is then managed in the solve stage associated
! to the ILU(0)/MILU(0) factorization).
!
! The routine copies and factors "on the fly" from a and blck into l (L factor),
! u (U factor, except its diagonal) and d (diagonal of U).
!
! This implementation of ILU(0)/MILU(0) is faster than the implementation in
! psb_ziluk_fct (the latter routine performs the more general ILU(k)/MILU(k)).
!
!
! Arguments:
! ialg - integer, input.
! The type of incomplete factorization to be performed.
! The MILU(0) factorization is computed if ialg = 2 (= psb_milu_n_);
! the ILU(0) factorization otherwise.
! a - type(psb_zspmat_type), input.
! The sparse matrix structure containing the local matrix.
! Note that if the 'base' Additive Schwarz preconditioner
! has overlap greater than 0 and the matrix has not been reordered
! (see psb_as_bld), then a contains only the 'original' local part
! of the distributed matrix, i.e. the rows of the matrix held
! by the calling process according to the initial data distribution.
! l - type(psb_zspmat_type), input/output.
! The L factor in the incomplete factorization.
! Note: its allocation is managed by the calling routine psb_ilu_bld,
! hence it cannot be only intent(out).
! u - type(psb_zspmat_type), input/output.
! The U factor (except its diagonal) in the incomplete factorization.
! Note: its allocation is managed by the calling routine psb_ilu_bld,
! hence it cannot be only intent(out).
! d - complex(psb_dpk_), dimension(:), input/output.
! The inverse of the diagonal entries of the U factor in the incomplete
! factorization.
! Note: its allocation is managed by the calling routine psb_ilu_bld,
! hence it cannot be only intent(out).
! info - integer, output.
! Error code.
! blck - type(psb_zspmat_type), input, optional, target.
! The sparse matrix structure containing the remote rows of the
! distributed matrix, that have been retrieved by psb_as_bld
! to build an Additive Schwarz base preconditioner with overlap
! greater than 0. If the overlap is 0 or the matrix has been reordered
! (see psb_fact_bld), then blck is empty.
!
subroutine psb_zilu0_fact(ialg,a,l,u,d,info,blck, upd)
use psb_base_mod
use psb_z_ilu_fact_mod, psb_protect_name => psb_zilu0_fact
implicit none
! Arguments
integer(psb_ipk_), intent(in) :: ialg
type(psb_zspmat_type),intent(in) :: a
type(psb_zspmat_type),intent(inout) :: l,u
complex(psb_dpk_), intent(inout) :: d(:)
integer(psb_ipk_), intent(out) :: info
type(psb_zspmat_type),intent(in), optional, target :: blck
character, intent(in), optional :: upd
! Local variables
integer(psb_ipk_) :: l1, l2, m, err_act
type(psb_zspmat_type), pointer :: blck_
type(psb_z_csr_sparse_mat) :: ll, uu
character :: upd_
character(len=20) :: name, ch_err
name='psb_zilu0_fact'
info = psb_success_
call psb_erractionsave(err_act)
!
! Point to / allocate memory for the incomplete factorization
!
if (present(blck)) then
blck_ => blck
else
allocate(blck_,stat=info)
if (info == psb_success_) call blck_%csall(izero,izero,info,ione)
if (info /= psb_success_) then
info=psb_err_from_subroutine_
ch_err='csall'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
endif
if (present(upd)) then
upd_ = psb_toupper(upd)
else
upd_ = 'F'
end if
m = a%get_nrows() + blck_%get_nrows()
if ((m /= l%get_nrows()).or.(m /= u%get_nrows()).or.&
& (m > size(d)) ) then
write(0,*) 'Wrong allocation status for L,D,U? ',&
& l%get_nrows(),size(d),u%get_nrows()
info = -1
return
end if
call l%mv_to(ll)
call u%mv_to(uu)
!
! Compute the ILU(0) or the MILU(0) factorization, depending on ialg
!
call psb_zilu0_factint(ialg,a,blck_,&
& d,ll%val,ll%ja,ll%irp,uu%val,uu%ja,uu%irp,l1,l2,upd_,info)
if(info.ne.0) then
info=psb_err_from_subroutine_
ch_err='psb_zilu0_factint'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
!
! Store information on the L and U sparse matrices
!
call l%mv_from(ll)
call l%set_triangle()
call l%set_unit()
call l%set_lower()
call u%mv_from(uu)
call u%set_triangle()
call u%set_unit()
call u%set_upper()
!
! Nullify pointer / deallocate memory
!
if (present(blck)) then
blck_ => null()
else
call blck_%free()
if(info.ne.0) then
info=psb_err_from_subroutine_
ch_err='psb_sp_free'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
deallocate(blck_)
endif
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
contains
!
! Subroutine: psb_zilu0_factint
! Version: complex
! Note: internal subroutine of psb_zilu0_fact.
!
! This routine computes either the ILU(0) or the MILU(0) factorization of the
! diagonal blocks of a distributed matrix.
! These factorizations are used to build the 'base preconditioner'
! (block-Jacobi preconditioner/solver, Additive Schwarz
! preconditioner) corresponding to a given level of a multilevel preconditioner.
!
! The local matrix is stored into a and b, as specified in the
! description of the arguments below. The storage format for both the L and U
! factors is CSR. The diagonal of the U factor is stored separately (actually,
! the inverse of the diagonal entries is stored; this is then managed in the
! solve stage associated to the ILU(0)/MILU(0) factorization).
!
! The routine copies and factors "on the fly" from the sparse matrix structures a
! and b into the arrays lval, uval, d (L, U without its diagonal, diagonal of U).
!
!
! Arguments:
! ialg - integer, input.
! The type of incomplete factorization to be performed.
! The ILU(0) factorization is computed if ialg = 1 (= psb_ilu_n_),
! the MILU(0) one if ialg = 2 (= psb_milu_n_); other values
! are not allowed.
! m - integer, output.
! The total number of rows of the local matrix to be factorized,
! i.e. ma+mb.
! ma - integer, input
! The number of rows of the local submatrix stored into a.
! a - type(psb_zspmat_type), input.
! The sparse matrix structure containing the local matrix.
! Note that, if the 'base' Additive Schwarz preconditioner
! has overlap greater than 0 and the matrix has not been reordered
! (see psb_fact_bld), then a contains only the 'original' local part
! of the distributed matrix, i.e. the rows of the matrix held
! by the calling process according to the initial data distribution.
! mb - integer, input.
! The number of rows of the local submatrix stored into b.
! b - type(psb_zspmat_type), input.
! The sparse matrix structure containing the remote rows of the
! distributed matrix, that have been retrieved by psb_as_bld
! to build an Additive Schwarz base preconditioner with overlap
! greater than 0. If the overlap is 0 or the matrix has been
! reordered (see psb_fact_bld), then b does not contain any row.
! d - complex(psb_dpk_), dimension(:), output.
! The inverse of the diagonal entries of the U factor in the
! incomplete factorization.
! lval - complex(psb_dpk_), dimension(:), input/output.
! The entries of U are stored according to the CSR format.
! The L factor in the incomplete factorization.
! lja - integer, dimension(:), input/output.
! The column indices of the nonzero entries of the L factor,
! according to the CSR storage format.
! lirp - integer, dimension(:), input/output.
! The indices identifying the first nonzero entry of each row
! of the L factor in lval, according to the CSR storage format.
! uval - complex(psb_dpk_), dimension(:), input/output.
! The U factor in the incomplete factorization.
! The entries of U are stored according to the CSR format.
! uja - integer, dimension(:), input/output.
! The column indices of the nonzero entries of the U factor,
! according to the CSR storage format.
! uirp - integer, dimension(:), input/output.
! The indices identifying the first nonzero entry of each row
! of the U factor in uval, according to the CSR storage format.
! l1 - integer, output.
! The number of nonzero entries in lval.
! l2 - integer, output.
! The number of nonzero entries in uval.
! info - integer, output.
! Error code.
!
subroutine psb_zilu0_factint(ialg,a,b,&
& d,lval,lja,lirp,uval,uja,uirp,l1,l2,upd,info)
implicit none
! Arguments
integer(psb_ipk_), intent(in) :: ialg
type(psb_zspmat_type),intent(in) :: a,b
integer(psb_ipk_),intent(inout) :: l1,l2,info
integer(psb_ipk_), intent(inout) :: lja(:),lirp(:),uja(:),uirp(:)
complex(psb_dpk_), intent(inout) :: lval(:),uval(:),d(:)
character, intent(in) :: upd
! Local variables
integer(psb_ipk_) :: i,j,k,l,low1,low2,kk,jj,ll, ktrw,err_act, m
integer(psb_ipk_) :: ma,mb
complex(psb_dpk_) :: dia,temp
integer(psb_ipk_), parameter :: nrb=16
type(psb_z_coo_sparse_mat) :: trw
integer(psb_ipk_) :: int_err(5)
character(len=20) :: name, ch_err
name='psb_zilu0_factint'
info=psb_success_
call psb_erractionsave(err_act)
if (psb_errstatus_fatal()) then
info = psb_err_internal_error_; goto 9999
end if
ma = a%get_nrows()
mb = b%get_nrows()
select case(ialg)
case(psb_ilu_n_,psb_milu_n_)
! Ok
case default
info=psb_err_input_asize_invalid_i_
call psb_errpush(info,name,&
& i_err=(/ione,ialg,izero,izero,izero/))
goto 9999
end select
call trw%allocate(izero,izero,ione)
if(info /= psb_success_) then
info=psb_err_from_subroutine_
ch_err='psb_sp_all'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
m = ma+mb
if (psb_toupper(upd) == 'F' ) then
lirp(1) = 1
uirp(1) = 1
l1 = 0
l2 = 0
!
! Cycle over the matrix rows
!
do i = 1, m
d(i) = zzero
if (i <= ma) then
!
! Copy the i-th local row of the matrix, stored in a,
! into lval/d(i)/uval
!
call ilu_copyin(i,ma,a,i,ione,m,l1,lja,lval,&
& d(i),l2,uja,uval,ktrw,trw,upd)
else
!
! Copy the i-th local row of the matrix, stored in b
! (as (i-ma)-th row), into lval/d(i)/uval
!
call ilu_copyin(i-ma,mb,b,i,ione,m,l1,lja,lval,&
& d(i),l2,uja,uval,ktrw,trw,upd)
endif
lirp(i+1) = l1 + 1
uirp(i+1) = l2 + 1
dia = d(i)
do kk = lirp(i), lirp(i+1) - 1
!
! Compute entry l(i,k) (lower factor L) of the incomplete
! factorization
!
temp = lval(kk)
k = lja(kk)
lval(kk) = temp*d(k)
!
! Update the rest of row i (lower and upper factors L and U)
! using l(i,k)
!
low1 = kk + 1
low2 = uirp(i)
!
updateloop: do jj = uirp(k), uirp(k+1) - 1
!
j = uja(jj)
!
if (j < i) then
!
! search l(i,*) (i-th row of L) for a matching index j
!
do ll = low1, lirp(i+1) - 1
l = lja(ll)
if (l > j) then
low1 = ll
exit
else if (l == j) then
lval(ll) = lval(ll) - temp*uval(jj)
low1 = ll + 1
cycle updateloop
end if
enddo
else if (j == i) then
!
! j=i: update the diagonal
!
dia = dia - temp*uval(jj)
cycle updateloop
!
else if (j > i) then
!
! search u(i,*) (i-th row of U) for a matching index j
!
do ll = low2, uirp(i+1) - 1
l = uja(ll)
if (l > j) then
low2 = ll
exit
else if (l == j) then
uval(ll) = uval(ll) - temp*uval(jj)
low2 = ll + 1
cycle updateloop
end if
enddo
end if
!
! If we get here we missed the cycle updateloop, which means
! that this entry does not match; thus we accumulate on the
! diagonal for MILU(0).
!
if (ialg == psb_milu_n_) then
dia = dia - temp*uval(jj)
end if
enddo updateloop
enddo
!
! Check the pivot size
!
if (abs(dia) < d_epstol) then
!
! Too small pivot: unstable factorization
!
info = psb_err_pivot_too_small_
int_err(1) = i
write(ch_err,'(g20.10)') abs(dia)
call psb_errpush(info,name,i_err=int_err,a_err=ch_err)
goto 9999
else
!
! Compute 1/pivot
!
dia = zone/dia
end if
d(i) = dia
!
! Scale row i of upper triangle
!
do kk = uirp(i), uirp(i+1) - 1
uval(kk) = uval(kk)*dia
enddo
enddo
else
write(0,*) 'Update not implemented '
info = 31
call psb_errpush(info,name,&
& i_err=(/ione*13,izero,izero,izero,izero/),a_err=upd)
goto 9999
end if
call trw%free()
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_zilu0_factint
!
! Subroutine: ilu_copyin
! Version: complex
! Note: internal subroutine of psb_zilu0_fact
!
! This routine copies a row of a sparse matrix A, stored in the psb_zspmat_type
! data structure a, into the arrays lval and uval and into the scalar variable
! dia, corresponding to the lower and upper triangles of A and to the diagonal
! entry of the row, respectively. The entries in lval and uval are stored
! according to the CSR format; the corresponding column indices are stored in
! the arrays lja and uja.
!
! If the sparse matrix is in CSR format, a 'straight' copy is performed;
! otherwise psb_sp_getblk is used to extract a block of rows, which is then
! copied into lval, dia, uval row by row, through successive calls to
! ilu_copyin.
!
! The routine is used by psb_zilu0_factint in the computation of the ILU(0)/MILU(0)
! factorization of a local sparse matrix.
!
! TODO: modify the routine to allow copying into output L and U that are
! already filled with indices; this would allow computing an ILU(k) pattern,
! then use the ILU(0) internal for subsequent calls with the same pattern.
!
! Arguments:
! i - integer, input.
! The local index of the row to be extracted from the
! sparse matrix structure a.
! m - integer, input.
! The number of rows of the local matrix stored into a.
! a - type(psb_zspmat_type), input.
! The sparse matrix structure containing the row to be copied.
! jd - integer, input.
! The column index of the diagonal entry of the row to be
! copied.
! jmin - integer, input.
! Minimum valid column index.
! jmax - integer, input.
! Maximum valid column index.
! The output matrix will contain a clipped copy taken from
! a(1:m,jmin:jmax).
! l1 - integer, input/output.
! Pointer to the last occupied entry of lval.
! lja - integer, dimension(:), input/output.
! The column indices of the nonzero entries of the lower triangle
! copied in lval row by row (see psb_zilu0_factint), according
! to the CSR storage format.
! lval - complex(psb_dpk_), dimension(:), input/output.
! The array where the entries of the row corresponding to the
! lower triangle are copied.
! dia - complex(psb_dpk_), output.
! The diagonal entry of the copied row.
! l2 - integer, input/output.
! Pointer to the last occupied entry of uval.
! uja - integer, dimension(:), input/output.
! The column indices of the nonzero entries of the upper triangle
! copied in uval row by row (see psb_zilu0_factint), according
! to the CSR storage format.
! uval - complex(psb_dpk_), dimension(:), input/output.
! The array where the entries of the row corresponding to the
! upper triangle are copied.
! ktrw - integer, input/output.
! The index identifying the last entry taken from the
! staging buffer trw. See below.
! trw - type(psb_zspmat_type), input/output.
! A staging buffer. If the matrix A is not in CSR format, we use
! the psb_sp_getblk routine and store its output in trw; when we
! need to call psb_sp_getblk we do it for a block of rows, and then
! we consume them from trw in successive calls to this routine,
! until we empty the buffer. Thus we will make a call to psb_sp_getblk
! every nrb calls to copyin. If A is in CSR format it is unused.
!
subroutine ilu_copyin(i,m,a,jd,jmin,jmax,l1,lja,lval,&
& dia,l2,uja,uval,ktrw,trw,upd)
use psb_base_mod
implicit none
! Arguments
type(psb_zspmat_type), intent(in) :: a
type(psb_z_coo_sparse_mat), intent(inout) :: trw
integer(psb_ipk_), intent(in) :: i,m,jd,jmin,jmax
integer(psb_ipk_), intent(inout) :: ktrw,l1,l2
integer(psb_ipk_), intent(inout) :: lja(:), uja(:)
complex(psb_dpk_), intent(inout) :: lval(:), uval(:), dia
character, intent(in) :: upd
! Local variables
integer(psb_ipk_) :: k,j,info,irb, nz
integer(psb_ipk_), parameter :: nrb=40
character(len=20), parameter :: name='ilu_copyin'
character(len=20) :: ch_err
info=psb_success_
call psb_erractionsave(err_act)
if (psb_errstatus_fatal()) then
info = psb_err_internal_error_; goto 9999
end if
if (psb_toupper(upd) == 'F') then
select type(aa => a%a)
type is (psb_z_csr_sparse_mat)
!
! Take a fast shortcut if the matrix is stored in CSR format
!
do j = aa%irp(i), aa%irp(i+1) - 1
k = aa%ja(j)
! write(0,*)'KKKKK',k
if ((k < jd).and.(k >= jmin)) then
l1 = l1 + 1
lval(l1) = aa%val(j)
lja(l1) = k
else if (k == jd) then
dia = aa%val(j)
else if ((k > jd).and.(k <= jmax)) then
l2 = l2 + 1
uval(l2) = aa%val(j)
uja(l2) = k
end if
enddo
class default
!
! Otherwise use psb_sp_getblk, slower but able (in principle) of
! handling any format. In this case, a block of rows is extracted
! instead of a single row, for performance reasons, and these
! rows are copied one by one into lval, dia, uval, through
! successive calls to ilu_copyin.
!
if ((mod(i,nrb) == 1).or.(nrb == 1)) then
irb = min(m-i+1,nrb)
call aa%csget(i,i+irb-1,trw,info)
if(info /= psb_success_) then
info=psb_err_from_subroutine_
ch_err='csget'
call psb_errpush(info,name,a_err=ch_err)
goto 9999
end if
ktrw=1
end if
nz = trw%get_nzeros()
do
if (ktrw > nz) exit
if (trw%ia(ktrw) > i) exit
k = trw%ja(ktrw)
if ((k < jd).and.(k >= jmin)) then
l1 = l1 + 1
lval(l1) = trw%val(ktrw)
lja(l1) = k
else if (k == jd) then
dia = trw%val(ktrw)
else if ((k > jd).and.(k <= jmax)) then
l2 = l2 + 1
uval(l2) = trw%val(ktrw)
uja(l2) = k
end if
ktrw = ktrw + 1
enddo
end select
else
write(0,*) 'Update not implemented '
info = 31
call psb_errpush(info,name,&
& i_err=(/ione*13,izero,izero,izero,izero/),a_err=upd)
goto 9999
end if
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine ilu_copyin
end subroutine psb_zilu0_fact

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -32,6 +32,7 @@
module psb_c_bjacprec
use psb_c_base_prec_mod
use psb_c_ilu_fact_mod
type, extends(psb_c_base_prec_type) :: psb_c_bjac_prec_type
integer(psb_ipk_), allocatable :: iprcparm(:)

@ -0,0 +1,121 @@
!
! Parallel Sparse BLAS version 3.5
! (C) Copyright 2006-2018
! Salvatore Filippone
! Alfredo Buttari
!
! 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.
!
! Moved here from MLD2P4, original copyright below.
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! 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 MLD2P4 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 MLD2P4 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: psb_c_ilu_fact_mod.f90
!
! Module: psb_c_ilu_fact_mod
!
! This module defines some interfaces used internally by the implementation of
! psb_c_ilu_solver, but not visible to the end user.
!
!
module psb_c_ilu_fact_mod
use psb_base_mod
use psb_prec_const_mod
interface psb_ilu0_fact
subroutine psb_cilu0_fact(ialg,a,l,u,d,info,blck,upd)
import psb_cspmat_type, psb_spk_, psb_ipk_
integer(psb_ipk_), intent(in) :: ialg
integer(psb_ipk_), intent(out) :: info
type(psb_cspmat_type),intent(in) :: a
type(psb_cspmat_type),intent(inout) :: l,u
type(psb_cspmat_type),intent(in), optional, target :: blck
character, intent(in), optional :: upd
complex(psb_spk_), intent(inout) :: d(:)
end subroutine psb_cilu0_fact
end interface
interface psb_iluk_fact
subroutine psb_ciluk_fact(fill_in,ialg,a,l,u,d,info,blck)
import psb_cspmat_type, psb_spk_, psb_ipk_
integer(psb_ipk_), intent(in) :: fill_in,ialg
integer(psb_ipk_), intent(out) :: info
type(psb_cspmat_type),intent(in) :: a
type(psb_cspmat_type),intent(inout) :: l,u
type(psb_cspmat_type),intent(in), optional, target :: blck
complex(psb_spk_), intent(inout) :: d(:)
end subroutine psb_ciluk_fact
end interface
interface psb_ilut_fact
subroutine psb_cilut_fact(fill_in,thres,a,l,u,d,info,blck,iscale)
import psb_cspmat_type, psb_spk_, psb_ipk_
integer(psb_ipk_), intent(in) :: fill_in
real(psb_spk_), intent(in) :: thres
integer(psb_ipk_), intent(out) :: info
type(psb_cspmat_type),intent(in) :: a
type(psb_cspmat_type),intent(inout) :: l,u
complex(psb_spk_), intent(inout) :: d(:)
type(psb_cspmat_type),intent(in), optional, target :: blck
integer(psb_ipk_), intent(in), optional :: iscale
end subroutine psb_cilut_fact
end interface
end module psb_c_ilu_fact_mod

@ -32,6 +32,7 @@
module psb_d_bjacprec
use psb_d_base_prec_mod
use psb_d_ilu_fact_mod
type, extends(psb_d_base_prec_type) :: psb_d_bjac_prec_type
integer(psb_ipk_), allocatable :: iprcparm(:)

@ -0,0 +1,121 @@
!
! Parallel Sparse BLAS version 3.5
! (C) Copyright 2006-2018
! Salvatore Filippone
! Alfredo Buttari
!
! 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.
!
! Moved here from MLD2P4, original copyright below.
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! 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 MLD2P4 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 MLD2P4 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: psb_d_ilu_fact_mod.f90
!
! Module: psb_d_ilu_fact_mod
!
! This module defines some interfaces used internally by the implementation of
! psb_d_ilu_solver, but not visible to the end user.
!
!
module psb_d_ilu_fact_mod
use psb_base_mod
use psb_prec_const_mod
interface psb_ilu0_fact
subroutine psb_dilu0_fact(ialg,a,l,u,d,info,blck,upd)
import psb_dspmat_type, psb_dpk_, psb_ipk_
integer(psb_ipk_), intent(in) :: ialg
integer(psb_ipk_), intent(out) :: info
type(psb_dspmat_type),intent(in) :: a
type(psb_dspmat_type),intent(inout) :: l,u
type(psb_dspmat_type),intent(in), optional, target :: blck
character, intent(in), optional :: upd
real(psb_dpk_), intent(inout) :: d(:)
end subroutine psb_dilu0_fact
end interface
interface psb_iluk_fact
subroutine psb_diluk_fact(fill_in,ialg,a,l,u,d,info,blck)
import psb_dspmat_type, psb_dpk_, psb_ipk_
integer(psb_ipk_), intent(in) :: fill_in,ialg
integer(psb_ipk_), intent(out) :: info
type(psb_dspmat_type),intent(in) :: a
type(psb_dspmat_type),intent(inout) :: l,u
type(psb_dspmat_type),intent(in), optional, target :: blck
real(psb_dpk_), intent(inout) :: d(:)
end subroutine psb_diluk_fact
end interface
interface psb_ilut_fact
subroutine psb_dilut_fact(fill_in,thres,a,l,u,d,info,blck,iscale)
import psb_dspmat_type, psb_dpk_, psb_ipk_
integer(psb_ipk_), intent(in) :: fill_in
real(psb_dpk_), intent(in) :: thres
integer(psb_ipk_), intent(out) :: info
type(psb_dspmat_type),intent(in) :: a
type(psb_dspmat_type),intent(inout) :: l,u
real(psb_dpk_), intent(inout) :: d(:)
type(psb_dspmat_type),intent(in), optional, target :: blck
integer(psb_ipk_), intent(in), optional :: iscale
end subroutine psb_dilut_fact
end interface
end module psb_d_ilu_fact_mod

@ -59,6 +59,17 @@ module psb_prec_const_mod
integer(psb_ipk_), parameter :: psb_l_pr_=1, psb_u_pr_=2, psb_bp_ilu_avsz=2
integer(psb_ipk_), parameter :: psb_max_avsz=psb_bp_ilu_avsz
integer(psb_ipk_), parameter :: psb_ilu_n_ = 13
integer(psb_ipk_), parameter :: psb_milu_n_ = 14
integer(psb_ipk_), parameter :: psb_ilu_t_ = 15
integer(psb_ipk_), parameter :: psb_ilu_scale_none_ = 0
integer(psb_ipk_), parameter :: psb_ilu_scale_maxval_ = 1
integer(psb_ipk_), parameter :: psb_ilu_scale_diag_ = 2
integer(psb_ipk_), parameter :: psb_ilu_scale_arwsum_ = 3
integer(psb_ipk_), parameter :: psb_ilu_scale_aclsum_ = 4
integer(psb_ipk_), parameter :: psb_ilu_scale_arcsum_ = 5
interface psb_check_def
module procedure psb_icheck_def, psb_scheck_def, psb_dcheck_def

@ -32,6 +32,7 @@
module psb_s_bjacprec
use psb_s_base_prec_mod
use psb_s_ilu_fact_mod
type, extends(psb_s_base_prec_type) :: psb_s_bjac_prec_type
integer(psb_ipk_), allocatable :: iprcparm(:)

@ -0,0 +1,121 @@
!
! Parallel Sparse BLAS version 3.5
! (C) Copyright 2006-2018
! Salvatore Filippone
! Alfredo Buttari
!
! 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.
!
! Moved here from MLD2P4, original copyright below.
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! 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 MLD2P4 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 MLD2P4 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: psb_s_ilu_fact_mod.f90
!
! Module: psb_s_ilu_fact_mod
!
! This module defines some interfaces used internally by the implementation of
! psb_s_ilu_solver, but not visible to the end user.
!
!
module psb_s_ilu_fact_mod
use psb_base_mod
use psb_prec_const_mod
interface psb_ilu0_fact
subroutine psb_silu0_fact(ialg,a,l,u,d,info,blck,upd)
import psb_sspmat_type, psb_spk_, psb_ipk_
integer(psb_ipk_), intent(in) :: ialg
integer(psb_ipk_), intent(out) :: info
type(psb_sspmat_type),intent(in) :: a
type(psb_sspmat_type),intent(inout) :: l,u
type(psb_sspmat_type),intent(in), optional, target :: blck
character, intent(in), optional :: upd
real(psb_spk_), intent(inout) :: d(:)
end subroutine psb_silu0_fact
end interface
interface psb_iluk_fact
subroutine psb_siluk_fact(fill_in,ialg,a,l,u,d,info,blck)
import psb_sspmat_type, psb_spk_, psb_ipk_
integer(psb_ipk_), intent(in) :: fill_in,ialg
integer(psb_ipk_), intent(out) :: info
type(psb_sspmat_type),intent(in) :: a
type(psb_sspmat_type),intent(inout) :: l,u
type(psb_sspmat_type),intent(in), optional, target :: blck
real(psb_spk_), intent(inout) :: d(:)
end subroutine psb_siluk_fact
end interface
interface psb_ilut_fact
subroutine psb_silut_fact(fill_in,thres,a,l,u,d,info,blck,iscale)
import psb_sspmat_type, psb_spk_, psb_ipk_
integer(psb_ipk_), intent(in) :: fill_in
real(psb_spk_), intent(in) :: thres
integer(psb_ipk_), intent(out) :: info
type(psb_sspmat_type),intent(in) :: a
type(psb_sspmat_type),intent(inout) :: l,u
real(psb_spk_), intent(inout) :: d(:)
type(psb_sspmat_type),intent(in), optional, target :: blck
integer(psb_ipk_), intent(in), optional :: iscale
end subroutine psb_silut_fact
end interface
end module psb_s_ilu_fact_mod

@ -32,6 +32,7 @@
module psb_z_bjacprec
use psb_z_base_prec_mod
use psb_z_ilu_fact_mod
type, extends(psb_z_base_prec_type) :: psb_z_bjac_prec_type
integer(psb_ipk_), allocatable :: iprcparm(:)

@ -0,0 +1,121 @@
!
! Parallel Sparse BLAS version 3.5
! (C) Copyright 2006-2018
! Salvatore Filippone
! Alfredo Buttari
!
! 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.
!
! Moved here from MLD2P4, original copyright below.
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! 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 MLD2P4 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 MLD2P4 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: psb_z_ilu_fact_mod.f90
!
! Module: psb_z_ilu_fact_mod
!
! This module defines some interfaces used internally by the implementation of
! psb_z_ilu_solver, but not visible to the end user.
!
!
module psb_z_ilu_fact_mod
use psb_base_mod
use psb_prec_const_mod
interface psb_ilu0_fact
subroutine psb_zilu0_fact(ialg,a,l,u,d,info,blck,upd)
import psb_zspmat_type, psb_dpk_, psb_ipk_
integer(psb_ipk_), intent(in) :: ialg
integer(psb_ipk_), intent(out) :: info
type(psb_zspmat_type),intent(in) :: a
type(psb_zspmat_type),intent(inout) :: l,u
type(psb_zspmat_type),intent(in), optional, target :: blck
character, intent(in), optional :: upd
complex(psb_dpk_), intent(inout) :: d(:)
end subroutine psb_zilu0_fact
end interface
interface psb_iluk_fact
subroutine psb_ziluk_fact(fill_in,ialg,a,l,u,d,info,blck)
import psb_zspmat_type, psb_dpk_, psb_ipk_
integer(psb_ipk_), intent(in) :: fill_in,ialg
integer(psb_ipk_), intent(out) :: info
type(psb_zspmat_type),intent(in) :: a
type(psb_zspmat_type),intent(inout) :: l,u
type(psb_zspmat_type),intent(in), optional, target :: blck
complex(psb_dpk_), intent(inout) :: d(:)
end subroutine psb_ziluk_fact
end interface
interface psb_ilut_fact
subroutine psb_zilut_fact(fill_in,thres,a,l,u,d,info,blck,iscale)
import psb_zspmat_type, psb_dpk_, psb_ipk_
integer(psb_ipk_), intent(in) :: fill_in
real(psb_dpk_), intent(in) :: thres
integer(psb_ipk_), intent(out) :: info
type(psb_zspmat_type),intent(in) :: a
type(psb_zspmat_type),intent(inout) :: l,u
complex(psb_dpk_), intent(inout) :: d(:)
type(psb_zspmat_type),intent(in), optional, target :: blck
integer(psb_ipk_), intent(in), optional :: iscale
end subroutine psb_zilut_fact
end interface
end module psb_z_ilu_fact_mod

@ -58,7 +58,6 @@ program psb_cf_sample
integer(psb_ipk_) :: ictxt, iam, np
integer(psb_lpk_) :: lnp
! solver paramters
integer(psb_ipk_) :: iter, itmax, ierr, itrace, ircode,&
& methd, istopc, irst

@ -58,7 +58,6 @@ program psb_df_sample
integer(psb_ipk_) :: ictxt, iam, np
integer(psb_lpk_) :: lnp
! solver paramters
integer(psb_ipk_) :: iter, itmax, ierr, itrace, ircode,&
& methd, istopc, irst

@ -58,7 +58,6 @@ program psb_sf_sample
integer(psb_ipk_) :: ictxt, iam, np
integer(psb_lpk_) :: lnp
! solver paramters
integer(psb_ipk_) :: iter, itmax, ierr, itrace, ircode,&
& methd, istopc, irst

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

Loading…
Cancel
Save