Merge branch 'new-context' of https://github.com/sfilippone/psblas3 into new-context

new-context
Salvatore Filippone 4 years ago
commit d1c1222209

1
.gitignore vendored

@ -5,6 +5,7 @@
# header files generated
cbind/*.h
util/psb_metis_int.h
# Make.inc generated
/Make.inc

@ -23,7 +23,7 @@ EXTRA_OPT=@EXTRA_OPT@
MPFC=@MPIFC@
MPCC=@MPICC@
FLINK=$(MPFC)
FLINK=@FLINK@
LIBS=@LIBS@

@ -175,7 +175,7 @@ end subroutine psi_cswapdata_vect
!
!
!
subroutine psi_cswap_vidx_vect(ictxt,iicomm,flag,beta,y,idx, &
subroutine psi_cswap_vidx_vect(ctxt,icomm,flag,beta,y,idx, &
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_cswap_vidx_vect
@ -192,8 +192,8 @@ subroutine psi_cswap_vidx_vect(ictxt,iicomm,flag,beta,y,idx, &
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_c_base_vect_type) :: y
@ -203,9 +203,8 @@ subroutine psi_cswap_vidx_vect(ictxt,iicomm,flag,beta,y,idx, &
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable :: prcid(:)
integer(psb_ipk_) :: nesd, nerv,&
& err_act, i, idx_pt, totsnd_, totrcv_,&
@ -218,9 +217,6 @@ subroutine psi_cswap_vidx_vect(ictxt,iicomm,flag,beta,y,idx, &
info=psb_success_
name='psi_swap_datav'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_
@ -517,7 +513,7 @@ end subroutine psi_cswapdata_multivect
!
!
!
subroutine psi_cswap_vidx_multivect(ictxt,iicomm,flag,beta,y,idx, &
subroutine psi_cswap_vidx_multivect(ctxt,icomm,flag,beta,y,idx, &
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_cswap_vidx_multivect
@ -534,8 +530,8 @@ subroutine psi_cswap_vidx_multivect(ictxt,iicomm,flag,beta,y,idx, &
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_c_base_multivect_type) :: y
@ -545,9 +541,8 @@ subroutine psi_cswap_vidx_multivect(ictxt,iicomm,flag,beta,y,idx, &
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable :: prcid(:)
integer(psb_ipk_) :: nesd, nerv,&
& err_act, i, idx_pt, totsnd_, totrcv_,&
@ -560,9 +555,6 @@ subroutine psi_cswap_vidx_multivect(ictxt,iicomm,flag,beta,y,idx, &
info=psb_success_
name='psi_swap_datav'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_

@ -179,8 +179,8 @@ subroutine psi_cswapidxm(ctxt,icomm,flag,n,beta,y,idx, &
! locals
integer(psb_mpk_) :: np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable, dimension(:) :: bsdidx, brvidx,&
& sdsz, rvsz, prcid, rvhd, sdhd
integer(psb_ipk_) :: nesd, nerv,&
@ -197,7 +197,6 @@ subroutine psi_cswapidxm(ctxt,icomm,flag,n,beta,y,idx, &
info=psb_success_
name='psi_swap_data'
call psb_erractionsave(err_act)
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_
@ -641,7 +640,7 @@ end subroutine psi_cswapdatav
!
!
!
subroutine psi_cswapidxv(ictxt,iicomm,flag,beta,y,idx, &
subroutine psi_cswapidxv(ctxt,icomm,flag,beta,y,idx, &
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_cswapidxv
@ -656,8 +655,8 @@ subroutine psi_cswapidxv(ictxt,iicomm,flag,beta,y,idx, &
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
complex(psb_spk_) :: y(:), beta
@ -665,9 +664,8 @@ subroutine psi_cswapidxv(ictxt,iicomm,flag,beta,y,idx, &
integer(psb_ipk_), intent(in) :: idx(:),totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable, dimension(:) :: bsdidx, brvidx,&
& sdsz, rvsz, prcid, rvhd, sdhd
integer(psb_ipk_) :: nesd, nerv,&
@ -684,9 +682,6 @@ subroutine psi_cswapidxv(ictxt,iicomm,flag,beta,y,idx, &
info=psb_success_
name='psi_swap_datav'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_

@ -176,7 +176,7 @@ end subroutine psi_cswaptran_vect
!
!
!
subroutine psi_ctran_vidx_vect(ictxt,iicomm,flag,beta,y,idx,&
subroutine psi_ctran_vidx_vect(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_ctran_vidx_vect
@ -193,8 +193,8 @@ subroutine psi_ctran_vidx_vect(ictxt,iicomm,flag,beta,y,idx,&
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_c_base_vect_type) :: y
@ -204,9 +204,8 @@ subroutine psi_ctran_vidx_vect(ictxt,iicomm,flag,beta,y,idx,&
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable :: prcid(:)
integer(psb_ipk_) :: nesd, nerv,&
& err_act, i, idx_pt, totsnd_, totrcv_,&
@ -219,9 +218,6 @@ subroutine psi_ctran_vidx_vect(ictxt,iicomm,flag,beta,y,idx,&
info=psb_success_
name='psi_swap_tran'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_
@ -528,7 +524,7 @@ subroutine psi_cswaptran_multivect(flag,beta,y,desc_a,work,info,data)
!
!
!
subroutine psi_ctran_vidx_multivect(ictxt,iicomm,flag,beta,y,idx,&
subroutine psi_ctran_vidx_multivect(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_ctran_vidx_multivect
@ -545,8 +541,8 @@ subroutine psi_ctran_vidx_multivect(ictxt,iicomm,flag,beta,y,idx,&
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_c_base_multivect_type) :: y
@ -556,9 +552,8 @@ subroutine psi_ctran_vidx_multivect(ictxt,iicomm,flag,beta,y,idx,&
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable :: prcid(:)
integer(psb_ipk_) :: nesd, nerv,&
& err_act, i, idx_pt, totsnd_, totrcv_,&
@ -571,9 +566,6 @@ subroutine psi_ctran_vidx_multivect(ictxt,iicomm,flag,beta,y,idx,&
info=psb_success_
name='psi_swap_tran'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_

@ -159,7 +159,7 @@ subroutine psi_cswaptranm(flag,n,beta,y,desc_a,work,info,data)
return
end subroutine psi_cswaptranm
subroutine psi_ctranidxm(ictxt,iicomm,flag,n,beta,y,idx,&
subroutine psi_ctranidxm(ctxt,icomm,flag,n,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_ctranidxm
@ -174,8 +174,8 @@ subroutine psi_ctranidxm(ictxt,iicomm,flag,n,beta,y,idx,&
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag,n
integer(psb_ipk_), intent(out) :: info
complex(psb_spk_) :: y(:,:), beta
@ -183,9 +183,8 @@ subroutine psi_ctranidxm(ictxt,iicomm,flag,n,beta,y,idx,&
integer(psb_ipk_), intent(in) :: idx(:),totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable, dimension(:) :: bsdidx, brvidx,&
& sdsz, rvsz, prcid, rvhd, sdhd
integer(psb_ipk_) :: nesd, nerv,&
@ -202,9 +201,6 @@ subroutine psi_ctranidxm(ictxt,iicomm,flag,n,beta,y,idx,&
info=psb_success_
name='psi_swap_tran'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_
@ -656,7 +652,7 @@ end subroutine psi_cswaptranv
!
!
!
subroutine psi_ctranidxv(ictxt,iicomm,flag,beta,y,idx,&
subroutine psi_ctranidxv(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_ctranidxv
@ -671,8 +667,8 @@ subroutine psi_ctranidxv(ictxt,iicomm,flag,beta,y,idx,&
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
complex(psb_spk_) :: y(:), beta
@ -680,9 +676,8 @@ subroutine psi_ctranidxv(ictxt,iicomm,flag,beta,y,idx,&
integer(psb_ipk_), intent(in) :: idx(:),totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable, dimension(:) :: bsdidx, brvidx,&
& sdsz, rvsz, prcid, rvhd, sdhd
integer(psb_ipk_) :: nesd, nerv,&
@ -699,9 +694,6 @@ subroutine psi_ctranidxv(ictxt,iicomm,flag,beta,y,idx,&
info=psb_success_
name='psi_swap_tran'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_

@ -175,7 +175,7 @@ end subroutine psi_dswapdata_vect
!
!
!
subroutine psi_dswap_vidx_vect(ictxt,iicomm,flag,beta,y,idx, &
subroutine psi_dswap_vidx_vect(ctxt,icomm,flag,beta,y,idx, &
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_dswap_vidx_vect
@ -192,8 +192,8 @@ subroutine psi_dswap_vidx_vect(ictxt,iicomm,flag,beta,y,idx, &
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_d_base_vect_type) :: y
@ -203,9 +203,8 @@ subroutine psi_dswap_vidx_vect(ictxt,iicomm,flag,beta,y,idx, &
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable :: prcid(:)
integer(psb_ipk_) :: nesd, nerv,&
& err_act, i, idx_pt, totsnd_, totrcv_,&
@ -218,9 +217,6 @@ subroutine psi_dswap_vidx_vect(ictxt,iicomm,flag,beta,y,idx, &
info=psb_success_
name='psi_swap_datav'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_
@ -517,7 +513,7 @@ end subroutine psi_dswapdata_multivect
!
!
!
subroutine psi_dswap_vidx_multivect(ictxt,iicomm,flag,beta,y,idx, &
subroutine psi_dswap_vidx_multivect(ctxt,icomm,flag,beta,y,idx, &
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_dswap_vidx_multivect
@ -534,8 +530,8 @@ subroutine psi_dswap_vidx_multivect(ictxt,iicomm,flag,beta,y,idx, &
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_d_base_multivect_type) :: y
@ -545,9 +541,8 @@ subroutine psi_dswap_vidx_multivect(ictxt,iicomm,flag,beta,y,idx, &
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable :: prcid(:)
integer(psb_ipk_) :: nesd, nerv,&
& err_act, i, idx_pt, totsnd_, totrcv_,&
@ -560,9 +555,6 @@ subroutine psi_dswap_vidx_multivect(ictxt,iicomm,flag,beta,y,idx, &
info=psb_success_
name='psi_swap_datav'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_

@ -179,8 +179,8 @@ subroutine psi_dswapidxm(ctxt,icomm,flag,n,beta,y,idx, &
! locals
integer(psb_mpk_) :: np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable, dimension(:) :: bsdidx, brvidx,&
& sdsz, rvsz, prcid, rvhd, sdhd
integer(psb_ipk_) :: nesd, nerv,&
@ -197,7 +197,6 @@ subroutine psi_dswapidxm(ctxt,icomm,flag,n,beta,y,idx, &
info=psb_success_
name='psi_swap_data'
call psb_erractionsave(err_act)
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_
@ -641,7 +640,7 @@ end subroutine psi_dswapdatav
!
!
!
subroutine psi_dswapidxv(ictxt,iicomm,flag,beta,y,idx, &
subroutine psi_dswapidxv(ctxt,icomm,flag,beta,y,idx, &
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_dswapidxv
@ -656,8 +655,8 @@ subroutine psi_dswapidxv(ictxt,iicomm,flag,beta,y,idx, &
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
real(psb_dpk_) :: y(:), beta
@ -665,9 +664,8 @@ subroutine psi_dswapidxv(ictxt,iicomm,flag,beta,y,idx, &
integer(psb_ipk_), intent(in) :: idx(:),totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable, dimension(:) :: bsdidx, brvidx,&
& sdsz, rvsz, prcid, rvhd, sdhd
integer(psb_ipk_) :: nesd, nerv,&
@ -684,9 +682,6 @@ subroutine psi_dswapidxv(ictxt,iicomm,flag,beta,y,idx, &
info=psb_success_
name='psi_swap_datav'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_

@ -176,7 +176,7 @@ end subroutine psi_dswaptran_vect
!
!
!
subroutine psi_dtran_vidx_vect(ictxt,iicomm,flag,beta,y,idx,&
subroutine psi_dtran_vidx_vect(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_dtran_vidx_vect
@ -193,8 +193,8 @@ subroutine psi_dtran_vidx_vect(ictxt,iicomm,flag,beta,y,idx,&
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_d_base_vect_type) :: y
@ -204,9 +204,8 @@ subroutine psi_dtran_vidx_vect(ictxt,iicomm,flag,beta,y,idx,&
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable :: prcid(:)
integer(psb_ipk_) :: nesd, nerv,&
& err_act, i, idx_pt, totsnd_, totrcv_,&
@ -219,9 +218,6 @@ subroutine psi_dtran_vidx_vect(ictxt,iicomm,flag,beta,y,idx,&
info=psb_success_
name='psi_swap_tran'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_
@ -528,7 +524,7 @@ subroutine psi_dswaptran_multivect(flag,beta,y,desc_a,work,info,data)
!
!
!
subroutine psi_dtran_vidx_multivect(ictxt,iicomm,flag,beta,y,idx,&
subroutine psi_dtran_vidx_multivect(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_dtran_vidx_multivect
@ -545,8 +541,8 @@ subroutine psi_dtran_vidx_multivect(ictxt,iicomm,flag,beta,y,idx,&
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_d_base_multivect_type) :: y
@ -556,9 +552,8 @@ subroutine psi_dtran_vidx_multivect(ictxt,iicomm,flag,beta,y,idx,&
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable :: prcid(:)
integer(psb_ipk_) :: nesd, nerv,&
& err_act, i, idx_pt, totsnd_, totrcv_,&
@ -571,9 +566,6 @@ subroutine psi_dtran_vidx_multivect(ictxt,iicomm,flag,beta,y,idx,&
info=psb_success_
name='psi_swap_tran'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_

@ -159,7 +159,7 @@ subroutine psi_dswaptranm(flag,n,beta,y,desc_a,work,info,data)
return
end subroutine psi_dswaptranm
subroutine psi_dtranidxm(ictxt,iicomm,flag,n,beta,y,idx,&
subroutine psi_dtranidxm(ctxt,icomm,flag,n,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_dtranidxm
@ -174,8 +174,8 @@ subroutine psi_dtranidxm(ictxt,iicomm,flag,n,beta,y,idx,&
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag,n
integer(psb_ipk_), intent(out) :: info
real(psb_dpk_) :: y(:,:), beta
@ -183,9 +183,8 @@ subroutine psi_dtranidxm(ictxt,iicomm,flag,n,beta,y,idx,&
integer(psb_ipk_), intent(in) :: idx(:),totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable, dimension(:) :: bsdidx, brvidx,&
& sdsz, rvsz, prcid, rvhd, sdhd
integer(psb_ipk_) :: nesd, nerv,&
@ -202,9 +201,6 @@ subroutine psi_dtranidxm(ictxt,iicomm,flag,n,beta,y,idx,&
info=psb_success_
name='psi_swap_tran'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_
@ -656,7 +652,7 @@ end subroutine psi_dswaptranv
!
!
!
subroutine psi_dtranidxv(ictxt,iicomm,flag,beta,y,idx,&
subroutine psi_dtranidxv(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_dtranidxv
@ -671,8 +667,8 @@ subroutine psi_dtranidxv(ictxt,iicomm,flag,beta,y,idx,&
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
real(psb_dpk_) :: y(:), beta
@ -680,9 +676,8 @@ subroutine psi_dtranidxv(ictxt,iicomm,flag,beta,y,idx,&
integer(psb_ipk_), intent(in) :: idx(:),totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable, dimension(:) :: bsdidx, brvidx,&
& sdsz, rvsz, prcid, rvhd, sdhd
integer(psb_ipk_) :: nesd, nerv,&
@ -699,9 +694,6 @@ subroutine psi_dtranidxv(ictxt,iicomm,flag,beta,y,idx,&
info=psb_success_
name='psi_swap_tran'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_

@ -179,8 +179,8 @@ subroutine psi_eswapidxm(ctxt,icomm,flag,n,beta,y,idx, &
! locals
integer(psb_mpk_) :: np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable, dimension(:) :: bsdidx, brvidx,&
& sdsz, rvsz, prcid, rvhd, sdhd
integer(psb_ipk_) :: nesd, nerv,&
@ -197,7 +197,6 @@ subroutine psi_eswapidxm(ctxt,icomm,flag,n,beta,y,idx, &
info=psb_success_
name='psi_swap_data'
call psb_erractionsave(err_act)
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_
@ -641,7 +640,7 @@ end subroutine psi_eswapdatav
!
!
!
subroutine psi_eswapidxv(ictxt,iicomm,flag,beta,y,idx, &
subroutine psi_eswapidxv(ctxt,icomm,flag,beta,y,idx, &
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_eswapidxv
@ -656,8 +655,8 @@ subroutine psi_eswapidxv(ictxt,iicomm,flag,beta,y,idx, &
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
integer(psb_epk_) :: y(:), beta
@ -665,9 +664,8 @@ subroutine psi_eswapidxv(ictxt,iicomm,flag,beta,y,idx, &
integer(psb_ipk_), intent(in) :: idx(:),totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable, dimension(:) :: bsdidx, brvidx,&
& sdsz, rvsz, prcid, rvhd, sdhd
integer(psb_ipk_) :: nesd, nerv,&
@ -684,9 +682,6 @@ subroutine psi_eswapidxv(ictxt,iicomm,flag,beta,y,idx, &
info=psb_success_
name='psi_swap_datav'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_

@ -159,7 +159,7 @@ subroutine psi_eswaptranm(flag,n,beta,y,desc_a,work,info,data)
return
end subroutine psi_eswaptranm
subroutine psi_etranidxm(ictxt,iicomm,flag,n,beta,y,idx,&
subroutine psi_etranidxm(ctxt,icomm,flag,n,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_etranidxm
@ -174,8 +174,8 @@ subroutine psi_etranidxm(ictxt,iicomm,flag,n,beta,y,idx,&
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag,n
integer(psb_ipk_), intent(out) :: info
integer(psb_epk_) :: y(:,:), beta
@ -183,9 +183,8 @@ subroutine psi_etranidxm(ictxt,iicomm,flag,n,beta,y,idx,&
integer(psb_ipk_), intent(in) :: idx(:),totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable, dimension(:) :: bsdidx, brvidx,&
& sdsz, rvsz, prcid, rvhd, sdhd
integer(psb_ipk_) :: nesd, nerv,&
@ -202,9 +201,6 @@ subroutine psi_etranidxm(ictxt,iicomm,flag,n,beta,y,idx,&
info=psb_success_
name='psi_swap_tran'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_
@ -656,7 +652,7 @@ end subroutine psi_eswaptranv
!
!
!
subroutine psi_etranidxv(ictxt,iicomm,flag,beta,y,idx,&
subroutine psi_etranidxv(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_etranidxv
@ -671,8 +667,8 @@ subroutine psi_etranidxv(ictxt,iicomm,flag,beta,y,idx,&
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
integer(psb_epk_) :: y(:), beta
@ -680,9 +676,8 @@ subroutine psi_etranidxv(ictxt,iicomm,flag,beta,y,idx,&
integer(psb_ipk_), intent(in) :: idx(:),totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable, dimension(:) :: bsdidx, brvidx,&
& sdsz, rvsz, prcid, rvhd, sdhd
integer(psb_ipk_) :: nesd, nerv,&
@ -699,9 +694,6 @@ subroutine psi_etranidxv(ictxt,iicomm,flag,beta,y,idx,&
info=psb_success_
name='psi_swap_tran'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_

@ -179,8 +179,8 @@ subroutine psi_i2swapidxm(ctxt,icomm,flag,n,beta,y,idx, &
! locals
integer(psb_mpk_) :: np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable, dimension(:) :: bsdidx, brvidx,&
& sdsz, rvsz, prcid, rvhd, sdhd
integer(psb_ipk_) :: nesd, nerv,&
@ -197,7 +197,6 @@ subroutine psi_i2swapidxm(ctxt,icomm,flag,n,beta,y,idx, &
info=psb_success_
name='psi_swap_data'
call psb_erractionsave(err_act)
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_
@ -641,7 +640,7 @@ end subroutine psi_i2swapdatav
!
!
!
subroutine psi_i2swapidxv(ictxt,iicomm,flag,beta,y,idx, &
subroutine psi_i2swapidxv(ctxt,icomm,flag,beta,y,idx, &
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_i2swapidxv
@ -656,8 +655,8 @@ subroutine psi_i2swapidxv(ictxt,iicomm,flag,beta,y,idx, &
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
integer(psb_i2pk_) :: y(:), beta
@ -665,9 +664,8 @@ subroutine psi_i2swapidxv(ictxt,iicomm,flag,beta,y,idx, &
integer(psb_ipk_), intent(in) :: idx(:),totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable, dimension(:) :: bsdidx, brvidx,&
& sdsz, rvsz, prcid, rvhd, sdhd
integer(psb_ipk_) :: nesd, nerv,&
@ -684,9 +682,6 @@ subroutine psi_i2swapidxv(ictxt,iicomm,flag,beta,y,idx, &
info=psb_success_
name='psi_swap_datav'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_

@ -159,7 +159,7 @@ subroutine psi_i2swaptranm(flag,n,beta,y,desc_a,work,info,data)
return
end subroutine psi_i2swaptranm
subroutine psi_i2tranidxm(ictxt,iicomm,flag,n,beta,y,idx,&
subroutine psi_i2tranidxm(ctxt,icomm,flag,n,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_i2tranidxm
@ -174,8 +174,8 @@ subroutine psi_i2tranidxm(ictxt,iicomm,flag,n,beta,y,idx,&
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag,n
integer(psb_ipk_), intent(out) :: info
integer(psb_i2pk_) :: y(:,:), beta
@ -183,9 +183,8 @@ subroutine psi_i2tranidxm(ictxt,iicomm,flag,n,beta,y,idx,&
integer(psb_ipk_), intent(in) :: idx(:),totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable, dimension(:) :: bsdidx, brvidx,&
& sdsz, rvsz, prcid, rvhd, sdhd
integer(psb_ipk_) :: nesd, nerv,&
@ -202,9 +201,6 @@ subroutine psi_i2tranidxm(ictxt,iicomm,flag,n,beta,y,idx,&
info=psb_success_
name='psi_swap_tran'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_
@ -656,7 +652,7 @@ end subroutine psi_i2swaptranv
!
!
!
subroutine psi_i2tranidxv(ictxt,iicomm,flag,beta,y,idx,&
subroutine psi_i2tranidxv(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_i2tranidxv
@ -671,8 +667,8 @@ subroutine psi_i2tranidxv(ictxt,iicomm,flag,beta,y,idx,&
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
integer(psb_i2pk_) :: y(:), beta
@ -680,9 +676,8 @@ subroutine psi_i2tranidxv(ictxt,iicomm,flag,beta,y,idx,&
integer(psb_ipk_), intent(in) :: idx(:),totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable, dimension(:) :: bsdidx, brvidx,&
& sdsz, rvsz, prcid, rvhd, sdhd
integer(psb_ipk_) :: nesd, nerv,&
@ -699,9 +694,6 @@ subroutine psi_i2tranidxv(ictxt,iicomm,flag,beta,y,idx,&
info=psb_success_
name='psi_swap_tran'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_

@ -175,7 +175,7 @@ end subroutine psi_iswapdata_vect
!
!
!
subroutine psi_iswap_vidx_vect(ictxt,iicomm,flag,beta,y,idx, &
subroutine psi_iswap_vidx_vect(ctxt,icomm,flag,beta,y,idx, &
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_iswap_vidx_vect
@ -192,8 +192,8 @@ subroutine psi_iswap_vidx_vect(ictxt,iicomm,flag,beta,y,idx, &
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_i_base_vect_type) :: y
@ -203,9 +203,8 @@ subroutine psi_iswap_vidx_vect(ictxt,iicomm,flag,beta,y,idx, &
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable :: prcid(:)
integer(psb_ipk_) :: nesd, nerv,&
& err_act, i, idx_pt, totsnd_, totrcv_,&
@ -218,9 +217,6 @@ subroutine psi_iswap_vidx_vect(ictxt,iicomm,flag,beta,y,idx, &
info=psb_success_
name='psi_swap_datav'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_
@ -517,7 +513,7 @@ end subroutine psi_iswapdata_multivect
!
!
!
subroutine psi_iswap_vidx_multivect(ictxt,iicomm,flag,beta,y,idx, &
subroutine psi_iswap_vidx_multivect(ctxt,icomm,flag,beta,y,idx, &
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_iswap_vidx_multivect
@ -534,8 +530,8 @@ subroutine psi_iswap_vidx_multivect(ictxt,iicomm,flag,beta,y,idx, &
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_i_base_multivect_type) :: y
@ -545,9 +541,8 @@ subroutine psi_iswap_vidx_multivect(ictxt,iicomm,flag,beta,y,idx, &
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable :: prcid(:)
integer(psb_ipk_) :: nesd, nerv,&
& err_act, i, idx_pt, totsnd_, totrcv_,&
@ -560,9 +555,6 @@ subroutine psi_iswap_vidx_multivect(ictxt,iicomm,flag,beta,y,idx, &
info=psb_success_
name='psi_swap_datav'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_

@ -176,7 +176,7 @@ end subroutine psi_iswaptran_vect
!
!
!
subroutine psi_itran_vidx_vect(ictxt,iicomm,flag,beta,y,idx,&
subroutine psi_itran_vidx_vect(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_itran_vidx_vect
@ -193,8 +193,8 @@ subroutine psi_itran_vidx_vect(ictxt,iicomm,flag,beta,y,idx,&
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_i_base_vect_type) :: y
@ -204,9 +204,8 @@ subroutine psi_itran_vidx_vect(ictxt,iicomm,flag,beta,y,idx,&
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable :: prcid(:)
integer(psb_ipk_) :: nesd, nerv,&
& err_act, i, idx_pt, totsnd_, totrcv_,&
@ -219,9 +218,6 @@ subroutine psi_itran_vidx_vect(ictxt,iicomm,flag,beta,y,idx,&
info=psb_success_
name='psi_swap_tran'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_
@ -528,7 +524,7 @@ subroutine psi_iswaptran_multivect(flag,beta,y,desc_a,work,info,data)
!
!
!
subroutine psi_itran_vidx_multivect(ictxt,iicomm,flag,beta,y,idx,&
subroutine psi_itran_vidx_multivect(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_itran_vidx_multivect
@ -545,8 +541,8 @@ subroutine psi_itran_vidx_multivect(ictxt,iicomm,flag,beta,y,idx,&
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_i_base_multivect_type) :: y
@ -556,9 +552,8 @@ subroutine psi_itran_vidx_multivect(ictxt,iicomm,flag,beta,y,idx,&
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable :: prcid(:)
integer(psb_ipk_) :: nesd, nerv,&
& err_act, i, idx_pt, totsnd_, totrcv_,&
@ -571,9 +566,6 @@ subroutine psi_itran_vidx_multivect(ictxt,iicomm,flag,beta,y,idx,&
info=psb_success_
name='psi_swap_tran'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_

@ -175,7 +175,7 @@ end subroutine psi_lswapdata_vect
!
!
!
subroutine psi_lswap_vidx_vect(ictxt,iicomm,flag,beta,y,idx, &
subroutine psi_lswap_vidx_vect(ctxt,icomm,flag,beta,y,idx, &
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_lswap_vidx_vect
@ -192,8 +192,8 @@ subroutine psi_lswap_vidx_vect(ictxt,iicomm,flag,beta,y,idx, &
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_l_base_vect_type) :: y
@ -203,9 +203,8 @@ subroutine psi_lswap_vidx_vect(ictxt,iicomm,flag,beta,y,idx, &
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable :: prcid(:)
integer(psb_ipk_) :: nesd, nerv,&
& err_act, i, idx_pt, totsnd_, totrcv_,&
@ -218,9 +217,6 @@ subroutine psi_lswap_vidx_vect(ictxt,iicomm,flag,beta,y,idx, &
info=psb_success_
name='psi_swap_datav'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_
@ -517,7 +513,7 @@ end subroutine psi_lswapdata_multivect
!
!
!
subroutine psi_lswap_vidx_multivect(ictxt,iicomm,flag,beta,y,idx, &
subroutine psi_lswap_vidx_multivect(ctxt,icomm,flag,beta,y,idx, &
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_lswap_vidx_multivect
@ -534,8 +530,8 @@ subroutine psi_lswap_vidx_multivect(ictxt,iicomm,flag,beta,y,idx, &
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_l_base_multivect_type) :: y
@ -545,9 +541,8 @@ subroutine psi_lswap_vidx_multivect(ictxt,iicomm,flag,beta,y,idx, &
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable :: prcid(:)
integer(psb_ipk_) :: nesd, nerv,&
& err_act, i, idx_pt, totsnd_, totrcv_,&
@ -560,9 +555,6 @@ subroutine psi_lswap_vidx_multivect(ictxt,iicomm,flag,beta,y,idx, &
info=psb_success_
name='psi_swap_datav'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_

@ -176,7 +176,7 @@ end subroutine psi_lswaptran_vect
!
!
!
subroutine psi_ltran_vidx_vect(ictxt,iicomm,flag,beta,y,idx,&
subroutine psi_ltran_vidx_vect(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_ltran_vidx_vect
@ -193,8 +193,8 @@ subroutine psi_ltran_vidx_vect(ictxt,iicomm,flag,beta,y,idx,&
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_l_base_vect_type) :: y
@ -204,9 +204,8 @@ subroutine psi_ltran_vidx_vect(ictxt,iicomm,flag,beta,y,idx,&
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable :: prcid(:)
integer(psb_ipk_) :: nesd, nerv,&
& err_act, i, idx_pt, totsnd_, totrcv_,&
@ -219,9 +218,6 @@ subroutine psi_ltran_vidx_vect(ictxt,iicomm,flag,beta,y,idx,&
info=psb_success_
name='psi_swap_tran'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_
@ -528,7 +524,7 @@ subroutine psi_lswaptran_multivect(flag,beta,y,desc_a,work,info,data)
!
!
!
subroutine psi_ltran_vidx_multivect(ictxt,iicomm,flag,beta,y,idx,&
subroutine psi_ltran_vidx_multivect(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_ltran_vidx_multivect
@ -545,8 +541,8 @@ subroutine psi_ltran_vidx_multivect(ictxt,iicomm,flag,beta,y,idx,&
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_l_base_multivect_type) :: y
@ -556,9 +552,8 @@ subroutine psi_ltran_vidx_multivect(ictxt,iicomm,flag,beta,y,idx,&
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable :: prcid(:)
integer(psb_ipk_) :: nesd, nerv,&
& err_act, i, idx_pt, totsnd_, totrcv_,&
@ -571,9 +566,6 @@ subroutine psi_ltran_vidx_multivect(ictxt,iicomm,flag,beta,y,idx,&
info=psb_success_
name='psi_swap_tran'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_

@ -179,8 +179,8 @@ subroutine psi_mswapidxm(ctxt,icomm,flag,n,beta,y,idx, &
! locals
integer(psb_mpk_) :: np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable, dimension(:) :: bsdidx, brvidx,&
& sdsz, rvsz, prcid, rvhd, sdhd
integer(psb_ipk_) :: nesd, nerv,&
@ -197,7 +197,6 @@ subroutine psi_mswapidxm(ctxt,icomm,flag,n,beta,y,idx, &
info=psb_success_
name='psi_swap_data'
call psb_erractionsave(err_act)
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_
@ -641,7 +640,7 @@ end subroutine psi_mswapdatav
!
!
!
subroutine psi_mswapidxv(ictxt,iicomm,flag,beta,y,idx, &
subroutine psi_mswapidxv(ctxt,icomm,flag,beta,y,idx, &
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_mswapidxv
@ -656,8 +655,8 @@ subroutine psi_mswapidxv(ictxt,iicomm,flag,beta,y,idx, &
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
integer(psb_mpk_) :: y(:), beta
@ -665,9 +664,8 @@ subroutine psi_mswapidxv(ictxt,iicomm,flag,beta,y,idx, &
integer(psb_ipk_), intent(in) :: idx(:),totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable, dimension(:) :: bsdidx, brvidx,&
& sdsz, rvsz, prcid, rvhd, sdhd
integer(psb_ipk_) :: nesd, nerv,&
@ -684,9 +682,6 @@ subroutine psi_mswapidxv(ictxt,iicomm,flag,beta,y,idx, &
info=psb_success_
name='psi_swap_datav'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_

@ -159,7 +159,7 @@ subroutine psi_mswaptranm(flag,n,beta,y,desc_a,work,info,data)
return
end subroutine psi_mswaptranm
subroutine psi_mtranidxm(ictxt,iicomm,flag,n,beta,y,idx,&
subroutine psi_mtranidxm(ctxt,icomm,flag,n,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_mtranidxm
@ -174,8 +174,8 @@ subroutine psi_mtranidxm(ictxt,iicomm,flag,n,beta,y,idx,&
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag,n
integer(psb_ipk_), intent(out) :: info
integer(psb_mpk_) :: y(:,:), beta
@ -183,9 +183,8 @@ subroutine psi_mtranidxm(ictxt,iicomm,flag,n,beta,y,idx,&
integer(psb_ipk_), intent(in) :: idx(:),totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable, dimension(:) :: bsdidx, brvidx,&
& sdsz, rvsz, prcid, rvhd, sdhd
integer(psb_ipk_) :: nesd, nerv,&
@ -202,9 +201,6 @@ subroutine psi_mtranidxm(ictxt,iicomm,flag,n,beta,y,idx,&
info=psb_success_
name='psi_swap_tran'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_
@ -656,7 +652,7 @@ end subroutine psi_mswaptranv
!
!
!
subroutine psi_mtranidxv(ictxt,iicomm,flag,beta,y,idx,&
subroutine psi_mtranidxv(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_mtranidxv
@ -671,8 +667,8 @@ subroutine psi_mtranidxv(ictxt,iicomm,flag,beta,y,idx,&
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
integer(psb_mpk_) :: y(:), beta
@ -680,9 +676,8 @@ subroutine psi_mtranidxv(ictxt,iicomm,flag,beta,y,idx,&
integer(psb_ipk_), intent(in) :: idx(:),totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable, dimension(:) :: bsdidx, brvidx,&
& sdsz, rvsz, prcid, rvhd, sdhd
integer(psb_ipk_) :: nesd, nerv,&
@ -699,9 +694,6 @@ subroutine psi_mtranidxv(ictxt,iicomm,flag,beta,y,idx,&
info=psb_success_
name='psi_swap_tran'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_

@ -175,7 +175,7 @@ end subroutine psi_sswapdata_vect
!
!
!
subroutine psi_sswap_vidx_vect(ictxt,iicomm,flag,beta,y,idx, &
subroutine psi_sswap_vidx_vect(ctxt,icomm,flag,beta,y,idx, &
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_sswap_vidx_vect
@ -192,8 +192,8 @@ subroutine psi_sswap_vidx_vect(ictxt,iicomm,flag,beta,y,idx, &
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_s_base_vect_type) :: y
@ -203,9 +203,8 @@ subroutine psi_sswap_vidx_vect(ictxt,iicomm,flag,beta,y,idx, &
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable :: prcid(:)
integer(psb_ipk_) :: nesd, nerv,&
& err_act, i, idx_pt, totsnd_, totrcv_,&
@ -218,9 +217,6 @@ subroutine psi_sswap_vidx_vect(ictxt,iicomm,flag,beta,y,idx, &
info=psb_success_
name='psi_swap_datav'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_
@ -517,7 +513,7 @@ end subroutine psi_sswapdata_multivect
!
!
!
subroutine psi_sswap_vidx_multivect(ictxt,iicomm,flag,beta,y,idx, &
subroutine psi_sswap_vidx_multivect(ctxt,icomm,flag,beta,y,idx, &
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_sswap_vidx_multivect
@ -534,8 +530,8 @@ subroutine psi_sswap_vidx_multivect(ictxt,iicomm,flag,beta,y,idx, &
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_s_base_multivect_type) :: y
@ -545,9 +541,8 @@ subroutine psi_sswap_vidx_multivect(ictxt,iicomm,flag,beta,y,idx, &
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable :: prcid(:)
integer(psb_ipk_) :: nesd, nerv,&
& err_act, i, idx_pt, totsnd_, totrcv_,&
@ -560,9 +555,6 @@ subroutine psi_sswap_vidx_multivect(ictxt,iicomm,flag,beta,y,idx, &
info=psb_success_
name='psi_swap_datav'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_

@ -179,8 +179,8 @@ subroutine psi_sswapidxm(ctxt,icomm,flag,n,beta,y,idx, &
! locals
integer(psb_mpk_) :: np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable, dimension(:) :: bsdidx, brvidx,&
& sdsz, rvsz, prcid, rvhd, sdhd
integer(psb_ipk_) :: nesd, nerv,&
@ -197,7 +197,6 @@ subroutine psi_sswapidxm(ctxt,icomm,flag,n,beta,y,idx, &
info=psb_success_
name='psi_swap_data'
call psb_erractionsave(err_act)
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_
@ -641,7 +640,7 @@ end subroutine psi_sswapdatav
!
!
!
subroutine psi_sswapidxv(ictxt,iicomm,flag,beta,y,idx, &
subroutine psi_sswapidxv(ctxt,icomm,flag,beta,y,idx, &
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_sswapidxv
@ -656,8 +655,8 @@ subroutine psi_sswapidxv(ictxt,iicomm,flag,beta,y,idx, &
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
real(psb_spk_) :: y(:), beta
@ -665,9 +664,8 @@ subroutine psi_sswapidxv(ictxt,iicomm,flag,beta,y,idx, &
integer(psb_ipk_), intent(in) :: idx(:),totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable, dimension(:) :: bsdidx, brvidx,&
& sdsz, rvsz, prcid, rvhd, sdhd
integer(psb_ipk_) :: nesd, nerv,&
@ -684,9 +682,6 @@ subroutine psi_sswapidxv(ictxt,iicomm,flag,beta,y,idx, &
info=psb_success_
name='psi_swap_datav'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_

@ -176,7 +176,7 @@ end subroutine psi_sswaptran_vect
!
!
!
subroutine psi_stran_vidx_vect(ictxt,iicomm,flag,beta,y,idx,&
subroutine psi_stran_vidx_vect(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_stran_vidx_vect
@ -193,8 +193,8 @@ subroutine psi_stran_vidx_vect(ictxt,iicomm,flag,beta,y,idx,&
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_s_base_vect_type) :: y
@ -204,9 +204,8 @@ subroutine psi_stran_vidx_vect(ictxt,iicomm,flag,beta,y,idx,&
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable :: prcid(:)
integer(psb_ipk_) :: nesd, nerv,&
& err_act, i, idx_pt, totsnd_, totrcv_,&
@ -219,9 +218,6 @@ subroutine psi_stran_vidx_vect(ictxt,iicomm,flag,beta,y,idx,&
info=psb_success_
name='psi_swap_tran'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_
@ -528,7 +524,7 @@ subroutine psi_sswaptran_multivect(flag,beta,y,desc_a,work,info,data)
!
!
!
subroutine psi_stran_vidx_multivect(ictxt,iicomm,flag,beta,y,idx,&
subroutine psi_stran_vidx_multivect(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_stran_vidx_multivect
@ -545,8 +541,8 @@ subroutine psi_stran_vidx_multivect(ictxt,iicomm,flag,beta,y,idx,&
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_s_base_multivect_type) :: y
@ -556,9 +552,8 @@ subroutine psi_stran_vidx_multivect(ictxt,iicomm,flag,beta,y,idx,&
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable :: prcid(:)
integer(psb_ipk_) :: nesd, nerv,&
& err_act, i, idx_pt, totsnd_, totrcv_,&
@ -571,9 +566,6 @@ subroutine psi_stran_vidx_multivect(ictxt,iicomm,flag,beta,y,idx,&
info=psb_success_
name='psi_swap_tran'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_

@ -159,7 +159,7 @@ subroutine psi_sswaptranm(flag,n,beta,y,desc_a,work,info,data)
return
end subroutine psi_sswaptranm
subroutine psi_stranidxm(ictxt,iicomm,flag,n,beta,y,idx,&
subroutine psi_stranidxm(ctxt,icomm,flag,n,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_stranidxm
@ -174,8 +174,8 @@ subroutine psi_stranidxm(ictxt,iicomm,flag,n,beta,y,idx,&
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag,n
integer(psb_ipk_), intent(out) :: info
real(psb_spk_) :: y(:,:), beta
@ -183,9 +183,8 @@ subroutine psi_stranidxm(ictxt,iicomm,flag,n,beta,y,idx,&
integer(psb_ipk_), intent(in) :: idx(:),totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable, dimension(:) :: bsdidx, brvidx,&
& sdsz, rvsz, prcid, rvhd, sdhd
integer(psb_ipk_) :: nesd, nerv,&
@ -202,9 +201,6 @@ subroutine psi_stranidxm(ictxt,iicomm,flag,n,beta,y,idx,&
info=psb_success_
name='psi_swap_tran'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_
@ -656,7 +652,7 @@ end subroutine psi_sswaptranv
!
!
!
subroutine psi_stranidxv(ictxt,iicomm,flag,beta,y,idx,&
subroutine psi_stranidxv(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_stranidxv
@ -671,8 +667,8 @@ subroutine psi_stranidxv(ictxt,iicomm,flag,beta,y,idx,&
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
real(psb_spk_) :: y(:), beta
@ -680,9 +676,8 @@ subroutine psi_stranidxv(ictxt,iicomm,flag,beta,y,idx,&
integer(psb_ipk_), intent(in) :: idx(:),totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable, dimension(:) :: bsdidx, brvidx,&
& sdsz, rvsz, prcid, rvhd, sdhd
integer(psb_ipk_) :: nesd, nerv,&
@ -699,9 +694,6 @@ subroutine psi_stranidxv(ictxt,iicomm,flag,beta,y,idx,&
info=psb_success_
name='psi_swap_tran'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_

@ -175,7 +175,7 @@ end subroutine psi_zswapdata_vect
!
!
!
subroutine psi_zswap_vidx_vect(ictxt,iicomm,flag,beta,y,idx, &
subroutine psi_zswap_vidx_vect(ctxt,icomm,flag,beta,y,idx, &
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_zswap_vidx_vect
@ -192,8 +192,8 @@ subroutine psi_zswap_vidx_vect(ictxt,iicomm,flag,beta,y,idx, &
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_z_base_vect_type) :: y
@ -203,9 +203,8 @@ subroutine psi_zswap_vidx_vect(ictxt,iicomm,flag,beta,y,idx, &
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable :: prcid(:)
integer(psb_ipk_) :: nesd, nerv,&
& err_act, i, idx_pt, totsnd_, totrcv_,&
@ -218,9 +217,6 @@ subroutine psi_zswap_vidx_vect(ictxt,iicomm,flag,beta,y,idx, &
info=psb_success_
name='psi_swap_datav'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_
@ -517,7 +513,7 @@ end subroutine psi_zswapdata_multivect
!
!
!
subroutine psi_zswap_vidx_multivect(ictxt,iicomm,flag,beta,y,idx, &
subroutine psi_zswap_vidx_multivect(ctxt,icomm,flag,beta,y,idx, &
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_zswap_vidx_multivect
@ -534,8 +530,8 @@ subroutine psi_zswap_vidx_multivect(ictxt,iicomm,flag,beta,y,idx, &
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_z_base_multivect_type) :: y
@ -545,9 +541,8 @@ subroutine psi_zswap_vidx_multivect(ictxt,iicomm,flag,beta,y,idx, &
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable :: prcid(:)
integer(psb_ipk_) :: nesd, nerv,&
& err_act, i, idx_pt, totsnd_, totrcv_,&
@ -560,9 +555,6 @@ subroutine psi_zswap_vidx_multivect(ictxt,iicomm,flag,beta,y,idx, &
info=psb_success_
name='psi_swap_datav'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_

@ -179,8 +179,8 @@ subroutine psi_zswapidxm(ctxt,icomm,flag,n,beta,y,idx, &
! locals
integer(psb_mpk_) :: np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable, dimension(:) :: bsdidx, brvidx,&
& sdsz, rvsz, prcid, rvhd, sdhd
integer(psb_ipk_) :: nesd, nerv,&
@ -197,7 +197,6 @@ subroutine psi_zswapidxm(ctxt,icomm,flag,n,beta,y,idx, &
info=psb_success_
name='psi_swap_data'
call psb_erractionsave(err_act)
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_
@ -641,7 +640,7 @@ end subroutine psi_zswapdatav
!
!
!
subroutine psi_zswapidxv(ictxt,iicomm,flag,beta,y,idx, &
subroutine psi_zswapidxv(ctxt,icomm,flag,beta,y,idx, &
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_zswapidxv
@ -656,8 +655,8 @@ subroutine psi_zswapidxv(ictxt,iicomm,flag,beta,y,idx, &
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
complex(psb_dpk_) :: y(:), beta
@ -665,9 +664,8 @@ subroutine psi_zswapidxv(ictxt,iicomm,flag,beta,y,idx, &
integer(psb_ipk_), intent(in) :: idx(:),totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable, dimension(:) :: bsdidx, brvidx,&
& sdsz, rvsz, prcid, rvhd, sdhd
integer(psb_ipk_) :: nesd, nerv,&
@ -684,9 +682,6 @@ subroutine psi_zswapidxv(ictxt,iicomm,flag,beta,y,idx, &
info=psb_success_
name='psi_swap_datav'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_

@ -176,7 +176,7 @@ end subroutine psi_zswaptran_vect
!
!
!
subroutine psi_ztran_vidx_vect(ictxt,iicomm,flag,beta,y,idx,&
subroutine psi_ztran_vidx_vect(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_ztran_vidx_vect
@ -193,8 +193,8 @@ subroutine psi_ztran_vidx_vect(ictxt,iicomm,flag,beta,y,idx,&
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_z_base_vect_type) :: y
@ -204,9 +204,8 @@ subroutine psi_ztran_vidx_vect(ictxt,iicomm,flag,beta,y,idx,&
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable :: prcid(:)
integer(psb_ipk_) :: nesd, nerv,&
& err_act, i, idx_pt, totsnd_, totrcv_,&
@ -219,9 +218,6 @@ subroutine psi_ztran_vidx_vect(ictxt,iicomm,flag,beta,y,idx,&
info=psb_success_
name='psi_swap_tran'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_
@ -528,7 +524,7 @@ subroutine psi_zswaptran_multivect(flag,beta,y,desc_a,work,info,data)
!
!
!
subroutine psi_ztran_vidx_multivect(ictxt,iicomm,flag,beta,y,idx,&
subroutine psi_ztran_vidx_multivect(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_ztran_vidx_multivect
@ -545,8 +541,8 @@ subroutine psi_ztran_vidx_multivect(ictxt,iicomm,flag,beta,y,idx,&
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_z_base_multivect_type) :: y
@ -556,9 +552,8 @@ subroutine psi_ztran_vidx_multivect(ictxt,iicomm,flag,beta,y,idx,&
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable :: prcid(:)
integer(psb_ipk_) :: nesd, nerv,&
& err_act, i, idx_pt, totsnd_, totrcv_,&
@ -571,9 +566,6 @@ subroutine psi_ztran_vidx_multivect(ictxt,iicomm,flag,beta,y,idx,&
info=psb_success_
name='psi_swap_tran'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_

@ -159,7 +159,7 @@ subroutine psi_zswaptranm(flag,n,beta,y,desc_a,work,info,data)
return
end subroutine psi_zswaptranm
subroutine psi_ztranidxm(ictxt,iicomm,flag,n,beta,y,idx,&
subroutine psi_ztranidxm(ctxt,icomm,flag,n,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_ztranidxm
@ -174,8 +174,8 @@ subroutine psi_ztranidxm(ictxt,iicomm,flag,n,beta,y,idx,&
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag,n
integer(psb_ipk_), intent(out) :: info
complex(psb_dpk_) :: y(:,:), beta
@ -183,9 +183,8 @@ subroutine psi_ztranidxm(ictxt,iicomm,flag,n,beta,y,idx,&
integer(psb_ipk_), intent(in) :: idx(:),totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable, dimension(:) :: bsdidx, brvidx,&
& sdsz, rvsz, prcid, rvhd, sdhd
integer(psb_ipk_) :: nesd, nerv,&
@ -202,9 +201,6 @@ subroutine psi_ztranidxm(ictxt,iicomm,flag,n,beta,y,idx,&
info=psb_success_
name='psi_swap_tran'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_
@ -656,7 +652,7 @@ end subroutine psi_zswaptranv
!
!
!
subroutine psi_ztranidxv(ictxt,iicomm,flag,beta,y,idx,&
subroutine psi_ztranidxv(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_ztranidxv
@ -671,8 +667,8 @@ subroutine psi_ztranidxv(ictxt,iicomm,flag,beta,y,idx,&
include 'mpif.h'
#endif
type(psb_ctxt_type), intent(in) :: ictxt
integer(psb_mpk_), intent(in) :: iicomm
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
complex(psb_dpk_) :: y(:), beta
@ -680,9 +676,8 @@ subroutine psi_ztranidxv(ictxt,iicomm,flag,beta,y,idx,&
integer(psb_ipk_), intent(in) :: idx(:),totxch,totsnd, totrcv
! locals
type(psb_ctxt_type) :: ctxt
integer(psb_mpk_) :: icomm, np, me,&
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable, dimension(:) :: bsdidx, brvidx,&
& sdsz, rvsz, prcid, rvhd, sdhd
integer(psb_ipk_) :: nesd, nerv,&
@ -699,9 +694,6 @@ subroutine psi_ztranidxv(ictxt,iicomm,flag,beta,y,idx,&
info=psb_success_
name='psi_swap_tran'
call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np)
if (np == -1) then
info=psb_err_context_error_

@ -29,8 +29,8 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine psi_i_bld_glb_csr_dep_list(ctxt,loc_dl,length_dl,c_dep_list,dl_ptr,info)
use psi_mod, psb_protect_name => psi_i_bld_glb_csr_dep_list
subroutine psi_i_bld_glb_dep_list(ctxt,loc_dl,length_dl,c_dep_list,dl_ptr,info)
use psi_mod, psb_protect_name => psi_i_bld_glb_dep_list
#ifdef MPI_MOD
use mpi
#endif
@ -123,4 +123,4 @@ subroutine psi_i_bld_glb_csr_dep_list(ctxt,loc_dl,length_dl,c_dep_list,dl_ptr,in
return
end subroutine psi_i_bld_glb_csr_dep_list
end subroutine psi_i_bld_glb_dep_list

@ -257,7 +257,7 @@ serial/psb_c_csc_mat_mod.o serial/psb_c_csr_mat_mod.o serial/psb_lc_csr_mat_mod.
serial/psb_z_csc_mat_mod.o serial/psb_z_csr_mat_mod.o serial/psb_lz_csr_mat_mod.o: serial/psb_z_base_mat_mod.o
serial/psb_mat_mod.o: serial/psb_vect_mod.o serial/psb_s_mat_mod.o serial/psb_d_mat_mod.o serial/psb_c_mat_mod.o serial/psb_z_mat_mod.o
serial/psb_serial_mod.o: serial/psb_s_serial_mod.o serial/psb_d_serial_mod.o serial/psb_c_serial_mod.o serial/psb_z_serial_mod.o
serial/psb_serial_mod.o: serial/psb_s_serial_mod.o serial/psb_d_serial_mod.o serial/psb_c_serial_mod.o serial/psb_z_serial_mod.o auxil/psi_serial_mod.o
serial/psb_i_vect_mod.o: serial/psb_i_base_vect_mod.o
serial/psb_l_vect_mod.o: serial/psb_l_base_vect_mod.o serial/psb_i_vect_mod.o
serial/psb_s_vect_mod.o: serial/psb_s_base_vect_mod.o serial/psb_i_vect_mod.o

@ -34,22 +34,38 @@ module psi_c_serial_mod
interface psb_gelp
! 2-D version
subroutine psb_cgelp(trans,iperm,x,info)
import :: psb_ipk_, psb_spk_
subroutine psb_m_cgelp(trans,iperm,x,info)
import :: psb_ipk_, psb_mpk_, psb_spk_
implicit none
complex(psb_spk_), intent(inout) :: x(:,:)
integer(psb_ipk_), intent(in) :: iperm(:)
integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
end subroutine psb_cgelp
subroutine psb_cgelpv(trans,iperm,x,info)
import :: psb_ipk_, psb_spk_
end subroutine psb_m_cgelp
subroutine psb_m_cgelpv(trans,iperm,x,info)
import :: psb_ipk_, psb_mpk_,psb_spk_
implicit none
complex(psb_spk_), intent(inout) :: x(:)
integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
end subroutine psb_m_cgelpv
subroutine psb_e_cgelp(trans,iperm,x,info)
import :: psb_ipk_, psb_epk_, psb_spk_
implicit none
complex(psb_spk_), intent(inout) :: x(:,:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
end subroutine psb_e_cgelp
subroutine psb_e_cgelpv(trans,iperm,x,info)
import :: psb_ipk_, psb_epk_, psb_spk_
implicit none
complex(psb_spk_), intent(inout) :: x(:)
integer(psb_ipk_), intent(in) :: iperm(:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
end subroutine psb_cgelpv
end subroutine psb_e_cgelpv
end interface psb_gelp
interface psb_geaxpby

@ -34,22 +34,38 @@ module psi_d_serial_mod
interface psb_gelp
! 2-D version
subroutine psb_dgelp(trans,iperm,x,info)
import :: psb_ipk_, psb_dpk_
subroutine psb_m_dgelp(trans,iperm,x,info)
import :: psb_ipk_, psb_mpk_, psb_dpk_
implicit none
real(psb_dpk_), intent(inout) :: x(:,:)
integer(psb_ipk_), intent(in) :: iperm(:)
integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
end subroutine psb_dgelp
subroutine psb_dgelpv(trans,iperm,x,info)
import :: psb_ipk_, psb_dpk_
end subroutine psb_m_dgelp
subroutine psb_m_dgelpv(trans,iperm,x,info)
import :: psb_ipk_, psb_mpk_,psb_dpk_
implicit none
real(psb_dpk_), intent(inout) :: x(:)
integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
end subroutine psb_m_dgelpv
subroutine psb_e_dgelp(trans,iperm,x,info)
import :: psb_ipk_, psb_epk_, psb_dpk_
implicit none
real(psb_dpk_), intent(inout) :: x(:,:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
end subroutine psb_e_dgelp
subroutine psb_e_dgelpv(trans,iperm,x,info)
import :: psb_ipk_, psb_epk_, psb_dpk_
implicit none
real(psb_dpk_), intent(inout) :: x(:)
integer(psb_ipk_), intent(in) :: iperm(:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
end subroutine psb_dgelpv
end subroutine psb_e_dgelpv
end interface psb_gelp
interface psb_geaxpby

@ -34,22 +34,38 @@ module psi_e_serial_mod
interface psb_gelp
! 2-D version
subroutine psb_egelp(trans,iperm,x,info)
subroutine psb_m_egelp(trans,iperm,x,info)
import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_
implicit none
integer(psb_epk_), intent(inout) :: x(:,:)
integer(psb_ipk_), intent(in) :: iperm(:)
integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
end subroutine psb_egelp
subroutine psb_egelpv(trans,iperm,x,info)
end subroutine psb_m_egelp
subroutine psb_m_egelpv(trans,iperm,x,info)
import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_
implicit none
integer(psb_epk_), intent(inout) :: x(:)
integer(psb_ipk_), intent(in) :: iperm(:)
integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
end subroutine psb_egelpv
end subroutine psb_m_egelpv
subroutine psb_e_egelp(trans,iperm,x,info)
import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_
implicit none
integer(psb_epk_), intent(inout) :: x(:,:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
end subroutine psb_e_egelp
subroutine psb_e_egelpv(trans,iperm,x,info)
import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_
implicit none
integer(psb_epk_), intent(inout) :: x(:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
end subroutine psb_e_egelpv
end interface psb_gelp
interface psb_geaxpby

@ -34,22 +34,38 @@ module psi_i2_serial_mod
interface psb_gelp
! 2-D version
subroutine psb_i2gelp(trans,iperm,x,info)
subroutine psb_m_i2gelp(trans,iperm,x,info)
import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_
implicit none
integer(psb_i2pk_), intent(inout) :: x(:,:)
integer(psb_ipk_), intent(in) :: iperm(:)
integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
end subroutine psb_i2gelp
subroutine psb_i2gelpv(trans,iperm,x,info)
end subroutine psb_m_i2gelp
subroutine psb_m_i2gelpv(trans,iperm,x,info)
import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_
implicit none
integer(psb_i2pk_), intent(inout) :: x(:)
integer(psb_ipk_), intent(in) :: iperm(:)
integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
end subroutine psb_i2gelpv
end subroutine psb_m_i2gelpv
subroutine psb_e_i2gelp(trans,iperm,x,info)
import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_
implicit none
integer(psb_i2pk_), intent(inout) :: x(:,:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
end subroutine psb_e_i2gelp
subroutine psb_e_i2gelpv(trans,iperm,x,info)
import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_
implicit none
integer(psb_i2pk_), intent(inout) :: x(:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
end subroutine psb_e_i2gelpv
end interface psb_gelp
interface psb_geaxpby

@ -34,22 +34,38 @@ module psi_m_serial_mod
interface psb_gelp
! 2-D version
subroutine psb_mgelp(trans,iperm,x,info)
subroutine psb_m_mgelp(trans,iperm,x,info)
import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_
implicit none
integer(psb_mpk_), intent(inout) :: x(:,:)
integer(psb_ipk_), intent(in) :: iperm(:)
integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
end subroutine psb_mgelp
subroutine psb_mgelpv(trans,iperm,x,info)
end subroutine psb_m_mgelp
subroutine psb_m_mgelpv(trans,iperm,x,info)
import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_
implicit none
integer(psb_mpk_), intent(inout) :: x(:)
integer(psb_ipk_), intent(in) :: iperm(:)
integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
end subroutine psb_mgelpv
end subroutine psb_m_mgelpv
subroutine psb_e_mgelp(trans,iperm,x,info)
import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_
implicit none
integer(psb_mpk_), intent(inout) :: x(:,:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
end subroutine psb_e_mgelp
subroutine psb_e_mgelpv(trans,iperm,x,info)
import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_
implicit none
integer(psb_mpk_), intent(inout) :: x(:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
end subroutine psb_e_mgelpv
end interface psb_gelp
interface psb_geaxpby

@ -34,22 +34,38 @@ module psi_s_serial_mod
interface psb_gelp
! 2-D version
subroutine psb_sgelp(trans,iperm,x,info)
import :: psb_ipk_, psb_spk_
subroutine psb_m_sgelp(trans,iperm,x,info)
import :: psb_ipk_, psb_mpk_, psb_spk_
implicit none
real(psb_spk_), intent(inout) :: x(:,:)
integer(psb_ipk_), intent(in) :: iperm(:)
integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
end subroutine psb_sgelp
subroutine psb_sgelpv(trans,iperm,x,info)
import :: psb_ipk_, psb_spk_
end subroutine psb_m_sgelp
subroutine psb_m_sgelpv(trans,iperm,x,info)
import :: psb_ipk_, psb_mpk_,psb_spk_
implicit none
real(psb_spk_), intent(inout) :: x(:)
integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
end subroutine psb_m_sgelpv
subroutine psb_e_sgelp(trans,iperm,x,info)
import :: psb_ipk_, psb_epk_, psb_spk_
implicit none
real(psb_spk_), intent(inout) :: x(:,:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
end subroutine psb_e_sgelp
subroutine psb_e_sgelpv(trans,iperm,x,info)
import :: psb_ipk_, psb_epk_, psb_spk_
implicit none
real(psb_spk_), intent(inout) :: x(:)
integer(psb_ipk_), intent(in) :: iperm(:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
end subroutine psb_sgelpv
end subroutine psb_e_sgelpv
end interface psb_gelp
interface psb_geaxpby

@ -34,22 +34,38 @@ module psi_z_serial_mod
interface psb_gelp
! 2-D version
subroutine psb_zgelp(trans,iperm,x,info)
import :: psb_ipk_, psb_dpk_
subroutine psb_m_zgelp(trans,iperm,x,info)
import :: psb_ipk_, psb_mpk_, psb_dpk_
implicit none
complex(psb_dpk_), intent(inout) :: x(:,:)
integer(psb_ipk_), intent(in) :: iperm(:)
integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
end subroutine psb_zgelp
subroutine psb_zgelpv(trans,iperm,x,info)
import :: psb_ipk_, psb_dpk_
end subroutine psb_m_zgelp
subroutine psb_m_zgelpv(trans,iperm,x,info)
import :: psb_ipk_, psb_mpk_,psb_dpk_
implicit none
complex(psb_dpk_), intent(inout) :: x(:)
integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
end subroutine psb_m_zgelpv
subroutine psb_e_zgelp(trans,iperm,x,info)
import :: psb_ipk_, psb_epk_, psb_dpk_
implicit none
complex(psb_dpk_), intent(inout) :: x(:,:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
end subroutine psb_e_zgelp
subroutine psb_e_zgelpv(trans,iperm,x,info)
import :: psb_ipk_, psb_epk_, psb_dpk_
implicit none
complex(psb_dpk_), intent(inout) :: x(:)
integer(psb_ipk_), intent(in) :: iperm(:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
end subroutine psb_zgelpv
end subroutine psb_e_zgelpv
end interface psb_gelp
interface psb_geaxpby

@ -56,11 +56,11 @@ module psi_c_comm_v_mod
type(psb_desc_type), target :: desc_a
integer(psb_ipk_), optional :: data
end subroutine psi_cswapdata_multivect
subroutine psi_cswap_vidx_vect(ctxt,iicomm,flag,beta,y,idx,&
subroutine psi_cswap_vidx_vect(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
import
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: iicomm
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_c_base_vect_type) :: y
@ -69,11 +69,11 @@ module psi_c_comm_v_mod
class(psb_i_base_vect_type), intent(inout) :: idx
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
end subroutine psi_cswap_vidx_vect
subroutine psi_cswap_vidx_multivect(ctxt,iicomm,flag,beta,y,idx,&
subroutine psi_cswap_vidx_multivect(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
import
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: iicomm
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_c_base_multivect_type) :: y
@ -106,11 +106,11 @@ module psi_c_comm_v_mod
type(psb_desc_type), target :: desc_a
integer(psb_ipk_), optional :: data
end subroutine psi_cswaptran_multivect
subroutine psi_ctran_vidx_vect(ctxt,iicomm,flag,beta,y,idx,&
subroutine psi_ctran_vidx_vect(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
import
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: iicomm
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_c_base_vect_type) :: y
@ -119,11 +119,11 @@ module psi_c_comm_v_mod
class(psb_i_base_vect_type), intent(inout) :: idx
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
end subroutine psi_ctran_vidx_vect
subroutine psi_ctran_vidx_multivect(ctxt,iicomm,flag,beta,y,idx,&
subroutine psi_ctran_vidx_multivect(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
import
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: iicomm
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_c_base_multivect_type) :: y

@ -56,11 +56,11 @@ module psi_d_comm_v_mod
type(psb_desc_type), target :: desc_a
integer(psb_ipk_), optional :: data
end subroutine psi_dswapdata_multivect
subroutine psi_dswap_vidx_vect(ctxt,iicomm,flag,beta,y,idx,&
subroutine psi_dswap_vidx_vect(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
import
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: iicomm
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_d_base_vect_type) :: y
@ -69,11 +69,11 @@ module psi_d_comm_v_mod
class(psb_i_base_vect_type), intent(inout) :: idx
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
end subroutine psi_dswap_vidx_vect
subroutine psi_dswap_vidx_multivect(ctxt,iicomm,flag,beta,y,idx,&
subroutine psi_dswap_vidx_multivect(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
import
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: iicomm
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_d_base_multivect_type) :: y
@ -106,11 +106,11 @@ module psi_d_comm_v_mod
type(psb_desc_type), target :: desc_a
integer(psb_ipk_), optional :: data
end subroutine psi_dswaptran_multivect
subroutine psi_dtran_vidx_vect(ctxt,iicomm,flag,beta,y,idx,&
subroutine psi_dtran_vidx_vect(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
import
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: iicomm
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_d_base_vect_type) :: y
@ -119,11 +119,11 @@ module psi_d_comm_v_mod
class(psb_i_base_vect_type), intent(inout) :: idx
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
end subroutine psi_dtran_vidx_vect
subroutine psi_dtran_vidx_multivect(ctxt,iicomm,flag,beta,y,idx,&
subroutine psi_dtran_vidx_multivect(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
import
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: iicomm
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_d_base_multivect_type) :: y

@ -57,11 +57,11 @@ module psi_i_comm_v_mod
type(psb_desc_type), target :: desc_a
integer(psb_ipk_), optional :: data
end subroutine psi_iswapdata_multivect
subroutine psi_iswap_vidx_vect(ctxt,iicomm,flag,beta,y,idx,&
subroutine psi_iswap_vidx_vect(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
import
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: iicomm
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_i_base_vect_type) :: y
@ -70,11 +70,11 @@ module psi_i_comm_v_mod
class(psb_i_base_vect_type), intent(inout) :: idx
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
end subroutine psi_iswap_vidx_vect
subroutine psi_iswap_vidx_multivect(ctxt,iicomm,flag,beta,y,idx,&
subroutine psi_iswap_vidx_multivect(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
import
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: iicomm
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_i_base_multivect_type) :: y
@ -107,11 +107,11 @@ module psi_i_comm_v_mod
type(psb_desc_type), target :: desc_a
integer(psb_ipk_), optional :: data
end subroutine psi_iswaptran_multivect
subroutine psi_itran_vidx_vect(ctxt,iicomm,flag,beta,y,idx,&
subroutine psi_itran_vidx_vect(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
import
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: iicomm
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_i_base_vect_type) :: y
@ -120,11 +120,11 @@ module psi_i_comm_v_mod
class(psb_i_base_vect_type), intent(inout) :: idx
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
end subroutine psi_itran_vidx_vect
subroutine psi_itran_vidx_multivect(ctxt,iicomm,flag,beta,y,idx,&
subroutine psi_itran_vidx_multivect(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
import
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: iicomm
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_i_base_multivect_type) :: y

@ -58,11 +58,11 @@ module psi_l_comm_v_mod
type(psb_desc_type), target :: desc_a
integer(psb_ipk_), optional :: data
end subroutine psi_lswapdata_multivect
subroutine psi_lswap_vidx_vect(ctxt,iicomm,flag,beta,y,idx,&
subroutine psi_lswap_vidx_vect(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
import
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: iicomm
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_l_base_vect_type) :: y
@ -71,11 +71,11 @@ module psi_l_comm_v_mod
class(psb_i_base_vect_type), intent(inout) :: idx
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
end subroutine psi_lswap_vidx_vect
subroutine psi_lswap_vidx_multivect(ctxt,iicomm,flag,beta,y,idx,&
subroutine psi_lswap_vidx_multivect(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
import
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: iicomm
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_l_base_multivect_type) :: y
@ -108,11 +108,11 @@ module psi_l_comm_v_mod
type(psb_desc_type), target :: desc_a
integer(psb_ipk_), optional :: data
end subroutine psi_lswaptran_multivect
subroutine psi_ltran_vidx_vect(ctxt,iicomm,flag,beta,y,idx,&
subroutine psi_ltran_vidx_vect(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
import
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: iicomm
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_l_base_vect_type) :: y
@ -121,11 +121,11 @@ module psi_l_comm_v_mod
class(psb_i_base_vect_type), intent(inout) :: idx
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
end subroutine psi_ltran_vidx_vect
subroutine psi_ltran_vidx_multivect(ctxt,iicomm,flag,beta,y,idx,&
subroutine psi_ltran_vidx_multivect(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
import
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: iicomm
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_l_base_multivect_type) :: y

@ -56,11 +56,11 @@ module psi_s_comm_v_mod
type(psb_desc_type), target :: desc_a
integer(psb_ipk_), optional :: data
end subroutine psi_sswapdata_multivect
subroutine psi_sswap_vidx_vect(ctxt,iicomm,flag,beta,y,idx,&
subroutine psi_sswap_vidx_vect(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
import
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: iicomm
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_s_base_vect_type) :: y
@ -69,11 +69,11 @@ module psi_s_comm_v_mod
class(psb_i_base_vect_type), intent(inout) :: idx
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
end subroutine psi_sswap_vidx_vect
subroutine psi_sswap_vidx_multivect(ctxt,iicomm,flag,beta,y,idx,&
subroutine psi_sswap_vidx_multivect(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
import
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: iicomm
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_s_base_multivect_type) :: y
@ -106,11 +106,11 @@ module psi_s_comm_v_mod
type(psb_desc_type), target :: desc_a
integer(psb_ipk_), optional :: data
end subroutine psi_sswaptran_multivect
subroutine psi_stran_vidx_vect(ctxt,iicomm,flag,beta,y,idx,&
subroutine psi_stran_vidx_vect(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
import
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: iicomm
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_s_base_vect_type) :: y
@ -119,11 +119,11 @@ module psi_s_comm_v_mod
class(psb_i_base_vect_type), intent(inout) :: idx
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
end subroutine psi_stran_vidx_vect
subroutine psi_stran_vidx_multivect(ctxt,iicomm,flag,beta,y,idx,&
subroutine psi_stran_vidx_multivect(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
import
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: iicomm
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_s_base_multivect_type) :: y

@ -56,11 +56,11 @@ module psi_z_comm_v_mod
type(psb_desc_type), target :: desc_a
integer(psb_ipk_), optional :: data
end subroutine psi_zswapdata_multivect
subroutine psi_zswap_vidx_vect(ctxt,iicomm,flag,beta,y,idx,&
subroutine psi_zswap_vidx_vect(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
import
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: iicomm
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_z_base_vect_type) :: y
@ -69,11 +69,11 @@ module psi_z_comm_v_mod
class(psb_i_base_vect_type), intent(inout) :: idx
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
end subroutine psi_zswap_vidx_vect
subroutine psi_zswap_vidx_multivect(ctxt,iicomm,flag,beta,y,idx,&
subroutine psi_zswap_vidx_multivect(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
import
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: iicomm
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_z_base_multivect_type) :: y
@ -106,11 +106,11 @@ module psi_z_comm_v_mod
type(psb_desc_type), target :: desc_a
integer(psb_ipk_), optional :: data
end subroutine psi_zswaptran_multivect
subroutine psi_ztran_vidx_vect(ctxt,iicomm,flag,beta,y,idx,&
subroutine psi_ztran_vidx_vect(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
import
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: iicomm
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_z_base_vect_type) :: y
@ -119,11 +119,11 @@ module psi_z_comm_v_mod
class(psb_i_base_vect_type), intent(inout) :: idx
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
end subroutine psi_ztran_vidx_vect
subroutine psi_ztran_vidx_multivect(ctxt,iicomm,flag,beta,y,idx,&
subroutine psi_ztran_vidx_multivect(ctxt,icomm,flag,beta,y,idx,&
& totxch,totsnd,totrcv,work,info)
import
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_mpk_), intent(in) :: iicomm
integer(psb_mpk_), intent(in) :: icomm
integer(psb_ipk_), intent(in) :: flag
integer(psb_ipk_), intent(out) :: info
class(psb_z_base_multivect_type) :: y

@ -613,8 +613,10 @@ contains
if (allocated(desc%indxmap)) then
val = desc%indxmap%get_ctxt()
else
call psb_errpush(psb_err_invalid_cd_state_,'psb_cd_get_context')
call psb_error()
! At this point, val should a non-ALLOCATED
! ctxt component, which suits us just fine.
!call psb_errpush(psb_err_invalid_cd_state_,'psb_cd_get_context')
!call psb_error()
end if
end function psb_cd_get_context

@ -224,6 +224,7 @@ module psb_indx_map_mod
generic, public :: qry_halo_owner => qry_halo_owner_s, qry_halo_owner_v
procedure, pass(idxmap) :: fnd_owner => psi_indx_map_fnd_owner
procedure, pass(idxmap) :: init_null => base_init_null
procedure, pass(idxmap) :: init_vl => base_init_vl
generic, public :: init => init_vl
@ -242,7 +243,7 @@ module psb_indx_map_mod
& base_ll2gs1, base_ll2gs2, base_ll2gv1, base_ll2gv2,&
& base_lg2ls1, base_lg2ls2, base_lg2lv1, base_lg2lv2,&
& base_lg2ls1_ins, base_lg2ls2_ins, base_lg2lv1_ins,&
& base_lg2lv2_ins, base_init_vl, base_is_null,&
& base_lg2lv2_ins, base_init_vl, base_is_null, base_init_null, &
& base_row_extendable, base_clone, base_cpy, base_reinit, &
& base_set_halo_owner, base_get_halo_owner, &
& base_qry_halo_owner_s, base_qry_halo_owner_v,&
@ -1345,6 +1346,17 @@ contains
end subroutine base_set_null
subroutine base_init_null(idxmap,ctxt,info)
class(psb_indx_map), intent(inout) :: idxmap
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_ipk_), intent(out) :: info
call idxmap%set_null()
idxmap%ctxt = ctxt
info = 0
return
end subroutine base_init_null
subroutine base_init_vl(idxmap,ctxt,vl,info)
use psb_penv_mod
use psb_error_mod

@ -105,8 +105,6 @@ contains
integer(psb_mpk_) :: root_
real(psb_dpk_) :: dat_
integer(psb_mpk_) :: iam, np, info, icomm
integer(psb_ipk_) :: iinfo
#if !defined(SERIAL_MPI)
call psb_info(ctxt,iam,np)

@ -102,8 +102,6 @@ contains
integer(psb_mpk_) :: root_
integer(psb_epk_) :: dat_
integer(psb_mpk_) :: iam, np, info, icomm
integer(psb_ipk_) :: iinfo
#if !defined(SERIAL_MPI)
call psb_info(ctxt,iam,np)

@ -102,8 +102,6 @@ contains
integer(psb_mpk_) :: root_
integer(psb_i2pk_) :: dat_
integer(psb_mpk_) :: iam, np, info, icomm
integer(psb_ipk_) :: iinfo
#if !defined(SERIAL_MPI)
call psb_info(ctxt,iam,np)

@ -102,8 +102,6 @@ contains
integer(psb_mpk_) :: root_
integer(psb_mpk_) :: dat_
integer(psb_mpk_) :: iam, np, info, icomm
integer(psb_ipk_) :: iinfo
#if !defined(SERIAL_MPI)
call psb_info(ctxt,iam,np)

@ -216,10 +216,11 @@ contains
logical, intent(out) :: dat(:)
integer(psb_mpk_), intent(in) :: src
integer(psb_mpk_) :: info
integer(psb_mpk_) :: status(mpi_status_size)
integer(psb_mpk_) :: status(mpi_status_size), icomm
#if defined(SERIAL_MPI)
#else
call mpi_recv(dat,size(dat),mpi_logical,src,psb_logical_tag,ctxt,status,info)
icomm = psb_get_mpi_comm(ctxt)
call mpi_recv(dat,size(dat),mpi_logical,src,psb_logical_tag,icomm,status,info)
call psb_test_nodes(psb_mesg_queue)
#endif

@ -105,8 +105,6 @@ contains
integer(psb_mpk_) :: root_
real(psb_spk_) :: dat_
integer(psb_mpk_) :: iam, np, info, icomm
integer(psb_ipk_) :: iinfo
#if !defined(SERIAL_MPI)
call psb_info(ctxt,iam,np)

@ -110,13 +110,13 @@ module psi_i_mod
end interface
interface psi_bld_glb_dep_list
subroutine psi_i_bld_glb_csr_dep_list(ctxt,loc_dl,length_dl,c_dep_list,dl_ptr,info)
subroutine psi_i_bld_glb_dep_list(ctxt,loc_dl,length_dl,c_dep_list,dl_ptr,info)
import
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_ipk_), intent(in) :: loc_dl(:), length_dl(0:)
integer(psb_ipk_), allocatable, intent(out) :: c_dep_list(:), dl_ptr(:)
integer(psb_ipk_), intent(out) :: info
end subroutine psi_i_bld_glb_csr_dep_list
end subroutine psi_i_bld_glb_dep_list
end interface
interface psi_extract_loc_dl

@ -266,14 +266,21 @@ contains
complex(psb_spk_), intent(in) :: this(:)
class(psb_c_base_vect_type), intent(inout) :: x
integer(psb_ipk_) :: info
integer(psb_ipk_) :: i
call psb_realloc(size(this),x%v,info)
if (info /= 0) then
call psb_errpush(psb_err_alloc_dealloc_,'base_vect_bld')
return
end if
#if defined (OPENMP)
!$omp parallel do private(i)
do i = 1, size(this)
x%v(i) = this(i)
end do
#else
x%v(:) = this(:)
#endif
end subroutine c_base_bld_x
!
@ -403,7 +410,6 @@ contains
case(psb_dupl_ovwrt_)
do i = 1, n
!loop over all val's rows
! row actual block row
if ((1 <= irl(i)).and.(irl(i) <= isz)) then
! this row belongs to me
@ -783,7 +789,7 @@ contains
integer(psb_ipk_) :: info
integer(psb_ipk_), optional :: n
! Local variables
integer(psb_ipk_) :: isz
integer(psb_ipk_) :: isz, i
if (.not.allocated(x%v)) return
if (.not.x%is_host()) call x%sync()
@ -794,7 +800,15 @@ contains
call psb_errpush(psb_err_alloc_dealloc_,'base_get_vect')
return
end if
if (.false.) then
res(1:isz) = x%v(1:isz)
else
!$omp parallel do private(i)
do i=1, isz
res(i) = x%v(i)
end do
end if
end function c_base_get_vect
!
@ -812,7 +826,7 @@ contains
complex(psb_spk_), intent(in) :: val
integer(psb_ipk_), optional :: first, last
integer(psb_ipk_) :: first_, last_
integer(psb_ipk_) :: first_, last_, i
first_=1
last_=size(x%v)
@ -820,7 +834,14 @@ contains
if (present(last)) last_ = min(last,last_)
if (x%is_dev()) call x%sync()
#if defined(OPENMP)
!$omp parallel do private(i)
do i = first_, last_
x%v(i) = val
end do
#else
x%v(first_:last_) = val
#endif
call x%set_host()
end subroutine c_base_set_scal
@ -838,19 +859,27 @@ contains
complex(psb_spk_), intent(in) :: val(:)
integer(psb_ipk_), optional :: first, last
integer(psb_ipk_) :: first_, last_
integer(psb_ipk_) :: first_, last_, i, info
if (.not.allocated(x%v)) then
call psb_realloc(size(val),x%v,info)
end if
first_ = 1
if (present(first)) first_ = max(1,first)
last_ = min(psb_size(x%v),first_+size(val)-1)
if (present(last)) last_ = min(last,last_)
if (allocated(x%v)) then
if (x%is_dev()) call x%sync()
#if defined(OPENMP)
!$omp parallel do private(i)
do i = first_, last_
x%v(i) = val(i-first_+1)
end do
#else
x%v(first_:last_) = val(1:last_-first_+1)
else
x%v = val
end if
#endif
call x%set_host()
end subroutine c_base_set_vect
@ -888,9 +917,18 @@ contains
implicit none
class(psb_c_base_vect_type), intent(inout) :: x
integer(psb_ipk_) :: i
if (allocated(x%v)) then
if (x%is_dev()) call x%sync()
#if defined(OPENMP)
!$omp parallel do private(i)
do i=1, size(x%v)
x%v(i) = abs(x%v(i))
end do
#else
x%v = abs(x%v)
#endif
call x%set_host()
end if
@ -1132,6 +1170,7 @@ contains
info = 0
if (y%is_dev()) call y%sync()
n = min(size(y%v), size(x))
!$omp parallel do private(i)
do i=1, n
y%v(i) = y%v(i)*x(i)
end do
@ -1169,6 +1208,7 @@ contains
if (beta == cone) then
return
else
!$omp parallel do private(i)
do i=1, n
z%v(i) = beta*z%v(i)
end do
@ -1176,42 +1216,51 @@ contains
else
if (alpha == cone) then
if (beta == czero) then
!$omp parallel do private(i)
do i=1, n
z%v(i) = y(i)*x(i)
end do
else if (beta == cone) then
!$omp parallel do private(i)
do i=1, n
z%v(i) = z%v(i) + y(i)*x(i)
end do
else
!$omp parallel do private(i)
do i=1, n
z%v(i) = beta*z%v(i) + y(i)*x(i)
end do
end if
else if (alpha == -cone) then
if (beta == czero) then
!$omp parallel do private(i)
do i=1, n
z%v(i) = -y(i)*x(i)
end do
else if (beta == cone) then
!$omp parallel do private(i)
do i=1, n
z%v(i) = z%v(i) - y(i)*x(i)
end do
else
!$omp parallel do private(i)
do i=1, n
z%v(i) = beta*z%v(i) - y(i)*x(i)
end do
end if
else
if (beta == czero) then
!$omp parallel do private(i)
do i=1, n
z%v(i) = alpha*y(i)*x(i)
end do
else if (beta == cone) then
!$omp parallel do private(i)
do i=1, n
z%v(i) = z%v(i) + alpha*y(i)*x(i)
end do
else
!$omp parallel do private(i)
do i=1, n
z%v(i) = beta*z%v(i) + alpha*y(i)*x(i)
end do
@ -1314,7 +1363,6 @@ contains
if (x%is_dev()) call x%sync()
call x%div(x%v,y%v,info)
end subroutine c_base_div_v
!
!> Function base_div_v2
@ -1358,7 +1406,6 @@ contains
if (x%is_dev()) call x%sync()
call x%div(x%v,y%v,info,flag)
end subroutine c_base_div_v_check
!
!> Function base_div_v2_check
@ -1381,7 +1428,6 @@ contains
if (z%is_dev()) call z%sync()
call z%div(x%v,y%v,info,flag)
end subroutine c_base_div_v2_check
!
!> Function base_div_a2
@ -1403,6 +1449,7 @@ contains
if (z%is_dev()) call z%sync()
n = min(size(y), size(x))
!$omp parallel do private(i)
do i=1, n
z%v(i) = x(i)/y(i)
end do
@ -1433,6 +1480,7 @@ contains
if (z%is_dev()) call z%sync()
n = min(size(y), size(x))
! $omp parallel do private(i)
do i=1, n
if (y(i) /= 0) then
z%v(i) = x(i)/y(i)
@ -1443,7 +1491,6 @@ contains
end do
end if
end subroutine c_base_div_a2_check
!
!> Function base_inv_v
@ -1487,7 +1534,6 @@ contains
if (y%is_dev()) call y%sync()
call y%inv(x%v,info,flag)
end subroutine c_base_inv_v_check
!
!> Function base_inv_a2
@ -1509,6 +1555,7 @@ contains
if (y%is_dev()) call y%sync()
n = size(x)
!$omp parallel do private(i)
do i=1, n
y%v(i) = 1_psb_spk_/x(i)
end do
@ -1539,6 +1586,7 @@ contains
if (y%is_dev()) call y%sync()
n = size(x)
!$omp parallel do private(i)
do i=1, n
if (x(i) /= 0) then
y%v(i) = 1_psb_spk_/x(i)
@ -1573,6 +1621,7 @@ contains
if (z%is_dev()) call z%sync()
n = size(x)
!$omp parallel do private(i)
do i = 1, n, 1
if ( abs(x(i)).ge.c ) then
z%v(i) = 1_psb_spk_
@ -1618,12 +1667,19 @@ contains
implicit none
class(psb_c_base_vect_type), intent(inout) :: x
complex(psb_spk_), intent (in) :: alpha
integer(psb_ipk_) :: i
if (allocated(x%v)) then
#if defined(OPENMP)
!$omp parallel do private(i)
do i=1,size(x%v)
x%v(i) = alpha*x%v(i)
end do
#else
x%v = alpha*x%v
call x%set_host()
#endif
end if
call x%set_host()
end subroutine c_base_scal
!
@ -1655,10 +1711,18 @@ contains
class(psb_c_base_vect_type), intent(inout) :: x
integer(psb_ipk_), intent(in) :: n
real(psb_spk_) :: res
integer(psb_ipk_) :: i
if (x%is_dev()) call x%sync()
#if defined(OPENMP)
res = szero
!$omp parallel do private(i) reduction(max: res)
do i=1, n
res = max(res,abs(x%v(i)))
end do
#else
res = maxval(abs(x%v(1:n)))
#endif
end function c_base_amax
@ -1672,10 +1736,18 @@ contains
class(psb_c_base_vect_type), intent(inout) :: x
integer(psb_ipk_), intent(in) :: n
real(psb_spk_) :: res
integer(psb_ipk_) :: i
if (x%is_dev()) call x%sync()
#if defined(OPENMP)
res=szero
!$omp parallel do private(i) reduction(+: res)
do i= 1, size(x%v)
res = res + abs(x%v(i))
end do
#else
res = sum(abs(x%v(1:n)))
#endif
end function c_base_asum
@ -1882,11 +1954,15 @@ contains
integer(psb_ipk_) :: i, n
if (z%is_dev()) call z%sync()
#if defined(OPENMP)
n = size(x)
do i = 1, n, 1
!$omp parallel do private(i)
do i = 1, n
z%v(i) = x(i) + b
end do
#else
z%v = x + b
#endif
info = 0
end subroutine c_base_addconst_a2
@ -1914,9 +1990,6 @@ contains
end module psb_c_base_vect_mod
module psb_c_base_multivect_mod
use psb_const_mod

@ -128,6 +128,7 @@ module psb_c_mat_mod
! Memory/data management
procedure, pass(a) :: csall => psb_c_csall
generic, public :: allocate => csall
procedure, pass(a) :: free => psb_c_free
procedure, pass(a) :: trim => psb_c_trim
procedure, pass(a) :: csput_a => psb_c_csput_a
@ -326,6 +327,7 @@ module psb_c_mat_mod
! Memory/data management
procedure, pass(a) :: csall => psb_lc_csall
generic, public :: allocate => csall
procedure, pass(a) :: free => psb_lc_free
procedure, pass(a) :: trim => psb_lc_trim
procedure, pass(a) :: csput_a => psb_lc_csput_a
@ -604,12 +606,14 @@ module psb_c_mat_mod
end interface
interface
subroutine psb_c_csall(nr,nc,a,info,nz)
import :: psb_ipk_, psb_lpk_, psb_cspmat_type
subroutine psb_c_csall(nr,nc,a,info,nz,type,mold)
import :: psb_ipk_, psb_lpk_, psb_cspmat_type, psb_c_base_sparse_mat
class(psb_cspmat_type), intent(inout) :: a
integer(psb_ipk_), intent(in) :: nr,nc
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: nz
character(len=*), intent(in), optional :: type
class(psb_c_base_sparse_mat), optional, intent(in) :: mold
end subroutine psb_c_csall
end interface
@ -1384,12 +1388,14 @@ module psb_c_mat_mod
end interface
interface
subroutine psb_lc_csall(nr,nc,a,info,nz)
import :: psb_ipk_, psb_lpk_, psb_lcspmat_type
subroutine psb_lc_csall(nr,nc,a,info,nz,type,mold)
import :: psb_ipk_, psb_lpk_, psb_lcspmat_type, psb_lc_base_sparse_mat
class(psb_lcspmat_type), intent(inout) :: a
integer(psb_lpk_), intent(in) :: nr,nc
integer(psb_ipk_), intent(out) :: info
integer(psb_lpk_), intent(in), optional :: nz
character(len=*), intent(in), optional :: type
class(psb_lc_base_sparse_mat), optional, intent(in) :: mold
end subroutine psb_lc_csall
end interface

@ -273,14 +273,21 @@ contains
real(psb_dpk_), intent(in) :: this(:)
class(psb_d_base_vect_type), intent(inout) :: x
integer(psb_ipk_) :: info
integer(psb_ipk_) :: i
call psb_realloc(size(this),x%v,info)
if (info /= 0) then
call psb_errpush(psb_err_alloc_dealloc_,'base_vect_bld')
return
end if
#if defined (OPENMP)
!$omp parallel do private(i)
do i = 1, size(this)
x%v(i) = this(i)
end do
#else
x%v(:) = this(:)
#endif
end subroutine d_base_bld_x
!
@ -410,7 +417,6 @@ contains
case(psb_dupl_ovwrt_)
do i = 1, n
!loop over all val's rows
! row actual block row
if ((1 <= irl(i)).and.(irl(i) <= isz)) then
! this row belongs to me
@ -790,7 +796,7 @@ contains
integer(psb_ipk_) :: info
integer(psb_ipk_), optional :: n
! Local variables
integer(psb_ipk_) :: isz
integer(psb_ipk_) :: isz, i
if (.not.allocated(x%v)) return
if (.not.x%is_host()) call x%sync()
@ -801,7 +807,15 @@ contains
call psb_errpush(psb_err_alloc_dealloc_,'base_get_vect')
return
end if
if (.false.) then
res(1:isz) = x%v(1:isz)
else
!$omp parallel do private(i)
do i=1, isz
res(i) = x%v(i)
end do
end if
end function d_base_get_vect
!
@ -819,7 +833,7 @@ contains
real(psb_dpk_), intent(in) :: val
integer(psb_ipk_), optional :: first, last
integer(psb_ipk_) :: first_, last_
integer(psb_ipk_) :: first_, last_, i
first_=1
last_=size(x%v)
@ -827,7 +841,14 @@ contains
if (present(last)) last_ = min(last,last_)
if (x%is_dev()) call x%sync()
#if defined(OPENMP)
!$omp parallel do private(i)
do i = first_, last_
x%v(i) = val
end do
#else
x%v(first_:last_) = val
#endif
call x%set_host()
end subroutine d_base_set_scal
@ -845,19 +866,27 @@ contains
real(psb_dpk_), intent(in) :: val(:)
integer(psb_ipk_), optional :: first, last
integer(psb_ipk_) :: first_, last_
integer(psb_ipk_) :: first_, last_, i, info
if (.not.allocated(x%v)) then
call psb_realloc(size(val),x%v,info)
end if
first_ = 1
if (present(first)) first_ = max(1,first)
last_ = min(psb_size(x%v),first_+size(val)-1)
if (present(last)) last_ = min(last,last_)
if (allocated(x%v)) then
if (x%is_dev()) call x%sync()
#if defined(OPENMP)
!$omp parallel do private(i)
do i = first_, last_
x%v(i) = val(i-first_+1)
end do
#else
x%v(first_:last_) = val(1:last_-first_+1)
else
x%v = val
end if
#endif
call x%set_host()
end subroutine d_base_set_vect
@ -895,9 +924,18 @@ contains
implicit none
class(psb_d_base_vect_type), intent(inout) :: x
integer(psb_ipk_) :: i
if (allocated(x%v)) then
if (x%is_dev()) call x%sync()
#if defined(OPENMP)
!$omp parallel do private(i)
do i=1, size(x%v)
x%v(i) = abs(x%v(i))
end do
#else
x%v = abs(x%v)
#endif
call x%set_host()
end if
@ -1139,6 +1177,7 @@ contains
info = 0
if (y%is_dev()) call y%sync()
n = min(size(y%v), size(x))
!$omp parallel do private(i)
do i=1, n
y%v(i) = y%v(i)*x(i)
end do
@ -1176,6 +1215,7 @@ contains
if (beta == done) then
return
else
!$omp parallel do private(i)
do i=1, n
z%v(i) = beta*z%v(i)
end do
@ -1183,42 +1223,51 @@ contains
else
if (alpha == done) then
if (beta == dzero) then
!$omp parallel do private(i)
do i=1, n
z%v(i) = y(i)*x(i)
end do
else if (beta == done) then
!$omp parallel do private(i)
do i=1, n
z%v(i) = z%v(i) + y(i)*x(i)
end do
else
!$omp parallel do private(i)
do i=1, n
z%v(i) = beta*z%v(i) + y(i)*x(i)
end do
end if
else if (alpha == -done) then
if (beta == dzero) then
!$omp parallel do private(i)
do i=1, n
z%v(i) = -y(i)*x(i)
end do
else if (beta == done) then
!$omp parallel do private(i)
do i=1, n
z%v(i) = z%v(i) - y(i)*x(i)
end do
else
!$omp parallel do private(i)
do i=1, n
z%v(i) = beta*z%v(i) - y(i)*x(i)
end do
end if
else
if (beta == dzero) then
!$omp parallel do private(i)
do i=1, n
z%v(i) = alpha*y(i)*x(i)
end do
else if (beta == done) then
!$omp parallel do private(i)
do i=1, n
z%v(i) = z%v(i) + alpha*y(i)*x(i)
end do
else
!$omp parallel do private(i)
do i=1, n
z%v(i) = beta*z%v(i) + alpha*y(i)*x(i)
end do
@ -1321,7 +1370,6 @@ contains
if (x%is_dev()) call x%sync()
call x%div(x%v,y%v,info)
end subroutine d_base_div_v
!
!> Function base_div_v2
@ -1365,7 +1413,6 @@ contains
if (x%is_dev()) call x%sync()
call x%div(x%v,y%v,info,flag)
end subroutine d_base_div_v_check
!
!> Function base_div_v2_check
@ -1388,7 +1435,6 @@ contains
if (z%is_dev()) call z%sync()
call z%div(x%v,y%v,info,flag)
end subroutine d_base_div_v2_check
!
!> Function base_div_a2
@ -1410,6 +1456,7 @@ contains
if (z%is_dev()) call z%sync()
n = min(size(y), size(x))
!$omp parallel do private(i)
do i=1, n
z%v(i) = x(i)/y(i)
end do
@ -1440,6 +1487,7 @@ contains
if (z%is_dev()) call z%sync()
n = min(size(y), size(x))
! $omp parallel do private(i)
do i=1, n
if (y(i) /= 0) then
z%v(i) = x(i)/y(i)
@ -1450,7 +1498,6 @@ contains
end do
end if
end subroutine d_base_div_a2_check
!
!> Function base_inv_v
@ -1494,7 +1541,6 @@ contains
if (y%is_dev()) call y%sync()
call y%inv(x%v,info,flag)
end subroutine d_base_inv_v_check
!
!> Function base_inv_a2
@ -1516,6 +1562,7 @@ contains
if (y%is_dev()) call y%sync()
n = size(x)
!$omp parallel do private(i)
do i=1, n
y%v(i) = 1_psb_dpk_/x(i)
end do
@ -1546,6 +1593,7 @@ contains
if (y%is_dev()) call y%sync()
n = size(x)
!$omp parallel do private(i)
do i=1, n
if (x(i) /= 0) then
y%v(i) = 1_psb_dpk_/x(i)
@ -1580,6 +1628,7 @@ contains
if (z%is_dev()) call z%sync()
n = size(x)
!$omp parallel do private(i)
do i = 1, n, 1
if ( abs(x(i)).ge.c ) then
z%v(i) = 1_psb_dpk_
@ -1625,12 +1674,19 @@ contains
implicit none
class(psb_d_base_vect_type), intent(inout) :: x
real(psb_dpk_), intent (in) :: alpha
integer(psb_ipk_) :: i
if (allocated(x%v)) then
#if defined(OPENMP)
!$omp parallel do private(i)
do i=1,size(x%v)
x%v(i) = alpha*x%v(i)
end do
#else
x%v = alpha*x%v
call x%set_host()
#endif
end if
call x%set_host()
end subroutine d_base_scal
!
@ -1662,10 +1718,18 @@ contains
class(psb_d_base_vect_type), intent(inout) :: x
integer(psb_ipk_), intent(in) :: n
real(psb_dpk_) :: res
integer(psb_ipk_) :: i
if (x%is_dev()) call x%sync()
#if defined(OPENMP)
res = dzero
!$omp parallel do private(i) reduction(max: res)
do i=1, n
res = max(res,abs(x%v(i)))
end do
#else
res = maxval(abs(x%v(1:n)))
#endif
end function d_base_amax
!
@ -1678,10 +1742,18 @@ contains
class(psb_d_base_vect_type), intent(inout) :: x
integer(psb_ipk_), intent(in) :: n
real(psb_dpk_) :: res
integer(psb_ipk_) :: i
if (x%is_dev()) call x%sync()
#if defined(OPENMP)
res = HUGE(done)
!$omp parallel do private(i) reduction(min: res)
do i=1, n
res = min(res,abs(x%v(i)))
end do
#else
res = minval(x%v(1:n))
#endif
end function d_base_min
!
@ -1730,10 +1802,11 @@ contains
z = huge(z)
n = min(size(y), size(x%v))
!$omp parallel do private(i,temp) reduction(min: z)
do i=1, n
if ( y(i) /= dzero ) then
temp = x%v(i)/y(i)
if (temp <= z) z = temp
z = min(z,temp)
end if
end do
@ -1750,10 +1823,18 @@ contains
class(psb_d_base_vect_type), intent(inout) :: x
integer(psb_ipk_), intent(in) :: n
real(psb_dpk_) :: res
integer(psb_ipk_) :: i
if (x%is_dev()) call x%sync()
#if defined(OPENMP)
res=dzero
!$omp parallel do private(i) reduction(+: res)
do i= 1, size(x%v)
res = res + abs(x%v(i))
end do
#else
res = sum(abs(x%v(1:n)))
#endif
end function d_base_asum
@ -2052,11 +2133,15 @@ contains
integer(psb_ipk_) :: i, n
if (z%is_dev()) call z%sync()
#if defined(OPENMP)
n = size(x)
do i = 1, n, 1
!$omp parallel do private(i)
do i = 1, n
z%v(i) = x(i) + b
end do
#else
z%v = x + b
#endif
info = 0
end subroutine d_base_addconst_a2
@ -2084,9 +2169,6 @@ contains
end module psb_d_base_vect_mod
module psb_d_base_multivect_mod
use psb_const_mod

@ -128,6 +128,7 @@ module psb_d_mat_mod
! Memory/data management
procedure, pass(a) :: csall => psb_d_csall
generic, public :: allocate => csall
procedure, pass(a) :: free => psb_d_free
procedure, pass(a) :: trim => psb_d_trim
procedure, pass(a) :: csput_a => psb_d_csput_a
@ -326,6 +327,7 @@ module psb_d_mat_mod
! Memory/data management
procedure, pass(a) :: csall => psb_ld_csall
generic, public :: allocate => csall
procedure, pass(a) :: free => psb_ld_free
procedure, pass(a) :: trim => psb_ld_trim
procedure, pass(a) :: csput_a => psb_ld_csput_a
@ -604,12 +606,14 @@ module psb_d_mat_mod
end interface
interface
subroutine psb_d_csall(nr,nc,a,info,nz)
import :: psb_ipk_, psb_lpk_, psb_dspmat_type
subroutine psb_d_csall(nr,nc,a,info,nz,type,mold)
import :: psb_ipk_, psb_lpk_, psb_dspmat_type, psb_d_base_sparse_mat
class(psb_dspmat_type), intent(inout) :: a
integer(psb_ipk_), intent(in) :: nr,nc
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: nz
character(len=*), intent(in), optional :: type
class(psb_d_base_sparse_mat), optional, intent(in) :: mold
end subroutine psb_d_csall
end interface
@ -1384,12 +1388,14 @@ module psb_d_mat_mod
end interface
interface
subroutine psb_ld_csall(nr,nc,a,info,nz)
import :: psb_ipk_, psb_lpk_, psb_ldspmat_type
subroutine psb_ld_csall(nr,nc,a,info,nz,type,mold)
import :: psb_ipk_, psb_lpk_, psb_ldspmat_type, psb_ld_base_sparse_mat
class(psb_ldspmat_type), intent(inout) :: a
integer(psb_lpk_), intent(in) :: nr,nc
integer(psb_ipk_), intent(out) :: info
integer(psb_lpk_), intent(in), optional :: nz
character(len=*), intent(in), optional :: type
class(psb_ld_base_sparse_mat), optional, intent(in) :: mold
end subroutine psb_ld_csall
end interface

@ -202,14 +202,21 @@ contains
integer(psb_ipk_), intent(in) :: this(:)
class(psb_i_base_vect_type), intent(inout) :: x
integer(psb_ipk_) :: info
integer(psb_ipk_) :: i
call psb_realloc(size(this),x%v,info)
if (info /= 0) then
call psb_errpush(psb_err_alloc_dealloc_,'base_vect_bld')
return
end if
#if defined (OPENMP)
!$omp parallel do private(i)
do i = 1, size(this)
x%v(i) = this(i)
end do
#else
x%v(:) = this(:)
#endif
end subroutine i_base_bld_x
!
@ -339,7 +346,6 @@ contains
case(psb_dupl_ovwrt_)
do i = 1, n
!loop over all val's rows
! row actual block row
if ((1 <= irl(i)).and.(irl(i) <= isz)) then
! this row belongs to me
@ -719,7 +725,7 @@ contains
integer(psb_ipk_) :: info
integer(psb_ipk_), optional :: n
! Local variables
integer(psb_ipk_) :: isz
integer(psb_ipk_) :: isz, i
if (.not.allocated(x%v)) return
if (.not.x%is_host()) call x%sync()
@ -730,7 +736,15 @@ contains
call psb_errpush(psb_err_alloc_dealloc_,'base_get_vect')
return
end if
if (.false.) then
res(1:isz) = x%v(1:isz)
else
!$omp parallel do private(i)
do i=1, isz
res(i) = x%v(i)
end do
end if
end function i_base_get_vect
!
@ -748,7 +762,7 @@ contains
integer(psb_ipk_), intent(in) :: val
integer(psb_ipk_), optional :: first, last
integer(psb_ipk_) :: first_, last_
integer(psb_ipk_) :: first_, last_, i
first_=1
last_=size(x%v)
@ -756,7 +770,14 @@ contains
if (present(last)) last_ = min(last,last_)
if (x%is_dev()) call x%sync()
#if defined(OPENMP)
!$omp parallel do private(i)
do i = first_, last_
x%v(i) = val
end do
#else
x%v(first_:last_) = val
#endif
call x%set_host()
end subroutine i_base_set_scal
@ -774,19 +795,27 @@ contains
integer(psb_ipk_), intent(in) :: val(:)
integer(psb_ipk_), optional :: first, last
integer(psb_ipk_) :: first_, last_
integer(psb_ipk_) :: first_, last_, i, info
if (.not.allocated(x%v)) then
call psb_realloc(size(val),x%v,info)
end if
first_ = 1
if (present(first)) first_ = max(1,first)
last_ = min(psb_size(x%v),first_+size(val)-1)
if (present(last)) last_ = min(last,last_)
if (allocated(x%v)) then
if (x%is_dev()) call x%sync()
#if defined(OPENMP)
!$omp parallel do private(i)
do i = first_, last_
x%v(i) = val(i-first_+1)
end do
#else
x%v(first_:last_) = val(1:last_-first_+1)
else
x%v = val
end if
#endif
call x%set_host()
end subroutine i_base_set_vect
@ -980,9 +1009,6 @@ contains
end module psb_i_base_vect_mod
module psb_i_base_multivect_mod
use psb_const_mod

@ -203,14 +203,21 @@ contains
integer(psb_lpk_), intent(in) :: this(:)
class(psb_l_base_vect_type), intent(inout) :: x
integer(psb_ipk_) :: info
integer(psb_ipk_) :: i
call psb_realloc(size(this),x%v,info)
if (info /= 0) then
call psb_errpush(psb_err_alloc_dealloc_,'base_vect_bld')
return
end if
#if defined (OPENMP)
!$omp parallel do private(i)
do i = 1, size(this)
x%v(i) = this(i)
end do
#else
x%v(:) = this(:)
#endif
end subroutine l_base_bld_x
!
@ -340,7 +347,6 @@ contains
case(psb_dupl_ovwrt_)
do i = 1, n
!loop over all val's rows
! row actual block row
if ((1 <= irl(i)).and.(irl(i) <= isz)) then
! this row belongs to me
@ -720,7 +726,7 @@ contains
integer(psb_ipk_) :: info
integer(psb_ipk_), optional :: n
! Local variables
integer(psb_ipk_) :: isz
integer(psb_ipk_) :: isz, i
if (.not.allocated(x%v)) return
if (.not.x%is_host()) call x%sync()
@ -731,7 +737,15 @@ contains
call psb_errpush(psb_err_alloc_dealloc_,'base_get_vect')
return
end if
if (.false.) then
res(1:isz) = x%v(1:isz)
else
!$omp parallel do private(i)
do i=1, isz
res(i) = x%v(i)
end do
end if
end function l_base_get_vect
!
@ -749,7 +763,7 @@ contains
integer(psb_lpk_), intent(in) :: val
integer(psb_ipk_), optional :: first, last
integer(psb_ipk_) :: first_, last_
integer(psb_ipk_) :: first_, last_, i
first_=1
last_=size(x%v)
@ -757,7 +771,14 @@ contains
if (present(last)) last_ = min(last,last_)
if (x%is_dev()) call x%sync()
#if defined(OPENMP)
!$omp parallel do private(i)
do i = first_, last_
x%v(i) = val
end do
#else
x%v(first_:last_) = val
#endif
call x%set_host()
end subroutine l_base_set_scal
@ -775,19 +796,27 @@ contains
integer(psb_lpk_), intent(in) :: val(:)
integer(psb_ipk_), optional :: first, last
integer(psb_ipk_) :: first_, last_
integer(psb_ipk_) :: first_, last_, i, info
if (.not.allocated(x%v)) then
call psb_realloc(size(val),x%v,info)
end if
first_ = 1
if (present(first)) first_ = max(1,first)
last_ = min(psb_size(x%v),first_+size(val)-1)
if (present(last)) last_ = min(last,last_)
if (allocated(x%v)) then
if (x%is_dev()) call x%sync()
#if defined(OPENMP)
!$omp parallel do private(i)
do i = first_, last_
x%v(i) = val(i-first_+1)
end do
#else
x%v(first_:last_) = val(1:last_-first_+1)
else
x%v = val
end if
#endif
call x%set_host()
end subroutine l_base_set_vect
@ -981,9 +1010,6 @@ contains
end module psb_l_base_vect_mod
module psb_l_base_multivect_mod
use psb_const_mod

@ -273,14 +273,21 @@ contains
real(psb_spk_), intent(in) :: this(:)
class(psb_s_base_vect_type), intent(inout) :: x
integer(psb_ipk_) :: info
integer(psb_ipk_) :: i
call psb_realloc(size(this),x%v,info)
if (info /= 0) then
call psb_errpush(psb_err_alloc_dealloc_,'base_vect_bld')
return
end if
#if defined (OPENMP)
!$omp parallel do private(i)
do i = 1, size(this)
x%v(i) = this(i)
end do
#else
x%v(:) = this(:)
#endif
end subroutine s_base_bld_x
!
@ -410,7 +417,6 @@ contains
case(psb_dupl_ovwrt_)
do i = 1, n
!loop over all val's rows
! row actual block row
if ((1 <= irl(i)).and.(irl(i) <= isz)) then
! this row belongs to me
@ -790,7 +796,7 @@ contains
integer(psb_ipk_) :: info
integer(psb_ipk_), optional :: n
! Local variables
integer(psb_ipk_) :: isz
integer(psb_ipk_) :: isz, i
if (.not.allocated(x%v)) return
if (.not.x%is_host()) call x%sync()
@ -801,7 +807,15 @@ contains
call psb_errpush(psb_err_alloc_dealloc_,'base_get_vect')
return
end if
if (.false.) then
res(1:isz) = x%v(1:isz)
else
!$omp parallel do private(i)
do i=1, isz
res(i) = x%v(i)
end do
end if
end function s_base_get_vect
!
@ -819,7 +833,7 @@ contains
real(psb_spk_), intent(in) :: val
integer(psb_ipk_), optional :: first, last
integer(psb_ipk_) :: first_, last_
integer(psb_ipk_) :: first_, last_, i
first_=1
last_=size(x%v)
@ -827,7 +841,14 @@ contains
if (present(last)) last_ = min(last,last_)
if (x%is_dev()) call x%sync()
#if defined(OPENMP)
!$omp parallel do private(i)
do i = first_, last_
x%v(i) = val
end do
#else
x%v(first_:last_) = val
#endif
call x%set_host()
end subroutine s_base_set_scal
@ -845,19 +866,27 @@ contains
real(psb_spk_), intent(in) :: val(:)
integer(psb_ipk_), optional :: first, last
integer(psb_ipk_) :: first_, last_
integer(psb_ipk_) :: first_, last_, i, info
if (.not.allocated(x%v)) then
call psb_realloc(size(val),x%v,info)
end if
first_ = 1
if (present(first)) first_ = max(1,first)
last_ = min(psb_size(x%v),first_+size(val)-1)
if (present(last)) last_ = min(last,last_)
if (allocated(x%v)) then
if (x%is_dev()) call x%sync()
#if defined(OPENMP)
!$omp parallel do private(i)
do i = first_, last_
x%v(i) = val(i-first_+1)
end do
#else
x%v(first_:last_) = val(1:last_-first_+1)
else
x%v = val
end if
#endif
call x%set_host()
end subroutine s_base_set_vect
@ -895,9 +924,18 @@ contains
implicit none
class(psb_s_base_vect_type), intent(inout) :: x
integer(psb_ipk_) :: i
if (allocated(x%v)) then
if (x%is_dev()) call x%sync()
#if defined(OPENMP)
!$omp parallel do private(i)
do i=1, size(x%v)
x%v(i) = abs(x%v(i))
end do
#else
x%v = abs(x%v)
#endif
call x%set_host()
end if
@ -1139,6 +1177,7 @@ contains
info = 0
if (y%is_dev()) call y%sync()
n = min(size(y%v), size(x))
!$omp parallel do private(i)
do i=1, n
y%v(i) = y%v(i)*x(i)
end do
@ -1176,6 +1215,7 @@ contains
if (beta == sone) then
return
else
!$omp parallel do private(i)
do i=1, n
z%v(i) = beta*z%v(i)
end do
@ -1183,42 +1223,51 @@ contains
else
if (alpha == sone) then
if (beta == szero) then
!$omp parallel do private(i)
do i=1, n
z%v(i) = y(i)*x(i)
end do
else if (beta == sone) then
!$omp parallel do private(i)
do i=1, n
z%v(i) = z%v(i) + y(i)*x(i)
end do
else
!$omp parallel do private(i)
do i=1, n
z%v(i) = beta*z%v(i) + y(i)*x(i)
end do
end if
else if (alpha == -sone) then
if (beta == szero) then
!$omp parallel do private(i)
do i=1, n
z%v(i) = -y(i)*x(i)
end do
else if (beta == sone) then
!$omp parallel do private(i)
do i=1, n
z%v(i) = z%v(i) - y(i)*x(i)
end do
else
!$omp parallel do private(i)
do i=1, n
z%v(i) = beta*z%v(i) - y(i)*x(i)
end do
end if
else
if (beta == szero) then
!$omp parallel do private(i)
do i=1, n
z%v(i) = alpha*y(i)*x(i)
end do
else if (beta == sone) then
!$omp parallel do private(i)
do i=1, n
z%v(i) = z%v(i) + alpha*y(i)*x(i)
end do
else
!$omp parallel do private(i)
do i=1, n
z%v(i) = beta*z%v(i) + alpha*y(i)*x(i)
end do
@ -1321,7 +1370,6 @@ contains
if (x%is_dev()) call x%sync()
call x%div(x%v,y%v,info)
end subroutine s_base_div_v
!
!> Function base_div_v2
@ -1365,7 +1413,6 @@ contains
if (x%is_dev()) call x%sync()
call x%div(x%v,y%v,info,flag)
end subroutine s_base_div_v_check
!
!> Function base_div_v2_check
@ -1388,7 +1435,6 @@ contains
if (z%is_dev()) call z%sync()
call z%div(x%v,y%v,info,flag)
end subroutine s_base_div_v2_check
!
!> Function base_div_a2
@ -1410,6 +1456,7 @@ contains
if (z%is_dev()) call z%sync()
n = min(size(y), size(x))
!$omp parallel do private(i)
do i=1, n
z%v(i) = x(i)/y(i)
end do
@ -1440,6 +1487,7 @@ contains
if (z%is_dev()) call z%sync()
n = min(size(y), size(x))
! $omp parallel do private(i)
do i=1, n
if (y(i) /= 0) then
z%v(i) = x(i)/y(i)
@ -1450,7 +1498,6 @@ contains
end do
end if
end subroutine s_base_div_a2_check
!
!> Function base_inv_v
@ -1494,7 +1541,6 @@ contains
if (y%is_dev()) call y%sync()
call y%inv(x%v,info,flag)
end subroutine s_base_inv_v_check
!
!> Function base_inv_a2
@ -1516,6 +1562,7 @@ contains
if (y%is_dev()) call y%sync()
n = size(x)
!$omp parallel do private(i)
do i=1, n
y%v(i) = 1_psb_spk_/x(i)
end do
@ -1546,6 +1593,7 @@ contains
if (y%is_dev()) call y%sync()
n = size(x)
!$omp parallel do private(i)
do i=1, n
if (x(i) /= 0) then
y%v(i) = 1_psb_spk_/x(i)
@ -1580,6 +1628,7 @@ contains
if (z%is_dev()) call z%sync()
n = size(x)
!$omp parallel do private(i)
do i = 1, n, 1
if ( abs(x(i)).ge.c ) then
z%v(i) = 1_psb_spk_
@ -1625,12 +1674,19 @@ contains
implicit none
class(psb_s_base_vect_type), intent(inout) :: x
real(psb_spk_), intent (in) :: alpha
integer(psb_ipk_) :: i
if (allocated(x%v)) then
#if defined(OPENMP)
!$omp parallel do private(i)
do i=1,size(x%v)
x%v(i) = alpha*x%v(i)
end do
#else
x%v = alpha*x%v
call x%set_host()
#endif
end if
call x%set_host()
end subroutine s_base_scal
!
@ -1662,10 +1718,18 @@ contains
class(psb_s_base_vect_type), intent(inout) :: x
integer(psb_ipk_), intent(in) :: n
real(psb_spk_) :: res
integer(psb_ipk_) :: i
if (x%is_dev()) call x%sync()
#if defined(OPENMP)
res = szero
!$omp parallel do private(i) reduction(max: res)
do i=1, n
res = max(res,abs(x%v(i)))
end do
#else
res = maxval(abs(x%v(1:n)))
#endif
end function s_base_amax
!
@ -1678,10 +1742,18 @@ contains
class(psb_s_base_vect_type), intent(inout) :: x
integer(psb_ipk_), intent(in) :: n
real(psb_spk_) :: res
integer(psb_ipk_) :: i
if (x%is_dev()) call x%sync()
#if defined(OPENMP)
res = HUGE(sone)
!$omp parallel do private(i) reduction(min: res)
do i=1, n
res = min(res,abs(x%v(i)))
end do
#else
res = minval(x%v(1:n))
#endif
end function s_base_min
!
@ -1730,10 +1802,11 @@ contains
z = huge(z)
n = min(size(y), size(x%v))
!$omp parallel do private(i,temp) reduction(min: z)
do i=1, n
if ( y(i) /= szero ) then
temp = x%v(i)/y(i)
if (temp <= z) z = temp
z = min(z,temp)
end if
end do
@ -1750,10 +1823,18 @@ contains
class(psb_s_base_vect_type), intent(inout) :: x
integer(psb_ipk_), intent(in) :: n
real(psb_spk_) :: res
integer(psb_ipk_) :: i
if (x%is_dev()) call x%sync()
#if defined(OPENMP)
res=szero
!$omp parallel do private(i) reduction(+: res)
do i= 1, size(x%v)
res = res + abs(x%v(i))
end do
#else
res = sum(abs(x%v(1:n)))
#endif
end function s_base_asum
@ -2052,11 +2133,15 @@ contains
integer(psb_ipk_) :: i, n
if (z%is_dev()) call z%sync()
#if defined(OPENMP)
n = size(x)
do i = 1, n, 1
!$omp parallel do private(i)
do i = 1, n
z%v(i) = x(i) + b
end do
#else
z%v = x + b
#endif
info = 0
end subroutine s_base_addconst_a2
@ -2084,9 +2169,6 @@ contains
end module psb_s_base_vect_mod
module psb_s_base_multivect_mod
use psb_const_mod

@ -128,6 +128,7 @@ module psb_s_mat_mod
! Memory/data management
procedure, pass(a) :: csall => psb_s_csall
generic, public :: allocate => csall
procedure, pass(a) :: free => psb_s_free
procedure, pass(a) :: trim => psb_s_trim
procedure, pass(a) :: csput_a => psb_s_csput_a
@ -326,6 +327,7 @@ module psb_s_mat_mod
! Memory/data management
procedure, pass(a) :: csall => psb_ls_csall
generic, public :: allocate => csall
procedure, pass(a) :: free => psb_ls_free
procedure, pass(a) :: trim => psb_ls_trim
procedure, pass(a) :: csput_a => psb_ls_csput_a
@ -604,12 +606,14 @@ module psb_s_mat_mod
end interface
interface
subroutine psb_s_csall(nr,nc,a,info,nz)
import :: psb_ipk_, psb_lpk_, psb_sspmat_type
subroutine psb_s_csall(nr,nc,a,info,nz,type,mold)
import :: psb_ipk_, psb_lpk_, psb_sspmat_type, psb_s_base_sparse_mat
class(psb_sspmat_type), intent(inout) :: a
integer(psb_ipk_), intent(in) :: nr,nc
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: nz
character(len=*), intent(in), optional :: type
class(psb_s_base_sparse_mat), optional, intent(in) :: mold
end subroutine psb_s_csall
end interface
@ -1384,12 +1388,14 @@ module psb_s_mat_mod
end interface
interface
subroutine psb_ls_csall(nr,nc,a,info,nz)
import :: psb_ipk_, psb_lpk_, psb_lsspmat_type
subroutine psb_ls_csall(nr,nc,a,info,nz,type,mold)
import :: psb_ipk_, psb_lpk_, psb_lsspmat_type, psb_ls_base_sparse_mat
class(psb_lsspmat_type), intent(inout) :: a
integer(psb_lpk_), intent(in) :: nr,nc
integer(psb_ipk_), intent(out) :: info
integer(psb_lpk_), intent(in), optional :: nz
character(len=*), intent(in), optional :: type
class(psb_ls_base_sparse_mat), optional, intent(in) :: mold
end subroutine psb_ls_csall
end interface

@ -66,6 +66,39 @@ module psb_serial_mod
real(psb_dpk_), intent (in) :: alpha, beta
integer(psb_ipk_), intent(out) :: info
end subroutine psb_d_nspaxpby
subroutine psb_s_nspaxpby(nz,iz,z,alpha, nx, ix, x, beta, ny,iy,y,info)
use psb_const_mod
integer(psb_ipk_), intent(out) :: nz
integer(psb_ipk_), intent(out) :: iz(:)
real(psb_spk_), intent (out) :: z(:)
integer(psb_ipk_), intent(in) :: nx, ny
integer(psb_ipk_), intent(in) :: ix(:), iy(:)
real(psb_spk_), intent (in) :: x(:), y(:)
real(psb_spk_), intent (in) :: alpha, beta
integer(psb_ipk_), intent(out) :: info
end subroutine psb_s_nspaxpby
subroutine psb_c_nspaxpby(nz,iz,z,alpha, nx, ix, x, beta, ny,iy,y,info)
use psb_const_mod
integer(psb_ipk_), intent(out) :: nz
integer(psb_ipk_), intent(out) :: iz(:)
complex(psb_spk_), intent (out) :: z(:)
integer(psb_ipk_), intent(in) :: nx, ny
integer(psb_ipk_), intent(in) :: ix(:), iy(:)
complex(psb_spk_), intent (in) :: x(:), y(:)
complex(psb_spk_), intent (in) :: alpha, beta
integer(psb_ipk_), intent(out) :: info
end subroutine psb_c_nspaxpby
subroutine psb_z_nspaxpby(nz,iz,z,alpha, nx, ix, x, beta, ny,iy,y,info)
use psb_const_mod
integer(psb_ipk_), intent(out) :: nz
integer(psb_ipk_), intent(out) :: iz(:)
complex(psb_dpk_), intent (out) :: z(:)
integer(psb_ipk_), intent(in) :: nx, ny
integer(psb_ipk_), intent(in) :: ix(:), iy(:)
complex(psb_dpk_), intent (in) :: x(:), y(:)
complex(psb_dpk_), intent (in) :: alpha, beta
integer(psb_ipk_), intent(out) :: info
end subroutine psb_z_nspaxpby
end interface psb_nspaxpby
interface
@ -374,4 +407,3 @@ contains
end module psb_serial_mod

@ -266,14 +266,21 @@ contains
complex(psb_dpk_), intent(in) :: this(:)
class(psb_z_base_vect_type), intent(inout) :: x
integer(psb_ipk_) :: info
integer(psb_ipk_) :: i
call psb_realloc(size(this),x%v,info)
if (info /= 0) then
call psb_errpush(psb_err_alloc_dealloc_,'base_vect_bld')
return
end if
#if defined (OPENMP)
!$omp parallel do private(i)
do i = 1, size(this)
x%v(i) = this(i)
end do
#else
x%v(:) = this(:)
#endif
end subroutine z_base_bld_x
!
@ -403,7 +410,6 @@ contains
case(psb_dupl_ovwrt_)
do i = 1, n
!loop over all val's rows
! row actual block row
if ((1 <= irl(i)).and.(irl(i) <= isz)) then
! this row belongs to me
@ -783,7 +789,7 @@ contains
integer(psb_ipk_) :: info
integer(psb_ipk_), optional :: n
! Local variables
integer(psb_ipk_) :: isz
integer(psb_ipk_) :: isz, i
if (.not.allocated(x%v)) return
if (.not.x%is_host()) call x%sync()
@ -794,7 +800,15 @@ contains
call psb_errpush(psb_err_alloc_dealloc_,'base_get_vect')
return
end if
if (.false.) then
res(1:isz) = x%v(1:isz)
else
!$omp parallel do private(i)
do i=1, isz
res(i) = x%v(i)
end do
end if
end function z_base_get_vect
!
@ -812,7 +826,7 @@ contains
complex(psb_dpk_), intent(in) :: val
integer(psb_ipk_), optional :: first, last
integer(psb_ipk_) :: first_, last_
integer(psb_ipk_) :: first_, last_, i
first_=1
last_=size(x%v)
@ -820,7 +834,14 @@ contains
if (present(last)) last_ = min(last,last_)
if (x%is_dev()) call x%sync()
#if defined(OPENMP)
!$omp parallel do private(i)
do i = first_, last_
x%v(i) = val
end do
#else
x%v(first_:last_) = val
#endif
call x%set_host()
end subroutine z_base_set_scal
@ -838,19 +859,27 @@ contains
complex(psb_dpk_), intent(in) :: val(:)
integer(psb_ipk_), optional :: first, last
integer(psb_ipk_) :: first_, last_
integer(psb_ipk_) :: first_, last_, i, info
if (.not.allocated(x%v)) then
call psb_realloc(size(val),x%v,info)
end if
first_ = 1
if (present(first)) first_ = max(1,first)
last_ = min(psb_size(x%v),first_+size(val)-1)
if (present(last)) last_ = min(last,last_)
if (allocated(x%v)) then
if (x%is_dev()) call x%sync()
#if defined(OPENMP)
!$omp parallel do private(i)
do i = first_, last_
x%v(i) = val(i-first_+1)
end do
#else
x%v(first_:last_) = val(1:last_-first_+1)
else
x%v = val
end if
#endif
call x%set_host()
end subroutine z_base_set_vect
@ -888,9 +917,18 @@ contains
implicit none
class(psb_z_base_vect_type), intent(inout) :: x
integer(psb_ipk_) :: i
if (allocated(x%v)) then
if (x%is_dev()) call x%sync()
#if defined(OPENMP)
!$omp parallel do private(i)
do i=1, size(x%v)
x%v(i) = abs(x%v(i))
end do
#else
x%v = abs(x%v)
#endif
call x%set_host()
end if
@ -1132,6 +1170,7 @@ contains
info = 0
if (y%is_dev()) call y%sync()
n = min(size(y%v), size(x))
!$omp parallel do private(i)
do i=1, n
y%v(i) = y%v(i)*x(i)
end do
@ -1169,6 +1208,7 @@ contains
if (beta == zone) then
return
else
!$omp parallel do private(i)
do i=1, n
z%v(i) = beta*z%v(i)
end do
@ -1176,42 +1216,51 @@ contains
else
if (alpha == zone) then
if (beta == zzero) then
!$omp parallel do private(i)
do i=1, n
z%v(i) = y(i)*x(i)
end do
else if (beta == zone) then
!$omp parallel do private(i)
do i=1, n
z%v(i) = z%v(i) + y(i)*x(i)
end do
else
!$omp parallel do private(i)
do i=1, n
z%v(i) = beta*z%v(i) + y(i)*x(i)
end do
end if
else if (alpha == -zone) then
if (beta == zzero) then
!$omp parallel do private(i)
do i=1, n
z%v(i) = -y(i)*x(i)
end do
else if (beta == zone) then
!$omp parallel do private(i)
do i=1, n
z%v(i) = z%v(i) - y(i)*x(i)
end do
else
!$omp parallel do private(i)
do i=1, n
z%v(i) = beta*z%v(i) - y(i)*x(i)
end do
end if
else
if (beta == zzero) then
!$omp parallel do private(i)
do i=1, n
z%v(i) = alpha*y(i)*x(i)
end do
else if (beta == zone) then
!$omp parallel do private(i)
do i=1, n
z%v(i) = z%v(i) + alpha*y(i)*x(i)
end do
else
!$omp parallel do private(i)
do i=1, n
z%v(i) = beta*z%v(i) + alpha*y(i)*x(i)
end do
@ -1314,7 +1363,6 @@ contains
if (x%is_dev()) call x%sync()
call x%div(x%v,y%v,info)
end subroutine z_base_div_v
!
!> Function base_div_v2
@ -1358,7 +1406,6 @@ contains
if (x%is_dev()) call x%sync()
call x%div(x%v,y%v,info,flag)
end subroutine z_base_div_v_check
!
!> Function base_div_v2_check
@ -1381,7 +1428,6 @@ contains
if (z%is_dev()) call z%sync()
call z%div(x%v,y%v,info,flag)
end subroutine z_base_div_v2_check
!
!> Function base_div_a2
@ -1403,6 +1449,7 @@ contains
if (z%is_dev()) call z%sync()
n = min(size(y), size(x))
!$omp parallel do private(i)
do i=1, n
z%v(i) = x(i)/y(i)
end do
@ -1433,6 +1480,7 @@ contains
if (z%is_dev()) call z%sync()
n = min(size(y), size(x))
! $omp parallel do private(i)
do i=1, n
if (y(i) /= 0) then
z%v(i) = x(i)/y(i)
@ -1443,7 +1491,6 @@ contains
end do
end if
end subroutine z_base_div_a2_check
!
!> Function base_inv_v
@ -1487,7 +1534,6 @@ contains
if (y%is_dev()) call y%sync()
call y%inv(x%v,info,flag)
end subroutine z_base_inv_v_check
!
!> Function base_inv_a2
@ -1509,6 +1555,7 @@ contains
if (y%is_dev()) call y%sync()
n = size(x)
!$omp parallel do private(i)
do i=1, n
y%v(i) = 1_psb_dpk_/x(i)
end do
@ -1539,6 +1586,7 @@ contains
if (y%is_dev()) call y%sync()
n = size(x)
!$omp parallel do private(i)
do i=1, n
if (x(i) /= 0) then
y%v(i) = 1_psb_dpk_/x(i)
@ -1573,6 +1621,7 @@ contains
if (z%is_dev()) call z%sync()
n = size(x)
!$omp parallel do private(i)
do i = 1, n, 1
if ( abs(x(i)).ge.c ) then
z%v(i) = 1_psb_dpk_
@ -1618,12 +1667,19 @@ contains
implicit none
class(psb_z_base_vect_type), intent(inout) :: x
complex(psb_dpk_), intent (in) :: alpha
integer(psb_ipk_) :: i
if (allocated(x%v)) then
#if defined(OPENMP)
!$omp parallel do private(i)
do i=1,size(x%v)
x%v(i) = alpha*x%v(i)
end do
#else
x%v = alpha*x%v
call x%set_host()
#endif
end if
call x%set_host()
end subroutine z_base_scal
!
@ -1655,10 +1711,18 @@ contains
class(psb_z_base_vect_type), intent(inout) :: x
integer(psb_ipk_), intent(in) :: n
real(psb_dpk_) :: res
integer(psb_ipk_) :: i
if (x%is_dev()) call x%sync()
#if defined(OPENMP)
res = dzero
!$omp parallel do private(i) reduction(max: res)
do i=1, n
res = max(res,abs(x%v(i)))
end do
#else
res = maxval(abs(x%v(1:n)))
#endif
end function z_base_amax
@ -1672,10 +1736,18 @@ contains
class(psb_z_base_vect_type), intent(inout) :: x
integer(psb_ipk_), intent(in) :: n
real(psb_dpk_) :: res
integer(psb_ipk_) :: i
if (x%is_dev()) call x%sync()
#if defined(OPENMP)
res=dzero
!$omp parallel do private(i) reduction(+: res)
do i= 1, size(x%v)
res = res + abs(x%v(i))
end do
#else
res = sum(abs(x%v(1:n)))
#endif
end function z_base_asum
@ -1882,11 +1954,15 @@ contains
integer(psb_ipk_) :: i, n
if (z%is_dev()) call z%sync()
#if defined(OPENMP)
n = size(x)
do i = 1, n, 1
!$omp parallel do private(i)
do i = 1, n
z%v(i) = x(i) + b
end do
#else
z%v = x + b
#endif
info = 0
end subroutine z_base_addconst_a2
@ -1914,9 +1990,6 @@ contains
end module psb_z_base_vect_mod
module psb_z_base_multivect_mod
use psb_const_mod

@ -128,6 +128,7 @@ module psb_z_mat_mod
! Memory/data management
procedure, pass(a) :: csall => psb_z_csall
generic, public :: allocate => csall
procedure, pass(a) :: free => psb_z_free
procedure, pass(a) :: trim => psb_z_trim
procedure, pass(a) :: csput_a => psb_z_csput_a
@ -326,6 +327,7 @@ module psb_z_mat_mod
! Memory/data management
procedure, pass(a) :: csall => psb_lz_csall
generic, public :: allocate => csall
procedure, pass(a) :: free => psb_lz_free
procedure, pass(a) :: trim => psb_lz_trim
procedure, pass(a) :: csput_a => psb_lz_csput_a
@ -604,12 +606,14 @@ module psb_z_mat_mod
end interface
interface
subroutine psb_z_csall(nr,nc,a,info,nz)
import :: psb_ipk_, psb_lpk_, psb_zspmat_type
subroutine psb_z_csall(nr,nc,a,info,nz,type,mold)
import :: psb_ipk_, psb_lpk_, psb_zspmat_type, psb_z_base_sparse_mat
class(psb_zspmat_type), intent(inout) :: a
integer(psb_ipk_), intent(in) :: nr,nc
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: nz
character(len=*), intent(in), optional :: type
class(psb_z_base_sparse_mat), optional, intent(in) :: mold
end subroutine psb_z_csall
end interface
@ -1384,12 +1388,14 @@ module psb_z_mat_mod
end interface
interface
subroutine psb_lz_csall(nr,nc,a,info,nz)
import :: psb_ipk_, psb_lpk_, psb_lzspmat_type
subroutine psb_lz_csall(nr,nc,a,info,nz,type,mold)
import :: psb_ipk_, psb_lpk_, psb_lzspmat_type, psb_lz_base_sparse_mat
class(psb_lzspmat_type), intent(inout) :: a
integer(psb_lpk_), intent(in) :: nr,nc
integer(psb_ipk_), intent(out) :: info
integer(psb_lpk_), intent(in), optional :: nz
character(len=*), intent(in), optional :: type
class(psb_lz_base_sparse_mat), optional, intent(in) :: mold
end subroutine psb_lz_csall
end interface

@ -431,5 +431,21 @@ Module psb_c_tools_mod
end function
end interface
interface psb_remap
subroutine psb_c_remap(np_remap, desc_in, a_in, &
& ipd, isrc, nrsrc, naggr, desc_out, a_out, info)
import
implicit none
!....parameters...
integer(psb_ipk_), intent(in) :: np_remap
type(psb_desc_type), intent(inout) :: desc_in
type(psb_cspmat_type), intent(inout) :: a_in
type(psb_cspmat_type), intent(out) :: a_out
type(psb_desc_type), intent(out) :: desc_out
integer(psb_ipk_), intent(out) :: ipd
integer(psb_ipk_), allocatable, intent(out) :: isrc(:), nrsrc(:), naggr(:)
integer(psb_ipk_), intent(out) :: info
end subroutine psb_c_remap
end interface psb_remap
end module psb_c_tools_mod

@ -431,5 +431,21 @@ Module psb_d_tools_mod
end function
end interface
interface psb_remap
subroutine psb_d_remap(np_remap, desc_in, a_in, &
& ipd, isrc, nrsrc, naggr, desc_out, a_out, info)
import
implicit none
!....parameters...
integer(psb_ipk_), intent(in) :: np_remap
type(psb_desc_type), intent(inout) :: desc_in
type(psb_dspmat_type), intent(inout) :: a_in
type(psb_dspmat_type), intent(out) :: a_out
type(psb_desc_type), intent(out) :: desc_out
integer(psb_ipk_), intent(out) :: ipd
integer(psb_ipk_), allocatable, intent(out) :: isrc(:), nrsrc(:), naggr(:)
integer(psb_ipk_), intent(out) :: info
end subroutine psb_d_remap
end interface psb_remap
end module psb_d_tools_mod

@ -170,5 +170,4 @@ Module psb_i_tools_mod
end subroutine psb_iins_multivect
end interface
end module psb_i_tools_mod

@ -170,5 +170,4 @@ Module psb_l_tools_mod
end subroutine psb_lins_multivect
end interface
end module psb_l_tools_mod

@ -431,5 +431,21 @@ Module psb_s_tools_mod
end function
end interface
interface psb_remap
subroutine psb_s_remap(np_remap, desc_in, a_in, &
& ipd, isrc, nrsrc, naggr, desc_out, a_out, info)
import
implicit none
!....parameters...
integer(psb_ipk_), intent(in) :: np_remap
type(psb_desc_type), intent(inout) :: desc_in
type(psb_sspmat_type), intent(inout) :: a_in
type(psb_sspmat_type), intent(out) :: a_out
type(psb_desc_type), intent(out) :: desc_out
integer(psb_ipk_), intent(out) :: ipd
integer(psb_ipk_), allocatable, intent(out) :: isrc(:), nrsrc(:), naggr(:)
integer(psb_ipk_), intent(out) :: info
end subroutine psb_s_remap
end interface psb_remap
end module psb_s_tools_mod

@ -431,5 +431,21 @@ Module psb_z_tools_mod
end function
end interface
interface psb_remap
subroutine psb_z_remap(np_remap, desc_in, a_in, &
& ipd, isrc, nrsrc, naggr, desc_out, a_out, info)
import
implicit none
!....parameters...
integer(psb_ipk_), intent(in) :: np_remap
type(psb_desc_type), intent(inout) :: desc_in
type(psb_zspmat_type), intent(inout) :: a_in
type(psb_zspmat_type), intent(out) :: a_out
type(psb_desc_type), intent(out) :: desc_out
integer(psb_ipk_), intent(out) :: ipd
integer(psb_ipk_), allocatable, intent(out) :: isrc(:), nrsrc(:), naggr(:)
integer(psb_ipk_), intent(out) :: info
end subroutine psb_z_remap
end interface psb_remap
end module psb_z_tools_mod

@ -37,9 +37,13 @@
function psb_cget_nnz(a,desc_a,info) result(res)
use psb_base_mod, psb_protect_name => psb_cget_nnz
use psi_mod
#ifdef MPI_MOD
use mpi
#endif
implicit none
#ifdef MPI_H
include 'mpif.h'
#endif
integer(psb_lpk_) :: res
type(psb_cspmat_type), intent(in) :: a

@ -37,9 +37,13 @@
function psb_dget_nnz(a,desc_a,info) result(res)
use psb_base_mod, psb_protect_name => psb_dget_nnz
use psi_mod
#ifdef MPI_MOD
use mpi
#endif
implicit none
#ifdef MPI_H
include 'mpif.h'
#endif
integer(psb_lpk_) :: res
type(psb_dspmat_type), intent(in) :: a

@ -37,9 +37,13 @@
function psb_sget_nnz(a,desc_a,info) result(res)
use psb_base_mod, psb_protect_name => psb_sget_nnz
use psi_mod
#ifdef MPI_MOD
use mpi
#endif
implicit none
#ifdef MPI_H
include 'mpif.h'
#endif
integer(psb_lpk_) :: res
type(psb_sspmat_type), intent(in) :: a

@ -37,9 +37,13 @@
function psb_zget_nnz(a,desc_a,info) result(res)
use psb_base_mod, psb_protect_name => psb_zget_nnz
use psi_mod
#ifdef MPI_MOD
use mpi
#endif
implicit none
#ifdef MPI_H
include 'mpif.h'
#endif
integer(psb_lpk_) :: res
type(psb_zspmat_type), intent(in) :: a

@ -11,10 +11,10 @@ FOBJS = psb_lsame.o psi_m_serial_impl.o psi_e_serial_impl.o \
smmp.o lsmmp.o \
psb_sgeprt.o psb_dgeprt.o psb_cgeprt.o psb_zgeprt.o\
psb_spdot_srtd.o psb_aspxpby.o psb_spge_dot.o\
psb_sgelp.o psb_dgelp.o psb_cgelp.o psb_zgelp.o \
psb_samax_s.o psb_damax_s.o psb_camax_s.o psb_zamax_s.o \
psb_sasum_s.o psb_dasum_s.o psb_casum_s.o psb_zasum_s.o
LIBDIR=..
INCDIR=..
MODDIR=../modules

@ -250,7 +250,6 @@ subroutine psb_c_base_mv_from_coo(a,b,info)
end subroutine psb_c_base_mv_from_coo
subroutine psb_c_base_mv_to_fmt(a,b,info)
use psb_c_base_mat_mod, psb_protect_name => psb_c_base_mv_to_fmt
use psb_error_mod
@ -698,6 +697,8 @@ subroutine psb_c_base_tril(a,l,info,&
call psb_realloc(max(mb,nb),ia,info)
call psb_realloc(max(mb,nb),ja,info)
call psb_realloc(max(mb,nb),val,info)
! Implementing this in OpenMP?
! Tricky, to be seen
do i=imin_,imax_, nbk
ibk = min(nbk,imax_-i+1)
call a%csget(i,i+ibk-1,nzout,ia,ja,val,info,&
@ -849,6 +850,8 @@ subroutine psb_c_base_triu(a,u,info,&
call psb_realloc(max(mb,nb),ia,info)
call psb_realloc(max(mb,nb),ja,info)
call psb_realloc(max(mb,nb),val,info)
! Implementing this in OpenMP?
! Tricky, to be seen
do i=imin_,imax_, nbk
ibk = min(nbk,imax_-i+1)
call a%csget(i,i+ibk-1,nzout,ia,ja,val,info,&
@ -914,8 +917,6 @@ subroutine psb_c_base_triu(a,u,info,&
end subroutine psb_c_base_triu
subroutine psb_c_base_clone(a,b,info)
use psb_c_base_mat_mod, psb_protect_name => psb_c_base_clone
use psb_error_mod
@ -960,6 +961,7 @@ subroutine psb_c_base_make_nonunit(a)
mnm = min(m,n)
nz = tmp%get_nzeros()
call tmp%reallocate(nz+mnm)
!$omp parallel do private(i) shared(nz)
do i=1, mnm
tmp%val(nz+i) = cone
tmp%ia(nz+i) = i
@ -1506,6 +1508,7 @@ contains
complex(psb_spk_), intent(out) :: y(*)
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1,n
y(i) = d(i)*x(i)
end do
@ -1519,6 +1522,7 @@ contains
complex(psb_spk_), intent(inout) :: x(*)
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1,n
x(i) = d(i)*x(i)
end do
@ -3182,6 +3186,8 @@ subroutine psb_lc_base_tril(a,l,info,&
call psb_realloc(max(mb,nb),ia,info)
call psb_realloc(max(mb,nb),ja,info)
call psb_realloc(max(mb,nb),val,info)
! Implementing this in OpenMP?
! Tricky, to be seen
do i=imin_,imax_, nbk
ibk = min(nbk,imax_-i+1)
call a%csget(i,i+ibk-1,nzout,ia,ja,val,info,&
@ -3334,6 +3340,8 @@ subroutine psb_lc_base_triu(a,u,info,&
call psb_realloc(max(mb,nb),ia,info)
call psb_realloc(max(mb,nb),ja,info)
call psb_realloc(max(mb,nb),val,info)
! Implementing this in OpenMP?
! Tricky, to be seen
do i=imin_,imax_, nbk
ibk = min(nbk,imax_-i+1)
call a%csget(i,i+ibk-1,nzout,ia,ja,val,info,&
@ -3446,6 +3454,7 @@ subroutine psb_lc_base_make_nonunit(a)
mnm = min(m,n)
nz = tmp%get_nzeros()
call tmp%reallocate(nz+mnm)
!$omp parallel do private(i) shared(nz)
do i=1, mnm
tmp%val(nz+i) = cone
tmp%ia(nz+i) = i

@ -114,6 +114,7 @@ subroutine psb_c_coo_scal(d,a,info,side)
goto 9999
end if
!$omp parallel do private(i,j)
do i=1,a%get_nzeros()
j = a%ia(i)
a%val(i) = a%val(i) * d(j)
@ -126,6 +127,7 @@ subroutine psb_c_coo_scal(d,a,info,side)
goto 9999
end if
!$omp parallel do private(i,j)
do i=1,a%get_nzeros()
j = a%ja(i)
a%val(i) = a%val(i) * d(j)
@ -201,6 +203,7 @@ subroutine psb_c_coo_scalplusidentity(d,a,info)
end if
mnm = min(a%get_nrows(),a%get_ncols())
!$omp parallel do private(i,j)
do i=1,a%get_nzeros()
a%val(i) = a%val(i) * d
j=a%ia(i)
@ -253,12 +256,30 @@ subroutine psb_c_coo_spaxpby(alpha,a,beta,b,info)
! Allocate (temporary) space for the solution
call tcoo%allocate(M,N,(nza+nzb))
! Compute the sum
#if defined (OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, nza
tcoo%ia(i) = a%ia(i)
tcoo%ja(i) = a%ja(i)
tcoo%val(i) = alpha*a%val(i)
end do
!$omp parallel do private(i)
do i=1, nzb
tcoo%ia(nza+i) = bcoo%ia(i)
tcoo%ja(nza+i) = bcoo%ja(i)
tcoo%val(nza+i) = beta*bcoo%val(i)
end do
end block
#else
tcoo%ia(1:nza) = a%ia(1:nza)
tcoo%ja(1:nza) = a%ja(1:nza)
tcoo%val(1:nza) = alpha*a%val(1:nza)
tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb)
tcoo%ja(nza+1:nza+nzb) = bcoo%ja(1:nzb)
tcoo%val(nza+1:nza+nzb) = beta*bcoo%val(1:nzb)
#endif
! Fix the indexes
call tcoo%fix(info)
! Move to correct output format
@ -346,12 +367,30 @@ function psb_c_coo_cmpmat(a,b,tol,info) result(res)
! Allocate (temporary) space for the solution
call tcoo%allocate(M,N,(nza+nzb))
! Compute the sum
#if defined (OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, nza
tcoo%ia(i) = a%ia(i)
tcoo%ja(i) = a%ja(i)
tcoo%val(i) = alpha*a%val(i)
end do
!$omp parallel do private(i)
do i=1, nzb
tcoo%ia(nza+i) = bcoo%ia(i)
tcoo%ja(nza+i) = bcoo%ja(i)
tcoo%val(nza+i) = (-sone)*beta*bcoo%val(i)
end do
end block
#else
tcoo%ia(1:nza) = a%ia(1:nza)
tcoo%ja(1:nza) = a%ja(1:nza)
tcoo%val(1:nza) = a%val(1:nza)
tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb)
tcoo%ja(nza+1:nza+nzb) = bcoo%ja(1:nzb)
tcoo%val(nza+1:nza+nzb) = (-sone)*bcoo%val(1:nzb)
#endif
! Fix the indexes
call tcoo%fix(info)
if (info /= psb_success_) then
@ -728,9 +767,6 @@ subroutine psb_c_coo_print(iout,a,iv,head,ivr,ivc)
end subroutine psb_c_coo_print
function psb_c_coo_get_nz_row(idx,a) result(res)
use psb_const_mod
use psb_sort_mod
@ -1670,7 +1706,6 @@ subroutine psb_c_coo_csmv(alpha,a,x,beta,y,info,trans)
end subroutine psb_c_coo_csmv
subroutine psb_c_coo_csmm(alpha,a,x,beta,y,info,trans)
use psb_const_mod
use psb_error_mod
@ -1709,11 +1744,9 @@ subroutine psb_c_coo_csmm(alpha,a,x,beta,y,info,trans)
trans_ = 'N'
end if
tra = (psb_toupper(trans_) == 'T')
ctra = (psb_toupper(trans_) == 'C')
if (tra.or.ctra) then
m = a%get_ncols()
n = a%get_nrows()
@ -1895,7 +1928,15 @@ function psb_c_coo_maxval(a) result(res)
nnz = a%get_nzeros()
if (allocated(a%val)) then
nnz = min(nnz,size(a%val))
#if defined(OPENMP)
res = szero
!$omp parallel do private(i) reduction(max: res)
do i=1, nnz
res = max(res,abs(a%val(i)))
end do
#else
res = maxval(abs(a%val(1:nnz)))
#endif
end if
end function psb_c_coo_maxval
@ -2275,11 +2316,13 @@ subroutine psb_c_coo_csgetptn(imin,imax,a,nz,ia,ja,info,&
& iren)
if (rscale_) then
!$omp parallel do private(i)
do i=nzin_+1, nzin_+nz
ia(i) = ia(i) - imin + 1
end do
end if
if (cscale_) then
!$omp parallel do private(i)
do i=nzin_+1, nzin_+nz
ja(i) = ja(i) - jmin_ + 1
end do
@ -2553,11 +2596,13 @@ subroutine psb_c_coo_csgetrow(imin,imax,a,nz,ia,ja,val,info,&
& iren)
if (rscale_) then
!$omp parallel do private(i)
do i=nzin_+1, nzin_+nz
ia(i) = ia(i) - imin + 1
end do
end if
if (cscale_) then
!$omp parallel do private(i)
do i=nzin_+1, nzin_+nz
ja(i) = ja(i) - jmin_ + 1
end do
@ -2768,7 +2813,6 @@ contains
end subroutine psb_c_coo_csgetrow
subroutine psb_c_coo_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info)
use psb_error_mod
use psb_realloc_mod
@ -3021,7 +3065,6 @@ contains
end subroutine psb_c_coo_csput_a
subroutine psb_c_cp_coo_to_coo(a,b,info)
use psb_error_mod
use psb_c_base_mat_mod, psb_protect_name => psb_c_cp_coo_to_coo
@ -3045,10 +3088,21 @@ subroutine psb_c_cp_coo_to_coo(a,b,info)
call b%set_nzeros(nz)
call b%reallocate(nz)
#if defined(OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, nz
b%ia(i) = a%ia(i)
b%ja(i) = a%ja(i)
b%val(i) = a%val(i)
end do
end block
#else
b%ia(1:nz) = a%ia(1:nz)
b%ja(1:nz) = a%ja(1:nz)
b%val(1:nz) = a%val(1:nz)
#endif
call b%set_host()
if (.not.b%is_by_rows()) call b%fix(info)
@ -3087,10 +3141,21 @@ subroutine psb_c_cp_coo_from_coo(a,b,info)
call a%set_nzeros(nz)
call a%reallocate(nz)
#if defined(OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, nz
a%ia(i) = b%ia(i)
a%ja(i) = b%ja(i)
a%val(i) = b%val(i)
end do
end block
#else
a%ia(1:nz) = b%ia(1:nz)
a%ja(1:nz) = b%ja(1:nz)
a%val(1:nz) = b%val(1:nz)
#endif
call a%set_host()
if (.not.a%is_by_rows()) call a%fix(info)
@ -3445,8 +3510,6 @@ subroutine psb_c_fix_coo(a,info,idir)
end subroutine psb_c_fix_coo
subroutine psb_c_fix_coo_inner(nr,nc,nzin,dupl,ia,ja,val,nzout,info,idir)
use psb_const_mod
use psb_error_mod
@ -4174,7 +4237,6 @@ subroutine psb_c_fix_coo_inner(nr,nc,nzin,dupl,ia,ja,val,nzout,info,idir)
end subroutine psb_c_fix_coo_inner
subroutine psb_c_cp_coo_to_lcoo(a,b,info)
use psb_error_mod
use psb_c_base_mat_mod, psb_protect_name => psb_c_cp_coo_to_lcoo
@ -4199,10 +4261,21 @@ subroutine psb_c_cp_coo_to_lcoo(a,b,info)
call b%set_nzeros(nz)
call b%reallocate(nz)
#if defined(OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, nz
b%ia(i) = a%ia(i)
b%ja(i) = a%ja(i)
b%val(i) = a%val(i)
end do
end block
#else
b%ia(1:nz) = a%ia(1:nz)
b%ja(1:nz) = a%ja(1:nz)
b%val(1:nz) = a%val(1:nz)
#endif
call b%set_host()
if (.not.b%is_by_rows()) call b%fix(info)
@ -4240,10 +4313,21 @@ subroutine psb_c_cp_coo_from_lcoo(a,b,info)
call a%set_nzeros(nz)
call a%reallocate(nz)
#if defined(OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, nz
a%ia(i) = b%ia(i)
a%ja(i) = b%ja(i)
a%val(i) = b%val(i)
end do
end block
#else
a%ia(1:nz) = b%ia(1:nz)
a%ja(1:nz) = b%ja(1:nz)
a%val(1:nz) = b%val(1:nz)
#endif
call a%set_host()
if (.not.a%is_by_rows()) call a%fix(info)
@ -4442,7 +4526,17 @@ function psb_lc_coo_maxval(a) result(res)
nnz = a%get_nzeros()
if (allocated(a%val)) then
nnz = min(nnz,size(a%val))
#if defined(OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, nnz
res = max(res,abs(a%val(i)))
end do
end block
#else
res = maxval(abs(a%val(1:nnz)))
#endif
end if
end function psb_lc_coo_maxval
@ -4499,7 +4593,17 @@ function psb_lc_coo_csnmi(a) result(res)
i = a%ia(j)
vt(i) = vt(i) + abs(a%val(j))
end do
#if defined(OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, m
res = max(res,abs(vt(i)))
end do
end block
#else
res = maxval(vt(1:m))
#endif
deallocate(vt,stat=info)
end if
@ -4539,7 +4643,17 @@ function psb_lc_coo_csnm1(a) result(res)
i = a%ja(j)
vt(i) = vt(i) + abs(a%val(j))
end do
#if defined(OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, n
res = max(res,abs(vt(i)))
end do
end block
#else
res = maxval(vt(1:n))
#endif
deallocate(vt,stat=info)
return
@ -4584,7 +4698,6 @@ subroutine psb_lc_coo_rowsum(d,a)
d(i) = d(i) + a%val(j)
end do
return
call psb_erractionrestore(err_act)
return
@ -4592,7 +4705,6 @@ subroutine psb_lc_coo_rowsum(d,a)
9999 call psb_error_handler(err_act)
return
end subroutine psb_lc_coo_rowsum
subroutine psb_lc_coo_arwsum(d,a)
@ -4761,6 +4873,7 @@ subroutine psb_lc_coo_scalplusidentity(d,a,info)
end if
mnm = min(a%get_nrows(),a%get_ncols())
!$omp parallel do private(i,j)
do i=1,a%get_nzeros()
a%val(i) = a%val(i) * d
j=a%ia(i)
@ -4813,12 +4926,30 @@ subroutine psb_lc_coo_spaxpby(alpha,a,beta,b,info)
! Allocate (temporary) space for the solution
call tcoo%allocate(M,N,(nza+nzb))
! Compute the sum
#if defined(OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, nza
tcoo%ia(i) = a%ia(i)
tcoo%ja(i) = a%ja(i)
tcoo%val(i) = alpha*a%val(i)
end do
!$omp parallel do private(i)
do i=1, nzb
tcoo%ia(nza+i) = bcoo%ia(i)
tcoo%ja(nza+i) = bcoo%ja(i)
tcoo%val(nza+i) = beta*bcoo%val(i)
end do
end block
#else
tcoo%ia(1:nza) = a%ia(1:nza)
tcoo%ja(1:nza) = a%ja(1:nza)
tcoo%val(1:nza) = alpha*a%val(1:nza)
tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb)
tcoo%ja(nza+1:nza+nzb) = bcoo%ja(1:nzb)
tcoo%val(nza+1:nza+nzb) = beta*bcoo%val(1:nzb)
#endif
! Fix the indexes
call tcoo%fix(info)
! Move to correct output format
@ -4906,12 +5037,30 @@ function psb_lc_coo_cmpmat(a,b,tol,info) result(res)
! Allocate (temporary) space for the solution
call tcoo%allocate(M,N,(nza+nzb))
! Compute the sum
#if defined(OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, nza
tcoo%ia(i) = a%ia(i)
tcoo%ja(i) = a%ja(i)
tcoo%val(i) = a%val(i)
end do
!$omp parallel do private(i)
do i=1, nzb
tcoo%ia(nza+i) = bcoo%ia(i)
tcoo%ja(nza+i) = bcoo%ja(i)
tcoo%val(nza+i) = (-1_psb_spk_)*bcoo%val(i)
end do
end block
#else
tcoo%ia(1:nza) = a%ia(1:nza)
tcoo%ja(1:nza) = a%ja(1:nza)
tcoo%val(1:nza) = a%val(1:nza)
tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb)
tcoo%ja(nza+1:nza+nzb) = bcoo%ja(1:nzb)
tcoo%val(nza+1:nza+nzb) = (-1_psb_spk_)*bcoo%val(1:nzb)
#endif
! Fix the indexes
call tcoo%fix(info)
if (info /= psb_success_) then
@ -5950,7 +6099,7 @@ subroutine psb_lc_coo_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info)
if (nz < 0) then
info = psb_err_iarg_neg_
call psb_errpush(info,name,i_err=(/1_psb_ipk_/))
3 call psb_errpush(info,name,i_err=(/1_psb_ipk_/))
goto 9999
end if
if (size(ia) < nz) then

@ -130,10 +130,12 @@ contains
if (alpha == czero) then
if (beta == czero) then
!$omp parallel do private(i)
do i = 1, m
y(i) = czero
enddo
else
!$omp parallel do private(i)
do i = 1, m
y(i) = beta*y(i)
end do
@ -147,6 +149,7 @@ contains
if (beta == czero) then
if (alpha == cone) then
!$omp parallel do private(i,j, acc) schedule(static)
do i=1,m
acc = czero
do j=irp(i), irp(i+1)-1
@ -157,6 +160,7 @@ contains
else if (alpha == -cone) then
!$omp parallel do private(i,j, acc)
do i=1,m
acc = czero
do j=irp(i), irp(i+1)-1
@ -167,6 +171,7 @@ contains
else
!$omp parallel do private(i,j,acc)
do i=1,m
acc = czero
do j=irp(i), irp(i+1)-1
@ -181,6 +186,7 @@ contains
else if (beta == cone) then
if (alpha == cone) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc = czero
do j=irp(i), irp(i+1)-1
@ -191,6 +197,7 @@ contains
else if (alpha == -cone) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc = czero
do j=irp(i), irp(i+1)-1
@ -201,6 +208,7 @@ contains
else
!$omp parallel do private(i,j,acc)
do i=1,m
acc = czero
do j=irp(i), irp(i+1)-1
@ -214,6 +222,7 @@ contains
else if (beta == -cone) then
if (alpha == cone) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc = czero
do j=irp(i), irp(i+1)-1
@ -224,6 +233,7 @@ contains
else if (alpha == -cone) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc = czero
do j=irp(i), irp(i+1)-1
@ -234,6 +244,7 @@ contains
else
!$omp parallel do private(i,j,acc)
do i=1,m
acc = czero
do j=irp(i), irp(i+1)-1
@ -247,6 +258,7 @@ contains
else
if (alpha == cone) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc = czero
do j=irp(i), irp(i+1)-1
@ -257,6 +269,7 @@ contains
else if (alpha == -cone) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc = czero
do j=irp(i), irp(i+1)-1
@ -267,6 +280,7 @@ contains
else
!$omp parallel do private(i,j,acc)
do i=1,m
acc = czero
do j=irp(i), irp(i+1)-1
@ -282,16 +296,19 @@ contains
else if (tra) then
if (beta == czero) then
!$omp parallel do private(i)
do i=1, m
y(i) = czero
end do
else if (beta == cone) then
! Do nothing
else if (beta == -cone) then
!$omp parallel do private(i)
do i=1, m
y(i) = -y(i)
end do
else
!$omp parallel do private(i)
do i=1, m
y(i) = beta*y(i)
end do
@ -476,16 +493,18 @@ contains
complex(psb_spk_), intent(inout) :: y(ldy,*)
logical, intent(in) :: is_triangle,is_unit,tra,ctra
complex(psb_spk_), intent(inout) :: acc(*)
complex(psb_spk_), intent(inout) :: acc(:)
integer(psb_ipk_) :: i,j, ir
if (alpha == czero) then
if (beta == czero) then
!$omp parallel do private(i)
do i = 1, m
y(i,1:nc) = czero
enddo
else
!$omp parallel do private(i)
do i = 1, m
y(i,1:nc) = beta*y(i,1:nc)
end do
@ -497,6 +516,7 @@ contains
if (beta == czero) then
if (alpha == cone) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = czero
do j=irp(i), irp(i+1)-1
@ -507,6 +527,7 @@ contains
else if (alpha == -cone) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = czero
do j=irp(i), irp(i+1)-1
@ -517,6 +538,7 @@ contains
else
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = czero
do j=irp(i), irp(i+1)-1
@ -531,6 +553,7 @@ contains
else if (beta == cone) then
if (alpha == cone) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = czero
do j=irp(i), irp(i+1)-1
@ -541,6 +564,7 @@ contains
else if (alpha == -cone) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = czero
do j=irp(i), irp(i+1)-1
@ -551,6 +575,7 @@ contains
else
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = czero
do j=irp(i), irp(i+1)-1
@ -564,6 +589,7 @@ contains
else if (beta == -cone) then
if (alpha == cone) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = czero
do j=irp(i), irp(i+1)-1
@ -574,6 +600,7 @@ contains
else if (alpha == -cone) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = czero
do j=irp(i), irp(i+1)-1
@ -584,6 +611,7 @@ contains
else
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = czero
do j=irp(i), irp(i+1)-1
@ -597,6 +625,7 @@ contains
else
if (alpha == cone) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = czero
do j=irp(i), irp(i+1)-1
@ -607,6 +636,7 @@ contains
else if (alpha == -cone) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = czero
do j=irp(i), irp(i+1)-1
@ -617,6 +647,7 @@ contains
else
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = czero
do j=irp(i), irp(i+1)-1

@ -582,7 +582,7 @@ end subroutine psb_c_get_neigh
subroutine psb_c_csall(nr,nc,a,info,nz)
subroutine psb_c_csall(nr,nc,a,info,nz,type,mold)
use psb_c_mat_mod, psb_protect_name => psb_c_csall
use psb_c_base_mat_mod
use psb_error_mod
@ -591,6 +591,8 @@ subroutine psb_c_csall(nr,nc,a,info,nz)
integer(psb_ipk_), intent(in) :: nr,nc
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: nz
character(len=*), intent(in), optional :: type
class(psb_c_base_sparse_mat), optional, intent(in) :: mold
integer(psb_ipk_) :: err_act
character(len=20) :: name='csall'
@ -601,7 +603,23 @@ subroutine psb_c_csall(nr,nc,a,info,nz)
call a%free()
info = psb_success_
if (present(mold)) then
allocate(a%a, stat=info, mold=mold)
else if (present(type)) then
select case (type)
case('CSR')
allocate(psb_c_csr_sparse_mat :: a%a, stat=info)
case('COO')
allocate(psb_c_coo_sparse_mat :: a%a, stat=info)
case('CSC')
allocate(psb_c_csc_sparse_mat :: a%a, stat=info)
case default
allocate(psb_c_coo_sparse_mat :: a%a, stat=info)
end select
else
allocate(psb_c_coo_sparse_mat :: a%a, stat=info)
end if
if (info /= psb_success_) then
info = psb_err_alloc_dealloc_
call psb_errpush(info, name)
@ -3381,7 +3399,7 @@ end subroutine psb_lc_get_neigh
subroutine psb_lc_csall(nr,nc,a,info,nz)
subroutine psb_lc_csall(nr,nc,a,info,nz,type,mold)
use psb_c_mat_mod, psb_protect_name => psb_lc_csall
use psb_c_base_mat_mod
use psb_error_mod
@ -3390,6 +3408,8 @@ subroutine psb_lc_csall(nr,nc,a,info,nz)
integer(psb_lpk_), intent(in) :: nr,nc
integer(psb_ipk_), intent(out) :: info
integer(psb_lpk_), intent(in), optional :: nz
character(len=*), intent(in), optional :: type
class(psb_lc_base_sparse_mat), optional, intent(in) :: mold
integer(psb_ipk_) :: err_act
character(len=20) :: name='csall'
@ -3400,7 +3420,22 @@ subroutine psb_lc_csall(nr,nc,a,info,nz)
call a%free()
info = psb_success_
if (present(mold)) then
allocate(a%a, stat=info, mold=mold)
else if (present(type)) then
select case (type)
case('CSR')
allocate(psb_lc_csr_sparse_mat :: a%a, stat=info)
case('COO')
allocate(psb_lc_coo_sparse_mat :: a%a, stat=info)
case('CSC')
allocate(psb_lc_csc_sparse_mat :: a%a, stat=info)
case default
allocate(psb_lc_coo_sparse_mat :: a%a, stat=info)
end select
else
allocate(psb_lc_coo_sparse_mat :: a%a, stat=info)
end if
if (info /= psb_success_) then
info = psb_err_alloc_dealloc_
call psb_errpush(info, name)

@ -250,7 +250,6 @@ subroutine psb_d_base_mv_from_coo(a,b,info)
end subroutine psb_d_base_mv_from_coo
subroutine psb_d_base_mv_to_fmt(a,b,info)
use psb_d_base_mat_mod, psb_protect_name => psb_d_base_mv_to_fmt
use psb_error_mod
@ -698,6 +697,8 @@ subroutine psb_d_base_tril(a,l,info,&
call psb_realloc(max(mb,nb),ia,info)
call psb_realloc(max(mb,nb),ja,info)
call psb_realloc(max(mb,nb),val,info)
! Implementing this in OpenMP?
! Tricky, to be seen
do i=imin_,imax_, nbk
ibk = min(nbk,imax_-i+1)
call a%csget(i,i+ibk-1,nzout,ia,ja,val,info,&
@ -849,6 +850,8 @@ subroutine psb_d_base_triu(a,u,info,&
call psb_realloc(max(mb,nb),ia,info)
call psb_realloc(max(mb,nb),ja,info)
call psb_realloc(max(mb,nb),val,info)
! Implementing this in OpenMP?
! Tricky, to be seen
do i=imin_,imax_, nbk
ibk = min(nbk,imax_-i+1)
call a%csget(i,i+ibk-1,nzout,ia,ja,val,info,&
@ -914,8 +917,6 @@ subroutine psb_d_base_triu(a,u,info,&
end subroutine psb_d_base_triu
subroutine psb_d_base_clone(a,b,info)
use psb_d_base_mat_mod, psb_protect_name => psb_d_base_clone
use psb_error_mod
@ -960,6 +961,7 @@ subroutine psb_d_base_make_nonunit(a)
mnm = min(m,n)
nz = tmp%get_nzeros()
call tmp%reallocate(nz+mnm)
!$omp parallel do private(i) shared(nz)
do i=1, mnm
tmp%val(nz+i) = done
tmp%ia(nz+i) = i
@ -1506,6 +1508,7 @@ contains
real(psb_dpk_), intent(out) :: y(*)
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1,n
y(i) = d(i)*x(i)
end do
@ -1519,6 +1522,7 @@ contains
real(psb_dpk_), intent(inout) :: x(*)
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1,n
x(i) = d(i)*x(i)
end do
@ -3182,6 +3186,8 @@ subroutine psb_ld_base_tril(a,l,info,&
call psb_realloc(max(mb,nb),ia,info)
call psb_realloc(max(mb,nb),ja,info)
call psb_realloc(max(mb,nb),val,info)
! Implementing this in OpenMP?
! Tricky, to be seen
do i=imin_,imax_, nbk
ibk = min(nbk,imax_-i+1)
call a%csget(i,i+ibk-1,nzout,ia,ja,val,info,&
@ -3334,6 +3340,8 @@ subroutine psb_ld_base_triu(a,u,info,&
call psb_realloc(max(mb,nb),ia,info)
call psb_realloc(max(mb,nb),ja,info)
call psb_realloc(max(mb,nb),val,info)
! Implementing this in OpenMP?
! Tricky, to be seen
do i=imin_,imax_, nbk
ibk = min(nbk,imax_-i+1)
call a%csget(i,i+ibk-1,nzout,ia,ja,val,info,&
@ -3446,6 +3454,7 @@ subroutine psb_ld_base_make_nonunit(a)
mnm = min(m,n)
nz = tmp%get_nzeros()
call tmp%reallocate(nz+mnm)
!$omp parallel do private(i) shared(nz)
do i=1, mnm
tmp%val(nz+i) = done
tmp%ia(nz+i) = i

@ -114,6 +114,7 @@ subroutine psb_d_coo_scal(d,a,info,side)
goto 9999
end if
!$omp parallel do private(i,j)
do i=1,a%get_nzeros()
j = a%ia(i)
a%val(i) = a%val(i) * d(j)
@ -126,6 +127,7 @@ subroutine psb_d_coo_scal(d,a,info,side)
goto 9999
end if
!$omp parallel do private(i,j)
do i=1,a%get_nzeros()
j = a%ja(i)
a%val(i) = a%val(i) * d(j)
@ -201,6 +203,7 @@ subroutine psb_d_coo_scalplusidentity(d,a,info)
end if
mnm = min(a%get_nrows(),a%get_ncols())
!$omp parallel do private(i,j)
do i=1,a%get_nzeros()
a%val(i) = a%val(i) * d
j=a%ia(i)
@ -253,12 +256,30 @@ subroutine psb_d_coo_spaxpby(alpha,a,beta,b,info)
! Allocate (temporary) space for the solution
call tcoo%allocate(M,N,(nza+nzb))
! Compute the sum
#if defined (OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, nza
tcoo%ia(i) = a%ia(i)
tcoo%ja(i) = a%ja(i)
tcoo%val(i) = alpha*a%val(i)
end do
!$omp parallel do private(i)
do i=1, nzb
tcoo%ia(nza+i) = bcoo%ia(i)
tcoo%ja(nza+i) = bcoo%ja(i)
tcoo%val(nza+i) = beta*bcoo%val(i)
end do
end block
#else
tcoo%ia(1:nza) = a%ia(1:nza)
tcoo%ja(1:nza) = a%ja(1:nza)
tcoo%val(1:nza) = alpha*a%val(1:nza)
tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb)
tcoo%ja(nza+1:nza+nzb) = bcoo%ja(1:nzb)
tcoo%val(nza+1:nza+nzb) = beta*bcoo%val(1:nzb)
#endif
! Fix the indexes
call tcoo%fix(info)
! Move to correct output format
@ -346,12 +367,30 @@ function psb_d_coo_cmpmat(a,b,tol,info) result(res)
! Allocate (temporary) space for the solution
call tcoo%allocate(M,N,(nza+nzb))
! Compute the sum
#if defined (OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, nza
tcoo%ia(i) = a%ia(i)
tcoo%ja(i) = a%ja(i)
tcoo%val(i) = alpha*a%val(i)
end do
!$omp parallel do private(i)
do i=1, nzb
tcoo%ia(nza+i) = bcoo%ia(i)
tcoo%ja(nza+i) = bcoo%ja(i)
tcoo%val(nza+i) = (-done)*beta*bcoo%val(i)
end do
end block
#else
tcoo%ia(1:nza) = a%ia(1:nza)
tcoo%ja(1:nza) = a%ja(1:nza)
tcoo%val(1:nza) = a%val(1:nza)
tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb)
tcoo%ja(nza+1:nza+nzb) = bcoo%ja(1:nzb)
tcoo%val(nza+1:nza+nzb) = (-done)*bcoo%val(1:nzb)
#endif
! Fix the indexes
call tcoo%fix(info)
if (info /= psb_success_) then
@ -728,9 +767,6 @@ subroutine psb_d_coo_print(iout,a,iv,head,ivr,ivc)
end subroutine psb_d_coo_print
function psb_d_coo_get_nz_row(idx,a) result(res)
use psb_const_mod
use psb_sort_mod
@ -1670,7 +1706,6 @@ subroutine psb_d_coo_csmv(alpha,a,x,beta,y,info,trans)
end subroutine psb_d_coo_csmv
subroutine psb_d_coo_csmm(alpha,a,x,beta,y,info,trans)
use psb_const_mod
use psb_error_mod
@ -1709,11 +1744,9 @@ subroutine psb_d_coo_csmm(alpha,a,x,beta,y,info,trans)
trans_ = 'N'
end if
tra = (psb_toupper(trans_) == 'T')
ctra = (psb_toupper(trans_) == 'C')
if (tra.or.ctra) then
m = a%get_ncols()
n = a%get_nrows()
@ -1895,7 +1928,15 @@ function psb_d_coo_maxval(a) result(res)
nnz = a%get_nzeros()
if (allocated(a%val)) then
nnz = min(nnz,size(a%val))
#if defined(OPENMP)
res = dzero
!$omp parallel do private(i) reduction(max: res)
do i=1, nnz
res = max(res,abs(a%val(i)))
end do
#else
res = maxval(abs(a%val(1:nnz)))
#endif
end if
end function psb_d_coo_maxval
@ -2275,11 +2316,13 @@ subroutine psb_d_coo_csgetptn(imin,imax,a,nz,ia,ja,info,&
& iren)
if (rscale_) then
!$omp parallel do private(i)
do i=nzin_+1, nzin_+nz
ia(i) = ia(i) - imin + 1
end do
end if
if (cscale_) then
!$omp parallel do private(i)
do i=nzin_+1, nzin_+nz
ja(i) = ja(i) - jmin_ + 1
end do
@ -2553,11 +2596,13 @@ subroutine psb_d_coo_csgetrow(imin,imax,a,nz,ia,ja,val,info,&
& iren)
if (rscale_) then
!$omp parallel do private(i)
do i=nzin_+1, nzin_+nz
ia(i) = ia(i) - imin + 1
end do
end if
if (cscale_) then
!$omp parallel do private(i)
do i=nzin_+1, nzin_+nz
ja(i) = ja(i) - jmin_ + 1
end do
@ -2768,7 +2813,6 @@ contains
end subroutine psb_d_coo_csgetrow
subroutine psb_d_coo_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info)
use psb_error_mod
use psb_realloc_mod
@ -3021,7 +3065,6 @@ contains
end subroutine psb_d_coo_csput_a
subroutine psb_d_cp_coo_to_coo(a,b,info)
use psb_error_mod
use psb_d_base_mat_mod, psb_protect_name => psb_d_cp_coo_to_coo
@ -3045,10 +3088,21 @@ subroutine psb_d_cp_coo_to_coo(a,b,info)
call b%set_nzeros(nz)
call b%reallocate(nz)
#if defined(OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, nz
b%ia(i) = a%ia(i)
b%ja(i) = a%ja(i)
b%val(i) = a%val(i)
end do
end block
#else
b%ia(1:nz) = a%ia(1:nz)
b%ja(1:nz) = a%ja(1:nz)
b%val(1:nz) = a%val(1:nz)
#endif
call b%set_host()
if (.not.b%is_by_rows()) call b%fix(info)
@ -3087,10 +3141,21 @@ subroutine psb_d_cp_coo_from_coo(a,b,info)
call a%set_nzeros(nz)
call a%reallocate(nz)
#if defined(OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, nz
a%ia(i) = b%ia(i)
a%ja(i) = b%ja(i)
a%val(i) = b%val(i)
end do
end block
#else
a%ia(1:nz) = b%ia(1:nz)
a%ja(1:nz) = b%ja(1:nz)
a%val(1:nz) = b%val(1:nz)
#endif
call a%set_host()
if (.not.a%is_by_rows()) call a%fix(info)
@ -3445,8 +3510,6 @@ subroutine psb_d_fix_coo(a,info,idir)
end subroutine psb_d_fix_coo
subroutine psb_d_fix_coo_inner(nr,nc,nzin,dupl,ia,ja,val,nzout,info,idir)
use psb_const_mod
use psb_error_mod
@ -4174,7 +4237,6 @@ subroutine psb_d_fix_coo_inner(nr,nc,nzin,dupl,ia,ja,val,nzout,info,idir)
end subroutine psb_d_fix_coo_inner
subroutine psb_d_cp_coo_to_lcoo(a,b,info)
use psb_error_mod
use psb_d_base_mat_mod, psb_protect_name => psb_d_cp_coo_to_lcoo
@ -4199,10 +4261,21 @@ subroutine psb_d_cp_coo_to_lcoo(a,b,info)
call b%set_nzeros(nz)
call b%reallocate(nz)
#if defined(OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, nz
b%ia(i) = a%ia(i)
b%ja(i) = a%ja(i)
b%val(i) = a%val(i)
end do
end block
#else
b%ia(1:nz) = a%ia(1:nz)
b%ja(1:nz) = a%ja(1:nz)
b%val(1:nz) = a%val(1:nz)
#endif
call b%set_host()
if (.not.b%is_by_rows()) call b%fix(info)
@ -4240,10 +4313,21 @@ subroutine psb_d_cp_coo_from_lcoo(a,b,info)
call a%set_nzeros(nz)
call a%reallocate(nz)
#if defined(OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, nz
a%ia(i) = b%ia(i)
a%ja(i) = b%ja(i)
a%val(i) = b%val(i)
end do
end block
#else
a%ia(1:nz) = b%ia(1:nz)
a%ja(1:nz) = b%ja(1:nz)
a%val(1:nz) = b%val(1:nz)
#endif
call a%set_host()
if (.not.a%is_by_rows()) call a%fix(info)
@ -4442,7 +4526,17 @@ function psb_ld_coo_maxval(a) result(res)
nnz = a%get_nzeros()
if (allocated(a%val)) then
nnz = min(nnz,size(a%val))
#if defined(OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, nnz
res = max(res,abs(a%val(i)))
end do
end block
#else
res = maxval(abs(a%val(1:nnz)))
#endif
end if
end function psb_ld_coo_maxval
@ -4499,7 +4593,17 @@ function psb_ld_coo_csnmi(a) result(res)
i = a%ia(j)
vt(i) = vt(i) + abs(a%val(j))
end do
#if defined(OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, m
res = max(res,abs(vt(i)))
end do
end block
#else
res = maxval(vt(1:m))
#endif
deallocate(vt,stat=info)
end if
@ -4539,7 +4643,17 @@ function psb_ld_coo_csnm1(a) result(res)
i = a%ja(j)
vt(i) = vt(i) + abs(a%val(j))
end do
#if defined(OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, n
res = max(res,abs(vt(i)))
end do
end block
#else
res = maxval(vt(1:n))
#endif
deallocate(vt,stat=info)
return
@ -4584,7 +4698,6 @@ subroutine psb_ld_coo_rowsum(d,a)
d(i) = d(i) + a%val(j)
end do
return
call psb_erractionrestore(err_act)
return
@ -4592,7 +4705,6 @@ subroutine psb_ld_coo_rowsum(d,a)
9999 call psb_error_handler(err_act)
return
end subroutine psb_ld_coo_rowsum
subroutine psb_ld_coo_arwsum(d,a)
@ -4761,6 +4873,7 @@ subroutine psb_ld_coo_scalplusidentity(d,a,info)
end if
mnm = min(a%get_nrows(),a%get_ncols())
!$omp parallel do private(i,j)
do i=1,a%get_nzeros()
a%val(i) = a%val(i) * d
j=a%ia(i)
@ -4813,12 +4926,30 @@ subroutine psb_ld_coo_spaxpby(alpha,a,beta,b,info)
! Allocate (temporary) space for the solution
call tcoo%allocate(M,N,(nza+nzb))
! Compute the sum
#if defined(OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, nza
tcoo%ia(i) = a%ia(i)
tcoo%ja(i) = a%ja(i)
tcoo%val(i) = alpha*a%val(i)
end do
!$omp parallel do private(i)
do i=1, nzb
tcoo%ia(nza+i) = bcoo%ia(i)
tcoo%ja(nza+i) = bcoo%ja(i)
tcoo%val(nza+i) = beta*bcoo%val(i)
end do
end block
#else
tcoo%ia(1:nza) = a%ia(1:nza)
tcoo%ja(1:nza) = a%ja(1:nza)
tcoo%val(1:nza) = alpha*a%val(1:nza)
tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb)
tcoo%ja(nza+1:nza+nzb) = bcoo%ja(1:nzb)
tcoo%val(nza+1:nza+nzb) = beta*bcoo%val(1:nzb)
#endif
! Fix the indexes
call tcoo%fix(info)
! Move to correct output format
@ -4906,12 +5037,30 @@ function psb_ld_coo_cmpmat(a,b,tol,info) result(res)
! Allocate (temporary) space for the solution
call tcoo%allocate(M,N,(nza+nzb))
! Compute the sum
#if defined(OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, nza
tcoo%ia(i) = a%ia(i)
tcoo%ja(i) = a%ja(i)
tcoo%val(i) = a%val(i)
end do
!$omp parallel do private(i)
do i=1, nzb
tcoo%ia(nza+i) = bcoo%ia(i)
tcoo%ja(nza+i) = bcoo%ja(i)
tcoo%val(nza+i) = (-1_psb_dpk_)*bcoo%val(i)
end do
end block
#else
tcoo%ia(1:nza) = a%ia(1:nza)
tcoo%ja(1:nza) = a%ja(1:nza)
tcoo%val(1:nza) = a%val(1:nza)
tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb)
tcoo%ja(nza+1:nza+nzb) = bcoo%ja(1:nzb)
tcoo%val(nza+1:nza+nzb) = (-1_psb_dpk_)*bcoo%val(1:nzb)
#endif
! Fix the indexes
call tcoo%fix(info)
if (info /= psb_success_) then
@ -5950,7 +6099,7 @@ subroutine psb_ld_coo_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info)
if (nz < 0) then
info = psb_err_iarg_neg_
call psb_errpush(info,name,i_err=(/1_psb_ipk_/))
3 call psb_errpush(info,name,i_err=(/1_psb_ipk_/))
goto 9999
end if
if (size(ia) < nz) then

@ -130,10 +130,12 @@ contains
if (alpha == dzero) then
if (beta == dzero) then
!$omp parallel do private(i)
do i = 1, m
y(i) = dzero
enddo
else
!$omp parallel do private(i)
do i = 1, m
y(i) = beta*y(i)
end do
@ -147,6 +149,7 @@ contains
if (beta == dzero) then
if (alpha == done) then
!$omp parallel do private(i,j, acc) schedule(static)
do i=1,m
acc = dzero
do j=irp(i), irp(i+1)-1
@ -157,6 +160,7 @@ contains
else if (alpha == -done) then
!$omp parallel do private(i,j, acc)
do i=1,m
acc = dzero
do j=irp(i), irp(i+1)-1
@ -167,6 +171,7 @@ contains
else
!$omp parallel do private(i,j,acc)
do i=1,m
acc = dzero
do j=irp(i), irp(i+1)-1
@ -181,6 +186,7 @@ contains
else if (beta == done) then
if (alpha == done) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc = dzero
do j=irp(i), irp(i+1)-1
@ -191,6 +197,7 @@ contains
else if (alpha == -done) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc = dzero
do j=irp(i), irp(i+1)-1
@ -201,6 +208,7 @@ contains
else
!$omp parallel do private(i,j,acc)
do i=1,m
acc = dzero
do j=irp(i), irp(i+1)-1
@ -214,6 +222,7 @@ contains
else if (beta == -done) then
if (alpha == done) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc = dzero
do j=irp(i), irp(i+1)-1
@ -224,6 +233,7 @@ contains
else if (alpha == -done) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc = dzero
do j=irp(i), irp(i+1)-1
@ -234,6 +244,7 @@ contains
else
!$omp parallel do private(i,j,acc)
do i=1,m
acc = dzero
do j=irp(i), irp(i+1)-1
@ -247,6 +258,7 @@ contains
else
if (alpha == done) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc = dzero
do j=irp(i), irp(i+1)-1
@ -257,6 +269,7 @@ contains
else if (alpha == -done) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc = dzero
do j=irp(i), irp(i+1)-1
@ -267,6 +280,7 @@ contains
else
!$omp parallel do private(i,j,acc)
do i=1,m
acc = dzero
do j=irp(i), irp(i+1)-1
@ -282,16 +296,19 @@ contains
else if (tra) then
if (beta == dzero) then
!$omp parallel do private(i)
do i=1, m
y(i) = dzero
end do
else if (beta == done) then
! Do nothing
else if (beta == -done) then
!$omp parallel do private(i)
do i=1, m
y(i) = -y(i)
end do
else
!$omp parallel do private(i)
do i=1, m
y(i) = beta*y(i)
end do
@ -476,16 +493,18 @@ contains
real(psb_dpk_), intent(inout) :: y(ldy,*)
logical, intent(in) :: is_triangle,is_unit,tra,ctra
real(psb_dpk_), intent(inout) :: acc(*)
real(psb_dpk_), intent(inout) :: acc(:)
integer(psb_ipk_) :: i,j, ir
if (alpha == dzero) then
if (beta == dzero) then
!$omp parallel do private(i)
do i = 1, m
y(i,1:nc) = dzero
enddo
else
!$omp parallel do private(i)
do i = 1, m
y(i,1:nc) = beta*y(i,1:nc)
end do
@ -497,6 +516,7 @@ contains
if (beta == dzero) then
if (alpha == done) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = dzero
do j=irp(i), irp(i+1)-1
@ -507,6 +527,7 @@ contains
else if (alpha == -done) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = dzero
do j=irp(i), irp(i+1)-1
@ -517,6 +538,7 @@ contains
else
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = dzero
do j=irp(i), irp(i+1)-1
@ -531,6 +553,7 @@ contains
else if (beta == done) then
if (alpha == done) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = dzero
do j=irp(i), irp(i+1)-1
@ -541,6 +564,7 @@ contains
else if (alpha == -done) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = dzero
do j=irp(i), irp(i+1)-1
@ -551,6 +575,7 @@ contains
else
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = dzero
do j=irp(i), irp(i+1)-1
@ -564,6 +589,7 @@ contains
else if (beta == -done) then
if (alpha == done) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = dzero
do j=irp(i), irp(i+1)-1
@ -574,6 +600,7 @@ contains
else if (alpha == -done) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = dzero
do j=irp(i), irp(i+1)-1
@ -584,6 +611,7 @@ contains
else
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = dzero
do j=irp(i), irp(i+1)-1
@ -597,6 +625,7 @@ contains
else
if (alpha == done) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = dzero
do j=irp(i), irp(i+1)-1
@ -607,6 +636,7 @@ contains
else if (alpha == -done) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = dzero
do j=irp(i), irp(i+1)-1
@ -617,6 +647,7 @@ contains
else
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = dzero
do j=irp(i), irp(i+1)-1

@ -582,7 +582,7 @@ end subroutine psb_d_get_neigh
subroutine psb_d_csall(nr,nc,a,info,nz)
subroutine psb_d_csall(nr,nc,a,info,nz,type,mold)
use psb_d_mat_mod, psb_protect_name => psb_d_csall
use psb_d_base_mat_mod
use psb_error_mod
@ -591,6 +591,8 @@ subroutine psb_d_csall(nr,nc,a,info,nz)
integer(psb_ipk_), intent(in) :: nr,nc
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: nz
character(len=*), intent(in), optional :: type
class(psb_d_base_sparse_mat), optional, intent(in) :: mold
integer(psb_ipk_) :: err_act
character(len=20) :: name='csall'
@ -601,7 +603,23 @@ subroutine psb_d_csall(nr,nc,a,info,nz)
call a%free()
info = psb_success_
if (present(mold)) then
allocate(a%a, stat=info, mold=mold)
else if (present(type)) then
select case (type)
case('CSR')
allocate(psb_d_csr_sparse_mat :: a%a, stat=info)
case('COO')
allocate(psb_d_coo_sparse_mat :: a%a, stat=info)
case('CSC')
allocate(psb_d_csc_sparse_mat :: a%a, stat=info)
case default
allocate(psb_d_coo_sparse_mat :: a%a, stat=info)
end select
else
allocate(psb_d_coo_sparse_mat :: a%a, stat=info)
end if
if (info /= psb_success_) then
info = psb_err_alloc_dealloc_
call psb_errpush(info, name)
@ -3381,7 +3399,7 @@ end subroutine psb_ld_get_neigh
subroutine psb_ld_csall(nr,nc,a,info,nz)
subroutine psb_ld_csall(nr,nc,a,info,nz,type,mold)
use psb_d_mat_mod, psb_protect_name => psb_ld_csall
use psb_d_base_mat_mod
use psb_error_mod
@ -3390,6 +3408,8 @@ subroutine psb_ld_csall(nr,nc,a,info,nz)
integer(psb_lpk_), intent(in) :: nr,nc
integer(psb_ipk_), intent(out) :: info
integer(psb_lpk_), intent(in), optional :: nz
character(len=*), intent(in), optional :: type
class(psb_ld_base_sparse_mat), optional, intent(in) :: mold
integer(psb_ipk_) :: err_act
character(len=20) :: name='csall'
@ -3400,7 +3420,22 @@ subroutine psb_ld_csall(nr,nc,a,info,nz)
call a%free()
info = psb_success_
if (present(mold)) then
allocate(a%a, stat=info, mold=mold)
else if (present(type)) then
select case (type)
case('CSR')
allocate(psb_ld_csr_sparse_mat :: a%a, stat=info)
case('COO')
allocate(psb_ld_coo_sparse_mat :: a%a, stat=info)
case('CSC')
allocate(psb_ld_csc_sparse_mat :: a%a, stat=info)
case default
allocate(psb_ld_coo_sparse_mat :: a%a, stat=info)
end select
else
allocate(psb_ld_coo_sparse_mat :: a%a, stat=info)
end if
if (info /= psb_success_) then
info = psb_err_alloc_dealloc_
call psb_errpush(info, name)

@ -250,7 +250,6 @@ subroutine psb_s_base_mv_from_coo(a,b,info)
end subroutine psb_s_base_mv_from_coo
subroutine psb_s_base_mv_to_fmt(a,b,info)
use psb_s_base_mat_mod, psb_protect_name => psb_s_base_mv_to_fmt
use psb_error_mod
@ -698,6 +697,8 @@ subroutine psb_s_base_tril(a,l,info,&
call psb_realloc(max(mb,nb),ia,info)
call psb_realloc(max(mb,nb),ja,info)
call psb_realloc(max(mb,nb),val,info)
! Implementing this in OpenMP?
! Tricky, to be seen
do i=imin_,imax_, nbk
ibk = min(nbk,imax_-i+1)
call a%csget(i,i+ibk-1,nzout,ia,ja,val,info,&
@ -849,6 +850,8 @@ subroutine psb_s_base_triu(a,u,info,&
call psb_realloc(max(mb,nb),ia,info)
call psb_realloc(max(mb,nb),ja,info)
call psb_realloc(max(mb,nb),val,info)
! Implementing this in OpenMP?
! Tricky, to be seen
do i=imin_,imax_, nbk
ibk = min(nbk,imax_-i+1)
call a%csget(i,i+ibk-1,nzout,ia,ja,val,info,&
@ -914,8 +917,6 @@ subroutine psb_s_base_triu(a,u,info,&
end subroutine psb_s_base_triu
subroutine psb_s_base_clone(a,b,info)
use psb_s_base_mat_mod, psb_protect_name => psb_s_base_clone
use psb_error_mod
@ -960,6 +961,7 @@ subroutine psb_s_base_make_nonunit(a)
mnm = min(m,n)
nz = tmp%get_nzeros()
call tmp%reallocate(nz+mnm)
!$omp parallel do private(i) shared(nz)
do i=1, mnm
tmp%val(nz+i) = sone
tmp%ia(nz+i) = i
@ -1506,6 +1508,7 @@ contains
real(psb_spk_), intent(out) :: y(*)
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1,n
y(i) = d(i)*x(i)
end do
@ -1519,6 +1522,7 @@ contains
real(psb_spk_), intent(inout) :: x(*)
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1,n
x(i) = d(i)*x(i)
end do
@ -3182,6 +3186,8 @@ subroutine psb_ls_base_tril(a,l,info,&
call psb_realloc(max(mb,nb),ia,info)
call psb_realloc(max(mb,nb),ja,info)
call psb_realloc(max(mb,nb),val,info)
! Implementing this in OpenMP?
! Tricky, to be seen
do i=imin_,imax_, nbk
ibk = min(nbk,imax_-i+1)
call a%csget(i,i+ibk-1,nzout,ia,ja,val,info,&
@ -3334,6 +3340,8 @@ subroutine psb_ls_base_triu(a,u,info,&
call psb_realloc(max(mb,nb),ia,info)
call psb_realloc(max(mb,nb),ja,info)
call psb_realloc(max(mb,nb),val,info)
! Implementing this in OpenMP?
! Tricky, to be seen
do i=imin_,imax_, nbk
ibk = min(nbk,imax_-i+1)
call a%csget(i,i+ibk-1,nzout,ia,ja,val,info,&
@ -3446,6 +3454,7 @@ subroutine psb_ls_base_make_nonunit(a)
mnm = min(m,n)
nz = tmp%get_nzeros()
call tmp%reallocate(nz+mnm)
!$omp parallel do private(i) shared(nz)
do i=1, mnm
tmp%val(nz+i) = sone
tmp%ia(nz+i) = i

@ -114,6 +114,7 @@ subroutine psb_s_coo_scal(d,a,info,side)
goto 9999
end if
!$omp parallel do private(i,j)
do i=1,a%get_nzeros()
j = a%ia(i)
a%val(i) = a%val(i) * d(j)
@ -126,6 +127,7 @@ subroutine psb_s_coo_scal(d,a,info,side)
goto 9999
end if
!$omp parallel do private(i,j)
do i=1,a%get_nzeros()
j = a%ja(i)
a%val(i) = a%val(i) * d(j)
@ -201,6 +203,7 @@ subroutine psb_s_coo_scalplusidentity(d,a,info)
end if
mnm = min(a%get_nrows(),a%get_ncols())
!$omp parallel do private(i,j)
do i=1,a%get_nzeros()
a%val(i) = a%val(i) * d
j=a%ia(i)
@ -253,12 +256,30 @@ subroutine psb_s_coo_spaxpby(alpha,a,beta,b,info)
! Allocate (temporary) space for the solution
call tcoo%allocate(M,N,(nza+nzb))
! Compute the sum
#if defined (OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, nza
tcoo%ia(i) = a%ia(i)
tcoo%ja(i) = a%ja(i)
tcoo%val(i) = alpha*a%val(i)
end do
!$omp parallel do private(i)
do i=1, nzb
tcoo%ia(nza+i) = bcoo%ia(i)
tcoo%ja(nza+i) = bcoo%ja(i)
tcoo%val(nza+i) = beta*bcoo%val(i)
end do
end block
#else
tcoo%ia(1:nza) = a%ia(1:nza)
tcoo%ja(1:nza) = a%ja(1:nza)
tcoo%val(1:nza) = alpha*a%val(1:nza)
tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb)
tcoo%ja(nza+1:nza+nzb) = bcoo%ja(1:nzb)
tcoo%val(nza+1:nza+nzb) = beta*bcoo%val(1:nzb)
#endif
! Fix the indexes
call tcoo%fix(info)
! Move to correct output format
@ -346,12 +367,30 @@ function psb_s_coo_cmpmat(a,b,tol,info) result(res)
! Allocate (temporary) space for the solution
call tcoo%allocate(M,N,(nza+nzb))
! Compute the sum
#if defined (OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, nza
tcoo%ia(i) = a%ia(i)
tcoo%ja(i) = a%ja(i)
tcoo%val(i) = alpha*a%val(i)
end do
!$omp parallel do private(i)
do i=1, nzb
tcoo%ia(nza+i) = bcoo%ia(i)
tcoo%ja(nza+i) = bcoo%ja(i)
tcoo%val(nza+i) = (-sone)*beta*bcoo%val(i)
end do
end block
#else
tcoo%ia(1:nza) = a%ia(1:nza)
tcoo%ja(1:nza) = a%ja(1:nza)
tcoo%val(1:nza) = a%val(1:nza)
tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb)
tcoo%ja(nza+1:nza+nzb) = bcoo%ja(1:nzb)
tcoo%val(nza+1:nza+nzb) = (-sone)*bcoo%val(1:nzb)
#endif
! Fix the indexes
call tcoo%fix(info)
if (info /= psb_success_) then
@ -728,9 +767,6 @@ subroutine psb_s_coo_print(iout,a,iv,head,ivr,ivc)
end subroutine psb_s_coo_print
function psb_s_coo_get_nz_row(idx,a) result(res)
use psb_const_mod
use psb_sort_mod
@ -1670,7 +1706,6 @@ subroutine psb_s_coo_csmv(alpha,a,x,beta,y,info,trans)
end subroutine psb_s_coo_csmv
subroutine psb_s_coo_csmm(alpha,a,x,beta,y,info,trans)
use psb_const_mod
use psb_error_mod
@ -1709,11 +1744,9 @@ subroutine psb_s_coo_csmm(alpha,a,x,beta,y,info,trans)
trans_ = 'N'
end if
tra = (psb_toupper(trans_) == 'T')
ctra = (psb_toupper(trans_) == 'C')
if (tra.or.ctra) then
m = a%get_ncols()
n = a%get_nrows()
@ -1895,7 +1928,15 @@ function psb_s_coo_maxval(a) result(res)
nnz = a%get_nzeros()
if (allocated(a%val)) then
nnz = min(nnz,size(a%val))
#if defined(OPENMP)
res = szero
!$omp parallel do private(i) reduction(max: res)
do i=1, nnz
res = max(res,abs(a%val(i)))
end do
#else
res = maxval(abs(a%val(1:nnz)))
#endif
end if
end function psb_s_coo_maxval
@ -2275,11 +2316,13 @@ subroutine psb_s_coo_csgetptn(imin,imax,a,nz,ia,ja,info,&
& iren)
if (rscale_) then
!$omp parallel do private(i)
do i=nzin_+1, nzin_+nz
ia(i) = ia(i) - imin + 1
end do
end if
if (cscale_) then
!$omp parallel do private(i)
do i=nzin_+1, nzin_+nz
ja(i) = ja(i) - jmin_ + 1
end do
@ -2553,11 +2596,13 @@ subroutine psb_s_coo_csgetrow(imin,imax,a,nz,ia,ja,val,info,&
& iren)
if (rscale_) then
!$omp parallel do private(i)
do i=nzin_+1, nzin_+nz
ia(i) = ia(i) - imin + 1
end do
end if
if (cscale_) then
!$omp parallel do private(i)
do i=nzin_+1, nzin_+nz
ja(i) = ja(i) - jmin_ + 1
end do
@ -2768,7 +2813,6 @@ contains
end subroutine psb_s_coo_csgetrow
subroutine psb_s_coo_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info)
use psb_error_mod
use psb_realloc_mod
@ -3021,7 +3065,6 @@ contains
end subroutine psb_s_coo_csput_a
subroutine psb_s_cp_coo_to_coo(a,b,info)
use psb_error_mod
use psb_s_base_mat_mod, psb_protect_name => psb_s_cp_coo_to_coo
@ -3045,10 +3088,21 @@ subroutine psb_s_cp_coo_to_coo(a,b,info)
call b%set_nzeros(nz)
call b%reallocate(nz)
#if defined(OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, nz
b%ia(i) = a%ia(i)
b%ja(i) = a%ja(i)
b%val(i) = a%val(i)
end do
end block
#else
b%ia(1:nz) = a%ia(1:nz)
b%ja(1:nz) = a%ja(1:nz)
b%val(1:nz) = a%val(1:nz)
#endif
call b%set_host()
if (.not.b%is_by_rows()) call b%fix(info)
@ -3087,10 +3141,21 @@ subroutine psb_s_cp_coo_from_coo(a,b,info)
call a%set_nzeros(nz)
call a%reallocate(nz)
#if defined(OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, nz
a%ia(i) = b%ia(i)
a%ja(i) = b%ja(i)
a%val(i) = b%val(i)
end do
end block
#else
a%ia(1:nz) = b%ia(1:nz)
a%ja(1:nz) = b%ja(1:nz)
a%val(1:nz) = b%val(1:nz)
#endif
call a%set_host()
if (.not.a%is_by_rows()) call a%fix(info)
@ -3445,8 +3510,6 @@ subroutine psb_s_fix_coo(a,info,idir)
end subroutine psb_s_fix_coo
subroutine psb_s_fix_coo_inner(nr,nc,nzin,dupl,ia,ja,val,nzout,info,idir)
use psb_const_mod
use psb_error_mod
@ -4174,7 +4237,6 @@ subroutine psb_s_fix_coo_inner(nr,nc,nzin,dupl,ia,ja,val,nzout,info,idir)
end subroutine psb_s_fix_coo_inner
subroutine psb_s_cp_coo_to_lcoo(a,b,info)
use psb_error_mod
use psb_s_base_mat_mod, psb_protect_name => psb_s_cp_coo_to_lcoo
@ -4199,10 +4261,21 @@ subroutine psb_s_cp_coo_to_lcoo(a,b,info)
call b%set_nzeros(nz)
call b%reallocate(nz)
#if defined(OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, nz
b%ia(i) = a%ia(i)
b%ja(i) = a%ja(i)
b%val(i) = a%val(i)
end do
end block
#else
b%ia(1:nz) = a%ia(1:nz)
b%ja(1:nz) = a%ja(1:nz)
b%val(1:nz) = a%val(1:nz)
#endif
call b%set_host()
if (.not.b%is_by_rows()) call b%fix(info)
@ -4240,10 +4313,21 @@ subroutine psb_s_cp_coo_from_lcoo(a,b,info)
call a%set_nzeros(nz)
call a%reallocate(nz)
#if defined(OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, nz
a%ia(i) = b%ia(i)
a%ja(i) = b%ja(i)
a%val(i) = b%val(i)
end do
end block
#else
a%ia(1:nz) = b%ia(1:nz)
a%ja(1:nz) = b%ja(1:nz)
a%val(1:nz) = b%val(1:nz)
#endif
call a%set_host()
if (.not.a%is_by_rows()) call a%fix(info)
@ -4442,7 +4526,17 @@ function psb_ls_coo_maxval(a) result(res)
nnz = a%get_nzeros()
if (allocated(a%val)) then
nnz = min(nnz,size(a%val))
#if defined(OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, nnz
res = max(res,abs(a%val(i)))
end do
end block
#else
res = maxval(abs(a%val(1:nnz)))
#endif
end if
end function psb_ls_coo_maxval
@ -4499,7 +4593,17 @@ function psb_ls_coo_csnmi(a) result(res)
i = a%ia(j)
vt(i) = vt(i) + abs(a%val(j))
end do
#if defined(OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, m
res = max(res,abs(vt(i)))
end do
end block
#else
res = maxval(vt(1:m))
#endif
deallocate(vt,stat=info)
end if
@ -4539,7 +4643,17 @@ function psb_ls_coo_csnm1(a) result(res)
i = a%ja(j)
vt(i) = vt(i) + abs(a%val(j))
end do
#if defined(OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, n
res = max(res,abs(vt(i)))
end do
end block
#else
res = maxval(vt(1:n))
#endif
deallocate(vt,stat=info)
return
@ -4584,7 +4698,6 @@ subroutine psb_ls_coo_rowsum(d,a)
d(i) = d(i) + a%val(j)
end do
return
call psb_erractionrestore(err_act)
return
@ -4592,7 +4705,6 @@ subroutine psb_ls_coo_rowsum(d,a)
9999 call psb_error_handler(err_act)
return
end subroutine psb_ls_coo_rowsum
subroutine psb_ls_coo_arwsum(d,a)
@ -4761,6 +4873,7 @@ subroutine psb_ls_coo_scalplusidentity(d,a,info)
end if
mnm = min(a%get_nrows(),a%get_ncols())
!$omp parallel do private(i,j)
do i=1,a%get_nzeros()
a%val(i) = a%val(i) * d
j=a%ia(i)
@ -4813,12 +4926,30 @@ subroutine psb_ls_coo_spaxpby(alpha,a,beta,b,info)
! Allocate (temporary) space for the solution
call tcoo%allocate(M,N,(nza+nzb))
! Compute the sum
#if defined(OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, nza
tcoo%ia(i) = a%ia(i)
tcoo%ja(i) = a%ja(i)
tcoo%val(i) = alpha*a%val(i)
end do
!$omp parallel do private(i)
do i=1, nzb
tcoo%ia(nza+i) = bcoo%ia(i)
tcoo%ja(nza+i) = bcoo%ja(i)
tcoo%val(nza+i) = beta*bcoo%val(i)
end do
end block
#else
tcoo%ia(1:nza) = a%ia(1:nza)
tcoo%ja(1:nza) = a%ja(1:nza)
tcoo%val(1:nza) = alpha*a%val(1:nza)
tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb)
tcoo%ja(nza+1:nza+nzb) = bcoo%ja(1:nzb)
tcoo%val(nza+1:nza+nzb) = beta*bcoo%val(1:nzb)
#endif
! Fix the indexes
call tcoo%fix(info)
! Move to correct output format
@ -4906,12 +5037,30 @@ function psb_ls_coo_cmpmat(a,b,tol,info) result(res)
! Allocate (temporary) space for the solution
call tcoo%allocate(M,N,(nza+nzb))
! Compute the sum
#if defined(OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, nza
tcoo%ia(i) = a%ia(i)
tcoo%ja(i) = a%ja(i)
tcoo%val(i) = a%val(i)
end do
!$omp parallel do private(i)
do i=1, nzb
tcoo%ia(nza+i) = bcoo%ia(i)
tcoo%ja(nza+i) = bcoo%ja(i)
tcoo%val(nza+i) = (-1_psb_spk_)*bcoo%val(i)
end do
end block
#else
tcoo%ia(1:nza) = a%ia(1:nza)
tcoo%ja(1:nza) = a%ja(1:nza)
tcoo%val(1:nza) = a%val(1:nza)
tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb)
tcoo%ja(nza+1:nza+nzb) = bcoo%ja(1:nzb)
tcoo%val(nza+1:nza+nzb) = (-1_psb_spk_)*bcoo%val(1:nzb)
#endif
! Fix the indexes
call tcoo%fix(info)
if (info /= psb_success_) then
@ -5950,7 +6099,7 @@ subroutine psb_ls_coo_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info)
if (nz < 0) then
info = psb_err_iarg_neg_
call psb_errpush(info,name,i_err=(/1_psb_ipk_/))
3 call psb_errpush(info,name,i_err=(/1_psb_ipk_/))
goto 9999
end if
if (size(ia) < nz) then

@ -130,10 +130,12 @@ contains
if (alpha == szero) then
if (beta == szero) then
!$omp parallel do private(i)
do i = 1, m
y(i) = szero
enddo
else
!$omp parallel do private(i)
do i = 1, m
y(i) = beta*y(i)
end do
@ -147,6 +149,7 @@ contains
if (beta == szero) then
if (alpha == sone) then
!$omp parallel do private(i,j, acc) schedule(static)
do i=1,m
acc = szero
do j=irp(i), irp(i+1)-1
@ -157,6 +160,7 @@ contains
else if (alpha == -sone) then
!$omp parallel do private(i,j, acc)
do i=1,m
acc = szero
do j=irp(i), irp(i+1)-1
@ -167,6 +171,7 @@ contains
else
!$omp parallel do private(i,j,acc)
do i=1,m
acc = szero
do j=irp(i), irp(i+1)-1
@ -181,6 +186,7 @@ contains
else if (beta == sone) then
if (alpha == sone) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc = szero
do j=irp(i), irp(i+1)-1
@ -191,6 +197,7 @@ contains
else if (alpha == -sone) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc = szero
do j=irp(i), irp(i+1)-1
@ -201,6 +208,7 @@ contains
else
!$omp parallel do private(i,j,acc)
do i=1,m
acc = szero
do j=irp(i), irp(i+1)-1
@ -214,6 +222,7 @@ contains
else if (beta == -sone) then
if (alpha == sone) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc = szero
do j=irp(i), irp(i+1)-1
@ -224,6 +233,7 @@ contains
else if (alpha == -sone) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc = szero
do j=irp(i), irp(i+1)-1
@ -234,6 +244,7 @@ contains
else
!$omp parallel do private(i,j,acc)
do i=1,m
acc = szero
do j=irp(i), irp(i+1)-1
@ -247,6 +258,7 @@ contains
else
if (alpha == sone) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc = szero
do j=irp(i), irp(i+1)-1
@ -257,6 +269,7 @@ contains
else if (alpha == -sone) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc = szero
do j=irp(i), irp(i+1)-1
@ -267,6 +280,7 @@ contains
else
!$omp parallel do private(i,j,acc)
do i=1,m
acc = szero
do j=irp(i), irp(i+1)-1
@ -282,16 +296,19 @@ contains
else if (tra) then
if (beta == szero) then
!$omp parallel do private(i)
do i=1, m
y(i) = szero
end do
else if (beta == sone) then
! Do nothing
else if (beta == -sone) then
!$omp parallel do private(i)
do i=1, m
y(i) = -y(i)
end do
else
!$omp parallel do private(i)
do i=1, m
y(i) = beta*y(i)
end do
@ -476,16 +493,18 @@ contains
real(psb_spk_), intent(inout) :: y(ldy,*)
logical, intent(in) :: is_triangle,is_unit,tra,ctra
real(psb_spk_), intent(inout) :: acc(*)
real(psb_spk_), intent(inout) :: acc(:)
integer(psb_ipk_) :: i,j, ir
if (alpha == szero) then
if (beta == szero) then
!$omp parallel do private(i)
do i = 1, m
y(i,1:nc) = szero
enddo
else
!$omp parallel do private(i)
do i = 1, m
y(i,1:nc) = beta*y(i,1:nc)
end do
@ -497,6 +516,7 @@ contains
if (beta == szero) then
if (alpha == sone) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = szero
do j=irp(i), irp(i+1)-1
@ -507,6 +527,7 @@ contains
else if (alpha == -sone) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = szero
do j=irp(i), irp(i+1)-1
@ -517,6 +538,7 @@ contains
else
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = szero
do j=irp(i), irp(i+1)-1
@ -531,6 +553,7 @@ contains
else if (beta == sone) then
if (alpha == sone) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = szero
do j=irp(i), irp(i+1)-1
@ -541,6 +564,7 @@ contains
else if (alpha == -sone) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = szero
do j=irp(i), irp(i+1)-1
@ -551,6 +575,7 @@ contains
else
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = szero
do j=irp(i), irp(i+1)-1
@ -564,6 +589,7 @@ contains
else if (beta == -sone) then
if (alpha == sone) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = szero
do j=irp(i), irp(i+1)-1
@ -574,6 +600,7 @@ contains
else if (alpha == -sone) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = szero
do j=irp(i), irp(i+1)-1
@ -584,6 +611,7 @@ contains
else
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = szero
do j=irp(i), irp(i+1)-1
@ -597,6 +625,7 @@ contains
else
if (alpha == sone) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = szero
do j=irp(i), irp(i+1)-1
@ -607,6 +636,7 @@ contains
else if (alpha == -sone) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = szero
do j=irp(i), irp(i+1)-1
@ -617,6 +647,7 @@ contains
else
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = szero
do j=irp(i), irp(i+1)-1

@ -582,7 +582,7 @@ end subroutine psb_s_get_neigh
subroutine psb_s_csall(nr,nc,a,info,nz)
subroutine psb_s_csall(nr,nc,a,info,nz,type,mold)
use psb_s_mat_mod, psb_protect_name => psb_s_csall
use psb_s_base_mat_mod
use psb_error_mod
@ -591,6 +591,8 @@ subroutine psb_s_csall(nr,nc,a,info,nz)
integer(psb_ipk_), intent(in) :: nr,nc
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: nz
character(len=*), intent(in), optional :: type
class(psb_s_base_sparse_mat), optional, intent(in) :: mold
integer(psb_ipk_) :: err_act
character(len=20) :: name='csall'
@ -601,7 +603,23 @@ subroutine psb_s_csall(nr,nc,a,info,nz)
call a%free()
info = psb_success_
if (present(mold)) then
allocate(a%a, stat=info, mold=mold)
else if (present(type)) then
select case (type)
case('CSR')
allocate(psb_s_csr_sparse_mat :: a%a, stat=info)
case('COO')
allocate(psb_s_coo_sparse_mat :: a%a, stat=info)
case('CSC')
allocate(psb_s_csc_sparse_mat :: a%a, stat=info)
case default
allocate(psb_s_coo_sparse_mat :: a%a, stat=info)
end select
else
allocate(psb_s_coo_sparse_mat :: a%a, stat=info)
end if
if (info /= psb_success_) then
info = psb_err_alloc_dealloc_
call psb_errpush(info, name)
@ -3381,7 +3399,7 @@ end subroutine psb_ls_get_neigh
subroutine psb_ls_csall(nr,nc,a,info,nz)
subroutine psb_ls_csall(nr,nc,a,info,nz,type,mold)
use psb_s_mat_mod, psb_protect_name => psb_ls_csall
use psb_s_base_mat_mod
use psb_error_mod
@ -3390,6 +3408,8 @@ subroutine psb_ls_csall(nr,nc,a,info,nz)
integer(psb_lpk_), intent(in) :: nr,nc
integer(psb_ipk_), intent(out) :: info
integer(psb_lpk_), intent(in), optional :: nz
character(len=*), intent(in), optional :: type
class(psb_ls_base_sparse_mat), optional, intent(in) :: mold
integer(psb_ipk_) :: err_act
character(len=20) :: name='csall'
@ -3400,7 +3420,22 @@ subroutine psb_ls_csall(nr,nc,a,info,nz)
call a%free()
info = psb_success_
if (present(mold)) then
allocate(a%a, stat=info, mold=mold)
else if (present(type)) then
select case (type)
case('CSR')
allocate(psb_ls_csr_sparse_mat :: a%a, stat=info)
case('COO')
allocate(psb_ls_coo_sparse_mat :: a%a, stat=info)
case('CSC')
allocate(psb_ls_csc_sparse_mat :: a%a, stat=info)
case default
allocate(psb_ls_coo_sparse_mat :: a%a, stat=info)
end select
else
allocate(psb_ls_coo_sparse_mat :: a%a, stat=info)
end if
if (info /= psb_success_) then
info = psb_err_alloc_dealloc_
call psb_errpush(info, name)

@ -250,7 +250,6 @@ subroutine psb_z_base_mv_from_coo(a,b,info)
end subroutine psb_z_base_mv_from_coo
subroutine psb_z_base_mv_to_fmt(a,b,info)
use psb_z_base_mat_mod, psb_protect_name => psb_z_base_mv_to_fmt
use psb_error_mod
@ -698,6 +697,8 @@ subroutine psb_z_base_tril(a,l,info,&
call psb_realloc(max(mb,nb),ia,info)
call psb_realloc(max(mb,nb),ja,info)
call psb_realloc(max(mb,nb),val,info)
! Implementing this in OpenMP?
! Tricky, to be seen
do i=imin_,imax_, nbk
ibk = min(nbk,imax_-i+1)
call a%csget(i,i+ibk-1,nzout,ia,ja,val,info,&
@ -849,6 +850,8 @@ subroutine psb_z_base_triu(a,u,info,&
call psb_realloc(max(mb,nb),ia,info)
call psb_realloc(max(mb,nb),ja,info)
call psb_realloc(max(mb,nb),val,info)
! Implementing this in OpenMP?
! Tricky, to be seen
do i=imin_,imax_, nbk
ibk = min(nbk,imax_-i+1)
call a%csget(i,i+ibk-1,nzout,ia,ja,val,info,&
@ -914,8 +917,6 @@ subroutine psb_z_base_triu(a,u,info,&
end subroutine psb_z_base_triu
subroutine psb_z_base_clone(a,b,info)
use psb_z_base_mat_mod, psb_protect_name => psb_z_base_clone
use psb_error_mod
@ -960,6 +961,7 @@ subroutine psb_z_base_make_nonunit(a)
mnm = min(m,n)
nz = tmp%get_nzeros()
call tmp%reallocate(nz+mnm)
!$omp parallel do private(i) shared(nz)
do i=1, mnm
tmp%val(nz+i) = zone
tmp%ia(nz+i) = i
@ -1506,6 +1508,7 @@ contains
complex(psb_dpk_), intent(out) :: y(*)
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1,n
y(i) = d(i)*x(i)
end do
@ -1519,6 +1522,7 @@ contains
complex(psb_dpk_), intent(inout) :: x(*)
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1,n
x(i) = d(i)*x(i)
end do
@ -3182,6 +3186,8 @@ subroutine psb_lz_base_tril(a,l,info,&
call psb_realloc(max(mb,nb),ia,info)
call psb_realloc(max(mb,nb),ja,info)
call psb_realloc(max(mb,nb),val,info)
! Implementing this in OpenMP?
! Tricky, to be seen
do i=imin_,imax_, nbk
ibk = min(nbk,imax_-i+1)
call a%csget(i,i+ibk-1,nzout,ia,ja,val,info,&
@ -3334,6 +3340,8 @@ subroutine psb_lz_base_triu(a,u,info,&
call psb_realloc(max(mb,nb),ia,info)
call psb_realloc(max(mb,nb),ja,info)
call psb_realloc(max(mb,nb),val,info)
! Implementing this in OpenMP?
! Tricky, to be seen
do i=imin_,imax_, nbk
ibk = min(nbk,imax_-i+1)
call a%csget(i,i+ibk-1,nzout,ia,ja,val,info,&
@ -3446,6 +3454,7 @@ subroutine psb_lz_base_make_nonunit(a)
mnm = min(m,n)
nz = tmp%get_nzeros()
call tmp%reallocate(nz+mnm)
!$omp parallel do private(i) shared(nz)
do i=1, mnm
tmp%val(nz+i) = zone
tmp%ia(nz+i) = i

@ -114,6 +114,7 @@ subroutine psb_z_coo_scal(d,a,info,side)
goto 9999
end if
!$omp parallel do private(i,j)
do i=1,a%get_nzeros()
j = a%ia(i)
a%val(i) = a%val(i) * d(j)
@ -126,6 +127,7 @@ subroutine psb_z_coo_scal(d,a,info,side)
goto 9999
end if
!$omp parallel do private(i,j)
do i=1,a%get_nzeros()
j = a%ja(i)
a%val(i) = a%val(i) * d(j)
@ -201,6 +203,7 @@ subroutine psb_z_coo_scalplusidentity(d,a,info)
end if
mnm = min(a%get_nrows(),a%get_ncols())
!$omp parallel do private(i,j)
do i=1,a%get_nzeros()
a%val(i) = a%val(i) * d
j=a%ia(i)
@ -253,12 +256,30 @@ subroutine psb_z_coo_spaxpby(alpha,a,beta,b,info)
! Allocate (temporary) space for the solution
call tcoo%allocate(M,N,(nza+nzb))
! Compute the sum
#if defined (OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, nza
tcoo%ia(i) = a%ia(i)
tcoo%ja(i) = a%ja(i)
tcoo%val(i) = alpha*a%val(i)
end do
!$omp parallel do private(i)
do i=1, nzb
tcoo%ia(nza+i) = bcoo%ia(i)
tcoo%ja(nza+i) = bcoo%ja(i)
tcoo%val(nza+i) = beta*bcoo%val(i)
end do
end block
#else
tcoo%ia(1:nza) = a%ia(1:nza)
tcoo%ja(1:nza) = a%ja(1:nza)
tcoo%val(1:nza) = alpha*a%val(1:nza)
tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb)
tcoo%ja(nza+1:nza+nzb) = bcoo%ja(1:nzb)
tcoo%val(nza+1:nza+nzb) = beta*bcoo%val(1:nzb)
#endif
! Fix the indexes
call tcoo%fix(info)
! Move to correct output format
@ -346,12 +367,30 @@ function psb_z_coo_cmpmat(a,b,tol,info) result(res)
! Allocate (temporary) space for the solution
call tcoo%allocate(M,N,(nza+nzb))
! Compute the sum
#if defined (OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, nza
tcoo%ia(i) = a%ia(i)
tcoo%ja(i) = a%ja(i)
tcoo%val(i) = alpha*a%val(i)
end do
!$omp parallel do private(i)
do i=1, nzb
tcoo%ia(nza+i) = bcoo%ia(i)
tcoo%ja(nza+i) = bcoo%ja(i)
tcoo%val(nza+i) = (-done)*beta*bcoo%val(i)
end do
end block
#else
tcoo%ia(1:nza) = a%ia(1:nza)
tcoo%ja(1:nza) = a%ja(1:nza)
tcoo%val(1:nza) = a%val(1:nza)
tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb)
tcoo%ja(nza+1:nza+nzb) = bcoo%ja(1:nzb)
tcoo%val(nza+1:nza+nzb) = (-done)*bcoo%val(1:nzb)
#endif
! Fix the indexes
call tcoo%fix(info)
if (info /= psb_success_) then
@ -728,9 +767,6 @@ subroutine psb_z_coo_print(iout,a,iv,head,ivr,ivc)
end subroutine psb_z_coo_print
function psb_z_coo_get_nz_row(idx,a) result(res)
use psb_const_mod
use psb_sort_mod
@ -1670,7 +1706,6 @@ subroutine psb_z_coo_csmv(alpha,a,x,beta,y,info,trans)
end subroutine psb_z_coo_csmv
subroutine psb_z_coo_csmm(alpha,a,x,beta,y,info,trans)
use psb_const_mod
use psb_error_mod
@ -1709,11 +1744,9 @@ subroutine psb_z_coo_csmm(alpha,a,x,beta,y,info,trans)
trans_ = 'N'
end if
tra = (psb_toupper(trans_) == 'T')
ctra = (psb_toupper(trans_) == 'C')
if (tra.or.ctra) then
m = a%get_ncols()
n = a%get_nrows()
@ -1895,7 +1928,15 @@ function psb_z_coo_maxval(a) result(res)
nnz = a%get_nzeros()
if (allocated(a%val)) then
nnz = min(nnz,size(a%val))
#if defined(OPENMP)
res = dzero
!$omp parallel do private(i) reduction(max: res)
do i=1, nnz
res = max(res,abs(a%val(i)))
end do
#else
res = maxval(abs(a%val(1:nnz)))
#endif
end if
end function psb_z_coo_maxval
@ -2275,11 +2316,13 @@ subroutine psb_z_coo_csgetptn(imin,imax,a,nz,ia,ja,info,&
& iren)
if (rscale_) then
!$omp parallel do private(i)
do i=nzin_+1, nzin_+nz
ia(i) = ia(i) - imin + 1
end do
end if
if (cscale_) then
!$omp parallel do private(i)
do i=nzin_+1, nzin_+nz
ja(i) = ja(i) - jmin_ + 1
end do
@ -2553,11 +2596,13 @@ subroutine psb_z_coo_csgetrow(imin,imax,a,nz,ia,ja,val,info,&
& iren)
if (rscale_) then
!$omp parallel do private(i)
do i=nzin_+1, nzin_+nz
ia(i) = ia(i) - imin + 1
end do
end if
if (cscale_) then
!$omp parallel do private(i)
do i=nzin_+1, nzin_+nz
ja(i) = ja(i) - jmin_ + 1
end do
@ -2768,7 +2813,6 @@ contains
end subroutine psb_z_coo_csgetrow
subroutine psb_z_coo_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info)
use psb_error_mod
use psb_realloc_mod
@ -3021,7 +3065,6 @@ contains
end subroutine psb_z_coo_csput_a
subroutine psb_z_cp_coo_to_coo(a,b,info)
use psb_error_mod
use psb_z_base_mat_mod, psb_protect_name => psb_z_cp_coo_to_coo
@ -3045,10 +3088,21 @@ subroutine psb_z_cp_coo_to_coo(a,b,info)
call b%set_nzeros(nz)
call b%reallocate(nz)
#if defined(OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, nz
b%ia(i) = a%ia(i)
b%ja(i) = a%ja(i)
b%val(i) = a%val(i)
end do
end block
#else
b%ia(1:nz) = a%ia(1:nz)
b%ja(1:nz) = a%ja(1:nz)
b%val(1:nz) = a%val(1:nz)
#endif
call b%set_host()
if (.not.b%is_by_rows()) call b%fix(info)
@ -3087,10 +3141,21 @@ subroutine psb_z_cp_coo_from_coo(a,b,info)
call a%set_nzeros(nz)
call a%reallocate(nz)
#if defined(OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, nz
a%ia(i) = b%ia(i)
a%ja(i) = b%ja(i)
a%val(i) = b%val(i)
end do
end block
#else
a%ia(1:nz) = b%ia(1:nz)
a%ja(1:nz) = b%ja(1:nz)
a%val(1:nz) = b%val(1:nz)
#endif
call a%set_host()
if (.not.a%is_by_rows()) call a%fix(info)
@ -3445,8 +3510,6 @@ subroutine psb_z_fix_coo(a,info,idir)
end subroutine psb_z_fix_coo
subroutine psb_z_fix_coo_inner(nr,nc,nzin,dupl,ia,ja,val,nzout,info,idir)
use psb_const_mod
use psb_error_mod
@ -4174,7 +4237,6 @@ subroutine psb_z_fix_coo_inner(nr,nc,nzin,dupl,ia,ja,val,nzout,info,idir)
end subroutine psb_z_fix_coo_inner
subroutine psb_z_cp_coo_to_lcoo(a,b,info)
use psb_error_mod
use psb_z_base_mat_mod, psb_protect_name => psb_z_cp_coo_to_lcoo
@ -4199,10 +4261,21 @@ subroutine psb_z_cp_coo_to_lcoo(a,b,info)
call b%set_nzeros(nz)
call b%reallocate(nz)
#if defined(OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, nz
b%ia(i) = a%ia(i)
b%ja(i) = a%ja(i)
b%val(i) = a%val(i)
end do
end block
#else
b%ia(1:nz) = a%ia(1:nz)
b%ja(1:nz) = a%ja(1:nz)
b%val(1:nz) = a%val(1:nz)
#endif
call b%set_host()
if (.not.b%is_by_rows()) call b%fix(info)
@ -4240,10 +4313,21 @@ subroutine psb_z_cp_coo_from_lcoo(a,b,info)
call a%set_nzeros(nz)
call a%reallocate(nz)
#if defined(OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, nz
a%ia(i) = b%ia(i)
a%ja(i) = b%ja(i)
a%val(i) = b%val(i)
end do
end block
#else
a%ia(1:nz) = b%ia(1:nz)
a%ja(1:nz) = b%ja(1:nz)
a%val(1:nz) = b%val(1:nz)
#endif
call a%set_host()
if (.not.a%is_by_rows()) call a%fix(info)
@ -4442,7 +4526,17 @@ function psb_lz_coo_maxval(a) result(res)
nnz = a%get_nzeros()
if (allocated(a%val)) then
nnz = min(nnz,size(a%val))
#if defined(OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, nnz
res = max(res,abs(a%val(i)))
end do
end block
#else
res = maxval(abs(a%val(1:nnz)))
#endif
end if
end function psb_lz_coo_maxval
@ -4499,7 +4593,17 @@ function psb_lz_coo_csnmi(a) result(res)
i = a%ia(j)
vt(i) = vt(i) + abs(a%val(j))
end do
#if defined(OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, m
res = max(res,abs(vt(i)))
end do
end block
#else
res = maxval(vt(1:m))
#endif
deallocate(vt,stat=info)
end if
@ -4539,7 +4643,17 @@ function psb_lz_coo_csnm1(a) result(res)
i = a%ja(j)
vt(i) = vt(i) + abs(a%val(j))
end do
#if defined(OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, n
res = max(res,abs(vt(i)))
end do
end block
#else
res = maxval(vt(1:n))
#endif
deallocate(vt,stat=info)
return
@ -4584,7 +4698,6 @@ subroutine psb_lz_coo_rowsum(d,a)
d(i) = d(i) + a%val(j)
end do
return
call psb_erractionrestore(err_act)
return
@ -4592,7 +4705,6 @@ subroutine psb_lz_coo_rowsum(d,a)
9999 call psb_error_handler(err_act)
return
end subroutine psb_lz_coo_rowsum
subroutine psb_lz_coo_arwsum(d,a)
@ -4761,6 +4873,7 @@ subroutine psb_lz_coo_scalplusidentity(d,a,info)
end if
mnm = min(a%get_nrows(),a%get_ncols())
!$omp parallel do private(i,j)
do i=1,a%get_nzeros()
a%val(i) = a%val(i) * d
j=a%ia(i)
@ -4813,12 +4926,30 @@ subroutine psb_lz_coo_spaxpby(alpha,a,beta,b,info)
! Allocate (temporary) space for the solution
call tcoo%allocate(M,N,(nza+nzb))
! Compute the sum
#if defined(OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, nza
tcoo%ia(i) = a%ia(i)
tcoo%ja(i) = a%ja(i)
tcoo%val(i) = alpha*a%val(i)
end do
!$omp parallel do private(i)
do i=1, nzb
tcoo%ia(nza+i) = bcoo%ia(i)
tcoo%ja(nza+i) = bcoo%ja(i)
tcoo%val(nza+i) = beta*bcoo%val(i)
end do
end block
#else
tcoo%ia(1:nza) = a%ia(1:nza)
tcoo%ja(1:nza) = a%ja(1:nza)
tcoo%val(1:nza) = alpha*a%val(1:nza)
tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb)
tcoo%ja(nza+1:nza+nzb) = bcoo%ja(1:nzb)
tcoo%val(nza+1:nza+nzb) = beta*bcoo%val(1:nzb)
#endif
! Fix the indexes
call tcoo%fix(info)
! Move to correct output format
@ -4906,12 +5037,30 @@ function psb_lz_coo_cmpmat(a,b,tol,info) result(res)
! Allocate (temporary) space for the solution
call tcoo%allocate(M,N,(nza+nzb))
! Compute the sum
#if defined(OPENMP)
block
integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1, nza
tcoo%ia(i) = a%ia(i)
tcoo%ja(i) = a%ja(i)
tcoo%val(i) = a%val(i)
end do
!$omp parallel do private(i)
do i=1, nzb
tcoo%ia(nza+i) = bcoo%ia(i)
tcoo%ja(nza+i) = bcoo%ja(i)
tcoo%val(nza+i) = (-1_psb_dpk_)*bcoo%val(i)
end do
end block
#else
tcoo%ia(1:nza) = a%ia(1:nza)
tcoo%ja(1:nza) = a%ja(1:nza)
tcoo%val(1:nza) = a%val(1:nza)
tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb)
tcoo%ja(nza+1:nza+nzb) = bcoo%ja(1:nzb)
tcoo%val(nza+1:nza+nzb) = (-1_psb_dpk_)*bcoo%val(1:nzb)
#endif
! Fix the indexes
call tcoo%fix(info)
if (info /= psb_success_) then
@ -5950,7 +6099,7 @@ subroutine psb_lz_coo_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info)
if (nz < 0) then
info = psb_err_iarg_neg_
call psb_errpush(info,name,i_err=(/1_psb_ipk_/))
3 call psb_errpush(info,name,i_err=(/1_psb_ipk_/))
goto 9999
end if
if (size(ia) < nz) then

@ -130,10 +130,12 @@ contains
if (alpha == zzero) then
if (beta == zzero) then
!$omp parallel do private(i)
do i = 1, m
y(i) = zzero
enddo
else
!$omp parallel do private(i)
do i = 1, m
y(i) = beta*y(i)
end do
@ -147,6 +149,7 @@ contains
if (beta == zzero) then
if (alpha == zone) then
!$omp parallel do private(i,j, acc) schedule(static)
do i=1,m
acc = zzero
do j=irp(i), irp(i+1)-1
@ -157,6 +160,7 @@ contains
else if (alpha == -zone) then
!$omp parallel do private(i,j, acc)
do i=1,m
acc = zzero
do j=irp(i), irp(i+1)-1
@ -167,6 +171,7 @@ contains
else
!$omp parallel do private(i,j,acc)
do i=1,m
acc = zzero
do j=irp(i), irp(i+1)-1
@ -181,6 +186,7 @@ contains
else if (beta == zone) then
if (alpha == zone) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc = zzero
do j=irp(i), irp(i+1)-1
@ -191,6 +197,7 @@ contains
else if (alpha == -zone) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc = zzero
do j=irp(i), irp(i+1)-1
@ -201,6 +208,7 @@ contains
else
!$omp parallel do private(i,j,acc)
do i=1,m
acc = zzero
do j=irp(i), irp(i+1)-1
@ -214,6 +222,7 @@ contains
else if (beta == -zone) then
if (alpha == zone) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc = zzero
do j=irp(i), irp(i+1)-1
@ -224,6 +233,7 @@ contains
else if (alpha == -zone) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc = zzero
do j=irp(i), irp(i+1)-1
@ -234,6 +244,7 @@ contains
else
!$omp parallel do private(i,j,acc)
do i=1,m
acc = zzero
do j=irp(i), irp(i+1)-1
@ -247,6 +258,7 @@ contains
else
if (alpha == zone) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc = zzero
do j=irp(i), irp(i+1)-1
@ -257,6 +269,7 @@ contains
else if (alpha == -zone) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc = zzero
do j=irp(i), irp(i+1)-1
@ -267,6 +280,7 @@ contains
else
!$omp parallel do private(i,j,acc)
do i=1,m
acc = zzero
do j=irp(i), irp(i+1)-1
@ -282,16 +296,19 @@ contains
else if (tra) then
if (beta == zzero) then
!$omp parallel do private(i)
do i=1, m
y(i) = zzero
end do
else if (beta == zone) then
! Do nothing
else if (beta == -zone) then
!$omp parallel do private(i)
do i=1, m
y(i) = -y(i)
end do
else
!$omp parallel do private(i)
do i=1, m
y(i) = beta*y(i)
end do
@ -476,16 +493,18 @@ contains
complex(psb_dpk_), intent(inout) :: y(ldy,*)
logical, intent(in) :: is_triangle,is_unit,tra,ctra
complex(psb_dpk_), intent(inout) :: acc(*)
complex(psb_dpk_), intent(inout) :: acc(:)
integer(psb_ipk_) :: i,j, ir
if (alpha == zzero) then
if (beta == zzero) then
!$omp parallel do private(i)
do i = 1, m
y(i,1:nc) = zzero
enddo
else
!$omp parallel do private(i)
do i = 1, m
y(i,1:nc) = beta*y(i,1:nc)
end do
@ -497,6 +516,7 @@ contains
if (beta == zzero) then
if (alpha == zone) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = zzero
do j=irp(i), irp(i+1)-1
@ -507,6 +527,7 @@ contains
else if (alpha == -zone) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = zzero
do j=irp(i), irp(i+1)-1
@ -517,6 +538,7 @@ contains
else
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = zzero
do j=irp(i), irp(i+1)-1
@ -531,6 +553,7 @@ contains
else if (beta == zone) then
if (alpha == zone) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = zzero
do j=irp(i), irp(i+1)-1
@ -541,6 +564,7 @@ contains
else if (alpha == -zone) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = zzero
do j=irp(i), irp(i+1)-1
@ -551,6 +575,7 @@ contains
else
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = zzero
do j=irp(i), irp(i+1)-1
@ -564,6 +589,7 @@ contains
else if (beta == -zone) then
if (alpha == zone) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = zzero
do j=irp(i), irp(i+1)-1
@ -574,6 +600,7 @@ contains
else if (alpha == -zone) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = zzero
do j=irp(i), irp(i+1)-1
@ -584,6 +611,7 @@ contains
else
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = zzero
do j=irp(i), irp(i+1)-1
@ -597,6 +625,7 @@ contains
else
if (alpha == zone) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = zzero
do j=irp(i), irp(i+1)-1
@ -607,6 +636,7 @@ contains
else if (alpha == -zone) then
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = zzero
do j=irp(i), irp(i+1)-1
@ -617,6 +647,7 @@ contains
else
!$omp parallel do private(i,j,acc)
do i=1,m
acc(1:nc) = zzero
do j=irp(i), irp(i+1)-1

@ -582,7 +582,7 @@ end subroutine psb_z_get_neigh
subroutine psb_z_csall(nr,nc,a,info,nz)
subroutine psb_z_csall(nr,nc,a,info,nz,type,mold)
use psb_z_mat_mod, psb_protect_name => psb_z_csall
use psb_z_base_mat_mod
use psb_error_mod
@ -591,6 +591,8 @@ subroutine psb_z_csall(nr,nc,a,info,nz)
integer(psb_ipk_), intent(in) :: nr,nc
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: nz
character(len=*), intent(in), optional :: type
class(psb_z_base_sparse_mat), optional, intent(in) :: mold
integer(psb_ipk_) :: err_act
character(len=20) :: name='csall'
@ -601,7 +603,23 @@ subroutine psb_z_csall(nr,nc,a,info,nz)
call a%free()
info = psb_success_
if (present(mold)) then
allocate(a%a, stat=info, mold=mold)
else if (present(type)) then
select case (type)
case('CSR')
allocate(psb_z_csr_sparse_mat :: a%a, stat=info)
case('COO')
allocate(psb_z_coo_sparse_mat :: a%a, stat=info)
case('CSC')
allocate(psb_z_csc_sparse_mat :: a%a, stat=info)
case default
allocate(psb_z_coo_sparse_mat :: a%a, stat=info)
end select
else
allocate(psb_z_coo_sparse_mat :: a%a, stat=info)
end if
if (info /= psb_success_) then
info = psb_err_alloc_dealloc_
call psb_errpush(info, name)
@ -3381,7 +3399,7 @@ end subroutine psb_lz_get_neigh
subroutine psb_lz_csall(nr,nc,a,info,nz)
subroutine psb_lz_csall(nr,nc,a,info,nz,type,mold)
use psb_z_mat_mod, psb_protect_name => psb_lz_csall
use psb_z_base_mat_mod
use psb_error_mod
@ -3390,6 +3408,8 @@ subroutine psb_lz_csall(nr,nc,a,info,nz)
integer(psb_lpk_), intent(in) :: nr,nc
integer(psb_ipk_), intent(out) :: info
integer(psb_lpk_), intent(in), optional :: nz
character(len=*), intent(in), optional :: type
class(psb_lz_base_sparse_mat), optional, intent(in) :: mold
integer(psb_ipk_) :: err_act
character(len=20) :: name='csall'
@ -3400,7 +3420,22 @@ subroutine psb_lz_csall(nr,nc,a,info,nz)
call a%free()
info = psb_success_
if (present(mold)) then
allocate(a%a, stat=info, mold=mold)
else if (present(type)) then
select case (type)
case('CSR')
allocate(psb_lz_csr_sparse_mat :: a%a, stat=info)
case('COO')
allocate(psb_lz_coo_sparse_mat :: a%a, stat=info)
case('CSC')
allocate(psb_lz_csc_sparse_mat :: a%a, stat=info)
case default
allocate(psb_lz_coo_sparse_mat :: a%a, stat=info)
end select
else
allocate(psb_lz_coo_sparse_mat :: a%a, stat=info)
end if
if (info /= psb_success_) then
info = psb_err_alloc_dealloc_
call psb_errpush(info, name)

@ -1,246 +0,0 @@
!
! Parallel Sparse BLAS version 3.5
! (C) Copyright 2006-2018
! Salvatore Filippone
! Alfredo Buttari University of Rome Tor Vergata
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the PSBLAS group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
!
! File: psb_cgelp.f90
!
!
! Subroutine: psb_cgelp
! Apply a left permutation to a dense matrix
!
! Arguments:
! trans - character.
! iperm - integer.
! x - real, dimension(:,:).
! info - integer. Return code.
subroutine psb_cgelp(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_cgelp
use psb_const_mod
use psb_error_mod
implicit none
complex(psb_spk_), intent(inout) :: x(:,:)
integer(psb_ipk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
! local variables
complex(psb_spk_),allocatable :: temp(:)
integer(psb_ipk_) :: int_err(5), i1sz, i2sz, err_act,i,j
integer(psb_ipk_), allocatable :: itemp(:)
complex(psb_spk_),parameter :: one=1
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name, ch_err
name = 'psb_cgelp'
if(psb_get_errstatus() /= 0) return
info=psb_success_
call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
i1sz = size(x,dim=1)
i2sz = size(x,dim=2)
if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name),': size',i1sz,i2sz
allocate(temp(i1sz),itemp(size(iperm)),stat=info)
if (info /= psb_success_) then
info=2040
call psb_errpush(info,name)
goto 9999
end if
itemp(:) = iperm(:)
if (.not.psb_isaperm(i1sz,itemp)) then
info=psb_err_iarg_invalid_value_
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
goto 9999
endif
select case( psb_toupper(trans))
case('N')
do j=1,i2sz
do i=1,i1sz
temp(i) = x(itemp(i),j)
end do
do i=1,i1sz
x(i,j) = temp(i)
end do
end do
case('T')
do j=1,i2sz
do i=1,i1sz
temp(itemp(i)) = x(i,j)
end do
do i=1,i1sz
x(i,j) = temp(i)
end do
end do
case default
info=psb_err_from_subroutine_
ch_err='dgelp'
call psb_errpush(info,name,a_err=ch_err)
end select
deallocate(temp,itemp)
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_cgelp
!!$
!!$ Parallel Sparse BLAS version 3.5
!!$ (C) Copyright 2006-2018
!!$ Salvatore Filippone University of Rome Tor Vergata
!!$ Alfredo Buttari University of Rome Tor Vergata
!!$
!!$ Redistribution and use in source and binary forms, with or without
!!$ modification, are permitted provided that the following conditions
!!$ are met:
!!$ 1. Redistributions of source code must retain the above copyright
!!$ notice, this list of conditions and the following disclaimer.
!!$ 2. Redistributions in binary form must reproduce the above copyright
!!$ notice, this list of conditions, and the following disclaimer in the
!!$ documentation and/or other materials provided with the distribution.
!!$ 3. The name of the PSBLAS group or the names of its contributors may
!!$ not be used to endorse or promote products derived from this
!!$ software without specific written permission.
!!$
!!$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!!$ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
!!$ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
!!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
!!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
!!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
!!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
!!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
!!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
!!$ POSSIBILITY OF SUCH DAMAGE.
!!$
!!$
!
!
! Subroutine: psb_cgelpv
! Apply a left permutation to a dense matrix
!
! Arguments:
! trans - character.
! iperm - integer.
! x - real, dimension(:).
! info - integer. Return code.
subroutine psb_cgelpv(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_cgelpv
use psb_const_mod
use psb_error_mod
implicit none
complex(psb_spk_), intent(inout) :: x(:)
integer(psb_ipk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
! local variables
integer(psb_ipk_) :: int_err(5), i1sz, err_act, i
complex(psb_spk_),allocatable :: temp(:)
integer(psb_ipk_), allocatable :: itemp(:)
complex(psb_spk_),parameter :: one=1
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name, ch_err
name = 'psb_cgelpv'
if(psb_get_errstatus() /= 0) return
info=psb_success_
call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
i1sz = min(size(x),size(iperm))
if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name),': size',i1sz
allocate(temp(i1sz),itemp(size(iperm)),stat=info)
if (info /= psb_success_) then
info=2040
call psb_errpush(info,name)
goto 9999
end if
itemp(:) = iperm(:)
if (.not.psb_isaperm(i1sz,itemp)) then
info=psb_err_iarg_invalid_value_
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
goto 9999
endif
select case( psb_toupper(trans))
case('N')
do i=1,i1sz
temp(i) = x(itemp(i))
end do
do i=1,i1sz
x(i) = temp(i)
end do
case('T')
do i=1,i1sz
temp(itemp(i)) = x(i)
end do
do i=1,i1sz
x(i) = temp(i)
end do
case default
info=psb_err_from_subroutine_
ch_err='dgelp'
call psb_errpush(info,name,a_err=ch_err)
end select
deallocate(temp,itemp)
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_cgelpv

@ -1,246 +0,0 @@
!
! Parallel Sparse BLAS version 3.5
! (C) Copyright 2006-2018
! Salvatore Filippone
! Alfredo Buttari University of Rome Tor Vergata
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the PSBLAS group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
!
! File: psb_dgelp.f90
!
!
! Subroutine: psb_dgelp
! Apply a left permutation to a dense matrix
!
! Arguments:
! trans - character.
! iperm - integer.
! x - real, dimension(:,:).
! info - integer. Return code.
subroutine psb_dgelp(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_dgelp
use psb_const_mod
use psb_error_mod
implicit none
real(psb_dpk_), intent(inout) :: x(:,:)
integer(psb_ipk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
! local variables
real(psb_dpk_),allocatable :: temp(:)
integer(psb_ipk_) :: int_err(5), i1sz, i2sz, err_act,i,j
integer(psb_ipk_), allocatable :: itemp(:)
real(psb_dpk_),parameter :: one=1
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name, ch_err
name = 'psb_dgelp'
if(psb_get_errstatus() /= 0) return
info=psb_success_
call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
i1sz = size(x,dim=1)
i2sz = size(x,dim=2)
if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name),': size',i1sz,i2sz
allocate(temp(i1sz),itemp(size(iperm)),stat=info)
if (info /= psb_success_) then
info=2040
call psb_errpush(info,name)
goto 9999
end if
itemp(:) = iperm(:)
if (.not.psb_isaperm(i1sz,itemp)) then
info=psb_err_iarg_invalid_value_
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
goto 9999
endif
select case( psb_toupper(trans))
case('N')
do j=1,i2sz
do i=1,i1sz
temp(i) = x(itemp(i),j)
end do
do i=1,i1sz
x(i,j) = temp(i)
end do
end do
case('T')
do j=1,i2sz
do i=1,i1sz
temp(itemp(i)) = x(i,j)
end do
do i=1,i1sz
x(i,j) = temp(i)
end do
end do
case default
info=psb_err_from_subroutine_
ch_err='dgelp'
call psb_errpush(info,name,a_err=ch_err)
end select
deallocate(temp,itemp)
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_dgelp
!!$
!!$ Parallel Sparse BLAS version 3.5
!!$ (C) Copyright 2006-2018
!!$ Salvatore Filippone University of Rome Tor Vergata
!!$ Alfredo Buttari University of Rome Tor Vergata
!!$
!!$ Redistribution and use in source and binary forms, with or without
!!$ modification, are permitted provided that the following conditions
!!$ are met:
!!$ 1. Redistributions of source code must retain the above copyright
!!$ notice, this list of conditions and the following disclaimer.
!!$ 2. Redistributions in binary form must reproduce the above copyright
!!$ notice, this list of conditions, and the following disclaimer in the
!!$ documentation and/or other materials provided with the distribution.
!!$ 3. The name of the PSBLAS group or the names of its contributors may
!!$ not be used to endorse or promote products derived from this
!!$ software without specific written permission.
!!$
!!$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!!$ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
!!$ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
!!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
!!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
!!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
!!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
!!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
!!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
!!$ POSSIBILITY OF SUCH DAMAGE.
!!$
!!$
!
!
! Subroutine: psb_dgelpv
! Apply a left permutation to a dense matrix
!
! Arguments:
! trans - character.
! iperm - integer.
! x - real, dimension(:).
! info - integer. Return code.
subroutine psb_dgelpv(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_dgelpv
use psb_const_mod
use psb_error_mod
implicit none
real(psb_dpk_), intent(inout) :: x(:)
integer(psb_ipk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
! local variables
integer(psb_ipk_) :: int_err(5), i1sz, err_act, i
real(psb_dpk_),allocatable :: temp(:)
integer(psb_ipk_), allocatable :: itemp(:)
real(psb_dpk_),parameter :: one=1
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name, ch_err
name = 'psb_dgelpv'
if(psb_get_errstatus() /= 0) return
info=psb_success_
call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
i1sz = min(size(x),size(iperm))
if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name),': size',i1sz
allocate(temp(i1sz),itemp(size(iperm)),stat=info)
if (info /= psb_success_) then
info=2040
call psb_errpush(info,name)
goto 9999
end if
itemp(:) = iperm(:)
if (.not.psb_isaperm(i1sz,itemp)) then
info=psb_err_iarg_invalid_value_
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
goto 9999
endif
select case( psb_toupper(trans))
case('N')
do i=1,i1sz
temp(i) = x(itemp(i))
end do
do i=1,i1sz
x(i) = temp(i)
end do
case('T')
do i=1,i1sz
temp(itemp(i)) = x(i)
end do
do i=1,i1sz
x(i) = temp(i)
end do
case default
info=psb_err_from_subroutine_
ch_err='dgelp'
call psb_errpush(info,name,a_err=ch_err)
end select
deallocate(temp,itemp)
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_dgelpv

@ -1,247 +0,0 @@
!
! Parallel Sparse BLAS version 3.5
! (C) Copyright 2006-2018
! Salvatore Filippone
! Alfredo Buttari University of Rome Tor Vergata
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the PSBLAS group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
!
! File: psb_sgelp.f90
!
!
! Subroutine: psb_sgelp
! Apply a left permutation to a dense matrix
!
! Arguments:
! trans - character.
! iperm - integer.
! x - real, dimension(:,:).
! info - integer. Return code.
subroutine psb_sgelp(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_sgelp
use psb_const_mod
use psb_error_mod
implicit none
real(psb_spk_), intent(inout) :: x(:,:)
integer(psb_ipk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
! local variables
integer(psb_ipk_) :: ctxt
real(psb_spk_),allocatable :: temp(:)
integer(psb_ipk_) :: int_err(5), i1sz, i2sz, err_act,i,j
integer(psb_ipk_), allocatable :: itemp(:)
real(psb_spk_),parameter :: one=1
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name, ch_err
name = 'psb_sgelp'
if(psb_get_errstatus() /= 0) return
info=psb_success_
call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
i1sz = size(x,dim=1)
i2sz = size(x,dim=2)
if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name),': size',i1sz,i2sz
allocate(temp(i1sz),itemp(size(iperm)),stat=info)
if (info /= psb_success_) then
info=2040
call psb_errpush(info,name)
goto 9999
end if
itemp(:) = iperm(:)
if (.not.psb_isaperm(i1sz,itemp)) then
info=psb_err_iarg_invalid_value_
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
goto 9999
endif
select case( psb_toupper(trans))
case('N')
do j=1,i2sz
do i=1,i1sz
temp(i) = x(itemp(i),j)
end do
do i=1,i1sz
x(i,j) = temp(i)
end do
end do
case('T')
do j=1,i2sz
do i=1,i1sz
temp(itemp(i)) = x(i,j)
end do
do i=1,i1sz
x(i,j) = temp(i)
end do
end do
case default
info=psb_err_from_subroutine_
ch_err='dgelp'
call psb_errpush(info,name,a_err=ch_err)
end select
deallocate(temp,itemp)
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_sgelp
!!$
!!$ Parallel Sparse BLAS version 3.5
!!$ (C) Copyright 2006-2018
!!$ Salvatore Filippone University of Rome Tor Vergata
!!$ Alfredo Buttari University of Rome Tor Vergata
!!$
!!$ Redistribution and use in source and binary forms, with or without
!!$ modification, are permitted provided that the following conditions
!!$ are met:
!!$ 1. Redistributions of source code must retain the above copyright
!!$ notice, this list of conditions and the following disclaimer.
!!$ 2. Redistributions in binary form must reproduce the above copyright
!!$ notice, this list of conditions, and the following disclaimer in the
!!$ documentation and/or other materials provided with the distribution.
!!$ 3. The name of the PSBLAS group or the names of its contributors may
!!$ not be used to endorse or promote products derived from this
!!$ software without specific written permission.
!!$
!!$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!!$ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
!!$ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
!!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
!!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
!!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
!!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
!!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
!!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
!!$ POSSIBILITY OF SUCH DAMAGE.
!!$
!!$
!
!
! Subroutine: psb_sgelpv
! Apply a left permutation to a dense matrix
!
! Arguments:
! trans - character.
! iperm - integer.
! x - real, dimension(:).
! info - integer. Return code.
subroutine psb_sgelpv(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_sgelpv
use psb_const_mod
use psb_error_mod
implicit none
real(psb_spk_), intent(inout) :: x(:)
integer(psb_ipk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
! local variables
integer(psb_ipk_) :: ctxt
integer(psb_ipk_) :: int_err(5), i1sz, err_act, i
real(psb_spk_),allocatable :: temp(:)
integer(psb_ipk_), allocatable :: itemp(:)
real(psb_spk_),parameter :: one=1
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name, ch_err
name = 'psb_sgelpv'
if(psb_get_errstatus() /= 0) return
info=psb_success_
call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
i1sz = min(size(x),size(iperm))
if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name),': size',i1sz
allocate(temp(i1sz),itemp(size(iperm)),stat=info)
if (info /= psb_success_) then
info=2040
call psb_errpush(info,name)
goto 9999
end if
itemp(:) = iperm(:)
if (.not.psb_isaperm(i1sz,itemp)) then
info=psb_err_iarg_invalid_value_
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
goto 9999
endif
select case( psb_toupper(trans))
case('N')
do i=1,i1sz
temp(i) = x(itemp(i))
end do
do i=1,i1sz
x(i) = temp(i)
end do
case('T')
do i=1,i1sz
temp(itemp(i)) = x(i)
end do
do i=1,i1sz
x(i) = temp(i)
end do
case default
info=psb_err_from_subroutine_
ch_err='dgelp'
call psb_errpush(info,name,a_err=ch_err)
end select
deallocate(temp,itemp)
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_sgelpv

@ -1,246 +0,0 @@
!
! Parallel Sparse BLAS version 3.5
! (C) Copyright 2006-2018
! Salvatore Filippone
! Alfredo Buttari University of Rome Tor Vergata
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the PSBLAS group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
!
! File: psb_zgelp.f90
!
!
! Subroutine: psb_zgelp
! Apply a left permutation to a dense matrix
!
! Arguments:
! trans - character.
! iperm - integer.
! x - real, dimension(:,:).
! info - integer. Return code.
subroutine psb_zgelp(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_zgelp
use psb_const_mod
use psb_error_mod
implicit none
complex(psb_dpk_), intent(inout) :: x(:,:)
integer(psb_ipk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
! local variables
complex(psb_dpk_),allocatable :: temp(:)
integer(psb_ipk_) :: int_err(5), i1sz, i2sz, err_act,i,j
integer(psb_ipk_), allocatable :: itemp(:)
complex(psb_dpk_),parameter :: one=1
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name, ch_err
name = 'psb_zgelp'
if(psb_get_errstatus() /= 0) return
info=psb_success_
call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
i1sz = size(x,dim=1)
i2sz = size(x,dim=2)
if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name),': size',i1sz,i2sz
allocate(temp(i1sz),itemp(size(iperm)),stat=info)
if (info /= psb_success_) then
info=2040
call psb_errpush(info,name)
goto 9999
end if
itemp(:) = iperm(:)
if (.not.psb_isaperm(i1sz,itemp)) then
info=psb_err_iarg_invalid_value_
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
goto 9999
endif
select case( psb_toupper(trans))
case('N')
do j=1,i2sz
do i=1,i1sz
temp(i) = x(itemp(i),j)
end do
do i=1,i1sz
x(i,j) = temp(i)
end do
end do
case('T')
do j=1,i2sz
do i=1,i1sz
temp(itemp(i)) = x(i,j)
end do
do i=1,i1sz
x(i,j) = temp(i)
end do
end do
case default
info=psb_err_from_subroutine_
ch_err='dgelp'
call psb_errpush(info,name,a_err=ch_err)
end select
deallocate(temp,itemp)
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_zgelp
!!$
!!$ Parallel Sparse BLAS version 3.5
!!$ (C) Copyright 2006-2018
!!$ Salvatore Filippone University of Rome Tor Vergata
!!$ Alfredo Buttari University of Rome Tor Vergata
!!$
!!$ Redistribution and use in source and binary forms, with or without
!!$ modification, are permitted provided that the following conditions
!!$ are met:
!!$ 1. Redistributions of source code must retain the above copyright
!!$ notice, this list of conditions and the following disclaimer.
!!$ 2. Redistributions in binary form must reproduce the above copyright
!!$ notice, this list of conditions, and the following disclaimer in the
!!$ documentation and/or other materials provided with the distribution.
!!$ 3. The name of the PSBLAS group or the names of its contributors may
!!$ not be used to endorse or promote products derived from this
!!$ software without specific written permission.
!!$
!!$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!!$ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
!!$ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
!!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
!!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
!!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
!!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
!!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
!!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
!!$ POSSIBILITY OF SUCH DAMAGE.
!!$
!!$
!
!
! Subroutine: psb_zgelpv
! Apply a left permutation to a dense matrix
!
! Arguments:
! trans - character.
! iperm - integer.
! x - real, dimension(:).
! info - integer. Return code.
subroutine psb_zgelpv(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_zgelpv
use psb_const_mod
use psb_error_mod
implicit none
complex(psb_dpk_), intent(inout) :: x(:)
integer(psb_ipk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
! local variables
integer(psb_ipk_) :: int_err(5), i1sz, err_act, i
complex(psb_dpk_),allocatable :: temp(:)
integer(psb_ipk_), allocatable :: itemp(:)
complex(psb_dpk_),parameter :: one=1
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name, ch_err
name = 'psb_zgelpv'
if(psb_get_errstatus() /= 0) return
info=psb_success_
call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
i1sz = min(size(x),size(iperm))
if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name),': size',i1sz
allocate(temp(i1sz),itemp(size(iperm)),stat=info)
if (info /= psb_success_) then
info=2040
call psb_errpush(info,name)
goto 9999
end if
itemp(:) = iperm(:)
if (.not.psb_isaperm(i1sz,itemp)) then
info=psb_err_iarg_invalid_value_
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
goto 9999
endif
select case( psb_toupper(trans))
case('N')
do i=1,i1sz
temp(i) = x(itemp(i))
end do
do i=1,i1sz
x(i) = temp(i)
end do
case('T')
do i=1,i1sz
temp(itemp(i)) = x(i)
end do
do i=1,i1sz
x(i) = temp(i)
end do
case default
info=psb_err_from_subroutine_
ch_err='dgelp'
call psb_errpush(info,name,a_err=ch_err)
end select
deallocate(temp,itemp)
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_zgelpv

@ -29,6 +29,407 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine psb_m_cgelp(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_m_cgelp
use psb_const_mod
use psb_error_mod
implicit none
complex(psb_spk_), intent(inout) :: x(:,:)
integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
! local variables
complex(psb_spk_),allocatable :: temp(:)
integer(psb_ipk_) :: int_err(5), i1sz, i2sz, err_act,i,j
integer(psb_ipk_), allocatable :: itemp(:)
complex(psb_spk_),parameter :: one=1
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
name = 'psb_cgelp'
if(psb_get_errstatus() /= 0) return
info=psb_success_
call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
i1sz = size(x,dim=1)
i2sz = size(x,dim=2)
if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name),': size',i1sz,i2sz
allocate(temp(i1sz),itemp(size(iperm)),stat=info)
if (info /= psb_success_) then
info=2040
call psb_errpush(info,name)
goto 9999
end if
itemp(:) = iperm(:)
if (.not.psb_isaperm(i1sz,itemp)) then
info=psb_err_iarg_invalid_value_
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
goto 9999
endif
select case( psb_toupper(trans))
case('N')
do j=1,i2sz
do i=1,i1sz
temp(i) = x(itemp(i),j)
end do
do i=1,i1sz
x(i,j) = temp(i)
end do
end do
case('T')
do j=1,i2sz
do i=1,i1sz
temp(itemp(i)) = x(i,j)
end do
do i=1,i1sz
x(i,j) = temp(i)
end do
end do
case default
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='cgelp')
end select
deallocate(temp,itemp)
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_m_cgelp
!!$
!!$ Parallel Sparse BLAS version 3.5
!!$ (C) Copyright 2006-2018
!!$ Salvatore Filippone University of Rome Tor Vergata
!!$ Alfredo Buttari University of Rome Tor Vergata
!!$
!!$ Redistribution and use in source and binary forms, with or without
!!$ modification, are permitted provided that the following conditions
!!$ are met:
!!$ 1. Redistributions of source code must retain the above copyright
!!$ notice, this list of conditions and the following disclaimer.
!!$ 2. Redistributions in binary form must reproduce the above copyright
!!$ notice, this list of conditions, and the following disclaimer in the
!!$ documentation and/or other materials provided with the distribution.
!!$ 3. The name of the PSBLAS group or the names of its contributors may
!!$ not be used to endorse or promote products derived from this
!!$ software without specific written permission.
!!$
!!$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!!$ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
!!$ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
!!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
!!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
!!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
!!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
!!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
!!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
!!$ POSSIBILITY OF SUCH DAMAGE.
!!$
!!$
!
!
! Subroutine: psb_cgelpv
! Apply a left permutation to a dense matrix
!
! Arguments:
! trans - character.
! iperm - integer.
! x - real, dimension(:).
! info - integer. Return code.
subroutine psb_m_cgelpv(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_m_cgelpv
use psb_const_mod
use psb_error_mod
implicit none
complex(psb_spk_), intent(inout) :: x(:)
integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
! local variables
integer(psb_ipk_) :: int_err(5), i1sz, err_act, i
complex(psb_spk_),allocatable :: temp(:)
integer(psb_ipk_), allocatable :: itemp(:)
complex(psb_spk_),parameter :: one=1
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
name = 'psb_cgelpv'
if(psb_get_errstatus() /= 0) return
info=psb_success_
call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
i1sz = min(size(x),size(iperm))
if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name),': size',i1sz
allocate(temp(i1sz),itemp(size(iperm)),stat=info)
if (info /= psb_success_) then
info=2040
call psb_errpush(info,name)
goto 9999
end if
itemp(:) = iperm(:)
if (.not.psb_isaperm(i1sz,itemp)) then
info=psb_err_iarg_invalid_value_
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
goto 9999
endif
select case( psb_toupper(trans))
case('N')
do i=1,i1sz
temp(i) = x(itemp(i))
end do
do i=1,i1sz
x(i) = temp(i)
end do
case('T')
do i=1,i1sz
temp(itemp(i)) = x(i)
end do
do i=1,i1sz
x(i) = temp(i)
end do
case default
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='cgelp')
end select
deallocate(temp,itemp)
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_m_cgelpv
subroutine psb_e_cgelp(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_e_cgelp
use psb_const_mod
use psb_error_mod
implicit none
complex(psb_spk_), intent(inout) :: x(:,:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
! local variables
complex(psb_spk_),allocatable :: temp(:)
integer(psb_ipk_) :: int_err(5), err_act
integer(psb_epk_) :: i1sz, i2sz, i, j
integer(psb_epk_), allocatable :: itemp(:)
complex(psb_spk_),parameter :: one=1
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
name = 'psb_cgelp'
if(psb_get_errstatus() /= 0) return
info=psb_success_
call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
i1sz = size(x,dim=1)
i2sz = size(x,dim=2)
if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name),': size',i1sz,i2sz
allocate(temp(i1sz),itemp(size(iperm)),stat=info)
if (info /= psb_success_) then
info=2040
call psb_errpush(info,name)
goto 9999
end if
itemp(:) = iperm(:)
if (.not.psb_isaperm(i1sz,itemp)) then
info=psb_err_iarg_invalid_value_
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
goto 9999
endif
select case( psb_toupper(trans))
case('N')
do j=1,i2sz
do i=1,i1sz
temp(i) = x(itemp(i),j)
end do
do i=1,i1sz
x(i,j) = temp(i)
end do
end do
case('T')
do j=1,i2sz
do i=1,i1sz
temp(itemp(i)) = x(i,j)
end do
do i=1,i1sz
x(i,j) = temp(i)
end do
end do
case default
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='cgelp')
end select
deallocate(temp,itemp)
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_e_cgelp
!!$
!!$ Parallel Sparse BLAS version 3.5
!!$ (C) Copyright 2006-2018
!!$ Salvatore Filippone University of Rome Tor Vergata
!!$ Alfredo Buttari University of Rome Tor Vergata
!!$
!!$ Redistribution and use in source and binary forms, with or without
!!$ modification, are permitted provided that the following conditions
!!$ are met:
!!$ 1. Redistributions of source code must retain the above copyright
!!$ notice, this list of conditions and the following disclaimer.
!!$ 2. Redistributions in binary form must reproduce the above copyright
!!$ notice, this list of conditions, and the following disclaimer in the
!!$ documentation and/or other materials provided with the distribution.
!!$ 3. The name of the PSBLAS group or the names of its contributors may
!!$ not be used to endorse or promote products derived from this
!!$ software without specific written permission.
!!$
!!$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!!$ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
!!$ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
!!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
!!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
!!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
!!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
!!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
!!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
!!$ POSSIBILITY OF SUCH DAMAGE.
!!$
!!$
!
!
! Subroutine: psb_cgelpv
! Apply a left permutation to a dense matrix
!
! Arguments:
! trans - character.
! iperm - integer.
! x - real, dimension(:).
! info - integer. Return code.
subroutine psb_e_cgelpv(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_e_cgelpv
use psb_const_mod
use psb_error_mod
implicit none
complex(psb_spk_), intent(inout) :: x(:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
! local variables
integer(psb_ipk_) :: int_err(5), err_act
complex(psb_spk_),allocatable :: temp(:)
integer(psb_epk_) :: i1sz, i
integer(psb_epk_), allocatable :: itemp(:)
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
name = 'psb_cgelp'
if(psb_get_errstatus() /= 0) return
info=psb_success_
call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
i1sz = min(size(x),size(iperm))
if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name),': size',i1sz
allocate(temp(i1sz),itemp(size(iperm)),stat=info)
if (info /= psb_success_) then
info=2040
call psb_errpush(info,name)
goto 9999
end if
itemp(:) = iperm(:)
if (.not.psb_isaperm(i1sz,itemp)) then
info=psb_err_iarg_invalid_value_
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
goto 9999
endif
select case( psb_toupper(trans))
case('N')
do i=1,i1sz
temp(i) = x(itemp(i))
end do
do i=1,i1sz
x(i) = temp(i)
end do
case('T')
do i=1,i1sz
temp(itemp(i)) = x(i)
end do
do i=1,i1sz
x(i) = temp(i)
end do
case default
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='cgelp')
end select
deallocate(temp,itemp)
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_e_cgelpv
subroutine psi_caxpby(m,n,alpha, x, beta, y, info)
use psb_const_mod
@ -40,7 +441,7 @@ subroutine psi_caxpby(m,n,alpha, x, beta, y, info)
complex(psb_spk_), intent (in) :: alpha, beta
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act
integer(psb_ipk_) :: lx, ly
integer(psb_ipk_) :: lx, ly, i
integer(psb_ipk_) :: ierr(5)
character(len=20) :: name, ch_err
@ -101,6 +502,7 @@ subroutine psi_caxpbyv(m,alpha, x, beta, y, info)
integer(psb_ipk_) :: err_act
integer(psb_ipk_) :: lx, ly
integer(psb_ipk_) :: ierr(5)
integer(psb_ipk_) :: i
character(len=20) :: name, ch_err
name='psb_geaxpby'
@ -131,7 +533,106 @@ subroutine psi_caxpbyv(m,alpha, x, beta, y, info)
goto 9999
end if
if (m>0) call caxpby(m,ione,alpha,x,lx,beta,y,ly,info)
! if (m>0) call caxpby(m,ione,alpha,x,lx,beta,y,ly,info)
if (alpha.eq.czero) then
if (beta.eq.czero) then
!$omp parallel do private(i)
do i=1,m
y(i) = czero
enddo
else if (beta.eq.cone) then
!
! Do nothing!
!
else if (beta.eq.-cone) then
!$omp parallel do private(i)
do i=1,m
y(i) = - y(i)
enddo
else
!$omp parallel do private(i)
do i=1,m
y(i) = beta*y(i)
enddo
endif
else if (alpha.eq.cone) then
if (beta.eq.czero) then
!$omp parallel do private(i)
do i=1,m
y(i) = x(i)
enddo
else if (beta.eq.cone) then
!$omp parallel do private(i)
do i=1,m
y(i) = x(i) + y(i)
enddo
else if (beta.eq.-cone) then
!$omp parallel do private(i)
do i=1,m
y(i) = x(i) - y(i)
enddo
else
!$omp parallel do private(i)
do i=1,m
y(i) = x(i) + beta*y(i)
enddo
endif
else if (alpha.eq.-cone) then
if (beta.eq.czero) then
!$omp parallel do private(i)
do i=1,m
y(i) = -x(i)
enddo
else if (beta.eq.cone) then
!$omp parallel do private(i)
do i=1,m
y(i) = -x(i) + y(i)
enddo
else if (beta.eq.-cone) then
!$omp parallel do private(i)
do i=1,m
y(i) = -x(i) - y(i)
enddo
else
!$omp parallel do private(i)
do i=1,m
y(i) = -x(i) + beta*y(i)
enddo
endif
else
if (beta.eq.czero) then
!$omp parallel do private(i)
do i=1,m
y(i) = alpha*x(i)
enddo
else if (beta.eq.cone) then
!$omp parallel do private(i)
do i=1,m
y(i) = alpha*x(i) + y(i)
enddo
else if (beta.eq.-cone) then
!$omp parallel do private(i)
do i=1,m
y(i) = alpha*x(i) - y(i)
enddo
else
!$omp parallel do private(i)
do i=1,m
y(i) = alpha*x(i) + beta*y(i)
enddo
endif
endif
call psb_erractionrestore(err_act)
return
@ -154,7 +655,7 @@ subroutine psi_caxpbyv2(m,alpha, x, beta, y, z, info)
complex(psb_spk_), intent (in) :: alpha, beta
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act
integer(psb_ipk_) :: lx, ly, lz
integer(psb_ipk_) :: lx, ly, lz, i
integer(psb_ipk_) :: ierr(5)
character(len=20) :: name, ch_err
@ -193,7 +694,105 @@ subroutine psi_caxpbyv2(m,alpha, x, beta, y, z, info)
goto 9999
end if
if (m>0) call caxpbyv2(m,ione,alpha,x,lx,beta,y,ly,z,lz,info)
if (alpha.eq.czero) then
if (beta.eq.czero) then
!$omp parallel do private(i)
do i=1,m
Z(i) = czero
enddo
else if (beta.eq.cone) then
!
! Do nothing!
!
else if (beta.eq.-cone) then
!$omp parallel do private(i)
do i=1,m
Z(i) = - y(i)
enddo
else
!$omp parallel do private(i)
do i=1,m
Z(i) = beta*y(i)
enddo
endif
else if (alpha.eq.cone) then
if (beta.eq.czero) then
!$omp parallel do private(i)
do i=1,m
Z(i) = x(i)
enddo
else if (beta.eq.cone) then
!$omp parallel do private(i)
do i=1,m
Z(i) = x(i) + y(i)
enddo
else if (beta.eq.-cone) then
!$omp parallel do private(i)
do i=1,m
Z(i) = x(i) - y(i)
enddo
else
!$omp parallel do private(i)
do i=1,m
Z(i) = x(i) + beta*y(i)
enddo
endif
else if (alpha.eq.-cone) then
if (beta.eq.czero) then
!$omp parallel do private(i)
do i=1,m
Z(i) = -x(i)
enddo
else if (beta.eq.cone) then
!$omp parallel do private(i)
do i=1,m
Z(i) = -x(i) + y(i)
enddo
else if (beta.eq.-cone) then
!$omp parallel do private(i)
do i=1,m
Z(i) = -x(i) - y(i)
enddo
else
!$omp parallel do private(i)
do i=1,m
Z(i) = -x(i) + beta*y(i)
enddo
endif
else
if (beta.eq.czero) then
!$omp parallel do private(i)
do i=1,m
Z(i) = alpha*x(i)
enddo
else if (beta.eq.cone) then
!$omp parallel do private(i)
do i=1,m
Z(i) = alpha*x(i) + y(i)
enddo
else if (beta.eq.-cone) then
!$omp parallel do private(i)
do i=1,m
Z(i) = alpha*x(i) - y(i)
enddo
else
!$omp parallel do private(i)
do i=1,m
Z(i) = alpha*x(i) + beta*y(i)
enddo
endif
endif
call psb_erractionrestore(err_act)
return
@ -541,6 +1140,7 @@ subroutine caxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
if (alpha.eq.czero) then
if (beta.eq.czero) then
do j=1, n
!$omp parallel do private(i)
do i=1,m
y(i,j) = czero
enddo
@ -552,12 +1152,14 @@ subroutine caxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
else if (beta.eq.-cone) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
y(i,j) = - y(i,j)
enddo
enddo
else
do j=1,n
!$omp parallel do private(i)
do i=1,m
y(i,j) = beta*y(i,j)
enddo
@ -568,12 +1170,14 @@ subroutine caxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
if (beta.eq.czero) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
y(i,j) = x(i,j)
enddo
enddo
else if (beta.eq.cone) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
y(i,j) = x(i,j) + y(i,j)
enddo
@ -581,12 +1185,14 @@ subroutine caxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
else if (beta.eq.-cone) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
y(i,j) = x(i,j) - y(i,j)
enddo
enddo
else
do j=1,n
!$omp parallel do private(i)
do i=1,m
y(i,j) = x(i,j) + beta*y(i,j)
enddo
@ -597,12 +1203,14 @@ subroutine caxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
if (beta.eq.czero) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
y(i,j) = -x(i,j)
enddo
enddo
else if (beta.eq.cone) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
y(i,j) = -x(i,j) + y(i,j)
enddo
@ -610,12 +1218,14 @@ subroutine caxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
else if (beta.eq.-cone) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
y(i,j) = -x(i,j) - y(i,j)
enddo
enddo
else
do j=1,n
!$omp parallel do private(i)
do i=1,m
y(i,j) = -x(i,j) + beta*y(i,j)
enddo
@ -626,12 +1236,14 @@ subroutine caxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
if (beta.eq.czero) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
y(i,j) = alpha*x(i,j)
enddo
enddo
else if (beta.eq.cone) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
y(i,j) = alpha*x(i,j) + y(i,j)
enddo
@ -639,12 +1251,14 @@ subroutine caxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
else if (beta.eq.-cone) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
y(i,j) = alpha*x(i,j) - y(i,j)
enddo
enddo
else
do j=1,n
!$omp parallel do private(i)
do i=1,m
y(i,j) = alpha*x(i,j) + beta*y(i,j)
enddo
@ -730,12 +1344,14 @@ subroutine caxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
else if (beta.eq.-cone) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
Z(i,j) = - y(i,j)
enddo
enddo
else
do j=1,n
!$omp parallel do private(i)
do i=1,m
Z(i,j) = beta*y(i,j)
enddo
@ -746,12 +1362,14 @@ subroutine caxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
if (beta.eq.czero) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
Z(i,j) = x(i,j)
enddo
enddo
else if (beta.eq.cone) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
Z(i,j) = x(i,j) + y(i,j)
enddo
@ -759,12 +1377,14 @@ subroutine caxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
else if (beta.eq.-cone) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
Z(i,j) = x(i,j) - y(i,j)
enddo
enddo
else
do j=1,n
!$omp parallel do private(i)
do i=1,m
Z(i,j) = x(i,j) + beta*y(i,j)
enddo
@ -775,12 +1395,14 @@ subroutine caxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
if (beta.eq.czero) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
Z(i,j) = -x(i,j)
enddo
enddo
else if (beta.eq.cone) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
Z(i,j) = -x(i,j) + y(i,j)
enddo
@ -788,12 +1410,14 @@ subroutine caxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
else if (beta.eq.-cone) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
Z(i,j) = -x(i,j) - y(i,j)
enddo
enddo
else
do j=1,n
!$omp parallel do private(i)
do i=1,m
Z(i,j) = -x(i,j) + beta*y(i,j)
enddo
@ -804,12 +1428,14 @@ subroutine caxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
if (beta.eq.czero) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
Z(i,j) = alpha*x(i,j)
enddo
enddo
else if (beta.eq.cone) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
Z(i,j) = alpha*x(i,j) + y(i,j)
enddo
@ -817,12 +1443,14 @@ subroutine caxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
else if (beta.eq.-cone) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
Z(i,j) = alpha*x(i,j) - y(i,j)
enddo
enddo
else
do j=1,n
!$omp parallel do private(i)
do i=1,m
Z(i,j) = alpha*x(i,j) + beta*y(i,j)
enddo

@ -29,6 +29,407 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine psb_m_dgelp(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_m_dgelp
use psb_const_mod
use psb_error_mod
implicit none
real(psb_dpk_), intent(inout) :: x(:,:)
integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
! local variables
real(psb_dpk_),allocatable :: temp(:)
integer(psb_ipk_) :: int_err(5), i1sz, i2sz, err_act,i,j
integer(psb_ipk_), allocatable :: itemp(:)
real(psb_dpk_),parameter :: one=1
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
name = 'psb_dgelp'
if(psb_get_errstatus() /= 0) return
info=psb_success_
call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
i1sz = size(x,dim=1)
i2sz = size(x,dim=2)
if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name),': size',i1sz,i2sz
allocate(temp(i1sz),itemp(size(iperm)),stat=info)
if (info /= psb_success_) then
info=2040
call psb_errpush(info,name)
goto 9999
end if
itemp(:) = iperm(:)
if (.not.psb_isaperm(i1sz,itemp)) then
info=psb_err_iarg_invalid_value_
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
goto 9999
endif
select case( psb_toupper(trans))
case('N')
do j=1,i2sz
do i=1,i1sz
temp(i) = x(itemp(i),j)
end do
do i=1,i1sz
x(i,j) = temp(i)
end do
end do
case('T')
do j=1,i2sz
do i=1,i1sz
temp(itemp(i)) = x(i,j)
end do
do i=1,i1sz
x(i,j) = temp(i)
end do
end do
case default
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='dgelp')
end select
deallocate(temp,itemp)
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_m_dgelp
!!$
!!$ Parallel Sparse BLAS version 3.5
!!$ (C) Copyright 2006-2018
!!$ Salvatore Filippone University of Rome Tor Vergata
!!$ Alfredo Buttari University of Rome Tor Vergata
!!$
!!$ Redistribution and use in source and binary forms, with or without
!!$ modification, are permitted provided that the following conditions
!!$ are met:
!!$ 1. Redistributions of source code must retain the above copyright
!!$ notice, this list of conditions and the following disclaimer.
!!$ 2. Redistributions in binary form must reproduce the above copyright
!!$ notice, this list of conditions, and the following disclaimer in the
!!$ documentation and/or other materials provided with the distribution.
!!$ 3. The name of the PSBLAS group or the names of its contributors may
!!$ not be used to endorse or promote products derived from this
!!$ software without specific written permission.
!!$
!!$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!!$ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
!!$ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
!!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
!!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
!!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
!!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
!!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
!!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
!!$ POSSIBILITY OF SUCH DAMAGE.
!!$
!!$
!
!
! Subroutine: psb_dgelpv
! Apply a left permutation to a dense matrix
!
! Arguments:
! trans - character.
! iperm - integer.
! x - real, dimension(:).
! info - integer. Return code.
subroutine psb_m_dgelpv(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_m_dgelpv
use psb_const_mod
use psb_error_mod
implicit none
real(psb_dpk_), intent(inout) :: x(:)
integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
! local variables
integer(psb_ipk_) :: int_err(5), i1sz, err_act, i
real(psb_dpk_),allocatable :: temp(:)
integer(psb_ipk_), allocatable :: itemp(:)
real(psb_dpk_),parameter :: one=1
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
name = 'psb_dgelpv'
if(psb_get_errstatus() /= 0) return
info=psb_success_
call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
i1sz = min(size(x),size(iperm))
if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name),': size',i1sz
allocate(temp(i1sz),itemp(size(iperm)),stat=info)
if (info /= psb_success_) then
info=2040
call psb_errpush(info,name)
goto 9999
end if
itemp(:) = iperm(:)
if (.not.psb_isaperm(i1sz,itemp)) then
info=psb_err_iarg_invalid_value_
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
goto 9999
endif
select case( psb_toupper(trans))
case('N')
do i=1,i1sz
temp(i) = x(itemp(i))
end do
do i=1,i1sz
x(i) = temp(i)
end do
case('T')
do i=1,i1sz
temp(itemp(i)) = x(i)
end do
do i=1,i1sz
x(i) = temp(i)
end do
case default
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='dgelp')
end select
deallocate(temp,itemp)
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_m_dgelpv
subroutine psb_e_dgelp(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_e_dgelp
use psb_const_mod
use psb_error_mod
implicit none
real(psb_dpk_), intent(inout) :: x(:,:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
! local variables
real(psb_dpk_),allocatable :: temp(:)
integer(psb_ipk_) :: int_err(5), err_act
integer(psb_epk_) :: i1sz, i2sz, i, j
integer(psb_epk_), allocatable :: itemp(:)
real(psb_dpk_),parameter :: one=1
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
name = 'psb_dgelp'
if(psb_get_errstatus() /= 0) return
info=psb_success_
call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
i1sz = size(x,dim=1)
i2sz = size(x,dim=2)
if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name),': size',i1sz,i2sz
allocate(temp(i1sz),itemp(size(iperm)),stat=info)
if (info /= psb_success_) then
info=2040
call psb_errpush(info,name)
goto 9999
end if
itemp(:) = iperm(:)
if (.not.psb_isaperm(i1sz,itemp)) then
info=psb_err_iarg_invalid_value_
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
goto 9999
endif
select case( psb_toupper(trans))
case('N')
do j=1,i2sz
do i=1,i1sz
temp(i) = x(itemp(i),j)
end do
do i=1,i1sz
x(i,j) = temp(i)
end do
end do
case('T')
do j=1,i2sz
do i=1,i1sz
temp(itemp(i)) = x(i,j)
end do
do i=1,i1sz
x(i,j) = temp(i)
end do
end do
case default
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='dgelp')
end select
deallocate(temp,itemp)
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_e_dgelp
!!$
!!$ Parallel Sparse BLAS version 3.5
!!$ (C) Copyright 2006-2018
!!$ Salvatore Filippone University of Rome Tor Vergata
!!$ Alfredo Buttari University of Rome Tor Vergata
!!$
!!$ Redistribution and use in source and binary forms, with or without
!!$ modification, are permitted provided that the following conditions
!!$ are met:
!!$ 1. Redistributions of source code must retain the above copyright
!!$ notice, this list of conditions and the following disclaimer.
!!$ 2. Redistributions in binary form must reproduce the above copyright
!!$ notice, this list of conditions, and the following disclaimer in the
!!$ documentation and/or other materials provided with the distribution.
!!$ 3. The name of the PSBLAS group or the names of its contributors may
!!$ not be used to endorse or promote products derived from this
!!$ software without specific written permission.
!!$
!!$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!!$ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
!!$ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
!!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
!!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
!!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
!!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
!!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
!!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
!!$ POSSIBILITY OF SUCH DAMAGE.
!!$
!!$
!
!
! Subroutine: psb_dgelpv
! Apply a left permutation to a dense matrix
!
! Arguments:
! trans - character.
! iperm - integer.
! x - real, dimension(:).
! info - integer. Return code.
subroutine psb_e_dgelpv(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_e_dgelpv
use psb_const_mod
use psb_error_mod
implicit none
real(psb_dpk_), intent(inout) :: x(:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
! local variables
integer(psb_ipk_) :: int_err(5), err_act
real(psb_dpk_),allocatable :: temp(:)
integer(psb_epk_) :: i1sz, i
integer(psb_epk_), allocatable :: itemp(:)
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
name = 'psb_dgelp'
if(psb_get_errstatus() /= 0) return
info=psb_success_
call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
i1sz = min(size(x),size(iperm))
if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name),': size',i1sz
allocate(temp(i1sz),itemp(size(iperm)),stat=info)
if (info /= psb_success_) then
info=2040
call psb_errpush(info,name)
goto 9999
end if
itemp(:) = iperm(:)
if (.not.psb_isaperm(i1sz,itemp)) then
info=psb_err_iarg_invalid_value_
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
goto 9999
endif
select case( psb_toupper(trans))
case('N')
do i=1,i1sz
temp(i) = x(itemp(i))
end do
do i=1,i1sz
x(i) = temp(i)
end do
case('T')
do i=1,i1sz
temp(itemp(i)) = x(i)
end do
do i=1,i1sz
x(i) = temp(i)
end do
case default
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='dgelp')
end select
deallocate(temp,itemp)
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_e_dgelpv
subroutine psi_daxpby(m,n,alpha, x, beta, y, info)
use psb_const_mod
@ -40,7 +441,7 @@ subroutine psi_daxpby(m,n,alpha, x, beta, y, info)
real(psb_dpk_), intent (in) :: alpha, beta
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act
integer(psb_ipk_) :: lx, ly
integer(psb_ipk_) :: lx, ly, i
integer(psb_ipk_) :: ierr(5)
character(len=20) :: name, ch_err
@ -101,6 +502,7 @@ subroutine psi_daxpbyv(m,alpha, x, beta, y, info)
integer(psb_ipk_) :: err_act
integer(psb_ipk_) :: lx, ly
integer(psb_ipk_) :: ierr(5)
integer(psb_ipk_) :: i
character(len=20) :: name, ch_err
name='psb_geaxpby'
@ -131,7 +533,106 @@ subroutine psi_daxpbyv(m,alpha, x, beta, y, info)
goto 9999
end if
if (m>0) call daxpby(m,ione,alpha,x,lx,beta,y,ly,info)
! if (m>0) call daxpby(m,ione,alpha,x,lx,beta,y,ly,info)
if (alpha.eq.dzero) then
if (beta.eq.dzero) then
!$omp parallel do private(i)
do i=1,m
y(i) = dzero
enddo
else if (beta.eq.done) then
!
! Do nothing!
!
else if (beta.eq.-done) then
!$omp parallel do private(i)
do i=1,m
y(i) = - y(i)
enddo
else
!$omp parallel do private(i)
do i=1,m
y(i) = beta*y(i)
enddo
endif
else if (alpha.eq.done) then
if (beta.eq.dzero) then
!$omp parallel do private(i)
do i=1,m
y(i) = x(i)
enddo
else if (beta.eq.done) then
!$omp parallel do private(i)
do i=1,m
y(i) = x(i) + y(i)
enddo
else if (beta.eq.-done) then
!$omp parallel do private(i)
do i=1,m
y(i) = x(i) - y(i)
enddo
else
!$omp parallel do private(i)
do i=1,m
y(i) = x(i) + beta*y(i)
enddo
endif
else if (alpha.eq.-done) then
if (beta.eq.dzero) then
!$omp parallel do private(i)
do i=1,m
y(i) = -x(i)
enddo
else if (beta.eq.done) then
!$omp parallel do private(i)
do i=1,m
y(i) = -x(i) + y(i)
enddo
else if (beta.eq.-done) then
!$omp parallel do private(i)
do i=1,m
y(i) = -x(i) - y(i)
enddo
else
!$omp parallel do private(i)
do i=1,m
y(i) = -x(i) + beta*y(i)
enddo
endif
else
if (beta.eq.dzero) then
!$omp parallel do private(i)
do i=1,m
y(i) = alpha*x(i)
enddo
else if (beta.eq.done) then
!$omp parallel do private(i)
do i=1,m
y(i) = alpha*x(i) + y(i)
enddo
else if (beta.eq.-done) then
!$omp parallel do private(i)
do i=1,m
y(i) = alpha*x(i) - y(i)
enddo
else
!$omp parallel do private(i)
do i=1,m
y(i) = alpha*x(i) + beta*y(i)
enddo
endif
endif
call psb_erractionrestore(err_act)
return
@ -154,7 +655,7 @@ subroutine psi_daxpbyv2(m,alpha, x, beta, y, z, info)
real(psb_dpk_), intent (in) :: alpha, beta
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act
integer(psb_ipk_) :: lx, ly, lz
integer(psb_ipk_) :: lx, ly, lz, i
integer(psb_ipk_) :: ierr(5)
character(len=20) :: name, ch_err
@ -193,7 +694,105 @@ subroutine psi_daxpbyv2(m,alpha, x, beta, y, z, info)
goto 9999
end if
if (m>0) call daxpbyv2(m,ione,alpha,x,lx,beta,y,ly,z,lz,info)
if (alpha.eq.dzero) then
if (beta.eq.dzero) then
!$omp parallel do private(i)
do i=1,m
Z(i) = dzero
enddo
else if (beta.eq.done) then
!
! Do nothing!
!
else if (beta.eq.-done) then
!$omp parallel do private(i)
do i=1,m
Z(i) = - y(i)
enddo
else
!$omp parallel do private(i)
do i=1,m
Z(i) = beta*y(i)
enddo
endif
else if (alpha.eq.done) then
if (beta.eq.dzero) then
!$omp parallel do private(i)
do i=1,m
Z(i) = x(i)
enddo
else if (beta.eq.done) then
!$omp parallel do private(i)
do i=1,m
Z(i) = x(i) + y(i)
enddo
else if (beta.eq.-done) then
!$omp parallel do private(i)
do i=1,m
Z(i) = x(i) - y(i)
enddo
else
!$omp parallel do private(i)
do i=1,m
Z(i) = x(i) + beta*y(i)
enddo
endif
else if (alpha.eq.-done) then
if (beta.eq.dzero) then
!$omp parallel do private(i)
do i=1,m
Z(i) = -x(i)
enddo
else if (beta.eq.done) then
!$omp parallel do private(i)
do i=1,m
Z(i) = -x(i) + y(i)
enddo
else if (beta.eq.-done) then
!$omp parallel do private(i)
do i=1,m
Z(i) = -x(i) - y(i)
enddo
else
!$omp parallel do private(i)
do i=1,m
Z(i) = -x(i) + beta*y(i)
enddo
endif
else
if (beta.eq.dzero) then
!$omp parallel do private(i)
do i=1,m
Z(i) = alpha*x(i)
enddo
else if (beta.eq.done) then
!$omp parallel do private(i)
do i=1,m
Z(i) = alpha*x(i) + y(i)
enddo
else if (beta.eq.-done) then
!$omp parallel do private(i)
do i=1,m
Z(i) = alpha*x(i) - y(i)
enddo
else
!$omp parallel do private(i)
do i=1,m
Z(i) = alpha*x(i) + beta*y(i)
enddo
endif
endif
call psb_erractionrestore(err_act)
return
@ -541,6 +1140,7 @@ subroutine daxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
if (alpha.eq.dzero) then
if (beta.eq.dzero) then
do j=1, n
!$omp parallel do private(i)
do i=1,m
y(i,j) = dzero
enddo
@ -552,12 +1152,14 @@ subroutine daxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
else if (beta.eq.-done) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
y(i,j) = - y(i,j)
enddo
enddo
else
do j=1,n
!$omp parallel do private(i)
do i=1,m
y(i,j) = beta*y(i,j)
enddo
@ -568,12 +1170,14 @@ subroutine daxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
if (beta.eq.dzero) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
y(i,j) = x(i,j)
enddo
enddo
else if (beta.eq.done) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
y(i,j) = x(i,j) + y(i,j)
enddo
@ -581,12 +1185,14 @@ subroutine daxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
else if (beta.eq.-done) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
y(i,j) = x(i,j) - y(i,j)
enddo
enddo
else
do j=1,n
!$omp parallel do private(i)
do i=1,m
y(i,j) = x(i,j) + beta*y(i,j)
enddo
@ -597,12 +1203,14 @@ subroutine daxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
if (beta.eq.dzero) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
y(i,j) = -x(i,j)
enddo
enddo
else if (beta.eq.done) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
y(i,j) = -x(i,j) + y(i,j)
enddo
@ -610,12 +1218,14 @@ subroutine daxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
else if (beta.eq.-done) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
y(i,j) = -x(i,j) - y(i,j)
enddo
enddo
else
do j=1,n
!$omp parallel do private(i)
do i=1,m
y(i,j) = -x(i,j) + beta*y(i,j)
enddo
@ -626,12 +1236,14 @@ subroutine daxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
if (beta.eq.dzero) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
y(i,j) = alpha*x(i,j)
enddo
enddo
else if (beta.eq.done) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
y(i,j) = alpha*x(i,j) + y(i,j)
enddo
@ -639,12 +1251,14 @@ subroutine daxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
else if (beta.eq.-done) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
y(i,j) = alpha*x(i,j) - y(i,j)
enddo
enddo
else
do j=1,n
!$omp parallel do private(i)
do i=1,m
y(i,j) = alpha*x(i,j) + beta*y(i,j)
enddo
@ -730,12 +1344,14 @@ subroutine daxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
else if (beta.eq.-done) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
Z(i,j) = - y(i,j)
enddo
enddo
else
do j=1,n
!$omp parallel do private(i)
do i=1,m
Z(i,j) = beta*y(i,j)
enddo
@ -746,12 +1362,14 @@ subroutine daxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
if (beta.eq.dzero) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
Z(i,j) = x(i,j)
enddo
enddo
else if (beta.eq.done) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
Z(i,j) = x(i,j) + y(i,j)
enddo
@ -759,12 +1377,14 @@ subroutine daxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
else if (beta.eq.-done) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
Z(i,j) = x(i,j) - y(i,j)
enddo
enddo
else
do j=1,n
!$omp parallel do private(i)
do i=1,m
Z(i,j) = x(i,j) + beta*y(i,j)
enddo
@ -775,12 +1395,14 @@ subroutine daxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
if (beta.eq.dzero) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
Z(i,j) = -x(i,j)
enddo
enddo
else if (beta.eq.done) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
Z(i,j) = -x(i,j) + y(i,j)
enddo
@ -788,12 +1410,14 @@ subroutine daxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
else if (beta.eq.-done) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
Z(i,j) = -x(i,j) - y(i,j)
enddo
enddo
else
do j=1,n
!$omp parallel do private(i)
do i=1,m
Z(i,j) = -x(i,j) + beta*y(i,j)
enddo
@ -804,12 +1428,14 @@ subroutine daxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
if (beta.eq.dzero) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
Z(i,j) = alpha*x(i,j)
enddo
enddo
else if (beta.eq.done) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
Z(i,j) = alpha*x(i,j) + y(i,j)
enddo
@ -817,12 +1443,14 @@ subroutine daxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
else if (beta.eq.-done) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
Z(i,j) = alpha*x(i,j) - y(i,j)
enddo
enddo
else
do j=1,n
!$omp parallel do private(i)
do i=1,m
Z(i,j) = alpha*x(i,j) + beta*y(i,j)
enddo

@ -29,6 +29,407 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine psb_m_egelp(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_m_egelp
use psb_const_mod
use psb_error_mod
implicit none
integer(psb_epk_), intent(inout) :: x(:,:)
integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
! local variables
integer(psb_epk_),allocatable :: temp(:)
integer(psb_ipk_) :: int_err(5), i1sz, i2sz, err_act,i,j
integer(psb_ipk_), allocatable :: itemp(:)
integer(psb_epk_),parameter :: one=1
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
name = 'psb_egelp'
if(psb_get_errstatus() /= 0) return
info=psb_success_
call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
i1sz = size(x,dim=1)
i2sz = size(x,dim=2)
if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name),': size',i1sz,i2sz
allocate(temp(i1sz),itemp(size(iperm)),stat=info)
if (info /= psb_success_) then
info=2040
call psb_errpush(info,name)
goto 9999
end if
itemp(:) = iperm(:)
if (.not.psb_isaperm(i1sz,itemp)) then
info=psb_err_iarg_invalid_value_
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
goto 9999
endif
select case( psb_toupper(trans))
case('N')
do j=1,i2sz
do i=1,i1sz
temp(i) = x(itemp(i),j)
end do
do i=1,i1sz
x(i,j) = temp(i)
end do
end do
case('T')
do j=1,i2sz
do i=1,i1sz
temp(itemp(i)) = x(i,j)
end do
do i=1,i1sz
x(i,j) = temp(i)
end do
end do
case default
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='egelp')
end select
deallocate(temp,itemp)
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_m_egelp
!!$
!!$ Parallel Sparse BLAS version 3.5
!!$ (C) Copyright 2006-2018
!!$ Salvatore Filippone University of Rome Tor Vergata
!!$ Alfredo Buttari University of Rome Tor Vergata
!!$
!!$ Redistribution and use in source and binary forms, with or without
!!$ modification, are permitted provided that the following conditions
!!$ are met:
!!$ 1. Redistributions of source code must retain the above copyright
!!$ notice, this list of conditions and the following disclaimer.
!!$ 2. Redistributions in binary form must reproduce the above copyright
!!$ notice, this list of conditions, and the following disclaimer in the
!!$ documentation and/or other materials provided with the distribution.
!!$ 3. The name of the PSBLAS group or the names of its contributors may
!!$ not be used to endorse or promote products derived from this
!!$ software without specific written permission.
!!$
!!$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!!$ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
!!$ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
!!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
!!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
!!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
!!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
!!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
!!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
!!$ POSSIBILITY OF SUCH DAMAGE.
!!$
!!$
!
!
! Subroutine: psb_egelpv
! Apply a left permutation to a dense matrix
!
! Arguments:
! trans - character.
! iperm - integer.
! x - real, dimension(:).
! info - integer. Return code.
subroutine psb_m_egelpv(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_m_egelpv
use psb_const_mod
use psb_error_mod
implicit none
integer(psb_epk_), intent(inout) :: x(:)
integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
! local variables
integer(psb_ipk_) :: int_err(5), i1sz, err_act, i
integer(psb_epk_),allocatable :: temp(:)
integer(psb_ipk_), allocatable :: itemp(:)
integer(psb_epk_),parameter :: one=1
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
name = 'psb_egelpv'
if(psb_get_errstatus() /= 0) return
info=psb_success_
call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
i1sz = min(size(x),size(iperm))
if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name),': size',i1sz
allocate(temp(i1sz),itemp(size(iperm)),stat=info)
if (info /= psb_success_) then
info=2040
call psb_errpush(info,name)
goto 9999
end if
itemp(:) = iperm(:)
if (.not.psb_isaperm(i1sz,itemp)) then
info=psb_err_iarg_invalid_value_
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
goto 9999
endif
select case( psb_toupper(trans))
case('N')
do i=1,i1sz
temp(i) = x(itemp(i))
end do
do i=1,i1sz
x(i) = temp(i)
end do
case('T')
do i=1,i1sz
temp(itemp(i)) = x(i)
end do
do i=1,i1sz
x(i) = temp(i)
end do
case default
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='egelp')
end select
deallocate(temp,itemp)
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_m_egelpv
subroutine psb_e_egelp(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_e_egelp
use psb_const_mod
use psb_error_mod
implicit none
integer(psb_epk_), intent(inout) :: x(:,:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
! local variables
integer(psb_epk_),allocatable :: temp(:)
integer(psb_ipk_) :: int_err(5), err_act
integer(psb_epk_) :: i1sz, i2sz, i, j
integer(psb_epk_), allocatable :: itemp(:)
integer(psb_epk_),parameter :: one=1
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
name = 'psb_egelp'
if(psb_get_errstatus() /= 0) return
info=psb_success_
call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
i1sz = size(x,dim=1)
i2sz = size(x,dim=2)
if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name),': size',i1sz,i2sz
allocate(temp(i1sz),itemp(size(iperm)),stat=info)
if (info /= psb_success_) then
info=2040
call psb_errpush(info,name)
goto 9999
end if
itemp(:) = iperm(:)
if (.not.psb_isaperm(i1sz,itemp)) then
info=psb_err_iarg_invalid_value_
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
goto 9999
endif
select case( psb_toupper(trans))
case('N')
do j=1,i2sz
do i=1,i1sz
temp(i) = x(itemp(i),j)
end do
do i=1,i1sz
x(i,j) = temp(i)
end do
end do
case('T')
do j=1,i2sz
do i=1,i1sz
temp(itemp(i)) = x(i,j)
end do
do i=1,i1sz
x(i,j) = temp(i)
end do
end do
case default
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='egelp')
end select
deallocate(temp,itemp)
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_e_egelp
!!$
!!$ Parallel Sparse BLAS version 3.5
!!$ (C) Copyright 2006-2018
!!$ Salvatore Filippone University of Rome Tor Vergata
!!$ Alfredo Buttari University of Rome Tor Vergata
!!$
!!$ Redistribution and use in source and binary forms, with or without
!!$ modification, are permitted provided that the following conditions
!!$ are met:
!!$ 1. Redistributions of source code must retain the above copyright
!!$ notice, this list of conditions and the following disclaimer.
!!$ 2. Redistributions in binary form must reproduce the above copyright
!!$ notice, this list of conditions, and the following disclaimer in the
!!$ documentation and/or other materials provided with the distribution.
!!$ 3. The name of the PSBLAS group or the names of its contributors may
!!$ not be used to endorse or promote products derived from this
!!$ software without specific written permission.
!!$
!!$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!!$ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
!!$ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
!!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
!!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
!!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
!!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
!!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
!!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
!!$ POSSIBILITY OF SUCH DAMAGE.
!!$
!!$
!
!
! Subroutine: psb_egelpv
! Apply a left permutation to a dense matrix
!
! Arguments:
! trans - character.
! iperm - integer.
! x - real, dimension(:).
! info - integer. Return code.
subroutine psb_e_egelpv(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_e_egelpv
use psb_const_mod
use psb_error_mod
implicit none
integer(psb_epk_), intent(inout) :: x(:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
! local variables
integer(psb_ipk_) :: int_err(5), err_act
integer(psb_epk_),allocatable :: temp(:)
integer(psb_epk_) :: i1sz, i
integer(psb_epk_), allocatable :: itemp(:)
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
name = 'psb_egelp'
if(psb_get_errstatus() /= 0) return
info=psb_success_
call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
i1sz = min(size(x),size(iperm))
if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name),': size',i1sz
allocate(temp(i1sz),itemp(size(iperm)),stat=info)
if (info /= psb_success_) then
info=2040
call psb_errpush(info,name)
goto 9999
end if
itemp(:) = iperm(:)
if (.not.psb_isaperm(i1sz,itemp)) then
info=psb_err_iarg_invalid_value_
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
goto 9999
endif
select case( psb_toupper(trans))
case('N')
do i=1,i1sz
temp(i) = x(itemp(i))
end do
do i=1,i1sz
x(i) = temp(i)
end do
case('T')
do i=1,i1sz
temp(itemp(i)) = x(i)
end do
do i=1,i1sz
x(i) = temp(i)
end do
case default
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='egelp')
end select
deallocate(temp,itemp)
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_e_egelpv
subroutine psi_eaxpby(m,n,alpha, x, beta, y, info)
use psb_const_mod

@ -29,6 +29,407 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine psb_m_i2gelp(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_m_i2gelp
use psb_const_mod
use psb_error_mod
implicit none
integer(psb_i2pk_), intent(inout) :: x(:,:)
integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
! local variables
integer(psb_i2pk_),allocatable :: temp(:)
integer(psb_ipk_) :: int_err(5), i1sz, i2sz, err_act,i,j
integer(psb_ipk_), allocatable :: itemp(:)
integer(psb_i2pk_),parameter :: one=1
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
name = 'psb_i2gelp'
if(psb_get_errstatus() /= 0) return
info=psb_success_
call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
i1sz = size(x,dim=1)
i2sz = size(x,dim=2)
if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name),': size',i1sz,i2sz
allocate(temp(i1sz),itemp(size(iperm)),stat=info)
if (info /= psb_success_) then
info=2040
call psb_errpush(info,name)
goto 9999
end if
itemp(:) = iperm(:)
if (.not.psb_isaperm(i1sz,itemp)) then
info=psb_err_iarg_invalid_value_
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
goto 9999
endif
select case( psb_toupper(trans))
case('N')
do j=1,i2sz
do i=1,i1sz
temp(i) = x(itemp(i),j)
end do
do i=1,i1sz
x(i,j) = temp(i)
end do
end do
case('T')
do j=1,i2sz
do i=1,i1sz
temp(itemp(i)) = x(i,j)
end do
do i=1,i1sz
x(i,j) = temp(i)
end do
end do
case default
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='i2gelp')
end select
deallocate(temp,itemp)
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_m_i2gelp
!!$
!!$ Parallel Sparse BLAS version 3.5
!!$ (C) Copyright 2006-2018
!!$ Salvatore Filippone University of Rome Tor Vergata
!!$ Alfredo Buttari University of Rome Tor Vergata
!!$
!!$ Redistribution and use in source and binary forms, with or without
!!$ modification, are permitted provided that the following conditions
!!$ are met:
!!$ 1. Redistributions of source code must retain the above copyright
!!$ notice, this list of conditions and the following disclaimer.
!!$ 2. Redistributions in binary form must reproduce the above copyright
!!$ notice, this list of conditions, and the following disclaimer in the
!!$ documentation and/or other materials provided with the distribution.
!!$ 3. The name of the PSBLAS group or the names of its contributors may
!!$ not be used to endorse or promote products derived from this
!!$ software without specific written permission.
!!$
!!$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!!$ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
!!$ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
!!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
!!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
!!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
!!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
!!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
!!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
!!$ POSSIBILITY OF SUCH DAMAGE.
!!$
!!$
!
!
! Subroutine: psb_i2gelpv
! Apply a left permutation to a dense matrix
!
! Arguments:
! trans - character.
! iperm - integer.
! x - real, dimension(:).
! info - integer. Return code.
subroutine psb_m_i2gelpv(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_m_i2gelpv
use psb_const_mod
use psb_error_mod
implicit none
integer(psb_i2pk_), intent(inout) :: x(:)
integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
! local variables
integer(psb_ipk_) :: int_err(5), i1sz, err_act, i
integer(psb_i2pk_),allocatable :: temp(:)
integer(psb_ipk_), allocatable :: itemp(:)
integer(psb_i2pk_),parameter :: one=1
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
name = 'psb_i2gelpv'
if(psb_get_errstatus() /= 0) return
info=psb_success_
call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
i1sz = min(size(x),size(iperm))
if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name),': size',i1sz
allocate(temp(i1sz),itemp(size(iperm)),stat=info)
if (info /= psb_success_) then
info=2040
call psb_errpush(info,name)
goto 9999
end if
itemp(:) = iperm(:)
if (.not.psb_isaperm(i1sz,itemp)) then
info=psb_err_iarg_invalid_value_
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
goto 9999
endif
select case( psb_toupper(trans))
case('N')
do i=1,i1sz
temp(i) = x(itemp(i))
end do
do i=1,i1sz
x(i) = temp(i)
end do
case('T')
do i=1,i1sz
temp(itemp(i)) = x(i)
end do
do i=1,i1sz
x(i) = temp(i)
end do
case default
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='i2gelp')
end select
deallocate(temp,itemp)
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_m_i2gelpv
subroutine psb_e_i2gelp(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_e_i2gelp
use psb_const_mod
use psb_error_mod
implicit none
integer(psb_i2pk_), intent(inout) :: x(:,:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
! local variables
integer(psb_i2pk_),allocatable :: temp(:)
integer(psb_ipk_) :: int_err(5), err_act
integer(psb_epk_) :: i1sz, i2sz, i, j
integer(psb_epk_), allocatable :: itemp(:)
integer(psb_i2pk_),parameter :: one=1
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
name = 'psb_i2gelp'
if(psb_get_errstatus() /= 0) return
info=psb_success_
call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
i1sz = size(x,dim=1)
i2sz = size(x,dim=2)
if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name),': size',i1sz,i2sz
allocate(temp(i1sz),itemp(size(iperm)),stat=info)
if (info /= psb_success_) then
info=2040
call psb_errpush(info,name)
goto 9999
end if
itemp(:) = iperm(:)
if (.not.psb_isaperm(i1sz,itemp)) then
info=psb_err_iarg_invalid_value_
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
goto 9999
endif
select case( psb_toupper(trans))
case('N')
do j=1,i2sz
do i=1,i1sz
temp(i) = x(itemp(i),j)
end do
do i=1,i1sz
x(i,j) = temp(i)
end do
end do
case('T')
do j=1,i2sz
do i=1,i1sz
temp(itemp(i)) = x(i,j)
end do
do i=1,i1sz
x(i,j) = temp(i)
end do
end do
case default
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='i2gelp')
end select
deallocate(temp,itemp)
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_e_i2gelp
!!$
!!$ Parallel Sparse BLAS version 3.5
!!$ (C) Copyright 2006-2018
!!$ Salvatore Filippone University of Rome Tor Vergata
!!$ Alfredo Buttari University of Rome Tor Vergata
!!$
!!$ Redistribution and use in source and binary forms, with or without
!!$ modification, are permitted provided that the following conditions
!!$ are met:
!!$ 1. Redistributions of source code must retain the above copyright
!!$ notice, this list of conditions and the following disclaimer.
!!$ 2. Redistributions in binary form must reproduce the above copyright
!!$ notice, this list of conditions, and the following disclaimer in the
!!$ documentation and/or other materials provided with the distribution.
!!$ 3. The name of the PSBLAS group or the names of its contributors may
!!$ not be used to endorse or promote products derived from this
!!$ software without specific written permission.
!!$
!!$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!!$ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
!!$ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
!!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
!!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
!!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
!!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
!!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
!!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
!!$ POSSIBILITY OF SUCH DAMAGE.
!!$
!!$
!
!
! Subroutine: psb_i2gelpv
! Apply a left permutation to a dense matrix
!
! Arguments:
! trans - character.
! iperm - integer.
! x - real, dimension(:).
! info - integer. Return code.
subroutine psb_e_i2gelpv(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_e_i2gelpv
use psb_const_mod
use psb_error_mod
implicit none
integer(psb_i2pk_), intent(inout) :: x(:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
! local variables
integer(psb_ipk_) :: int_err(5), err_act
integer(psb_i2pk_),allocatable :: temp(:)
integer(psb_epk_) :: i1sz, i
integer(psb_epk_), allocatable :: itemp(:)
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
name = 'psb_i2gelp'
if(psb_get_errstatus() /= 0) return
info=psb_success_
call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
i1sz = min(size(x),size(iperm))
if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name),': size',i1sz
allocate(temp(i1sz),itemp(size(iperm)),stat=info)
if (info /= psb_success_) then
info=2040
call psb_errpush(info,name)
goto 9999
end if
itemp(:) = iperm(:)
if (.not.psb_isaperm(i1sz,itemp)) then
info=psb_err_iarg_invalid_value_
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
goto 9999
endif
select case( psb_toupper(trans))
case('N')
do i=1,i1sz
temp(i) = x(itemp(i))
end do
do i=1,i1sz
x(i) = temp(i)
end do
case('T')
do i=1,i1sz
temp(itemp(i)) = x(i)
end do
do i=1,i1sz
x(i) = temp(i)
end do
case default
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='i2gelp')
end select
deallocate(temp,itemp)
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_e_i2gelpv
subroutine psi_i2axpby(m,n,alpha, x, beta, y, info)
use psb_const_mod

@ -29,6 +29,407 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine psb_m_mgelp(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_m_mgelp
use psb_const_mod
use psb_error_mod
implicit none
integer(psb_mpk_), intent(inout) :: x(:,:)
integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
! local variables
integer(psb_mpk_),allocatable :: temp(:)
integer(psb_ipk_) :: int_err(5), i1sz, i2sz, err_act,i,j
integer(psb_ipk_), allocatable :: itemp(:)
integer(psb_mpk_),parameter :: one=1
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
name = 'psb_mgelp'
if(psb_get_errstatus() /= 0) return
info=psb_success_
call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
i1sz = size(x,dim=1)
i2sz = size(x,dim=2)
if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name),': size',i1sz,i2sz
allocate(temp(i1sz),itemp(size(iperm)),stat=info)
if (info /= psb_success_) then
info=2040
call psb_errpush(info,name)
goto 9999
end if
itemp(:) = iperm(:)
if (.not.psb_isaperm(i1sz,itemp)) then
info=psb_err_iarg_invalid_value_
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
goto 9999
endif
select case( psb_toupper(trans))
case('N')
do j=1,i2sz
do i=1,i1sz
temp(i) = x(itemp(i),j)
end do
do i=1,i1sz
x(i,j) = temp(i)
end do
end do
case('T')
do j=1,i2sz
do i=1,i1sz
temp(itemp(i)) = x(i,j)
end do
do i=1,i1sz
x(i,j) = temp(i)
end do
end do
case default
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='mgelp')
end select
deallocate(temp,itemp)
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_m_mgelp
!!$
!!$ Parallel Sparse BLAS version 3.5
!!$ (C) Copyright 2006-2018
!!$ Salvatore Filippone University of Rome Tor Vergata
!!$ Alfredo Buttari University of Rome Tor Vergata
!!$
!!$ Redistribution and use in source and binary forms, with or without
!!$ modification, are permitted provided that the following conditions
!!$ are met:
!!$ 1. Redistributions of source code must retain the above copyright
!!$ notice, this list of conditions and the following disclaimer.
!!$ 2. Redistributions in binary form must reproduce the above copyright
!!$ notice, this list of conditions, and the following disclaimer in the
!!$ documentation and/or other materials provided with the distribution.
!!$ 3. The name of the PSBLAS group or the names of its contributors may
!!$ not be used to endorse or promote products derived from this
!!$ software without specific written permission.
!!$
!!$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!!$ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
!!$ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
!!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
!!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
!!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
!!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
!!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
!!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
!!$ POSSIBILITY OF SUCH DAMAGE.
!!$
!!$
!
!
! Subroutine: psb_mgelpv
! Apply a left permutation to a dense matrix
!
! Arguments:
! trans - character.
! iperm - integer.
! x - real, dimension(:).
! info - integer. Return code.
subroutine psb_m_mgelpv(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_m_mgelpv
use psb_const_mod
use psb_error_mod
implicit none
integer(psb_mpk_), intent(inout) :: x(:)
integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
! local variables
integer(psb_ipk_) :: int_err(5), i1sz, err_act, i
integer(psb_mpk_),allocatable :: temp(:)
integer(psb_ipk_), allocatable :: itemp(:)
integer(psb_mpk_),parameter :: one=1
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
name = 'psb_mgelpv'
if(psb_get_errstatus() /= 0) return
info=psb_success_
call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
i1sz = min(size(x),size(iperm))
if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name),': size',i1sz
allocate(temp(i1sz),itemp(size(iperm)),stat=info)
if (info /= psb_success_) then
info=2040
call psb_errpush(info,name)
goto 9999
end if
itemp(:) = iperm(:)
if (.not.psb_isaperm(i1sz,itemp)) then
info=psb_err_iarg_invalid_value_
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
goto 9999
endif
select case( psb_toupper(trans))
case('N')
do i=1,i1sz
temp(i) = x(itemp(i))
end do
do i=1,i1sz
x(i) = temp(i)
end do
case('T')
do i=1,i1sz
temp(itemp(i)) = x(i)
end do
do i=1,i1sz
x(i) = temp(i)
end do
case default
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='mgelp')
end select
deallocate(temp,itemp)
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_m_mgelpv
subroutine psb_e_mgelp(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_e_mgelp
use psb_const_mod
use psb_error_mod
implicit none
integer(psb_mpk_), intent(inout) :: x(:,:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
! local variables
integer(psb_mpk_),allocatable :: temp(:)
integer(psb_ipk_) :: int_err(5), err_act
integer(psb_epk_) :: i1sz, i2sz, i, j
integer(psb_epk_), allocatable :: itemp(:)
integer(psb_mpk_),parameter :: one=1
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
name = 'psb_mgelp'
if(psb_get_errstatus() /= 0) return
info=psb_success_
call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
i1sz = size(x,dim=1)
i2sz = size(x,dim=2)
if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name),': size',i1sz,i2sz
allocate(temp(i1sz),itemp(size(iperm)),stat=info)
if (info /= psb_success_) then
info=2040
call psb_errpush(info,name)
goto 9999
end if
itemp(:) = iperm(:)
if (.not.psb_isaperm(i1sz,itemp)) then
info=psb_err_iarg_invalid_value_
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
goto 9999
endif
select case( psb_toupper(trans))
case('N')
do j=1,i2sz
do i=1,i1sz
temp(i) = x(itemp(i),j)
end do
do i=1,i1sz
x(i,j) = temp(i)
end do
end do
case('T')
do j=1,i2sz
do i=1,i1sz
temp(itemp(i)) = x(i,j)
end do
do i=1,i1sz
x(i,j) = temp(i)
end do
end do
case default
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='mgelp')
end select
deallocate(temp,itemp)
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_e_mgelp
!!$
!!$ Parallel Sparse BLAS version 3.5
!!$ (C) Copyright 2006-2018
!!$ Salvatore Filippone University of Rome Tor Vergata
!!$ Alfredo Buttari University of Rome Tor Vergata
!!$
!!$ Redistribution and use in source and binary forms, with or without
!!$ modification, are permitted provided that the following conditions
!!$ are met:
!!$ 1. Redistributions of source code must retain the above copyright
!!$ notice, this list of conditions and the following disclaimer.
!!$ 2. Redistributions in binary form must reproduce the above copyright
!!$ notice, this list of conditions, and the following disclaimer in the
!!$ documentation and/or other materials provided with the distribution.
!!$ 3. The name of the PSBLAS group or the names of its contributors may
!!$ not be used to endorse or promote products derived from this
!!$ software without specific written permission.
!!$
!!$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!!$ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
!!$ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
!!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
!!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
!!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
!!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
!!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
!!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
!!$ POSSIBILITY OF SUCH DAMAGE.
!!$
!!$
!
!
! Subroutine: psb_mgelpv
! Apply a left permutation to a dense matrix
!
! Arguments:
! trans - character.
! iperm - integer.
! x - real, dimension(:).
! info - integer. Return code.
subroutine psb_e_mgelpv(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_e_mgelpv
use psb_const_mod
use psb_error_mod
implicit none
integer(psb_mpk_), intent(inout) :: x(:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
! local variables
integer(psb_ipk_) :: int_err(5), err_act
integer(psb_mpk_),allocatable :: temp(:)
integer(psb_epk_) :: i1sz, i
integer(psb_epk_), allocatable :: itemp(:)
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
name = 'psb_mgelp'
if(psb_get_errstatus() /= 0) return
info=psb_success_
call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
i1sz = min(size(x),size(iperm))
if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name),': size',i1sz
allocate(temp(i1sz),itemp(size(iperm)),stat=info)
if (info /= psb_success_) then
info=2040
call psb_errpush(info,name)
goto 9999
end if
itemp(:) = iperm(:)
if (.not.psb_isaperm(i1sz,itemp)) then
info=psb_err_iarg_invalid_value_
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
goto 9999
endif
select case( psb_toupper(trans))
case('N')
do i=1,i1sz
temp(i) = x(itemp(i))
end do
do i=1,i1sz
x(i) = temp(i)
end do
case('T')
do i=1,i1sz
temp(itemp(i)) = x(i)
end do
do i=1,i1sz
x(i) = temp(i)
end do
case default
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='mgelp')
end select
deallocate(temp,itemp)
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_e_mgelpv
subroutine psi_maxpby(m,n,alpha, x, beta, y, info)
use psb_const_mod

@ -29,6 +29,407 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine psb_m_sgelp(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_m_sgelp
use psb_const_mod
use psb_error_mod
implicit none
real(psb_spk_), intent(inout) :: x(:,:)
integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
! local variables
real(psb_spk_),allocatable :: temp(:)
integer(psb_ipk_) :: int_err(5), i1sz, i2sz, err_act,i,j
integer(psb_ipk_), allocatable :: itemp(:)
real(psb_spk_),parameter :: one=1
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
name = 'psb_sgelp'
if(psb_get_errstatus() /= 0) return
info=psb_success_
call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
i1sz = size(x,dim=1)
i2sz = size(x,dim=2)
if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name),': size',i1sz,i2sz
allocate(temp(i1sz),itemp(size(iperm)),stat=info)
if (info /= psb_success_) then
info=2040
call psb_errpush(info,name)
goto 9999
end if
itemp(:) = iperm(:)
if (.not.psb_isaperm(i1sz,itemp)) then
info=psb_err_iarg_invalid_value_
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
goto 9999
endif
select case( psb_toupper(trans))
case('N')
do j=1,i2sz
do i=1,i1sz
temp(i) = x(itemp(i),j)
end do
do i=1,i1sz
x(i,j) = temp(i)
end do
end do
case('T')
do j=1,i2sz
do i=1,i1sz
temp(itemp(i)) = x(i,j)
end do
do i=1,i1sz
x(i,j) = temp(i)
end do
end do
case default
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='sgelp')
end select
deallocate(temp,itemp)
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_m_sgelp
!!$
!!$ Parallel Sparse BLAS version 3.5
!!$ (C) Copyright 2006-2018
!!$ Salvatore Filippone University of Rome Tor Vergata
!!$ Alfredo Buttari University of Rome Tor Vergata
!!$
!!$ Redistribution and use in source and binary forms, with or without
!!$ modification, are permitted provided that the following conditions
!!$ are met:
!!$ 1. Redistributions of source code must retain the above copyright
!!$ notice, this list of conditions and the following disclaimer.
!!$ 2. Redistributions in binary form must reproduce the above copyright
!!$ notice, this list of conditions, and the following disclaimer in the
!!$ documentation and/or other materials provided with the distribution.
!!$ 3. The name of the PSBLAS group or the names of its contributors may
!!$ not be used to endorse or promote products derived from this
!!$ software without specific written permission.
!!$
!!$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!!$ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
!!$ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
!!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
!!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
!!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
!!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
!!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
!!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
!!$ POSSIBILITY OF SUCH DAMAGE.
!!$
!!$
!
!
! Subroutine: psb_sgelpv
! Apply a left permutation to a dense matrix
!
! Arguments:
! trans - character.
! iperm - integer.
! x - real, dimension(:).
! info - integer. Return code.
subroutine psb_m_sgelpv(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_m_sgelpv
use psb_const_mod
use psb_error_mod
implicit none
real(psb_spk_), intent(inout) :: x(:)
integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
! local variables
integer(psb_ipk_) :: int_err(5), i1sz, err_act, i
real(psb_spk_),allocatable :: temp(:)
integer(psb_ipk_), allocatable :: itemp(:)
real(psb_spk_),parameter :: one=1
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
name = 'psb_sgelpv'
if(psb_get_errstatus() /= 0) return
info=psb_success_
call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
i1sz = min(size(x),size(iperm))
if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name),': size',i1sz
allocate(temp(i1sz),itemp(size(iperm)),stat=info)
if (info /= psb_success_) then
info=2040
call psb_errpush(info,name)
goto 9999
end if
itemp(:) = iperm(:)
if (.not.psb_isaperm(i1sz,itemp)) then
info=psb_err_iarg_invalid_value_
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
goto 9999
endif
select case( psb_toupper(trans))
case('N')
do i=1,i1sz
temp(i) = x(itemp(i))
end do
do i=1,i1sz
x(i) = temp(i)
end do
case('T')
do i=1,i1sz
temp(itemp(i)) = x(i)
end do
do i=1,i1sz
x(i) = temp(i)
end do
case default
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='sgelp')
end select
deallocate(temp,itemp)
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_m_sgelpv
subroutine psb_e_sgelp(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_e_sgelp
use psb_const_mod
use psb_error_mod
implicit none
real(psb_spk_), intent(inout) :: x(:,:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
! local variables
real(psb_spk_),allocatable :: temp(:)
integer(psb_ipk_) :: int_err(5), err_act
integer(psb_epk_) :: i1sz, i2sz, i, j
integer(psb_epk_), allocatable :: itemp(:)
real(psb_spk_),parameter :: one=1
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
name = 'psb_sgelp'
if(psb_get_errstatus() /= 0) return
info=psb_success_
call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
i1sz = size(x,dim=1)
i2sz = size(x,dim=2)
if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name),': size',i1sz,i2sz
allocate(temp(i1sz),itemp(size(iperm)),stat=info)
if (info /= psb_success_) then
info=2040
call psb_errpush(info,name)
goto 9999
end if
itemp(:) = iperm(:)
if (.not.psb_isaperm(i1sz,itemp)) then
info=psb_err_iarg_invalid_value_
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
goto 9999
endif
select case( psb_toupper(trans))
case('N')
do j=1,i2sz
do i=1,i1sz
temp(i) = x(itemp(i),j)
end do
do i=1,i1sz
x(i,j) = temp(i)
end do
end do
case('T')
do j=1,i2sz
do i=1,i1sz
temp(itemp(i)) = x(i,j)
end do
do i=1,i1sz
x(i,j) = temp(i)
end do
end do
case default
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='sgelp')
end select
deallocate(temp,itemp)
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_e_sgelp
!!$
!!$ Parallel Sparse BLAS version 3.5
!!$ (C) Copyright 2006-2018
!!$ Salvatore Filippone University of Rome Tor Vergata
!!$ Alfredo Buttari University of Rome Tor Vergata
!!$
!!$ Redistribution and use in source and binary forms, with or without
!!$ modification, are permitted provided that the following conditions
!!$ are met:
!!$ 1. Redistributions of source code must retain the above copyright
!!$ notice, this list of conditions and the following disclaimer.
!!$ 2. Redistributions in binary form must reproduce the above copyright
!!$ notice, this list of conditions, and the following disclaimer in the
!!$ documentation and/or other materials provided with the distribution.
!!$ 3. The name of the PSBLAS group or the names of its contributors may
!!$ not be used to endorse or promote products derived from this
!!$ software without specific written permission.
!!$
!!$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!!$ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
!!$ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
!!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
!!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
!!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
!!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
!!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
!!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
!!$ POSSIBILITY OF SUCH DAMAGE.
!!$
!!$
!
!
! Subroutine: psb_sgelpv
! Apply a left permutation to a dense matrix
!
! Arguments:
! trans - character.
! iperm - integer.
! x - real, dimension(:).
! info - integer. Return code.
subroutine psb_e_sgelpv(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_e_sgelpv
use psb_const_mod
use psb_error_mod
implicit none
real(psb_spk_), intent(inout) :: x(:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
! local variables
integer(psb_ipk_) :: int_err(5), err_act
real(psb_spk_),allocatable :: temp(:)
integer(psb_epk_) :: i1sz, i
integer(psb_epk_), allocatable :: itemp(:)
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
name = 'psb_sgelp'
if(psb_get_errstatus() /= 0) return
info=psb_success_
call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
i1sz = min(size(x),size(iperm))
if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name),': size',i1sz
allocate(temp(i1sz),itemp(size(iperm)),stat=info)
if (info /= psb_success_) then
info=2040
call psb_errpush(info,name)
goto 9999
end if
itemp(:) = iperm(:)
if (.not.psb_isaperm(i1sz,itemp)) then
info=psb_err_iarg_invalid_value_
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
goto 9999
endif
select case( psb_toupper(trans))
case('N')
do i=1,i1sz
temp(i) = x(itemp(i))
end do
do i=1,i1sz
x(i) = temp(i)
end do
case('T')
do i=1,i1sz
temp(itemp(i)) = x(i)
end do
do i=1,i1sz
x(i) = temp(i)
end do
case default
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='sgelp')
end select
deallocate(temp,itemp)
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_e_sgelpv
subroutine psi_saxpby(m,n,alpha, x, beta, y, info)
use psb_const_mod
@ -40,7 +441,7 @@ subroutine psi_saxpby(m,n,alpha, x, beta, y, info)
real(psb_spk_), intent (in) :: alpha, beta
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act
integer(psb_ipk_) :: lx, ly
integer(psb_ipk_) :: lx, ly, i
integer(psb_ipk_) :: ierr(5)
character(len=20) :: name, ch_err
@ -101,6 +502,7 @@ subroutine psi_saxpbyv(m,alpha, x, beta, y, info)
integer(psb_ipk_) :: err_act
integer(psb_ipk_) :: lx, ly
integer(psb_ipk_) :: ierr(5)
integer(psb_ipk_) :: i
character(len=20) :: name, ch_err
name='psb_geaxpby'
@ -131,7 +533,106 @@ subroutine psi_saxpbyv(m,alpha, x, beta, y, info)
goto 9999
end if
if (m>0) call saxpby(m,ione,alpha,x,lx,beta,y,ly,info)
! if (m>0) call saxpby(m,ione,alpha,x,lx,beta,y,ly,info)
if (alpha.eq.szero) then
if (beta.eq.szero) then
!$omp parallel do private(i)
do i=1,m
y(i) = szero
enddo
else if (beta.eq.sone) then
!
! Do nothing!
!
else if (beta.eq.-sone) then
!$omp parallel do private(i)
do i=1,m
y(i) = - y(i)
enddo
else
!$omp parallel do private(i)
do i=1,m
y(i) = beta*y(i)
enddo
endif
else if (alpha.eq.sone) then
if (beta.eq.szero) then
!$omp parallel do private(i)
do i=1,m
y(i) = x(i)
enddo
else if (beta.eq.sone) then
!$omp parallel do private(i)
do i=1,m
y(i) = x(i) + y(i)
enddo
else if (beta.eq.-sone) then
!$omp parallel do private(i)
do i=1,m
y(i) = x(i) - y(i)
enddo
else
!$omp parallel do private(i)
do i=1,m
y(i) = x(i) + beta*y(i)
enddo
endif
else if (alpha.eq.-sone) then
if (beta.eq.szero) then
!$omp parallel do private(i)
do i=1,m
y(i) = -x(i)
enddo
else if (beta.eq.sone) then
!$omp parallel do private(i)
do i=1,m
y(i) = -x(i) + y(i)
enddo
else if (beta.eq.-sone) then
!$omp parallel do private(i)
do i=1,m
y(i) = -x(i) - y(i)
enddo
else
!$omp parallel do private(i)
do i=1,m
y(i) = -x(i) + beta*y(i)
enddo
endif
else
if (beta.eq.szero) then
!$omp parallel do private(i)
do i=1,m
y(i) = alpha*x(i)
enddo
else if (beta.eq.sone) then
!$omp parallel do private(i)
do i=1,m
y(i) = alpha*x(i) + y(i)
enddo
else if (beta.eq.-sone) then
!$omp parallel do private(i)
do i=1,m
y(i) = alpha*x(i) - y(i)
enddo
else
!$omp parallel do private(i)
do i=1,m
y(i) = alpha*x(i) + beta*y(i)
enddo
endif
endif
call psb_erractionrestore(err_act)
return
@ -154,7 +655,7 @@ subroutine psi_saxpbyv2(m,alpha, x, beta, y, z, info)
real(psb_spk_), intent (in) :: alpha, beta
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act
integer(psb_ipk_) :: lx, ly, lz
integer(psb_ipk_) :: lx, ly, lz, i
integer(psb_ipk_) :: ierr(5)
character(len=20) :: name, ch_err
@ -193,7 +694,105 @@ subroutine psi_saxpbyv2(m,alpha, x, beta, y, z, info)
goto 9999
end if
if (m>0) call saxpbyv2(m,ione,alpha,x,lx,beta,y,ly,z,lz,info)
if (alpha.eq.szero) then
if (beta.eq.szero) then
!$omp parallel do private(i)
do i=1,m
Z(i) = szero
enddo
else if (beta.eq.sone) then
!
! Do nothing!
!
else if (beta.eq.-sone) then
!$omp parallel do private(i)
do i=1,m
Z(i) = - y(i)
enddo
else
!$omp parallel do private(i)
do i=1,m
Z(i) = beta*y(i)
enddo
endif
else if (alpha.eq.sone) then
if (beta.eq.szero) then
!$omp parallel do private(i)
do i=1,m
Z(i) = x(i)
enddo
else if (beta.eq.sone) then
!$omp parallel do private(i)
do i=1,m
Z(i) = x(i) + y(i)
enddo
else if (beta.eq.-sone) then
!$omp parallel do private(i)
do i=1,m
Z(i) = x(i) - y(i)
enddo
else
!$omp parallel do private(i)
do i=1,m
Z(i) = x(i) + beta*y(i)
enddo
endif
else if (alpha.eq.-sone) then
if (beta.eq.szero) then
!$omp parallel do private(i)
do i=1,m
Z(i) = -x(i)
enddo
else if (beta.eq.sone) then
!$omp parallel do private(i)
do i=1,m
Z(i) = -x(i) + y(i)
enddo
else if (beta.eq.-sone) then
!$omp parallel do private(i)
do i=1,m
Z(i) = -x(i) - y(i)
enddo
else
!$omp parallel do private(i)
do i=1,m
Z(i) = -x(i) + beta*y(i)
enddo
endif
else
if (beta.eq.szero) then
!$omp parallel do private(i)
do i=1,m
Z(i) = alpha*x(i)
enddo
else if (beta.eq.sone) then
!$omp parallel do private(i)
do i=1,m
Z(i) = alpha*x(i) + y(i)
enddo
else if (beta.eq.-sone) then
!$omp parallel do private(i)
do i=1,m
Z(i) = alpha*x(i) - y(i)
enddo
else
!$omp parallel do private(i)
do i=1,m
Z(i) = alpha*x(i) + beta*y(i)
enddo
endif
endif
call psb_erractionrestore(err_act)
return
@ -541,6 +1140,7 @@ subroutine saxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
if (alpha.eq.szero) then
if (beta.eq.szero) then
do j=1, n
!$omp parallel do private(i)
do i=1,m
y(i,j) = szero
enddo
@ -552,12 +1152,14 @@ subroutine saxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
else if (beta.eq.-sone) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
y(i,j) = - y(i,j)
enddo
enddo
else
do j=1,n
!$omp parallel do private(i)
do i=1,m
y(i,j) = beta*y(i,j)
enddo
@ -568,12 +1170,14 @@ subroutine saxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
if (beta.eq.szero) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
y(i,j) = x(i,j)
enddo
enddo
else if (beta.eq.sone) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
y(i,j) = x(i,j) + y(i,j)
enddo
@ -581,12 +1185,14 @@ subroutine saxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
else if (beta.eq.-sone) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
y(i,j) = x(i,j) - y(i,j)
enddo
enddo
else
do j=1,n
!$omp parallel do private(i)
do i=1,m
y(i,j) = x(i,j) + beta*y(i,j)
enddo
@ -597,12 +1203,14 @@ subroutine saxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
if (beta.eq.szero) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
y(i,j) = -x(i,j)
enddo
enddo
else if (beta.eq.sone) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
y(i,j) = -x(i,j) + y(i,j)
enddo
@ -610,12 +1218,14 @@ subroutine saxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
else if (beta.eq.-sone) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
y(i,j) = -x(i,j) - y(i,j)
enddo
enddo
else
do j=1,n
!$omp parallel do private(i)
do i=1,m
y(i,j) = -x(i,j) + beta*y(i,j)
enddo
@ -626,12 +1236,14 @@ subroutine saxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
if (beta.eq.szero) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
y(i,j) = alpha*x(i,j)
enddo
enddo
else if (beta.eq.sone) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
y(i,j) = alpha*x(i,j) + y(i,j)
enddo
@ -639,12 +1251,14 @@ subroutine saxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
else if (beta.eq.-sone) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
y(i,j) = alpha*x(i,j) - y(i,j)
enddo
enddo
else
do j=1,n
!$omp parallel do private(i)
do i=1,m
y(i,j) = alpha*x(i,j) + beta*y(i,j)
enddo
@ -730,12 +1344,14 @@ subroutine saxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
else if (beta.eq.-sone) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
Z(i,j) = - y(i,j)
enddo
enddo
else
do j=1,n
!$omp parallel do private(i)
do i=1,m
Z(i,j) = beta*y(i,j)
enddo
@ -746,12 +1362,14 @@ subroutine saxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
if (beta.eq.szero) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
Z(i,j) = x(i,j)
enddo
enddo
else if (beta.eq.sone) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
Z(i,j) = x(i,j) + y(i,j)
enddo
@ -759,12 +1377,14 @@ subroutine saxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
else if (beta.eq.-sone) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
Z(i,j) = x(i,j) - y(i,j)
enddo
enddo
else
do j=1,n
!$omp parallel do private(i)
do i=1,m
Z(i,j) = x(i,j) + beta*y(i,j)
enddo
@ -775,12 +1395,14 @@ subroutine saxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
if (beta.eq.szero) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
Z(i,j) = -x(i,j)
enddo
enddo
else if (beta.eq.sone) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
Z(i,j) = -x(i,j) + y(i,j)
enddo
@ -788,12 +1410,14 @@ subroutine saxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
else if (beta.eq.-sone) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
Z(i,j) = -x(i,j) - y(i,j)
enddo
enddo
else
do j=1,n
!$omp parallel do private(i)
do i=1,m
Z(i,j) = -x(i,j) + beta*y(i,j)
enddo
@ -804,12 +1428,14 @@ subroutine saxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
if (beta.eq.szero) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
Z(i,j) = alpha*x(i,j)
enddo
enddo
else if (beta.eq.sone) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
Z(i,j) = alpha*x(i,j) + y(i,j)
enddo
@ -817,12 +1443,14 @@ subroutine saxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
else if (beta.eq.-sone) then
do j=1,n
!$omp parallel do private(i)
do i=1,m
Z(i,j) = alpha*x(i,j) - y(i,j)
enddo
enddo
else
do j=1,n
!$omp parallel do private(i)
do i=1,m
Z(i,j) = alpha*x(i,j) + beta*y(i,j)
enddo

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

Loading…
Cancel
Save