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 # header files generated
cbind/*.h cbind/*.h
util/psb_metis_int.h
# Make.inc generated # Make.inc generated
/Make.inc /Make.inc

@ -23,7 +23,7 @@ EXTRA_OPT=@EXTRA_OPT@
MPFC=@MPIFC@ MPFC=@MPIFC@
MPCC=@MPICC@ MPCC=@MPICC@
FLINK=$(MPFC) FLINK=@FLINK@
LIBS=@LIBS@ 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) & totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_cswap_vidx_vect 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' include 'mpif.h'
#endif #endif
type(psb_ctxt_type), intent(in) :: ictxt 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(in) :: flag
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
class(psb_c_base_vect_type) :: y 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 integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
! locals ! locals
type(psb_ctxt_type) :: ctxt integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: icomm, np, me,& integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable :: prcid(:) integer(psb_mpk_), allocatable :: prcid(:)
integer(psb_ipk_) :: nesd, nerv,& integer(psb_ipk_) :: nesd, nerv,&
& err_act, i, idx_pt, totsnd_, totrcv_,& & 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_ info=psb_success_
name='psi_swap_datav' name='psi_swap_datav'
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np) call psb_info(ctxt,me,np)
if (np == -1) then if (np == -1) then
info=psb_err_context_error_ 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) & totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_cswap_vidx_multivect 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' include 'mpif.h'
#endif #endif
type(psb_ctxt_type), intent(in) :: ictxt 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(in) :: flag
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
class(psb_c_base_multivect_type) :: y 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 integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
! locals ! locals
type(psb_ctxt_type) :: ctxt integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: icomm, np, me,& integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable :: prcid(:) integer(psb_mpk_), allocatable :: prcid(:)
integer(psb_ipk_) :: nesd, nerv,& integer(psb_ipk_) :: nesd, nerv,&
& err_act, i, idx_pt, totsnd_, totrcv_,& & 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_ info=psb_success_
name='psi_swap_datav' name='psi_swap_datav'
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np) call psb_info(ctxt,me,np)
if (np == -1) then if (np == -1) then
info=psb_err_context_error_ info=psb_err_context_error_

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

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

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

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

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

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

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

@ -159,7 +159,7 @@ subroutine psi_i2swaptranm(flag,n,beta,y,desc_a,work,info,data)
return return
end subroutine psi_i2swaptranm 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) & totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_i2tranidxm 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' include 'mpif.h'
#endif #endif
type(psb_ctxt_type), intent(in) :: ictxt 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,n integer(psb_ipk_), intent(in) :: flag,n
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
integer(psb_i2pk_) :: y(:,:), beta 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 integer(psb_ipk_), intent(in) :: idx(:),totxch,totsnd, totrcv
! locals ! locals
type(psb_ctxt_type) :: ctxt integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: icomm, np, me,& integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable, dimension(:) :: bsdidx, brvidx,& integer(psb_mpk_), allocatable, dimension(:) :: bsdidx, brvidx,&
& sdsz, rvsz, prcid, rvhd, sdhd & sdsz, rvsz, prcid, rvhd, sdhd
integer(psb_ipk_) :: nesd, nerv,& integer(psb_ipk_) :: nesd, nerv,&
@ -202,9 +201,6 @@ subroutine psi_i2tranidxm(ictxt,iicomm,flag,n,beta,y,idx,&
info=psb_success_ info=psb_success_
name='psi_swap_tran' name='psi_swap_tran'
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np) call psb_info(ctxt,me,np)
if (np == -1) then if (np == -1) then
info=psb_err_context_error_ 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) & totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_i2tranidxv use psi_mod, psb_protect_name => psi_i2tranidxv
@ -671,8 +667,8 @@ subroutine psi_i2tranidxv(ictxt,iicomm,flag,beta,y,idx,&
include 'mpif.h' include 'mpif.h'
#endif #endif
type(psb_ctxt_type), intent(in) :: ictxt 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(in) :: flag
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
integer(psb_i2pk_) :: y(:), beta 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 integer(psb_ipk_), intent(in) :: idx(:),totxch,totsnd, totrcv
! locals ! locals
type(psb_ctxt_type) :: ctxt integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: icomm, np, me,& integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable, dimension(:) :: bsdidx, brvidx,& integer(psb_mpk_), allocatable, dimension(:) :: bsdidx, brvidx,&
& sdsz, rvsz, prcid, rvhd, sdhd & sdsz, rvsz, prcid, rvhd, sdhd
integer(psb_ipk_) :: nesd, nerv,& integer(psb_ipk_) :: nesd, nerv,&
@ -699,9 +694,6 @@ subroutine psi_i2tranidxv(ictxt,iicomm,flag,beta,y,idx,&
info=psb_success_ info=psb_success_
name='psi_swap_tran' name='psi_swap_tran'
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np) call psb_info(ctxt,me,np)
if (np == -1) then if (np == -1) then
info=psb_err_context_error_ 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) & totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_iswap_vidx_vect 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' include 'mpif.h'
#endif #endif
type(psb_ctxt_type), intent(in) :: ictxt 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(in) :: flag
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
class(psb_i_base_vect_type) :: y 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 integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
! locals ! locals
type(psb_ctxt_type) :: ctxt integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: icomm, np, me,& integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable :: prcid(:) integer(psb_mpk_), allocatable :: prcid(:)
integer(psb_ipk_) :: nesd, nerv,& integer(psb_ipk_) :: nesd, nerv,&
& err_act, i, idx_pt, totsnd_, totrcv_,& & 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_ info=psb_success_
name='psi_swap_datav' name='psi_swap_datav'
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np) call psb_info(ctxt,me,np)
if (np == -1) then if (np == -1) then
info=psb_err_context_error_ 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) & totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_iswap_vidx_multivect 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' include 'mpif.h'
#endif #endif
type(psb_ctxt_type), intent(in) :: ictxt 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(in) :: flag
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
class(psb_i_base_multivect_type) :: y 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 integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
! locals ! locals
type(psb_ctxt_type) :: ctxt integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: icomm, np, me,& integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable :: prcid(:) integer(psb_mpk_), allocatable :: prcid(:)
integer(psb_ipk_) :: nesd, nerv,& integer(psb_ipk_) :: nesd, nerv,&
& err_act, i, idx_pt, totsnd_, totrcv_,& & 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_ info=psb_success_
name='psi_swap_datav' name='psi_swap_datav'
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np) call psb_info(ctxt,me,np)
if (np == -1) then if (np == -1) then
info=psb_err_context_error_ 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) & totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_itran_vidx_vect 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' include 'mpif.h'
#endif #endif
type(psb_ctxt_type), intent(in) :: ictxt 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(in) :: flag
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
class(psb_i_base_vect_type) :: y 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 integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
! locals ! locals
type(psb_ctxt_type) :: ctxt integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: icomm, np, me,& integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable :: prcid(:) integer(psb_mpk_), allocatable :: prcid(:)
integer(psb_ipk_) :: nesd, nerv,& integer(psb_ipk_) :: nesd, nerv,&
& err_act, i, idx_pt, totsnd_, totrcv_,& & 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_ info=psb_success_
name='psi_swap_tran' name='psi_swap_tran'
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np) call psb_info(ctxt,me,np)
if (np == -1) then if (np == -1) then
info=psb_err_context_error_ 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) & totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_itran_vidx_multivect 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' include 'mpif.h'
#endif #endif
type(psb_ctxt_type), intent(in) :: ictxt 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(in) :: flag
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
class(psb_i_base_multivect_type) :: y 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 integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
! locals ! locals
type(psb_ctxt_type) :: ctxt integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: icomm, np, me,& integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable :: prcid(:) integer(psb_mpk_), allocatable :: prcid(:)
integer(psb_ipk_) :: nesd, nerv,& integer(psb_ipk_) :: nesd, nerv,&
& err_act, i, idx_pt, totsnd_, totrcv_,& & 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_ info=psb_success_
name='psi_swap_tran' name='psi_swap_tran'
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np) call psb_info(ctxt,me,np)
if (np == -1) then if (np == -1) then
info=psb_err_context_error_ 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) & totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_lswap_vidx_vect 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' include 'mpif.h'
#endif #endif
type(psb_ctxt_type), intent(in) :: ictxt 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(in) :: flag
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
class(psb_l_base_vect_type) :: y 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 integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
! locals ! locals
type(psb_ctxt_type) :: ctxt integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: icomm, np, me,& integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable :: prcid(:) integer(psb_mpk_), allocatable :: prcid(:)
integer(psb_ipk_) :: nesd, nerv,& integer(psb_ipk_) :: nesd, nerv,&
& err_act, i, idx_pt, totsnd_, totrcv_,& & 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_ info=psb_success_
name='psi_swap_datav' name='psi_swap_datav'
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np) call psb_info(ctxt,me,np)
if (np == -1) then if (np == -1) then
info=psb_err_context_error_ 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) & totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_lswap_vidx_multivect 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' include 'mpif.h'
#endif #endif
type(psb_ctxt_type), intent(in) :: ictxt 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(in) :: flag
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
class(psb_l_base_multivect_type) :: y 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 integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
! locals ! locals
type(psb_ctxt_type) :: ctxt integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: icomm, np, me,& integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable :: prcid(:) integer(psb_mpk_), allocatable :: prcid(:)
integer(psb_ipk_) :: nesd, nerv,& integer(psb_ipk_) :: nesd, nerv,&
& err_act, i, idx_pt, totsnd_, totrcv_,& & 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_ info=psb_success_
name='psi_swap_datav' name='psi_swap_datav'
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np) call psb_info(ctxt,me,np)
if (np == -1) then if (np == -1) then
info=psb_err_context_error_ 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) & totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_ltran_vidx_vect 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' include 'mpif.h'
#endif #endif
type(psb_ctxt_type), intent(in) :: ictxt 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(in) :: flag
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
class(psb_l_base_vect_type) :: y 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 integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
! locals ! locals
type(psb_ctxt_type) :: ctxt integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: icomm, np, me,& integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable :: prcid(:) integer(psb_mpk_), allocatable :: prcid(:)
integer(psb_ipk_) :: nesd, nerv,& integer(psb_ipk_) :: nesd, nerv,&
& err_act, i, idx_pt, totsnd_, totrcv_,& & 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_ info=psb_success_
name='psi_swap_tran' name='psi_swap_tran'
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np) call psb_info(ctxt,me,np)
if (np == -1) then if (np == -1) then
info=psb_err_context_error_ 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) & totxch,totsnd,totrcv,work,info)
use psi_mod, psb_protect_name => psi_ltran_vidx_multivect 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' include 'mpif.h'
#endif #endif
type(psb_ctxt_type), intent(in) :: ictxt 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(in) :: flag
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
class(psb_l_base_multivect_type) :: y 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 integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
! locals ! locals
type(psb_ctxt_type) :: ctxt integer(psb_ipk_) :: np, me
integer(psb_mpk_) :: icomm, np, me,& integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
integer(psb_mpk_), allocatable :: prcid(:) integer(psb_mpk_), allocatable :: prcid(:)
integer(psb_ipk_) :: nesd, nerv,& integer(psb_ipk_) :: nesd, nerv,&
& err_act, i, idx_pt, totsnd_, totrcv_,& & 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_ info=psb_success_
name='psi_swap_tran' name='psi_swap_tran'
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
ctxt = ictxt
icomm = iicomm
call psb_info(ctxt,me,np) call psb_info(ctxt,me,np)
if (np == -1) then if (np == -1) then
info=psb_err_context_error_ info=psb_err_context_error_

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

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

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

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

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

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

@ -29,8 +29,8 @@
! POSSIBILITY OF SUCH DAMAGE. ! POSSIBILITY OF SUCH DAMAGE.
! !
! !
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)
use psi_mod, psb_protect_name => psi_i_bld_glb_csr_dep_list use psi_mod, psb_protect_name => psi_i_bld_glb_dep_list
#ifdef MPI_MOD #ifdef MPI_MOD
use mpi use mpi
#endif #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 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_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_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_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_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 serial/psb_s_vect_mod.o: serial/psb_s_base_vect_mod.o serial/psb_i_vect_mod.o

@ -32,24 +32,40 @@
module psi_c_serial_mod module psi_c_serial_mod
use psb_const_mod, only : psb_ipk_, psb_lpk_, psb_mpk_, psb_epk_, psb_spk_ use psb_const_mod, only : psb_ipk_, psb_lpk_, psb_mpk_, psb_epk_, psb_spk_
interface psb_gelp interface psb_gelp
! 2-D version ! 2-D version
subroutine psb_cgelp(trans,iperm,x,info) subroutine psb_m_cgelp(trans,iperm,x,info)
import :: psb_ipk_, psb_spk_ import :: psb_ipk_, psb_mpk_, psb_spk_
implicit none implicit none
complex(psb_spk_), intent(inout) :: x(:,:) complex(psb_spk_), intent(inout) :: x(:,:)
integer(psb_ipk_), intent(in) :: iperm(:) integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans character, intent(in) :: trans
end subroutine psb_cgelp end subroutine psb_m_cgelp
subroutine psb_cgelpv(trans,iperm,x,info) subroutine psb_m_cgelpv(trans,iperm,x,info)
import :: psb_ipk_, psb_spk_ 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 implicit none
complex(psb_spk_), intent(inout) :: x(:) complex(psb_spk_), intent(inout) :: x(:)
integer(psb_ipk_), intent(in) :: iperm(:) integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans character, intent(in) :: trans
end subroutine psb_cgelpv end subroutine psb_e_cgelpv
end interface psb_gelp end interface psb_gelp
interface psb_geaxpby interface psb_geaxpby

@ -32,24 +32,40 @@
module psi_d_serial_mod module psi_d_serial_mod
use psb_const_mod, only : psb_ipk_, psb_lpk_, psb_mpk_, psb_epk_, psb_dpk_ use psb_const_mod, only : psb_ipk_, psb_lpk_, psb_mpk_, psb_epk_, psb_dpk_
interface psb_gelp interface psb_gelp
! 2-D version ! 2-D version
subroutine psb_dgelp(trans,iperm,x,info) subroutine psb_m_dgelp(trans,iperm,x,info)
import :: psb_ipk_, psb_dpk_ import :: psb_ipk_, psb_mpk_, psb_dpk_
implicit none implicit none
real(psb_dpk_), intent(inout) :: x(:,:) real(psb_dpk_), intent(inout) :: x(:,:)
integer(psb_ipk_), intent(in) :: iperm(:) integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans character, intent(in) :: trans
end subroutine psb_dgelp end subroutine psb_m_dgelp
subroutine psb_dgelpv(trans,iperm,x,info) subroutine psb_m_dgelpv(trans,iperm,x,info)
import :: psb_ipk_, psb_dpk_ 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 implicit none
real(psb_dpk_), intent(inout) :: x(:) real(psb_dpk_), intent(inout) :: x(:)
integer(psb_ipk_), intent(in) :: iperm(:) integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans character, intent(in) :: trans
end subroutine psb_dgelpv end subroutine psb_e_dgelpv
end interface psb_gelp end interface psb_gelp
interface psb_geaxpby interface psb_geaxpby

@ -32,24 +32,40 @@
module psi_e_serial_mod module psi_e_serial_mod
use psb_const_mod, only : psb_ipk_, psb_lpk_, psb_mpk_, psb_epk_ use psb_const_mod, only : psb_ipk_, psb_lpk_, psb_mpk_, psb_epk_
interface psb_gelp interface psb_gelp
! 2-D version ! 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_ import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_
implicit none implicit none
integer(psb_epk_), intent(inout) :: x(:,:) integer(psb_epk_), intent(inout) :: x(:,:)
integer(psb_ipk_), intent(in) :: iperm(:) integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans character, intent(in) :: trans
end subroutine psb_egelp end subroutine psb_m_egelp
subroutine psb_egelpv(trans,iperm,x,info) subroutine psb_m_egelpv(trans,iperm,x,info)
import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_ import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_
implicit none implicit none
integer(psb_epk_), intent(inout) :: x(:) integer(psb_epk_), intent(inout) :: x(:)
integer(psb_ipk_), intent(in) :: iperm(:) integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans 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 end interface psb_gelp
interface psb_geaxpby interface psb_geaxpby

@ -32,24 +32,40 @@
module psi_i2_serial_mod module psi_i2_serial_mod
use psb_const_mod, only : psb_ipk_, psb_lpk_, psb_mpk_, psb_epk_ use psb_const_mod, only : psb_ipk_, psb_lpk_, psb_mpk_, psb_epk_
interface psb_gelp interface psb_gelp
! 2-D version ! 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_ import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_
implicit none implicit none
integer(psb_i2pk_), intent(inout) :: x(:,:) integer(psb_i2pk_), intent(inout) :: x(:,:)
integer(psb_ipk_), intent(in) :: iperm(:) integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans character, intent(in) :: trans
end subroutine psb_i2gelp end subroutine psb_m_i2gelp
subroutine psb_i2gelpv(trans,iperm,x,info) subroutine psb_m_i2gelpv(trans,iperm,x,info)
import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_ import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_
implicit none implicit none
integer(psb_i2pk_), intent(inout) :: x(:) integer(psb_i2pk_), intent(inout) :: x(:)
integer(psb_ipk_), intent(in) :: iperm(:) integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans 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 end interface psb_gelp
interface psb_geaxpby interface psb_geaxpby

@ -32,24 +32,40 @@
module psi_m_serial_mod module psi_m_serial_mod
use psb_const_mod, only : psb_ipk_, psb_lpk_, psb_mpk_, psb_epk_ use psb_const_mod, only : psb_ipk_, psb_lpk_, psb_mpk_, psb_epk_
interface psb_gelp interface psb_gelp
! 2-D version ! 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_ import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_
implicit none implicit none
integer(psb_mpk_), intent(inout) :: x(:,:) integer(psb_mpk_), intent(inout) :: x(:,:)
integer(psb_ipk_), intent(in) :: iperm(:) integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans character, intent(in) :: trans
end subroutine psb_mgelp end subroutine psb_m_mgelp
subroutine psb_mgelpv(trans,iperm,x,info) subroutine psb_m_mgelpv(trans,iperm,x,info)
import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_ import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_
implicit none implicit none
integer(psb_mpk_), intent(inout) :: x(:) integer(psb_mpk_), intent(inout) :: x(:)
integer(psb_ipk_), intent(in) :: iperm(:) integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans 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 end interface psb_gelp
interface psb_geaxpby interface psb_geaxpby

@ -32,24 +32,40 @@
module psi_s_serial_mod module psi_s_serial_mod
use psb_const_mod, only : psb_ipk_, psb_lpk_, psb_mpk_, psb_epk_, psb_spk_ use psb_const_mod, only : psb_ipk_, psb_lpk_, psb_mpk_, psb_epk_, psb_spk_
interface psb_gelp interface psb_gelp
! 2-D version ! 2-D version
subroutine psb_sgelp(trans,iperm,x,info) subroutine psb_m_sgelp(trans,iperm,x,info)
import :: psb_ipk_, psb_spk_ import :: psb_ipk_, psb_mpk_, psb_spk_
implicit none implicit none
real(psb_spk_), intent(inout) :: x(:,:) real(psb_spk_), intent(inout) :: x(:,:)
integer(psb_ipk_), intent(in) :: iperm(:) integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans character, intent(in) :: trans
end subroutine psb_sgelp end subroutine psb_m_sgelp
subroutine psb_sgelpv(trans,iperm,x,info) subroutine psb_m_sgelpv(trans,iperm,x,info)
import :: psb_ipk_, psb_spk_ 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 implicit none
real(psb_spk_), intent(inout) :: x(:) real(psb_spk_), intent(inout) :: x(:)
integer(psb_ipk_), intent(in) :: iperm(:) integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans character, intent(in) :: trans
end subroutine psb_sgelpv end subroutine psb_e_sgelpv
end interface psb_gelp end interface psb_gelp
interface psb_geaxpby interface psb_geaxpby

@ -32,24 +32,40 @@
module psi_z_serial_mod module psi_z_serial_mod
use psb_const_mod, only : psb_ipk_, psb_lpk_, psb_mpk_, psb_epk_, psb_dpk_ use psb_const_mod, only : psb_ipk_, psb_lpk_, psb_mpk_, psb_epk_, psb_dpk_
interface psb_gelp interface psb_gelp
! 2-D version ! 2-D version
subroutine psb_zgelp(trans,iperm,x,info) subroutine psb_m_zgelp(trans,iperm,x,info)
import :: psb_ipk_, psb_dpk_ import :: psb_ipk_, psb_mpk_, psb_dpk_
implicit none implicit none
complex(psb_dpk_), intent(inout) :: x(:,:) complex(psb_dpk_), intent(inout) :: x(:,:)
integer(psb_ipk_), intent(in) :: iperm(:) integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans character, intent(in) :: trans
end subroutine psb_zgelp end subroutine psb_m_zgelp
subroutine psb_zgelpv(trans,iperm,x,info) subroutine psb_m_zgelpv(trans,iperm,x,info)
import :: psb_ipk_, psb_dpk_ 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 implicit none
complex(psb_dpk_), intent(inout) :: x(:) complex(psb_dpk_), intent(inout) :: x(:)
integer(psb_ipk_), intent(in) :: iperm(:) integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans character, intent(in) :: trans
end subroutine psb_zgelpv end subroutine psb_e_zgelpv
end interface psb_gelp end interface psb_gelp
interface psb_geaxpby interface psb_geaxpby

@ -56,11 +56,11 @@ module psi_c_comm_v_mod
type(psb_desc_type), target :: desc_a type(psb_desc_type), target :: desc_a
integer(psb_ipk_), optional :: data integer(psb_ipk_), optional :: data
end subroutine psi_cswapdata_multivect 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) & totxch,totsnd,totrcv,work,info)
import import
type(psb_ctxt_type), intent(in) :: ctxt 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(in) :: flag
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
class(psb_c_base_vect_type) :: y 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 class(psb_i_base_vect_type), intent(inout) :: idx
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
end subroutine psi_cswap_vidx_vect 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) & totxch,totsnd,totrcv,work,info)
import import
type(psb_ctxt_type), intent(in) :: ctxt 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(in) :: flag
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
class(psb_c_base_multivect_type) :: y class(psb_c_base_multivect_type) :: y
@ -106,11 +106,11 @@ module psi_c_comm_v_mod
type(psb_desc_type), target :: desc_a type(psb_desc_type), target :: desc_a
integer(psb_ipk_), optional :: data integer(psb_ipk_), optional :: data
end subroutine psi_cswaptran_multivect 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) & totxch,totsnd,totrcv,work,info)
import import
type(psb_ctxt_type), intent(in) :: ctxt 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(in) :: flag
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
class(psb_c_base_vect_type) :: y 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 class(psb_i_base_vect_type), intent(inout) :: idx
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
end subroutine psi_ctran_vidx_vect 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) & totxch,totsnd,totrcv,work,info)
import import
type(psb_ctxt_type), intent(in) :: ctxt 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(in) :: flag
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
class(psb_c_base_multivect_type) :: y class(psb_c_base_multivect_type) :: y

@ -56,11 +56,11 @@ module psi_d_comm_v_mod
type(psb_desc_type), target :: desc_a type(psb_desc_type), target :: desc_a
integer(psb_ipk_), optional :: data integer(psb_ipk_), optional :: data
end subroutine psi_dswapdata_multivect 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) & totxch,totsnd,totrcv,work,info)
import import
type(psb_ctxt_type), intent(in) :: ctxt 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(in) :: flag
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
class(psb_d_base_vect_type) :: y 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 class(psb_i_base_vect_type), intent(inout) :: idx
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
end subroutine psi_dswap_vidx_vect 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) & totxch,totsnd,totrcv,work,info)
import import
type(psb_ctxt_type), intent(in) :: ctxt 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(in) :: flag
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
class(psb_d_base_multivect_type) :: y class(psb_d_base_multivect_type) :: y
@ -106,11 +106,11 @@ module psi_d_comm_v_mod
type(psb_desc_type), target :: desc_a type(psb_desc_type), target :: desc_a
integer(psb_ipk_), optional :: data integer(psb_ipk_), optional :: data
end subroutine psi_dswaptran_multivect 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) & totxch,totsnd,totrcv,work,info)
import import
type(psb_ctxt_type), intent(in) :: ctxt 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(in) :: flag
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
class(psb_d_base_vect_type) :: y 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 class(psb_i_base_vect_type), intent(inout) :: idx
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
end subroutine psi_dtran_vidx_vect 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) & totxch,totsnd,totrcv,work,info)
import import
type(psb_ctxt_type), intent(in) :: ctxt 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(in) :: flag
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
class(psb_d_base_multivect_type) :: y class(psb_d_base_multivect_type) :: y

@ -57,11 +57,11 @@ module psi_i_comm_v_mod
type(psb_desc_type), target :: desc_a type(psb_desc_type), target :: desc_a
integer(psb_ipk_), optional :: data integer(psb_ipk_), optional :: data
end subroutine psi_iswapdata_multivect 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) & totxch,totsnd,totrcv,work,info)
import import
type(psb_ctxt_type), intent(in) :: ctxt 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(in) :: flag
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
class(psb_i_base_vect_type) :: y 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 class(psb_i_base_vect_type), intent(inout) :: idx
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
end subroutine psi_iswap_vidx_vect 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) & totxch,totsnd,totrcv,work,info)
import import
type(psb_ctxt_type), intent(in) :: ctxt 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(in) :: flag
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
class(psb_i_base_multivect_type) :: y class(psb_i_base_multivect_type) :: y
@ -107,11 +107,11 @@ module psi_i_comm_v_mod
type(psb_desc_type), target :: desc_a type(psb_desc_type), target :: desc_a
integer(psb_ipk_), optional :: data integer(psb_ipk_), optional :: data
end subroutine psi_iswaptran_multivect 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) & totxch,totsnd,totrcv,work,info)
import import
type(psb_ctxt_type), intent(in) :: ctxt 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(in) :: flag
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
class(psb_i_base_vect_type) :: y 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 class(psb_i_base_vect_type), intent(inout) :: idx
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
end subroutine psi_itran_vidx_vect 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) & totxch,totsnd,totrcv,work,info)
import import
type(psb_ctxt_type), intent(in) :: ctxt 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(in) :: flag
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
class(psb_i_base_multivect_type) :: y class(psb_i_base_multivect_type) :: y

@ -58,11 +58,11 @@ module psi_l_comm_v_mod
type(psb_desc_type), target :: desc_a type(psb_desc_type), target :: desc_a
integer(psb_ipk_), optional :: data integer(psb_ipk_), optional :: data
end subroutine psi_lswapdata_multivect 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) & totxch,totsnd,totrcv,work,info)
import import
type(psb_ctxt_type), intent(in) :: ctxt 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(in) :: flag
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
class(psb_l_base_vect_type) :: y 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 class(psb_i_base_vect_type), intent(inout) :: idx
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
end subroutine psi_lswap_vidx_vect 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) & totxch,totsnd,totrcv,work,info)
import import
type(psb_ctxt_type), intent(in) :: ctxt 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(in) :: flag
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
class(psb_l_base_multivect_type) :: y class(psb_l_base_multivect_type) :: y
@ -108,11 +108,11 @@ module psi_l_comm_v_mod
type(psb_desc_type), target :: desc_a type(psb_desc_type), target :: desc_a
integer(psb_ipk_), optional :: data integer(psb_ipk_), optional :: data
end subroutine psi_lswaptran_multivect 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) & totxch,totsnd,totrcv,work,info)
import import
type(psb_ctxt_type), intent(in) :: ctxt 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(in) :: flag
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
class(psb_l_base_vect_type) :: y 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 class(psb_i_base_vect_type), intent(inout) :: idx
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
end subroutine psi_ltran_vidx_vect 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) & totxch,totsnd,totrcv,work,info)
import import
type(psb_ctxt_type), intent(in) :: ctxt 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(in) :: flag
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
class(psb_l_base_multivect_type) :: y class(psb_l_base_multivect_type) :: y

@ -56,11 +56,11 @@ module psi_s_comm_v_mod
type(psb_desc_type), target :: desc_a type(psb_desc_type), target :: desc_a
integer(psb_ipk_), optional :: data integer(psb_ipk_), optional :: data
end subroutine psi_sswapdata_multivect 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) & totxch,totsnd,totrcv,work,info)
import import
type(psb_ctxt_type), intent(in) :: ctxt 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(in) :: flag
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
class(psb_s_base_vect_type) :: y 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 class(psb_i_base_vect_type), intent(inout) :: idx
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
end subroutine psi_sswap_vidx_vect 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) & totxch,totsnd,totrcv,work,info)
import import
type(psb_ctxt_type), intent(in) :: ctxt 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(in) :: flag
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
class(psb_s_base_multivect_type) :: y class(psb_s_base_multivect_type) :: y
@ -106,11 +106,11 @@ module psi_s_comm_v_mod
type(psb_desc_type), target :: desc_a type(psb_desc_type), target :: desc_a
integer(psb_ipk_), optional :: data integer(psb_ipk_), optional :: data
end subroutine psi_sswaptran_multivect 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) & totxch,totsnd,totrcv,work,info)
import import
type(psb_ctxt_type), intent(in) :: ctxt 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(in) :: flag
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
class(psb_s_base_vect_type) :: y 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 class(psb_i_base_vect_type), intent(inout) :: idx
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
end subroutine psi_stran_vidx_vect 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) & totxch,totsnd,totrcv,work,info)
import import
type(psb_ctxt_type), intent(in) :: ctxt 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(in) :: flag
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
class(psb_s_base_multivect_type) :: y class(psb_s_base_multivect_type) :: y

@ -56,11 +56,11 @@ module psi_z_comm_v_mod
type(psb_desc_type), target :: desc_a type(psb_desc_type), target :: desc_a
integer(psb_ipk_), optional :: data integer(psb_ipk_), optional :: data
end subroutine psi_zswapdata_multivect 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) & totxch,totsnd,totrcv,work,info)
import import
type(psb_ctxt_type), intent(in) :: ctxt 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(in) :: flag
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
class(psb_z_base_vect_type) :: y 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 class(psb_i_base_vect_type), intent(inout) :: idx
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
end subroutine psi_zswap_vidx_vect 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) & totxch,totsnd,totrcv,work,info)
import import
type(psb_ctxt_type), intent(in) :: ctxt 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(in) :: flag
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
class(psb_z_base_multivect_type) :: y class(psb_z_base_multivect_type) :: y
@ -106,11 +106,11 @@ module psi_z_comm_v_mod
type(psb_desc_type), target :: desc_a type(psb_desc_type), target :: desc_a
integer(psb_ipk_), optional :: data integer(psb_ipk_), optional :: data
end subroutine psi_zswaptran_multivect 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) & totxch,totsnd,totrcv,work,info)
import import
type(psb_ctxt_type), intent(in) :: ctxt 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(in) :: flag
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
class(psb_z_base_vect_type) :: y 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 class(psb_i_base_vect_type), intent(inout) :: idx
integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv
end subroutine psi_ztran_vidx_vect 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) & totxch,totsnd,totrcv,work,info)
import import
type(psb_ctxt_type), intent(in) :: ctxt 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(in) :: flag
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
class(psb_z_base_multivect_type) :: y class(psb_z_base_multivect_type) :: y

@ -613,8 +613,10 @@ contains
if (allocated(desc%indxmap)) then if (allocated(desc%indxmap)) then
val = desc%indxmap%get_ctxt() val = desc%indxmap%get_ctxt()
else else
call psb_errpush(psb_err_invalid_cd_state_,'psb_cd_get_context') ! At this point, val should a non-ALLOCATED
call psb_error() ! 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 if
end function psb_cd_get_context 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 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) :: fnd_owner => psi_indx_map_fnd_owner
procedure, pass(idxmap) :: init_null => base_init_null
procedure, pass(idxmap) :: init_vl => base_init_vl procedure, pass(idxmap) :: init_vl => base_init_vl
generic, public :: init => 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_ll2gs1, base_ll2gs2, base_ll2gv1, base_ll2gv2,&
& base_lg2ls1, base_lg2ls2, base_lg2lv1, base_lg2lv2,& & base_lg2ls1, base_lg2ls2, base_lg2lv1, base_lg2lv2,&
& base_lg2ls1_ins, base_lg2ls2_ins, base_lg2lv1_ins,& & 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_row_extendable, base_clone, base_cpy, base_reinit, &
& base_set_halo_owner, base_get_halo_owner, & & base_set_halo_owner, base_get_halo_owner, &
& base_qry_halo_owner_s, base_qry_halo_owner_v,& & base_qry_halo_owner_s, base_qry_halo_owner_v,&
@ -1345,6 +1346,17 @@ contains
end subroutine base_set_null 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) subroutine base_init_vl(idxmap,ctxt,vl,info)
use psb_penv_mod use psb_penv_mod
use psb_error_mod use psb_error_mod
@ -1414,7 +1426,7 @@ contains
call psb_get_erraction(err_act) call psb_get_erraction(err_act)
outmap%state = idxmap%state outmap%state = idxmap%state
outmap%ctxt = idxmap%ctxt outmap%ctxt = idxmap%ctxt
outmap%mpic = idxmap%mpic outmap%mpic = idxmap%mpic
outmap%global_rows = idxmap%global_rows outmap%global_rows = idxmap%global_rows
outmap%global_cols = idxmap%global_cols outmap%global_cols = idxmap%global_cols

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

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

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

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

@ -216,10 +216,11 @@ contains
logical, intent(out) :: dat(:) logical, intent(out) :: dat(:)
integer(psb_mpk_), intent(in) :: src integer(psb_mpk_), intent(in) :: src
integer(psb_mpk_) :: info integer(psb_mpk_) :: info
integer(psb_mpk_) :: status(mpi_status_size) integer(psb_mpk_) :: status(mpi_status_size), icomm
#if defined(SERIAL_MPI) #if defined(SERIAL_MPI)
#else #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) call psb_test_nodes(psb_mesg_queue)
#endif #endif

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

@ -110,13 +110,13 @@ module psi_i_mod
end interface end interface
interface psi_bld_glb_dep_list 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 import
type(psb_ctxt_type), intent(in) :: ctxt type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_ipk_), intent(in) :: loc_dl(:), length_dl(0:) integer(psb_ipk_), intent(in) :: loc_dl(:), length_dl(0:)
integer(psb_ipk_), allocatable, intent(out) :: c_dep_list(:), dl_ptr(:) integer(psb_ipk_), allocatable, intent(out) :: c_dep_list(:), dl_ptr(:)
integer(psb_ipk_), intent(out) :: info 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 end interface
interface psi_extract_loc_dl interface psi_extract_loc_dl

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

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

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

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

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

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

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

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

@ -1,9 +1,9 @@
! !
! Parallel Sparse BLAS version 3.5 ! Parallel Sparse BLAS version 3.5
! (C) Copyright 2006-2018 ! (C) Copyright 2006-2018
! Salvatore Filippone ! Salvatore Filippone
! Alfredo Buttari ! Alfredo Buttari
! !
! Redistribution and use in source and binary forms, with or without ! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions ! modification, are permitted provided that the following conditions
! are met: ! are met:
@ -15,7 +15,7 @@
! 3. The name of the PSBLAS group or the names of its contributors may ! 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 ! not be used to endorse or promote products derived from this
! software without specific written permission. ! software without specific written permission.
! !
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED ! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
@ -27,8 +27,8 @@
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ! 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 ! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE. ! POSSIBILITY OF SUCH DAMAGE.
! !
! !
module psb_serial_mod module psb_serial_mod
use psb_const_mod use psb_const_mod
use psb_error_mod use psb_error_mod
@ -66,9 +66,42 @@ module psb_serial_mod
real(psb_dpk_), intent (in) :: alpha, beta real(psb_dpk_), intent (in) :: alpha, beta
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
end subroutine psb_d_nspaxpby 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 end interface psb_nspaxpby
interface interface
subroutine symbmm (n, m, l, ia, ja, diaga, & subroutine symbmm (n, m, l, ia, ja, diaga, &
& ib, jb, diagb, ic, jc, diagc, index) & ib, jb, diagb, ic, jc, diagc, index)
import :: psb_ipk_ import :: psb_ipk_
@ -84,7 +117,7 @@ module psb_serial_mod
integer(psb_lpk_), allocatable :: ic(:),jc(:) integer(psb_lpk_), allocatable :: ic(:),jc(:)
end subroutine lsymbmm end subroutine lsymbmm
end interface end interface
contains contains
@ -103,13 +136,13 @@ contains
elemental function psb_cnrm1(x) result(res) elemental function psb_cnrm1(x) result(res)
complex(psb_spk_), intent(in) :: x complex(psb_spk_), intent(in) :: x
real(psb_spk_) :: res real(psb_spk_) :: res
res = abs( real( x ) ) + abs( aimag( x ) ) res = abs( real( x ) ) + abs( aimag( x ) )
end function psb_cnrm1 end function psb_cnrm1
elemental function psb_znrm1(x) result(res) elemental function psb_znrm1(x) result(res)
complex(psb_dpk_), intent(in) :: x complex(psb_dpk_), intent(in) :: x
real(psb_dpk_) :: res real(psb_dpk_) :: res
res = abs( real( x ) ) + abs( aimag( x ) ) res = abs( real( x ) ) + abs( aimag( x ) )
end function psb_znrm1 end function psb_znrm1
elemental function psb_sminreal(x) result(res) elemental function psb_sminreal(x) result(res)
@ -127,13 +160,13 @@ contains
elemental function psb_cminreal(x) result(res) elemental function psb_cminreal(x) result(res)
complex(psb_spk_), intent(in) :: x complex(psb_spk_), intent(in) :: x
real(psb_spk_) :: res real(psb_spk_) :: res
res = min( real( x ) , aimag( x ) ) res = min( real( x ) , aimag( x ) )
end function psb_cminreal end function psb_cminreal
elemental function psb_zminreal(x) result(res) elemental function psb_zminreal(x) result(res)
complex(psb_dpk_), intent(in) :: x complex(psb_dpk_), intent(in) :: x
real(psb_dpk_) :: res real(psb_dpk_) :: res
res = min( real( x ) , aimag( x ) ) res = min( real( x ) , aimag( x ) )
end function psb_zminreal end function psb_zminreal
@ -197,7 +230,7 @@ contains
! .. executable statements .. ! .. executable statements ..
! !
if( n <= 0 ) return if( n <= 0 ) return
if( incx == 1 .and. incy == 1 ) then if( incx == 1 .and. incy == 1 ) then
! !
! code for both increments equal to 1 ! code for both increments equal to 1
! !
@ -232,7 +265,7 @@ contains
real(psb_spk_) norm,scale real(psb_spk_) norm,scale
complex(psb_spk_) alpha complex(psb_spk_) alpha
! !
if (cabs(ca) == 0.0) then if (cabs(ca) == 0.0) then
! !
c = 0.0d0 c = 0.0d0
s = (1.0,0.0) s = (1.0,0.0)
@ -316,7 +349,7 @@ contains
! .. executable statements .. ! .. executable statements ..
! !
if( n <= 0 ) return if( n <= 0 ) return
if( incx == 1 .and. incy == 1 ) then if( incx == 1 .and. incy == 1 ) then
! !
! code for both increments equal to 1 ! code for both increments equal to 1
! !
@ -351,7 +384,7 @@ contains
real(psb_dpk_) norm,scale real(psb_dpk_) norm,scale
complex(psb_dpk_) alpha complex(psb_dpk_) alpha
! !
if (cdabs(ca) == 0.0d0) then if (cdabs(ca) == 0.0d0) then
! !
c = 0.0d0 c = 0.0d0
s = (1.0d0,0.0d0) s = (1.0d0,0.0d0)
@ -374,4 +407,3 @@ contains
end module psb_serial_mod end module psb_serial_mod

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

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

@ -431,5 +431,21 @@ Module psb_c_tools_mod
end function end function
end interface 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 end module psb_c_tools_mod

@ -431,5 +431,21 @@ Module psb_d_tools_mod
end function end function
end interface 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 end module psb_d_tools_mod

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

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

@ -431,5 +431,21 @@ Module psb_s_tools_mod
end function end function
end interface 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 end module psb_s_tools_mod

@ -431,5 +431,21 @@ Module psb_z_tools_mod
end function end function
end interface 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 end module psb_z_tools_mod

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

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

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

@ -37,9 +37,13 @@
function psb_zget_nnz(a,desc_a,info) result(res) function psb_zget_nnz(a,desc_a,info) result(res)
use psb_base_mod, psb_protect_name => psb_zget_nnz use psb_base_mod, psb_protect_name => psb_zget_nnz
use psi_mod use psi_mod
use mpi #ifdef MPI_MOD
use mpi
implicit none #endif
implicit none
#ifdef MPI_H
include 'mpif.h'
#endif
integer(psb_lpk_) :: res integer(psb_lpk_) :: res
type(psb_zspmat_type), intent(in) :: a 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 \ smmp.o lsmmp.o \
psb_sgeprt.o psb_dgeprt.o psb_cgeprt.o psb_zgeprt.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_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_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 psb_sasum_s.o psb_dasum_s.o psb_casum_s.o psb_zasum_s.o
LIBDIR=.. LIBDIR=..
INCDIR=.. INCDIR=..
MODDIR=../modules MODDIR=../modules

@ -250,7 +250,6 @@ subroutine psb_c_base_mv_from_coo(a,b,info)
end subroutine psb_c_base_mv_from_coo end subroutine psb_c_base_mv_from_coo
subroutine psb_c_base_mv_to_fmt(a,b,info) 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_c_base_mat_mod, psb_protect_name => psb_c_base_mv_to_fmt
use psb_error_mod 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),ia,info)
call psb_realloc(max(mb,nb),ja,info) call psb_realloc(max(mb,nb),ja,info)
call psb_realloc(max(mb,nb),val,info) call psb_realloc(max(mb,nb),val,info)
! Implementing this in OpenMP?
! Tricky, to be seen
do i=imin_,imax_, nbk do i=imin_,imax_, nbk
ibk = min(nbk,imax_-i+1) ibk = min(nbk,imax_-i+1)
call a%csget(i,i+ibk-1,nzout,ia,ja,val,info,& 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),ia,info)
call psb_realloc(max(mb,nb),ja,info) call psb_realloc(max(mb,nb),ja,info)
call psb_realloc(max(mb,nb),val,info) call psb_realloc(max(mb,nb),val,info)
! Implementing this in OpenMP?
! Tricky, to be seen
do i=imin_,imax_, nbk do i=imin_,imax_, nbk
ibk = min(nbk,imax_-i+1) ibk = min(nbk,imax_-i+1)
call a%csget(i,i+ibk-1,nzout,ia,ja,val,info,& 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 end subroutine psb_c_base_triu
subroutine psb_c_base_clone(a,b,info) subroutine psb_c_base_clone(a,b,info)
use psb_c_base_mat_mod, psb_protect_name => psb_c_base_clone use psb_c_base_mat_mod, psb_protect_name => psb_c_base_clone
use psb_error_mod use psb_error_mod
@ -960,6 +961,7 @@ subroutine psb_c_base_make_nonunit(a)
mnm = min(m,n) mnm = min(m,n)
nz = tmp%get_nzeros() nz = tmp%get_nzeros()
call tmp%reallocate(nz+mnm) call tmp%reallocate(nz+mnm)
!$omp parallel do private(i) shared(nz)
do i=1, mnm do i=1, mnm
tmp%val(nz+i) = cone tmp%val(nz+i) = cone
tmp%ia(nz+i) = i tmp%ia(nz+i) = i
@ -1506,6 +1508,7 @@ contains
complex(psb_spk_), intent(out) :: y(*) complex(psb_spk_), intent(out) :: y(*)
integer(psb_ipk_) :: i integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1,n do i=1,n
y(i) = d(i)*x(i) y(i) = d(i)*x(i)
end do end do
@ -1519,6 +1522,7 @@ contains
complex(psb_spk_), intent(inout) :: x(*) complex(psb_spk_), intent(inout) :: x(*)
integer(psb_ipk_) :: i integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1,n do i=1,n
x(i) = d(i)*x(i) x(i) = d(i)*x(i)
end do 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),ia,info)
call psb_realloc(max(mb,nb),ja,info) call psb_realloc(max(mb,nb),ja,info)
call psb_realloc(max(mb,nb),val,info) call psb_realloc(max(mb,nb),val,info)
! Implementing this in OpenMP?
! Tricky, to be seen
do i=imin_,imax_, nbk do i=imin_,imax_, nbk
ibk = min(nbk,imax_-i+1) ibk = min(nbk,imax_-i+1)
call a%csget(i,i+ibk-1,nzout,ia,ja,val,info,& 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),ia,info)
call psb_realloc(max(mb,nb),ja,info) call psb_realloc(max(mb,nb),ja,info)
call psb_realloc(max(mb,nb),val,info) call psb_realloc(max(mb,nb),val,info)
! Implementing this in OpenMP?
! Tricky, to be seen
do i=imin_,imax_, nbk do i=imin_,imax_, nbk
ibk = min(nbk,imax_-i+1) ibk = min(nbk,imax_-i+1)
call a%csget(i,i+ibk-1,nzout,ia,ja,val,info,& 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) mnm = min(m,n)
nz = tmp%get_nzeros() nz = tmp%get_nzeros()
call tmp%reallocate(nz+mnm) call tmp%reallocate(nz+mnm)
!$omp parallel do private(i) shared(nz)
do i=1, mnm do i=1, mnm
tmp%val(nz+i) = cone tmp%val(nz+i) = cone
tmp%ia(nz+i) = i tmp%ia(nz+i) = i

@ -114,6 +114,7 @@ subroutine psb_c_coo_scal(d,a,info,side)
goto 9999 goto 9999
end if end if
!$omp parallel do private(i,j)
do i=1,a%get_nzeros() do i=1,a%get_nzeros()
j = a%ia(i) j = a%ia(i)
a%val(i) = a%val(i) * d(j) a%val(i) = a%val(i) * d(j)
@ -126,6 +127,7 @@ subroutine psb_c_coo_scal(d,a,info,side)
goto 9999 goto 9999
end if end if
!$omp parallel do private(i,j)
do i=1,a%get_nzeros() do i=1,a%get_nzeros()
j = a%ja(i) j = a%ja(i)
a%val(i) = a%val(i) * d(j) a%val(i) = a%val(i) * d(j)
@ -201,6 +203,7 @@ subroutine psb_c_coo_scalplusidentity(d,a,info)
end if end if
mnm = min(a%get_nrows(),a%get_ncols()) mnm = min(a%get_nrows(),a%get_ncols())
!$omp parallel do private(i,j)
do i=1,a%get_nzeros() do i=1,a%get_nzeros()
a%val(i) = a%val(i) * d a%val(i) = a%val(i) * d
j=a%ia(i) j=a%ia(i)
@ -253,12 +256,30 @@ subroutine psb_c_coo_spaxpby(alpha,a,beta,b,info)
! Allocate (temporary) space for the solution ! Allocate (temporary) space for the solution
call tcoo%allocate(M,N,(nza+nzb)) call tcoo%allocate(M,N,(nza+nzb))
! Compute the sum ! 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%ia(1:nza) = a%ia(1:nza)
tcoo%ja(1:nza) = a%ja(1:nza) tcoo%ja(1:nza) = a%ja(1:nza)
tcoo%val(1:nza) = alpha*a%val(1:nza) tcoo%val(1:nza) = alpha*a%val(1:nza)
tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb) tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb)
tcoo%ja(nza+1:nza+nzb) = bcoo%ja(1:nzb) tcoo%ja(nza+1:nza+nzb) = bcoo%ja(1:nzb)
tcoo%val(nza+1:nza+nzb) = beta*bcoo%val(1:nzb) tcoo%val(nza+1:nza+nzb) = beta*bcoo%val(1:nzb)
#endif
! Fix the indexes ! Fix the indexes
call tcoo%fix(info) call tcoo%fix(info)
! Move to correct output format ! 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 ! Allocate (temporary) space for the solution
call tcoo%allocate(M,N,(nza+nzb)) call tcoo%allocate(M,N,(nza+nzb))
! Compute the sum ! 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%ia(1:nza) = a%ia(1:nza)
tcoo%ja(1:nza) = a%ja(1:nza) tcoo%ja(1:nza) = a%ja(1:nza)
tcoo%val(1:nza) = a%val(1:nza) tcoo%val(1:nza) = a%val(1:nza)
tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb) tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb)
tcoo%ja(nza+1:nza+nzb) = bcoo%ja(1:nzb) tcoo%ja(nza+1:nza+nzb) = bcoo%ja(1:nzb)
tcoo%val(nza+1:nza+nzb) = (-sone)*bcoo%val(1:nzb) tcoo%val(nza+1:nza+nzb) = (-sone)*bcoo%val(1:nzb)
#endif
! Fix the indexes ! Fix the indexes
call tcoo%fix(info) call tcoo%fix(info)
if (info /= psb_success_) then 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 end subroutine psb_c_coo_print
function psb_c_coo_get_nz_row(idx,a) result(res) function psb_c_coo_get_nz_row(idx,a) result(res)
use psb_const_mod use psb_const_mod
use psb_sort_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 end subroutine psb_c_coo_csmv
subroutine psb_c_coo_csmm(alpha,a,x,beta,y,info,trans) subroutine psb_c_coo_csmm(alpha,a,x,beta,y,info,trans)
use psb_const_mod use psb_const_mod
use psb_error_mod use psb_error_mod
@ -1709,11 +1744,9 @@ subroutine psb_c_coo_csmm(alpha,a,x,beta,y,info,trans)
trans_ = 'N' trans_ = 'N'
end if end if
tra = (psb_toupper(trans_) == 'T') tra = (psb_toupper(trans_) == 'T')
ctra = (psb_toupper(trans_) == 'C') ctra = (psb_toupper(trans_) == 'C')
if (tra.or.ctra) then if (tra.or.ctra) then
m = a%get_ncols() m = a%get_ncols()
n = a%get_nrows() n = a%get_nrows()
@ -1895,7 +1928,15 @@ function psb_c_coo_maxval(a) result(res)
nnz = a%get_nzeros() nnz = a%get_nzeros()
if (allocated(a%val)) then if (allocated(a%val)) then
nnz = min(nnz,size(a%val)) 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))) res = maxval(abs(a%val(1:nnz)))
#endif
end if end if
end function psb_c_coo_maxval end function psb_c_coo_maxval
@ -2275,11 +2316,13 @@ subroutine psb_c_coo_csgetptn(imin,imax,a,nz,ia,ja,info,&
& iren) & iren)
if (rscale_) then if (rscale_) then
!$omp parallel do private(i)
do i=nzin_+1, nzin_+nz do i=nzin_+1, nzin_+nz
ia(i) = ia(i) - imin + 1 ia(i) = ia(i) - imin + 1
end do end do
end if end if
if (cscale_) then if (cscale_) then
!$omp parallel do private(i)
do i=nzin_+1, nzin_+nz do i=nzin_+1, nzin_+nz
ja(i) = ja(i) - jmin_ + 1 ja(i) = ja(i) - jmin_ + 1
end do end do
@ -2553,11 +2596,13 @@ subroutine psb_c_coo_csgetrow(imin,imax,a,nz,ia,ja,val,info,&
& iren) & iren)
if (rscale_) then if (rscale_) then
!$omp parallel do private(i)
do i=nzin_+1, nzin_+nz do i=nzin_+1, nzin_+nz
ia(i) = ia(i) - imin + 1 ia(i) = ia(i) - imin + 1
end do end do
end if end if
if (cscale_) then if (cscale_) then
!$omp parallel do private(i)
do i=nzin_+1, nzin_+nz do i=nzin_+1, nzin_+nz
ja(i) = ja(i) - jmin_ + 1 ja(i) = ja(i) - jmin_ + 1
end do end do
@ -2768,7 +2813,6 @@ contains
end subroutine psb_c_coo_csgetrow end subroutine psb_c_coo_csgetrow
subroutine psb_c_coo_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info) subroutine psb_c_coo_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info)
use psb_error_mod use psb_error_mod
use psb_realloc_mod use psb_realloc_mod
@ -3021,7 +3065,6 @@ contains
end subroutine psb_c_coo_csput_a end subroutine psb_c_coo_csput_a
subroutine psb_c_cp_coo_to_coo(a,b,info) subroutine psb_c_cp_coo_to_coo(a,b,info)
use psb_error_mod use psb_error_mod
use psb_c_base_mat_mod, psb_protect_name => psb_c_cp_coo_to_coo 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%set_nzeros(nz)
call b%reallocate(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%ia(1:nz) = a%ia(1:nz)
b%ja(1:nz) = a%ja(1:nz) b%ja(1:nz) = a%ja(1:nz)
b%val(1:nz) = a%val(1:nz) b%val(1:nz) = a%val(1:nz)
#endif
call b%set_host() call b%set_host()
if (.not.b%is_by_rows()) call b%fix(info) 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%set_nzeros(nz)
call a%reallocate(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%ia(1:nz) = b%ia(1:nz)
a%ja(1:nz) = b%ja(1:nz) a%ja(1:nz) = b%ja(1:nz)
a%val(1:nz) = b%val(1:nz) a%val(1:nz) = b%val(1:nz)
#endif
call a%set_host() call a%set_host()
if (.not.a%is_by_rows()) call a%fix(info) 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 end subroutine psb_c_fix_coo
subroutine psb_c_fix_coo_inner(nr,nc,nzin,dupl,ia,ja,val,nzout,info,idir) subroutine psb_c_fix_coo_inner(nr,nc,nzin,dupl,ia,ja,val,nzout,info,idir)
use psb_const_mod use psb_const_mod
use psb_error_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 end subroutine psb_c_fix_coo_inner
subroutine psb_c_cp_coo_to_lcoo(a,b,info) subroutine psb_c_cp_coo_to_lcoo(a,b,info)
use psb_error_mod use psb_error_mod
use psb_c_base_mat_mod, psb_protect_name => psb_c_cp_coo_to_lcoo 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%set_nzeros(nz)
call b%reallocate(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%ia(1:nz) = a%ia(1:nz)
b%ja(1:nz) = a%ja(1:nz) b%ja(1:nz) = a%ja(1:nz)
b%val(1:nz) = a%val(1:nz) b%val(1:nz) = a%val(1:nz)
#endif
call b%set_host() call b%set_host()
if (.not.b%is_by_rows()) call b%fix(info) 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%set_nzeros(nz)
call a%reallocate(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%ia(1:nz) = b%ia(1:nz)
a%ja(1:nz) = b%ja(1:nz) a%ja(1:nz) = b%ja(1:nz)
a%val(1:nz) = b%val(1:nz) a%val(1:nz) = b%val(1:nz)
#endif
call a%set_host() call a%set_host()
if (.not.a%is_by_rows()) call a%fix(info) 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() nnz = a%get_nzeros()
if (allocated(a%val)) then if (allocated(a%val)) then
nnz = min(nnz,size(a%val)) 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))) res = maxval(abs(a%val(1:nnz)))
#endif
end if end if
end function psb_lc_coo_maxval end function psb_lc_coo_maxval
@ -4499,7 +4593,17 @@ function psb_lc_coo_csnmi(a) result(res)
i = a%ia(j) i = a%ia(j)
vt(i) = vt(i) + abs(a%val(j)) vt(i) = vt(i) + abs(a%val(j))
end do 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)) res = maxval(vt(1:m))
#endif
deallocate(vt,stat=info) deallocate(vt,stat=info)
end if end if
@ -4539,7 +4643,17 @@ function psb_lc_coo_csnm1(a) result(res)
i = a%ja(j) i = a%ja(j)
vt(i) = vt(i) + abs(a%val(j)) vt(i) = vt(i) + abs(a%val(j))
end do 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)) res = maxval(vt(1:n))
#endif
deallocate(vt,stat=info) deallocate(vt,stat=info)
return return
@ -4584,7 +4698,6 @@ subroutine psb_lc_coo_rowsum(d,a)
d(i) = d(i) + a%val(j) d(i) = d(i) + a%val(j)
end do end do
return return
call psb_erractionrestore(err_act) call psb_erractionrestore(err_act)
return return
@ -4592,7 +4705,6 @@ subroutine psb_lc_coo_rowsum(d,a)
9999 call psb_error_handler(err_act) 9999 call psb_error_handler(err_act)
return return
end subroutine psb_lc_coo_rowsum end subroutine psb_lc_coo_rowsum
subroutine psb_lc_coo_arwsum(d,a) subroutine psb_lc_coo_arwsum(d,a)
@ -4761,6 +4873,7 @@ subroutine psb_lc_coo_scalplusidentity(d,a,info)
end if end if
mnm = min(a%get_nrows(),a%get_ncols()) mnm = min(a%get_nrows(),a%get_ncols())
!$omp parallel do private(i,j)
do i=1,a%get_nzeros() do i=1,a%get_nzeros()
a%val(i) = a%val(i) * d a%val(i) = a%val(i) * d
j=a%ia(i) j=a%ia(i)
@ -4813,12 +4926,30 @@ subroutine psb_lc_coo_spaxpby(alpha,a,beta,b,info)
! Allocate (temporary) space for the solution ! Allocate (temporary) space for the solution
call tcoo%allocate(M,N,(nza+nzb)) call tcoo%allocate(M,N,(nza+nzb))
! Compute the sum ! 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%ia(1:nza) = a%ia(1:nza)
tcoo%ja(1:nza) = a%ja(1:nza) tcoo%ja(1:nza) = a%ja(1:nza)
tcoo%val(1:nza) = alpha*a%val(1:nza) tcoo%val(1:nza) = alpha*a%val(1:nza)
tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb) tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb)
tcoo%ja(nza+1:nza+nzb) = bcoo%ja(1:nzb) tcoo%ja(nza+1:nza+nzb) = bcoo%ja(1:nzb)
tcoo%val(nza+1:nza+nzb) = beta*bcoo%val(1:nzb) tcoo%val(nza+1:nza+nzb) = beta*bcoo%val(1:nzb)
#endif
! Fix the indexes ! Fix the indexes
call tcoo%fix(info) call tcoo%fix(info)
! Move to correct output format ! 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 ! Allocate (temporary) space for the solution
call tcoo%allocate(M,N,(nza+nzb)) call tcoo%allocate(M,N,(nza+nzb))
! Compute the sum ! 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%ia(1:nza) = a%ia(1:nza)
tcoo%ja(1:nza) = a%ja(1:nza) tcoo%ja(1:nza) = a%ja(1:nza)
tcoo%val(1:nza) = a%val(1:nza) tcoo%val(1:nza) = a%val(1:nza)
tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb) tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb)
tcoo%ja(nza+1:nza+nzb) = bcoo%ja(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) tcoo%val(nza+1:nza+nzb) = (-1_psb_spk_)*bcoo%val(1:nzb)
#endif
! Fix the indexes ! Fix the indexes
call tcoo%fix(info) call tcoo%fix(info)
if (info /= psb_success_) then 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 if (nz < 0) then
info = psb_err_iarg_neg_ 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 goto 9999
end if end if
if (size(ia) < nz) then if (size(ia) < nz) then

@ -130,10 +130,12 @@ contains
if (alpha == czero) then if (alpha == czero) then
if (beta == czero) then if (beta == czero) then
!$omp parallel do private(i)
do i = 1, m do i = 1, m
y(i) = czero y(i) = czero
enddo enddo
else else
!$omp parallel do private(i)
do i = 1, m do i = 1, m
y(i) = beta*y(i) y(i) = beta*y(i)
end do end do
@ -147,6 +149,7 @@ contains
if (beta == czero) then if (beta == czero) then
if (alpha == cone) then if (alpha == cone) then
!$omp parallel do private(i,j, acc) schedule(static)
do i=1,m do i=1,m
acc = czero acc = czero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -157,6 +160,7 @@ contains
else if (alpha == -cone) then else if (alpha == -cone) then
!$omp parallel do private(i,j, acc)
do i=1,m do i=1,m
acc = czero acc = czero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -167,6 +171,7 @@ contains
else else
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc = czero acc = czero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -181,6 +186,7 @@ contains
else if (beta == cone) then else if (beta == cone) then
if (alpha == cone) then if (alpha == cone) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc = czero acc = czero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -191,6 +197,7 @@ contains
else if (alpha == -cone) then else if (alpha == -cone) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc = czero acc = czero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -201,6 +208,7 @@ contains
else else
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc = czero acc = czero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -214,6 +222,7 @@ contains
else if (beta == -cone) then else if (beta == -cone) then
if (alpha == cone) then if (alpha == cone) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc = czero acc = czero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -224,6 +233,7 @@ contains
else if (alpha == -cone) then else if (alpha == -cone) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc = czero acc = czero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -234,6 +244,7 @@ contains
else else
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc = czero acc = czero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -247,6 +258,7 @@ contains
else else
if (alpha == cone) then if (alpha == cone) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc = czero acc = czero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -257,6 +269,7 @@ contains
else if (alpha == -cone) then else if (alpha == -cone) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc = czero acc = czero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -267,6 +280,7 @@ contains
else else
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc = czero acc = czero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -282,16 +296,19 @@ contains
else if (tra) then else if (tra) then
if (beta == czero) then if (beta == czero) then
!$omp parallel do private(i)
do i=1, m do i=1, m
y(i) = czero y(i) = czero
end do end do
else if (beta == cone) then else if (beta == cone) then
! Do nothing ! Do nothing
else if (beta == -cone) then else if (beta == -cone) then
!$omp parallel do private(i)
do i=1, m do i=1, m
y(i) = -y(i) y(i) = -y(i)
end do end do
else else
!$omp parallel do private(i)
do i=1, m do i=1, m
y(i) = beta*y(i) y(i) = beta*y(i)
end do end do
@ -476,16 +493,18 @@ contains
complex(psb_spk_), intent(inout) :: y(ldy,*) complex(psb_spk_), intent(inout) :: y(ldy,*)
logical, intent(in) :: is_triangle,is_unit,tra,ctra 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 integer(psb_ipk_) :: i,j, ir
if (alpha == czero) then if (alpha == czero) then
if (beta == czero) then if (beta == czero) then
!$omp parallel do private(i)
do i = 1, m do i = 1, m
y(i,1:nc) = czero y(i,1:nc) = czero
enddo enddo
else else
!$omp parallel do private(i)
do i = 1, m do i = 1, m
y(i,1:nc) = beta*y(i,1:nc) y(i,1:nc) = beta*y(i,1:nc)
end do end do
@ -497,6 +516,7 @@ contains
if (beta == czero) then if (beta == czero) then
if (alpha == cone) then if (alpha == cone) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = czero acc(1:nc) = czero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -507,6 +527,7 @@ contains
else if (alpha == -cone) then else if (alpha == -cone) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = czero acc(1:nc) = czero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -517,6 +538,7 @@ contains
else else
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = czero acc(1:nc) = czero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -531,6 +553,7 @@ contains
else if (beta == cone) then else if (beta == cone) then
if (alpha == cone) then if (alpha == cone) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = czero acc(1:nc) = czero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -541,6 +564,7 @@ contains
else if (alpha == -cone) then else if (alpha == -cone) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = czero acc(1:nc) = czero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -551,6 +575,7 @@ contains
else else
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = czero acc(1:nc) = czero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -564,6 +589,7 @@ contains
else if (beta == -cone) then else if (beta == -cone) then
if (alpha == cone) then if (alpha == cone) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = czero acc(1:nc) = czero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -574,6 +600,7 @@ contains
else if (alpha == -cone) then else if (alpha == -cone) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = czero acc(1:nc) = czero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -584,6 +611,7 @@ contains
else else
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = czero acc(1:nc) = czero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -597,6 +625,7 @@ contains
else else
if (alpha == cone) then if (alpha == cone) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = czero acc(1:nc) = czero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -607,6 +636,7 @@ contains
else if (alpha == -cone) then else if (alpha == -cone) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = czero acc(1:nc) = czero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -617,6 +647,7 @@ contains
else else
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = czero acc(1:nc) = czero
do j=irp(i), irp(i+1)-1 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_mat_mod, psb_protect_name => psb_c_csall
use psb_c_base_mat_mod use psb_c_base_mat_mod
use psb_error_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(in) :: nr,nc
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: nz 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 integer(psb_ipk_) :: err_act
character(len=20) :: name='csall' character(len=20) :: name='csall'
@ -601,7 +603,23 @@ subroutine psb_c_csall(nr,nc,a,info,nz)
call a%free() call a%free()
info = psb_success_ info = psb_success_
allocate(psb_c_coo_sparse_mat :: a%a, stat=info) 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 if (info /= psb_success_) then
info = psb_err_alloc_dealloc_ info = psb_err_alloc_dealloc_
call psb_errpush(info, name) 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_mat_mod, psb_protect_name => psb_lc_csall
use psb_c_base_mat_mod use psb_c_base_mat_mod
use psb_error_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_lpk_), intent(in) :: nr,nc
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
integer(psb_lpk_), intent(in), optional :: nz 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 integer(psb_ipk_) :: err_act
character(len=20) :: name='csall' character(len=20) :: name='csall'
@ -3400,7 +3420,22 @@ subroutine psb_lc_csall(nr,nc,a,info,nz)
call a%free() call a%free()
info = psb_success_ info = psb_success_
allocate(psb_lc_coo_sparse_mat :: a%a, stat=info) 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 if (info /= psb_success_) then
info = psb_err_alloc_dealloc_ info = psb_err_alloc_dealloc_
call psb_errpush(info, name) 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 end subroutine psb_d_base_mv_from_coo
subroutine psb_d_base_mv_to_fmt(a,b,info) 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_d_base_mat_mod, psb_protect_name => psb_d_base_mv_to_fmt
use psb_error_mod 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),ia,info)
call psb_realloc(max(mb,nb),ja,info) call psb_realloc(max(mb,nb),ja,info)
call psb_realloc(max(mb,nb),val,info) call psb_realloc(max(mb,nb),val,info)
! Implementing this in OpenMP?
! Tricky, to be seen
do i=imin_,imax_, nbk do i=imin_,imax_, nbk
ibk = min(nbk,imax_-i+1) ibk = min(nbk,imax_-i+1)
call a%csget(i,i+ibk-1,nzout,ia,ja,val,info,& 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),ia,info)
call psb_realloc(max(mb,nb),ja,info) call psb_realloc(max(mb,nb),ja,info)
call psb_realloc(max(mb,nb),val,info) call psb_realloc(max(mb,nb),val,info)
! Implementing this in OpenMP?
! Tricky, to be seen
do i=imin_,imax_, nbk do i=imin_,imax_, nbk
ibk = min(nbk,imax_-i+1) ibk = min(nbk,imax_-i+1)
call a%csget(i,i+ibk-1,nzout,ia,ja,val,info,& 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 end subroutine psb_d_base_triu
subroutine psb_d_base_clone(a,b,info) subroutine psb_d_base_clone(a,b,info)
use psb_d_base_mat_mod, psb_protect_name => psb_d_base_clone use psb_d_base_mat_mod, psb_protect_name => psb_d_base_clone
use psb_error_mod use psb_error_mod
@ -960,6 +961,7 @@ subroutine psb_d_base_make_nonunit(a)
mnm = min(m,n) mnm = min(m,n)
nz = tmp%get_nzeros() nz = tmp%get_nzeros()
call tmp%reallocate(nz+mnm) call tmp%reallocate(nz+mnm)
!$omp parallel do private(i) shared(nz)
do i=1, mnm do i=1, mnm
tmp%val(nz+i) = done tmp%val(nz+i) = done
tmp%ia(nz+i) = i tmp%ia(nz+i) = i
@ -1506,6 +1508,7 @@ contains
real(psb_dpk_), intent(out) :: y(*) real(psb_dpk_), intent(out) :: y(*)
integer(psb_ipk_) :: i integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1,n do i=1,n
y(i) = d(i)*x(i) y(i) = d(i)*x(i)
end do end do
@ -1519,6 +1522,7 @@ contains
real(psb_dpk_), intent(inout) :: x(*) real(psb_dpk_), intent(inout) :: x(*)
integer(psb_ipk_) :: i integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1,n do i=1,n
x(i) = d(i)*x(i) x(i) = d(i)*x(i)
end do 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),ia,info)
call psb_realloc(max(mb,nb),ja,info) call psb_realloc(max(mb,nb),ja,info)
call psb_realloc(max(mb,nb),val,info) call psb_realloc(max(mb,nb),val,info)
! Implementing this in OpenMP?
! Tricky, to be seen
do i=imin_,imax_, nbk do i=imin_,imax_, nbk
ibk = min(nbk,imax_-i+1) ibk = min(nbk,imax_-i+1)
call a%csget(i,i+ibk-1,nzout,ia,ja,val,info,& 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),ia,info)
call psb_realloc(max(mb,nb),ja,info) call psb_realloc(max(mb,nb),ja,info)
call psb_realloc(max(mb,nb),val,info) call psb_realloc(max(mb,nb),val,info)
! Implementing this in OpenMP?
! Tricky, to be seen
do i=imin_,imax_, nbk do i=imin_,imax_, nbk
ibk = min(nbk,imax_-i+1) ibk = min(nbk,imax_-i+1)
call a%csget(i,i+ibk-1,nzout,ia,ja,val,info,& 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) mnm = min(m,n)
nz = tmp%get_nzeros() nz = tmp%get_nzeros()
call tmp%reallocate(nz+mnm) call tmp%reallocate(nz+mnm)
!$omp parallel do private(i) shared(nz)
do i=1, mnm do i=1, mnm
tmp%val(nz+i) = done tmp%val(nz+i) = done
tmp%ia(nz+i) = i tmp%ia(nz+i) = i

@ -114,6 +114,7 @@ subroutine psb_d_coo_scal(d,a,info,side)
goto 9999 goto 9999
end if end if
!$omp parallel do private(i,j)
do i=1,a%get_nzeros() do i=1,a%get_nzeros()
j = a%ia(i) j = a%ia(i)
a%val(i) = a%val(i) * d(j) a%val(i) = a%val(i) * d(j)
@ -126,6 +127,7 @@ subroutine psb_d_coo_scal(d,a,info,side)
goto 9999 goto 9999
end if end if
!$omp parallel do private(i,j)
do i=1,a%get_nzeros() do i=1,a%get_nzeros()
j = a%ja(i) j = a%ja(i)
a%val(i) = a%val(i) * d(j) a%val(i) = a%val(i) * d(j)
@ -201,6 +203,7 @@ subroutine psb_d_coo_scalplusidentity(d,a,info)
end if end if
mnm = min(a%get_nrows(),a%get_ncols()) mnm = min(a%get_nrows(),a%get_ncols())
!$omp parallel do private(i,j)
do i=1,a%get_nzeros() do i=1,a%get_nzeros()
a%val(i) = a%val(i) * d a%val(i) = a%val(i) * d
j=a%ia(i) j=a%ia(i)
@ -253,12 +256,30 @@ subroutine psb_d_coo_spaxpby(alpha,a,beta,b,info)
! Allocate (temporary) space for the solution ! Allocate (temporary) space for the solution
call tcoo%allocate(M,N,(nza+nzb)) call tcoo%allocate(M,N,(nza+nzb))
! Compute the sum ! 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%ia(1:nza) = a%ia(1:nza)
tcoo%ja(1:nza) = a%ja(1:nza) tcoo%ja(1:nza) = a%ja(1:nza)
tcoo%val(1:nza) = alpha*a%val(1:nza) tcoo%val(1:nza) = alpha*a%val(1:nza)
tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb) tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb)
tcoo%ja(nza+1:nza+nzb) = bcoo%ja(1:nzb) tcoo%ja(nza+1:nza+nzb) = bcoo%ja(1:nzb)
tcoo%val(nza+1:nza+nzb) = beta*bcoo%val(1:nzb) tcoo%val(nza+1:nza+nzb) = beta*bcoo%val(1:nzb)
#endif
! Fix the indexes ! Fix the indexes
call tcoo%fix(info) call tcoo%fix(info)
! Move to correct output format ! 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 ! Allocate (temporary) space for the solution
call tcoo%allocate(M,N,(nza+nzb)) call tcoo%allocate(M,N,(nza+nzb))
! Compute the sum ! 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%ia(1:nza) = a%ia(1:nza)
tcoo%ja(1:nza) = a%ja(1:nza) tcoo%ja(1:nza) = a%ja(1:nza)
tcoo%val(1:nza) = a%val(1:nza) tcoo%val(1:nza) = a%val(1:nza)
tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb) tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb)
tcoo%ja(nza+1:nza+nzb) = bcoo%ja(1:nzb) tcoo%ja(nza+1:nza+nzb) = bcoo%ja(1:nzb)
tcoo%val(nza+1:nza+nzb) = (-done)*bcoo%val(1:nzb) tcoo%val(nza+1:nza+nzb) = (-done)*bcoo%val(1:nzb)
#endif
! Fix the indexes ! Fix the indexes
call tcoo%fix(info) call tcoo%fix(info)
if (info /= psb_success_) then 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 end subroutine psb_d_coo_print
function psb_d_coo_get_nz_row(idx,a) result(res) function psb_d_coo_get_nz_row(idx,a) result(res)
use psb_const_mod use psb_const_mod
use psb_sort_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 end subroutine psb_d_coo_csmv
subroutine psb_d_coo_csmm(alpha,a,x,beta,y,info,trans) subroutine psb_d_coo_csmm(alpha,a,x,beta,y,info,trans)
use psb_const_mod use psb_const_mod
use psb_error_mod use psb_error_mod
@ -1709,11 +1744,9 @@ subroutine psb_d_coo_csmm(alpha,a,x,beta,y,info,trans)
trans_ = 'N' trans_ = 'N'
end if end if
tra = (psb_toupper(trans_) == 'T') tra = (psb_toupper(trans_) == 'T')
ctra = (psb_toupper(trans_) == 'C') ctra = (psb_toupper(trans_) == 'C')
if (tra.or.ctra) then if (tra.or.ctra) then
m = a%get_ncols() m = a%get_ncols()
n = a%get_nrows() n = a%get_nrows()
@ -1895,7 +1928,15 @@ function psb_d_coo_maxval(a) result(res)
nnz = a%get_nzeros() nnz = a%get_nzeros()
if (allocated(a%val)) then if (allocated(a%val)) then
nnz = min(nnz,size(a%val)) 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))) res = maxval(abs(a%val(1:nnz)))
#endif
end if end if
end function psb_d_coo_maxval end function psb_d_coo_maxval
@ -2275,11 +2316,13 @@ subroutine psb_d_coo_csgetptn(imin,imax,a,nz,ia,ja,info,&
& iren) & iren)
if (rscale_) then if (rscale_) then
!$omp parallel do private(i)
do i=nzin_+1, nzin_+nz do i=nzin_+1, nzin_+nz
ia(i) = ia(i) - imin + 1 ia(i) = ia(i) - imin + 1
end do end do
end if end if
if (cscale_) then if (cscale_) then
!$omp parallel do private(i)
do i=nzin_+1, nzin_+nz do i=nzin_+1, nzin_+nz
ja(i) = ja(i) - jmin_ + 1 ja(i) = ja(i) - jmin_ + 1
end do end do
@ -2553,11 +2596,13 @@ subroutine psb_d_coo_csgetrow(imin,imax,a,nz,ia,ja,val,info,&
& iren) & iren)
if (rscale_) then if (rscale_) then
!$omp parallel do private(i)
do i=nzin_+1, nzin_+nz do i=nzin_+1, nzin_+nz
ia(i) = ia(i) - imin + 1 ia(i) = ia(i) - imin + 1
end do end do
end if end if
if (cscale_) then if (cscale_) then
!$omp parallel do private(i)
do i=nzin_+1, nzin_+nz do i=nzin_+1, nzin_+nz
ja(i) = ja(i) - jmin_ + 1 ja(i) = ja(i) - jmin_ + 1
end do end do
@ -2768,7 +2813,6 @@ contains
end subroutine psb_d_coo_csgetrow end subroutine psb_d_coo_csgetrow
subroutine psb_d_coo_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info) subroutine psb_d_coo_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info)
use psb_error_mod use psb_error_mod
use psb_realloc_mod use psb_realloc_mod
@ -3021,7 +3065,6 @@ contains
end subroutine psb_d_coo_csput_a end subroutine psb_d_coo_csput_a
subroutine psb_d_cp_coo_to_coo(a,b,info) subroutine psb_d_cp_coo_to_coo(a,b,info)
use psb_error_mod use psb_error_mod
use psb_d_base_mat_mod, psb_protect_name => psb_d_cp_coo_to_coo 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%set_nzeros(nz)
call b%reallocate(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%ia(1:nz) = a%ia(1:nz)
b%ja(1:nz) = a%ja(1:nz) b%ja(1:nz) = a%ja(1:nz)
b%val(1:nz) = a%val(1:nz) b%val(1:nz) = a%val(1:nz)
#endif
call b%set_host() call b%set_host()
if (.not.b%is_by_rows()) call b%fix(info) 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%set_nzeros(nz)
call a%reallocate(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%ia(1:nz) = b%ia(1:nz)
a%ja(1:nz) = b%ja(1:nz) a%ja(1:nz) = b%ja(1:nz)
a%val(1:nz) = b%val(1:nz) a%val(1:nz) = b%val(1:nz)
#endif
call a%set_host() call a%set_host()
if (.not.a%is_by_rows()) call a%fix(info) 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 end subroutine psb_d_fix_coo
subroutine psb_d_fix_coo_inner(nr,nc,nzin,dupl,ia,ja,val,nzout,info,idir) subroutine psb_d_fix_coo_inner(nr,nc,nzin,dupl,ia,ja,val,nzout,info,idir)
use psb_const_mod use psb_const_mod
use psb_error_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 end subroutine psb_d_fix_coo_inner
subroutine psb_d_cp_coo_to_lcoo(a,b,info) subroutine psb_d_cp_coo_to_lcoo(a,b,info)
use psb_error_mod use psb_error_mod
use psb_d_base_mat_mod, psb_protect_name => psb_d_cp_coo_to_lcoo 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%set_nzeros(nz)
call b%reallocate(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%ia(1:nz) = a%ia(1:nz)
b%ja(1:nz) = a%ja(1:nz) b%ja(1:nz) = a%ja(1:nz)
b%val(1:nz) = a%val(1:nz) b%val(1:nz) = a%val(1:nz)
#endif
call b%set_host() call b%set_host()
if (.not.b%is_by_rows()) call b%fix(info) 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%set_nzeros(nz)
call a%reallocate(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%ia(1:nz) = b%ia(1:nz)
a%ja(1:nz) = b%ja(1:nz) a%ja(1:nz) = b%ja(1:nz)
a%val(1:nz) = b%val(1:nz) a%val(1:nz) = b%val(1:nz)
#endif
call a%set_host() call a%set_host()
if (.not.a%is_by_rows()) call a%fix(info) 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() nnz = a%get_nzeros()
if (allocated(a%val)) then if (allocated(a%val)) then
nnz = min(nnz,size(a%val)) 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))) res = maxval(abs(a%val(1:nnz)))
#endif
end if end if
end function psb_ld_coo_maxval end function psb_ld_coo_maxval
@ -4499,7 +4593,17 @@ function psb_ld_coo_csnmi(a) result(res)
i = a%ia(j) i = a%ia(j)
vt(i) = vt(i) + abs(a%val(j)) vt(i) = vt(i) + abs(a%val(j))
end do 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)) res = maxval(vt(1:m))
#endif
deallocate(vt,stat=info) deallocate(vt,stat=info)
end if end if
@ -4539,7 +4643,17 @@ function psb_ld_coo_csnm1(a) result(res)
i = a%ja(j) i = a%ja(j)
vt(i) = vt(i) + abs(a%val(j)) vt(i) = vt(i) + abs(a%val(j))
end do 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)) res = maxval(vt(1:n))
#endif
deallocate(vt,stat=info) deallocate(vt,stat=info)
return return
@ -4584,7 +4698,6 @@ subroutine psb_ld_coo_rowsum(d,a)
d(i) = d(i) + a%val(j) d(i) = d(i) + a%val(j)
end do end do
return return
call psb_erractionrestore(err_act) call psb_erractionrestore(err_act)
return return
@ -4592,7 +4705,6 @@ subroutine psb_ld_coo_rowsum(d,a)
9999 call psb_error_handler(err_act) 9999 call psb_error_handler(err_act)
return return
end subroutine psb_ld_coo_rowsum end subroutine psb_ld_coo_rowsum
subroutine psb_ld_coo_arwsum(d,a) subroutine psb_ld_coo_arwsum(d,a)
@ -4761,6 +4873,7 @@ subroutine psb_ld_coo_scalplusidentity(d,a,info)
end if end if
mnm = min(a%get_nrows(),a%get_ncols()) mnm = min(a%get_nrows(),a%get_ncols())
!$omp parallel do private(i,j)
do i=1,a%get_nzeros() do i=1,a%get_nzeros()
a%val(i) = a%val(i) * d a%val(i) = a%val(i) * d
j=a%ia(i) j=a%ia(i)
@ -4813,12 +4926,30 @@ subroutine psb_ld_coo_spaxpby(alpha,a,beta,b,info)
! Allocate (temporary) space for the solution ! Allocate (temporary) space for the solution
call tcoo%allocate(M,N,(nza+nzb)) call tcoo%allocate(M,N,(nza+nzb))
! Compute the sum ! 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%ia(1:nza) = a%ia(1:nza)
tcoo%ja(1:nza) = a%ja(1:nza) tcoo%ja(1:nza) = a%ja(1:nza)
tcoo%val(1:nza) = alpha*a%val(1:nza) tcoo%val(1:nza) = alpha*a%val(1:nza)
tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb) tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb)
tcoo%ja(nza+1:nza+nzb) = bcoo%ja(1:nzb) tcoo%ja(nza+1:nza+nzb) = bcoo%ja(1:nzb)
tcoo%val(nza+1:nza+nzb) = beta*bcoo%val(1:nzb) tcoo%val(nza+1:nza+nzb) = beta*bcoo%val(1:nzb)
#endif
! Fix the indexes ! Fix the indexes
call tcoo%fix(info) call tcoo%fix(info)
! Move to correct output format ! 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 ! Allocate (temporary) space for the solution
call tcoo%allocate(M,N,(nza+nzb)) call tcoo%allocate(M,N,(nza+nzb))
! Compute the sum ! 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%ia(1:nza) = a%ia(1:nza)
tcoo%ja(1:nza) = a%ja(1:nza) tcoo%ja(1:nza) = a%ja(1:nza)
tcoo%val(1:nza) = a%val(1:nza) tcoo%val(1:nza) = a%val(1:nza)
tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb) tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb)
tcoo%ja(nza+1:nza+nzb) = bcoo%ja(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) tcoo%val(nza+1:nza+nzb) = (-1_psb_dpk_)*bcoo%val(1:nzb)
#endif
! Fix the indexes ! Fix the indexes
call tcoo%fix(info) call tcoo%fix(info)
if (info /= psb_success_) then 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 if (nz < 0) then
info = psb_err_iarg_neg_ 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 goto 9999
end if end if
if (size(ia) < nz) then if (size(ia) < nz) then

@ -130,10 +130,12 @@ contains
if (alpha == dzero) then if (alpha == dzero) then
if (beta == dzero) then if (beta == dzero) then
!$omp parallel do private(i)
do i = 1, m do i = 1, m
y(i) = dzero y(i) = dzero
enddo enddo
else else
!$omp parallel do private(i)
do i = 1, m do i = 1, m
y(i) = beta*y(i) y(i) = beta*y(i)
end do end do
@ -147,6 +149,7 @@ contains
if (beta == dzero) then if (beta == dzero) then
if (alpha == done) then if (alpha == done) then
!$omp parallel do private(i,j, acc) schedule(static)
do i=1,m do i=1,m
acc = dzero acc = dzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -157,6 +160,7 @@ contains
else if (alpha == -done) then else if (alpha == -done) then
!$omp parallel do private(i,j, acc)
do i=1,m do i=1,m
acc = dzero acc = dzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -167,6 +171,7 @@ contains
else else
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc = dzero acc = dzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -181,6 +186,7 @@ contains
else if (beta == done) then else if (beta == done) then
if (alpha == done) then if (alpha == done) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc = dzero acc = dzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -191,6 +197,7 @@ contains
else if (alpha == -done) then else if (alpha == -done) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc = dzero acc = dzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -201,6 +208,7 @@ contains
else else
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc = dzero acc = dzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -214,6 +222,7 @@ contains
else if (beta == -done) then else if (beta == -done) then
if (alpha == done) then if (alpha == done) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc = dzero acc = dzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -224,6 +233,7 @@ contains
else if (alpha == -done) then else if (alpha == -done) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc = dzero acc = dzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -234,6 +244,7 @@ contains
else else
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc = dzero acc = dzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -247,6 +258,7 @@ contains
else else
if (alpha == done) then if (alpha == done) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc = dzero acc = dzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -257,6 +269,7 @@ contains
else if (alpha == -done) then else if (alpha == -done) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc = dzero acc = dzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -267,6 +280,7 @@ contains
else else
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc = dzero acc = dzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -282,16 +296,19 @@ contains
else if (tra) then else if (tra) then
if (beta == dzero) then if (beta == dzero) then
!$omp parallel do private(i)
do i=1, m do i=1, m
y(i) = dzero y(i) = dzero
end do end do
else if (beta == done) then else if (beta == done) then
! Do nothing ! Do nothing
else if (beta == -done) then else if (beta == -done) then
!$omp parallel do private(i)
do i=1, m do i=1, m
y(i) = -y(i) y(i) = -y(i)
end do end do
else else
!$omp parallel do private(i)
do i=1, m do i=1, m
y(i) = beta*y(i) y(i) = beta*y(i)
end do end do
@ -476,16 +493,18 @@ contains
real(psb_dpk_), intent(inout) :: y(ldy,*) real(psb_dpk_), intent(inout) :: y(ldy,*)
logical, intent(in) :: is_triangle,is_unit,tra,ctra 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 integer(psb_ipk_) :: i,j, ir
if (alpha == dzero) then if (alpha == dzero) then
if (beta == dzero) then if (beta == dzero) then
!$omp parallel do private(i)
do i = 1, m do i = 1, m
y(i,1:nc) = dzero y(i,1:nc) = dzero
enddo enddo
else else
!$omp parallel do private(i)
do i = 1, m do i = 1, m
y(i,1:nc) = beta*y(i,1:nc) y(i,1:nc) = beta*y(i,1:nc)
end do end do
@ -497,6 +516,7 @@ contains
if (beta == dzero) then if (beta == dzero) then
if (alpha == done) then if (alpha == done) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = dzero acc(1:nc) = dzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -507,6 +527,7 @@ contains
else if (alpha == -done) then else if (alpha == -done) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = dzero acc(1:nc) = dzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -517,6 +538,7 @@ contains
else else
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = dzero acc(1:nc) = dzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -531,6 +553,7 @@ contains
else if (beta == done) then else if (beta == done) then
if (alpha == done) then if (alpha == done) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = dzero acc(1:nc) = dzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -541,6 +564,7 @@ contains
else if (alpha == -done) then else if (alpha == -done) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = dzero acc(1:nc) = dzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -551,6 +575,7 @@ contains
else else
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = dzero acc(1:nc) = dzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -564,6 +589,7 @@ contains
else if (beta == -done) then else if (beta == -done) then
if (alpha == done) then if (alpha == done) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = dzero acc(1:nc) = dzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -574,6 +600,7 @@ contains
else if (alpha == -done) then else if (alpha == -done) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = dzero acc(1:nc) = dzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -584,6 +611,7 @@ contains
else else
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = dzero acc(1:nc) = dzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -597,6 +625,7 @@ contains
else else
if (alpha == done) then if (alpha == done) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = dzero acc(1:nc) = dzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -607,6 +636,7 @@ contains
else if (alpha == -done) then else if (alpha == -done) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = dzero acc(1:nc) = dzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -617,6 +647,7 @@ contains
else else
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = dzero acc(1:nc) = dzero
do j=irp(i), irp(i+1)-1 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_mat_mod, psb_protect_name => psb_d_csall
use psb_d_base_mat_mod use psb_d_base_mat_mod
use psb_error_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(in) :: nr,nc
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: nz 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 integer(psb_ipk_) :: err_act
character(len=20) :: name='csall' character(len=20) :: name='csall'
@ -601,7 +603,23 @@ subroutine psb_d_csall(nr,nc,a,info,nz)
call a%free() call a%free()
info = psb_success_ info = psb_success_
allocate(psb_d_coo_sparse_mat :: a%a, stat=info) 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 if (info /= psb_success_) then
info = psb_err_alloc_dealloc_ info = psb_err_alloc_dealloc_
call psb_errpush(info, name) 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_mat_mod, psb_protect_name => psb_ld_csall
use psb_d_base_mat_mod use psb_d_base_mat_mod
use psb_error_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_lpk_), intent(in) :: nr,nc
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
integer(psb_lpk_), intent(in), optional :: nz 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 integer(psb_ipk_) :: err_act
character(len=20) :: name='csall' character(len=20) :: name='csall'
@ -3400,7 +3420,22 @@ subroutine psb_ld_csall(nr,nc,a,info,nz)
call a%free() call a%free()
info = psb_success_ info = psb_success_
allocate(psb_ld_coo_sparse_mat :: a%a, stat=info) 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 if (info /= psb_success_) then
info = psb_err_alloc_dealloc_ info = psb_err_alloc_dealloc_
call psb_errpush(info, name) 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 end subroutine psb_s_base_mv_from_coo
subroutine psb_s_base_mv_to_fmt(a,b,info) 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_s_base_mat_mod, psb_protect_name => psb_s_base_mv_to_fmt
use psb_error_mod 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),ia,info)
call psb_realloc(max(mb,nb),ja,info) call psb_realloc(max(mb,nb),ja,info)
call psb_realloc(max(mb,nb),val,info) call psb_realloc(max(mb,nb),val,info)
! Implementing this in OpenMP?
! Tricky, to be seen
do i=imin_,imax_, nbk do i=imin_,imax_, nbk
ibk = min(nbk,imax_-i+1) ibk = min(nbk,imax_-i+1)
call a%csget(i,i+ibk-1,nzout,ia,ja,val,info,& 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),ia,info)
call psb_realloc(max(mb,nb),ja,info) call psb_realloc(max(mb,nb),ja,info)
call psb_realloc(max(mb,nb),val,info) call psb_realloc(max(mb,nb),val,info)
! Implementing this in OpenMP?
! Tricky, to be seen
do i=imin_,imax_, nbk do i=imin_,imax_, nbk
ibk = min(nbk,imax_-i+1) ibk = min(nbk,imax_-i+1)
call a%csget(i,i+ibk-1,nzout,ia,ja,val,info,& 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 end subroutine psb_s_base_triu
subroutine psb_s_base_clone(a,b,info) subroutine psb_s_base_clone(a,b,info)
use psb_s_base_mat_mod, psb_protect_name => psb_s_base_clone use psb_s_base_mat_mod, psb_protect_name => psb_s_base_clone
use psb_error_mod use psb_error_mod
@ -960,6 +961,7 @@ subroutine psb_s_base_make_nonunit(a)
mnm = min(m,n) mnm = min(m,n)
nz = tmp%get_nzeros() nz = tmp%get_nzeros()
call tmp%reallocate(nz+mnm) call tmp%reallocate(nz+mnm)
!$omp parallel do private(i) shared(nz)
do i=1, mnm do i=1, mnm
tmp%val(nz+i) = sone tmp%val(nz+i) = sone
tmp%ia(nz+i) = i tmp%ia(nz+i) = i
@ -1506,6 +1508,7 @@ contains
real(psb_spk_), intent(out) :: y(*) real(psb_spk_), intent(out) :: y(*)
integer(psb_ipk_) :: i integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1,n do i=1,n
y(i) = d(i)*x(i) y(i) = d(i)*x(i)
end do end do
@ -1519,6 +1522,7 @@ contains
real(psb_spk_), intent(inout) :: x(*) real(psb_spk_), intent(inout) :: x(*)
integer(psb_ipk_) :: i integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1,n do i=1,n
x(i) = d(i)*x(i) x(i) = d(i)*x(i)
end do 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),ia,info)
call psb_realloc(max(mb,nb),ja,info) call psb_realloc(max(mb,nb),ja,info)
call psb_realloc(max(mb,nb),val,info) call psb_realloc(max(mb,nb),val,info)
! Implementing this in OpenMP?
! Tricky, to be seen
do i=imin_,imax_, nbk do i=imin_,imax_, nbk
ibk = min(nbk,imax_-i+1) ibk = min(nbk,imax_-i+1)
call a%csget(i,i+ibk-1,nzout,ia,ja,val,info,& 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),ia,info)
call psb_realloc(max(mb,nb),ja,info) call psb_realloc(max(mb,nb),ja,info)
call psb_realloc(max(mb,nb),val,info) call psb_realloc(max(mb,nb),val,info)
! Implementing this in OpenMP?
! Tricky, to be seen
do i=imin_,imax_, nbk do i=imin_,imax_, nbk
ibk = min(nbk,imax_-i+1) ibk = min(nbk,imax_-i+1)
call a%csget(i,i+ibk-1,nzout,ia,ja,val,info,& 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) mnm = min(m,n)
nz = tmp%get_nzeros() nz = tmp%get_nzeros()
call tmp%reallocate(nz+mnm) call tmp%reallocate(nz+mnm)
!$omp parallel do private(i) shared(nz)
do i=1, mnm do i=1, mnm
tmp%val(nz+i) = sone tmp%val(nz+i) = sone
tmp%ia(nz+i) = i tmp%ia(nz+i) = i

@ -114,6 +114,7 @@ subroutine psb_s_coo_scal(d,a,info,side)
goto 9999 goto 9999
end if end if
!$omp parallel do private(i,j)
do i=1,a%get_nzeros() do i=1,a%get_nzeros()
j = a%ia(i) j = a%ia(i)
a%val(i) = a%val(i) * d(j) a%val(i) = a%val(i) * d(j)
@ -126,6 +127,7 @@ subroutine psb_s_coo_scal(d,a,info,side)
goto 9999 goto 9999
end if end if
!$omp parallel do private(i,j)
do i=1,a%get_nzeros() do i=1,a%get_nzeros()
j = a%ja(i) j = a%ja(i)
a%val(i) = a%val(i) * d(j) a%val(i) = a%val(i) * d(j)
@ -201,6 +203,7 @@ subroutine psb_s_coo_scalplusidentity(d,a,info)
end if end if
mnm = min(a%get_nrows(),a%get_ncols()) mnm = min(a%get_nrows(),a%get_ncols())
!$omp parallel do private(i,j)
do i=1,a%get_nzeros() do i=1,a%get_nzeros()
a%val(i) = a%val(i) * d a%val(i) = a%val(i) * d
j=a%ia(i) j=a%ia(i)
@ -253,12 +256,30 @@ subroutine psb_s_coo_spaxpby(alpha,a,beta,b,info)
! Allocate (temporary) space for the solution ! Allocate (temporary) space for the solution
call tcoo%allocate(M,N,(nza+nzb)) call tcoo%allocate(M,N,(nza+nzb))
! Compute the sum ! 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%ia(1:nza) = a%ia(1:nza)
tcoo%ja(1:nza) = a%ja(1:nza) tcoo%ja(1:nza) = a%ja(1:nza)
tcoo%val(1:nza) = alpha*a%val(1:nza) tcoo%val(1:nza) = alpha*a%val(1:nza)
tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb) tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb)
tcoo%ja(nza+1:nza+nzb) = bcoo%ja(1:nzb) tcoo%ja(nza+1:nza+nzb) = bcoo%ja(1:nzb)
tcoo%val(nza+1:nza+nzb) = beta*bcoo%val(1:nzb) tcoo%val(nza+1:nza+nzb) = beta*bcoo%val(1:nzb)
#endif
! Fix the indexes ! Fix the indexes
call tcoo%fix(info) call tcoo%fix(info)
! Move to correct output format ! 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 ! Allocate (temporary) space for the solution
call tcoo%allocate(M,N,(nza+nzb)) call tcoo%allocate(M,N,(nza+nzb))
! Compute the sum ! 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%ia(1:nza) = a%ia(1:nza)
tcoo%ja(1:nza) = a%ja(1:nza) tcoo%ja(1:nza) = a%ja(1:nza)
tcoo%val(1:nza) = a%val(1:nza) tcoo%val(1:nza) = a%val(1:nza)
tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb) tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb)
tcoo%ja(nza+1:nza+nzb) = bcoo%ja(1:nzb) tcoo%ja(nza+1:nza+nzb) = bcoo%ja(1:nzb)
tcoo%val(nza+1:nza+nzb) = (-sone)*bcoo%val(1:nzb) tcoo%val(nza+1:nza+nzb) = (-sone)*bcoo%val(1:nzb)
#endif
! Fix the indexes ! Fix the indexes
call tcoo%fix(info) call tcoo%fix(info)
if (info /= psb_success_) then 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 end subroutine psb_s_coo_print
function psb_s_coo_get_nz_row(idx,a) result(res) function psb_s_coo_get_nz_row(idx,a) result(res)
use psb_const_mod use psb_const_mod
use psb_sort_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 end subroutine psb_s_coo_csmv
subroutine psb_s_coo_csmm(alpha,a,x,beta,y,info,trans) subroutine psb_s_coo_csmm(alpha,a,x,beta,y,info,trans)
use psb_const_mod use psb_const_mod
use psb_error_mod use psb_error_mod
@ -1709,11 +1744,9 @@ subroutine psb_s_coo_csmm(alpha,a,x,beta,y,info,trans)
trans_ = 'N' trans_ = 'N'
end if end if
tra = (psb_toupper(trans_) == 'T') tra = (psb_toupper(trans_) == 'T')
ctra = (psb_toupper(trans_) == 'C') ctra = (psb_toupper(trans_) == 'C')
if (tra.or.ctra) then if (tra.or.ctra) then
m = a%get_ncols() m = a%get_ncols()
n = a%get_nrows() n = a%get_nrows()
@ -1895,7 +1928,15 @@ function psb_s_coo_maxval(a) result(res)
nnz = a%get_nzeros() nnz = a%get_nzeros()
if (allocated(a%val)) then if (allocated(a%val)) then
nnz = min(nnz,size(a%val)) 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))) res = maxval(abs(a%val(1:nnz)))
#endif
end if end if
end function psb_s_coo_maxval end function psb_s_coo_maxval
@ -2275,11 +2316,13 @@ subroutine psb_s_coo_csgetptn(imin,imax,a,nz,ia,ja,info,&
& iren) & iren)
if (rscale_) then if (rscale_) then
!$omp parallel do private(i)
do i=nzin_+1, nzin_+nz do i=nzin_+1, nzin_+nz
ia(i) = ia(i) - imin + 1 ia(i) = ia(i) - imin + 1
end do end do
end if end if
if (cscale_) then if (cscale_) then
!$omp parallel do private(i)
do i=nzin_+1, nzin_+nz do i=nzin_+1, nzin_+nz
ja(i) = ja(i) - jmin_ + 1 ja(i) = ja(i) - jmin_ + 1
end do end do
@ -2553,11 +2596,13 @@ subroutine psb_s_coo_csgetrow(imin,imax,a,nz,ia,ja,val,info,&
& iren) & iren)
if (rscale_) then if (rscale_) then
!$omp parallel do private(i)
do i=nzin_+1, nzin_+nz do i=nzin_+1, nzin_+nz
ia(i) = ia(i) - imin + 1 ia(i) = ia(i) - imin + 1
end do end do
end if end if
if (cscale_) then if (cscale_) then
!$omp parallel do private(i)
do i=nzin_+1, nzin_+nz do i=nzin_+1, nzin_+nz
ja(i) = ja(i) - jmin_ + 1 ja(i) = ja(i) - jmin_ + 1
end do end do
@ -2768,7 +2813,6 @@ contains
end subroutine psb_s_coo_csgetrow end subroutine psb_s_coo_csgetrow
subroutine psb_s_coo_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info) subroutine psb_s_coo_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info)
use psb_error_mod use psb_error_mod
use psb_realloc_mod use psb_realloc_mod
@ -3021,7 +3065,6 @@ contains
end subroutine psb_s_coo_csput_a end subroutine psb_s_coo_csput_a
subroutine psb_s_cp_coo_to_coo(a,b,info) subroutine psb_s_cp_coo_to_coo(a,b,info)
use psb_error_mod use psb_error_mod
use psb_s_base_mat_mod, psb_protect_name => psb_s_cp_coo_to_coo 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%set_nzeros(nz)
call b%reallocate(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%ia(1:nz) = a%ia(1:nz)
b%ja(1:nz) = a%ja(1:nz) b%ja(1:nz) = a%ja(1:nz)
b%val(1:nz) = a%val(1:nz) b%val(1:nz) = a%val(1:nz)
#endif
call b%set_host() call b%set_host()
if (.not.b%is_by_rows()) call b%fix(info) 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%set_nzeros(nz)
call a%reallocate(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%ia(1:nz) = b%ia(1:nz)
a%ja(1:nz) = b%ja(1:nz) a%ja(1:nz) = b%ja(1:nz)
a%val(1:nz) = b%val(1:nz) a%val(1:nz) = b%val(1:nz)
#endif
call a%set_host() call a%set_host()
if (.not.a%is_by_rows()) call a%fix(info) 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 end subroutine psb_s_fix_coo
subroutine psb_s_fix_coo_inner(nr,nc,nzin,dupl,ia,ja,val,nzout,info,idir) subroutine psb_s_fix_coo_inner(nr,nc,nzin,dupl,ia,ja,val,nzout,info,idir)
use psb_const_mod use psb_const_mod
use psb_error_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 end subroutine psb_s_fix_coo_inner
subroutine psb_s_cp_coo_to_lcoo(a,b,info) subroutine psb_s_cp_coo_to_lcoo(a,b,info)
use psb_error_mod use psb_error_mod
use psb_s_base_mat_mod, psb_protect_name => psb_s_cp_coo_to_lcoo 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%set_nzeros(nz)
call b%reallocate(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%ia(1:nz) = a%ia(1:nz)
b%ja(1:nz) = a%ja(1:nz) b%ja(1:nz) = a%ja(1:nz)
b%val(1:nz) = a%val(1:nz) b%val(1:nz) = a%val(1:nz)
#endif
call b%set_host() call b%set_host()
if (.not.b%is_by_rows()) call b%fix(info) 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%set_nzeros(nz)
call a%reallocate(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%ia(1:nz) = b%ia(1:nz)
a%ja(1:nz) = b%ja(1:nz) a%ja(1:nz) = b%ja(1:nz)
a%val(1:nz) = b%val(1:nz) a%val(1:nz) = b%val(1:nz)
#endif
call a%set_host() call a%set_host()
if (.not.a%is_by_rows()) call a%fix(info) 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() nnz = a%get_nzeros()
if (allocated(a%val)) then if (allocated(a%val)) then
nnz = min(nnz,size(a%val)) 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))) res = maxval(abs(a%val(1:nnz)))
#endif
end if end if
end function psb_ls_coo_maxval end function psb_ls_coo_maxval
@ -4499,7 +4593,17 @@ function psb_ls_coo_csnmi(a) result(res)
i = a%ia(j) i = a%ia(j)
vt(i) = vt(i) + abs(a%val(j)) vt(i) = vt(i) + abs(a%val(j))
end do 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)) res = maxval(vt(1:m))
#endif
deallocate(vt,stat=info) deallocate(vt,stat=info)
end if end if
@ -4539,7 +4643,17 @@ function psb_ls_coo_csnm1(a) result(res)
i = a%ja(j) i = a%ja(j)
vt(i) = vt(i) + abs(a%val(j)) vt(i) = vt(i) + abs(a%val(j))
end do 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)) res = maxval(vt(1:n))
#endif
deallocate(vt,stat=info) deallocate(vt,stat=info)
return return
@ -4584,7 +4698,6 @@ subroutine psb_ls_coo_rowsum(d,a)
d(i) = d(i) + a%val(j) d(i) = d(i) + a%val(j)
end do end do
return return
call psb_erractionrestore(err_act) call psb_erractionrestore(err_act)
return return
@ -4592,7 +4705,6 @@ subroutine psb_ls_coo_rowsum(d,a)
9999 call psb_error_handler(err_act) 9999 call psb_error_handler(err_act)
return return
end subroutine psb_ls_coo_rowsum end subroutine psb_ls_coo_rowsum
subroutine psb_ls_coo_arwsum(d,a) subroutine psb_ls_coo_arwsum(d,a)
@ -4761,6 +4873,7 @@ subroutine psb_ls_coo_scalplusidentity(d,a,info)
end if end if
mnm = min(a%get_nrows(),a%get_ncols()) mnm = min(a%get_nrows(),a%get_ncols())
!$omp parallel do private(i,j)
do i=1,a%get_nzeros() do i=1,a%get_nzeros()
a%val(i) = a%val(i) * d a%val(i) = a%val(i) * d
j=a%ia(i) j=a%ia(i)
@ -4813,12 +4926,30 @@ subroutine psb_ls_coo_spaxpby(alpha,a,beta,b,info)
! Allocate (temporary) space for the solution ! Allocate (temporary) space for the solution
call tcoo%allocate(M,N,(nza+nzb)) call tcoo%allocate(M,N,(nza+nzb))
! Compute the sum ! 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%ia(1:nza) = a%ia(1:nza)
tcoo%ja(1:nza) = a%ja(1:nza) tcoo%ja(1:nza) = a%ja(1:nza)
tcoo%val(1:nza) = alpha*a%val(1:nza) tcoo%val(1:nza) = alpha*a%val(1:nza)
tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb) tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb)
tcoo%ja(nza+1:nza+nzb) = bcoo%ja(1:nzb) tcoo%ja(nza+1:nza+nzb) = bcoo%ja(1:nzb)
tcoo%val(nza+1:nza+nzb) = beta*bcoo%val(1:nzb) tcoo%val(nza+1:nza+nzb) = beta*bcoo%val(1:nzb)
#endif
! Fix the indexes ! Fix the indexes
call tcoo%fix(info) call tcoo%fix(info)
! Move to correct output format ! 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 ! Allocate (temporary) space for the solution
call tcoo%allocate(M,N,(nza+nzb)) call tcoo%allocate(M,N,(nza+nzb))
! Compute the sum ! 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%ia(1:nza) = a%ia(1:nza)
tcoo%ja(1:nza) = a%ja(1:nza) tcoo%ja(1:nza) = a%ja(1:nza)
tcoo%val(1:nza) = a%val(1:nza) tcoo%val(1:nza) = a%val(1:nza)
tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb) tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb)
tcoo%ja(nza+1:nza+nzb) = bcoo%ja(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) tcoo%val(nza+1:nza+nzb) = (-1_psb_spk_)*bcoo%val(1:nzb)
#endif
! Fix the indexes ! Fix the indexes
call tcoo%fix(info) call tcoo%fix(info)
if (info /= psb_success_) then 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 if (nz < 0) then
info = psb_err_iarg_neg_ 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 goto 9999
end if end if
if (size(ia) < nz) then if (size(ia) < nz) then

@ -130,10 +130,12 @@ contains
if (alpha == szero) then if (alpha == szero) then
if (beta == szero) then if (beta == szero) then
!$omp parallel do private(i)
do i = 1, m do i = 1, m
y(i) = szero y(i) = szero
enddo enddo
else else
!$omp parallel do private(i)
do i = 1, m do i = 1, m
y(i) = beta*y(i) y(i) = beta*y(i)
end do end do
@ -147,6 +149,7 @@ contains
if (beta == szero) then if (beta == szero) then
if (alpha == sone) then if (alpha == sone) then
!$omp parallel do private(i,j, acc) schedule(static)
do i=1,m do i=1,m
acc = szero acc = szero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -157,6 +160,7 @@ contains
else if (alpha == -sone) then else if (alpha == -sone) then
!$omp parallel do private(i,j, acc)
do i=1,m do i=1,m
acc = szero acc = szero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -167,6 +171,7 @@ contains
else else
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc = szero acc = szero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -181,6 +186,7 @@ contains
else if (beta == sone) then else if (beta == sone) then
if (alpha == sone) then if (alpha == sone) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc = szero acc = szero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -191,6 +197,7 @@ contains
else if (alpha == -sone) then else if (alpha == -sone) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc = szero acc = szero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -201,6 +208,7 @@ contains
else else
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc = szero acc = szero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -214,6 +222,7 @@ contains
else if (beta == -sone) then else if (beta == -sone) then
if (alpha == sone) then if (alpha == sone) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc = szero acc = szero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -224,6 +233,7 @@ contains
else if (alpha == -sone) then else if (alpha == -sone) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc = szero acc = szero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -234,6 +244,7 @@ contains
else else
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc = szero acc = szero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -247,6 +258,7 @@ contains
else else
if (alpha == sone) then if (alpha == sone) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc = szero acc = szero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -257,6 +269,7 @@ contains
else if (alpha == -sone) then else if (alpha == -sone) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc = szero acc = szero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -267,6 +280,7 @@ contains
else else
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc = szero acc = szero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -282,16 +296,19 @@ contains
else if (tra) then else if (tra) then
if (beta == szero) then if (beta == szero) then
!$omp parallel do private(i)
do i=1, m do i=1, m
y(i) = szero y(i) = szero
end do end do
else if (beta == sone) then else if (beta == sone) then
! Do nothing ! Do nothing
else if (beta == -sone) then else if (beta == -sone) then
!$omp parallel do private(i)
do i=1, m do i=1, m
y(i) = -y(i) y(i) = -y(i)
end do end do
else else
!$omp parallel do private(i)
do i=1, m do i=1, m
y(i) = beta*y(i) y(i) = beta*y(i)
end do end do
@ -476,16 +493,18 @@ contains
real(psb_spk_), intent(inout) :: y(ldy,*) real(psb_spk_), intent(inout) :: y(ldy,*)
logical, intent(in) :: is_triangle,is_unit,tra,ctra 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 integer(psb_ipk_) :: i,j, ir
if (alpha == szero) then if (alpha == szero) then
if (beta == szero) then if (beta == szero) then
!$omp parallel do private(i)
do i = 1, m do i = 1, m
y(i,1:nc) = szero y(i,1:nc) = szero
enddo enddo
else else
!$omp parallel do private(i)
do i = 1, m do i = 1, m
y(i,1:nc) = beta*y(i,1:nc) y(i,1:nc) = beta*y(i,1:nc)
end do end do
@ -497,6 +516,7 @@ contains
if (beta == szero) then if (beta == szero) then
if (alpha == sone) then if (alpha == sone) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = szero acc(1:nc) = szero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -507,6 +527,7 @@ contains
else if (alpha == -sone) then else if (alpha == -sone) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = szero acc(1:nc) = szero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -517,6 +538,7 @@ contains
else else
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = szero acc(1:nc) = szero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -531,6 +553,7 @@ contains
else if (beta == sone) then else if (beta == sone) then
if (alpha == sone) then if (alpha == sone) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = szero acc(1:nc) = szero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -541,6 +564,7 @@ contains
else if (alpha == -sone) then else if (alpha == -sone) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = szero acc(1:nc) = szero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -551,6 +575,7 @@ contains
else else
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = szero acc(1:nc) = szero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -564,6 +589,7 @@ contains
else if (beta == -sone) then else if (beta == -sone) then
if (alpha == sone) then if (alpha == sone) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = szero acc(1:nc) = szero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -574,6 +600,7 @@ contains
else if (alpha == -sone) then else if (alpha == -sone) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = szero acc(1:nc) = szero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -584,6 +611,7 @@ contains
else else
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = szero acc(1:nc) = szero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -597,6 +625,7 @@ contains
else else
if (alpha == sone) then if (alpha == sone) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = szero acc(1:nc) = szero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -607,6 +636,7 @@ contains
else if (alpha == -sone) then else if (alpha == -sone) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = szero acc(1:nc) = szero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -617,6 +647,7 @@ contains
else else
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = szero acc(1:nc) = szero
do j=irp(i), irp(i+1)-1 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_mat_mod, psb_protect_name => psb_s_csall
use psb_s_base_mat_mod use psb_s_base_mat_mod
use psb_error_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(in) :: nr,nc
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: nz 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 integer(psb_ipk_) :: err_act
character(len=20) :: name='csall' character(len=20) :: name='csall'
@ -601,7 +603,23 @@ subroutine psb_s_csall(nr,nc,a,info,nz)
call a%free() call a%free()
info = psb_success_ info = psb_success_
allocate(psb_s_coo_sparse_mat :: a%a, stat=info) 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 if (info /= psb_success_) then
info = psb_err_alloc_dealloc_ info = psb_err_alloc_dealloc_
call psb_errpush(info, name) 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_mat_mod, psb_protect_name => psb_ls_csall
use psb_s_base_mat_mod use psb_s_base_mat_mod
use psb_error_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_lpk_), intent(in) :: nr,nc
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
integer(psb_lpk_), intent(in), optional :: nz 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 integer(psb_ipk_) :: err_act
character(len=20) :: name='csall' character(len=20) :: name='csall'
@ -3400,7 +3420,22 @@ subroutine psb_ls_csall(nr,nc,a,info,nz)
call a%free() call a%free()
info = psb_success_ info = psb_success_
allocate(psb_ls_coo_sparse_mat :: a%a, stat=info) 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 if (info /= psb_success_) then
info = psb_err_alloc_dealloc_ info = psb_err_alloc_dealloc_
call psb_errpush(info, name) 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 end subroutine psb_z_base_mv_from_coo
subroutine psb_z_base_mv_to_fmt(a,b,info) 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_z_base_mat_mod, psb_protect_name => psb_z_base_mv_to_fmt
use psb_error_mod 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),ia,info)
call psb_realloc(max(mb,nb),ja,info) call psb_realloc(max(mb,nb),ja,info)
call psb_realloc(max(mb,nb),val,info) call psb_realloc(max(mb,nb),val,info)
! Implementing this in OpenMP?
! Tricky, to be seen
do i=imin_,imax_, nbk do i=imin_,imax_, nbk
ibk = min(nbk,imax_-i+1) ibk = min(nbk,imax_-i+1)
call a%csget(i,i+ibk-1,nzout,ia,ja,val,info,& 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),ia,info)
call psb_realloc(max(mb,nb),ja,info) call psb_realloc(max(mb,nb),ja,info)
call psb_realloc(max(mb,nb),val,info) call psb_realloc(max(mb,nb),val,info)
! Implementing this in OpenMP?
! Tricky, to be seen
do i=imin_,imax_, nbk do i=imin_,imax_, nbk
ibk = min(nbk,imax_-i+1) ibk = min(nbk,imax_-i+1)
call a%csget(i,i+ibk-1,nzout,ia,ja,val,info,& 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 end subroutine psb_z_base_triu
subroutine psb_z_base_clone(a,b,info) subroutine psb_z_base_clone(a,b,info)
use psb_z_base_mat_mod, psb_protect_name => psb_z_base_clone use psb_z_base_mat_mod, psb_protect_name => psb_z_base_clone
use psb_error_mod use psb_error_mod
@ -960,6 +961,7 @@ subroutine psb_z_base_make_nonunit(a)
mnm = min(m,n) mnm = min(m,n)
nz = tmp%get_nzeros() nz = tmp%get_nzeros()
call tmp%reallocate(nz+mnm) call tmp%reallocate(nz+mnm)
!$omp parallel do private(i) shared(nz)
do i=1, mnm do i=1, mnm
tmp%val(nz+i) = zone tmp%val(nz+i) = zone
tmp%ia(nz+i) = i tmp%ia(nz+i) = i
@ -1506,6 +1508,7 @@ contains
complex(psb_dpk_), intent(out) :: y(*) complex(psb_dpk_), intent(out) :: y(*)
integer(psb_ipk_) :: i integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1,n do i=1,n
y(i) = d(i)*x(i) y(i) = d(i)*x(i)
end do end do
@ -1519,6 +1522,7 @@ contains
complex(psb_dpk_), intent(inout) :: x(*) complex(psb_dpk_), intent(inout) :: x(*)
integer(psb_ipk_) :: i integer(psb_ipk_) :: i
!$omp parallel do private(i)
do i=1,n do i=1,n
x(i) = d(i)*x(i) x(i) = d(i)*x(i)
end do 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),ia,info)
call psb_realloc(max(mb,nb),ja,info) call psb_realloc(max(mb,nb),ja,info)
call psb_realloc(max(mb,nb),val,info) call psb_realloc(max(mb,nb),val,info)
! Implementing this in OpenMP?
! Tricky, to be seen
do i=imin_,imax_, nbk do i=imin_,imax_, nbk
ibk = min(nbk,imax_-i+1) ibk = min(nbk,imax_-i+1)
call a%csget(i,i+ibk-1,nzout,ia,ja,val,info,& 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),ia,info)
call psb_realloc(max(mb,nb),ja,info) call psb_realloc(max(mb,nb),ja,info)
call psb_realloc(max(mb,nb),val,info) call psb_realloc(max(mb,nb),val,info)
! Implementing this in OpenMP?
! Tricky, to be seen
do i=imin_,imax_, nbk do i=imin_,imax_, nbk
ibk = min(nbk,imax_-i+1) ibk = min(nbk,imax_-i+1)
call a%csget(i,i+ibk-1,nzout,ia,ja,val,info,& 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) mnm = min(m,n)
nz = tmp%get_nzeros() nz = tmp%get_nzeros()
call tmp%reallocate(nz+mnm) call tmp%reallocate(nz+mnm)
!$omp parallel do private(i) shared(nz)
do i=1, mnm do i=1, mnm
tmp%val(nz+i) = zone tmp%val(nz+i) = zone
tmp%ia(nz+i) = i tmp%ia(nz+i) = i

@ -114,6 +114,7 @@ subroutine psb_z_coo_scal(d,a,info,side)
goto 9999 goto 9999
end if end if
!$omp parallel do private(i,j)
do i=1,a%get_nzeros() do i=1,a%get_nzeros()
j = a%ia(i) j = a%ia(i)
a%val(i) = a%val(i) * d(j) a%val(i) = a%val(i) * d(j)
@ -126,6 +127,7 @@ subroutine psb_z_coo_scal(d,a,info,side)
goto 9999 goto 9999
end if end if
!$omp parallel do private(i,j)
do i=1,a%get_nzeros() do i=1,a%get_nzeros()
j = a%ja(i) j = a%ja(i)
a%val(i) = a%val(i) * d(j) a%val(i) = a%val(i) * d(j)
@ -201,6 +203,7 @@ subroutine psb_z_coo_scalplusidentity(d,a,info)
end if end if
mnm = min(a%get_nrows(),a%get_ncols()) mnm = min(a%get_nrows(),a%get_ncols())
!$omp parallel do private(i,j)
do i=1,a%get_nzeros() do i=1,a%get_nzeros()
a%val(i) = a%val(i) * d a%val(i) = a%val(i) * d
j=a%ia(i) j=a%ia(i)
@ -253,12 +256,30 @@ subroutine psb_z_coo_spaxpby(alpha,a,beta,b,info)
! Allocate (temporary) space for the solution ! Allocate (temporary) space for the solution
call tcoo%allocate(M,N,(nza+nzb)) call tcoo%allocate(M,N,(nza+nzb))
! Compute the sum ! 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%ia(1:nza) = a%ia(1:nza)
tcoo%ja(1:nza) = a%ja(1:nza) tcoo%ja(1:nza) = a%ja(1:nza)
tcoo%val(1:nza) = alpha*a%val(1:nza) tcoo%val(1:nza) = alpha*a%val(1:nza)
tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb) tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb)
tcoo%ja(nza+1:nza+nzb) = bcoo%ja(1:nzb) tcoo%ja(nza+1:nza+nzb) = bcoo%ja(1:nzb)
tcoo%val(nza+1:nza+nzb) = beta*bcoo%val(1:nzb) tcoo%val(nza+1:nza+nzb) = beta*bcoo%val(1:nzb)
#endif
! Fix the indexes ! Fix the indexes
call tcoo%fix(info) call tcoo%fix(info)
! Move to correct output format ! 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 ! Allocate (temporary) space for the solution
call tcoo%allocate(M,N,(nza+nzb)) call tcoo%allocate(M,N,(nza+nzb))
! Compute the sum ! 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%ia(1:nza) = a%ia(1:nza)
tcoo%ja(1:nza) = a%ja(1:nza) tcoo%ja(1:nza) = a%ja(1:nza)
tcoo%val(1:nza) = a%val(1:nza) tcoo%val(1:nza) = a%val(1:nza)
tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb) tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb)
tcoo%ja(nza+1:nza+nzb) = bcoo%ja(1:nzb) tcoo%ja(nza+1:nza+nzb) = bcoo%ja(1:nzb)
tcoo%val(nza+1:nza+nzb) = (-done)*bcoo%val(1:nzb) tcoo%val(nza+1:nza+nzb) = (-done)*bcoo%val(1:nzb)
#endif
! Fix the indexes ! Fix the indexes
call tcoo%fix(info) call tcoo%fix(info)
if (info /= psb_success_) then 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 end subroutine psb_z_coo_print
function psb_z_coo_get_nz_row(idx,a) result(res) function psb_z_coo_get_nz_row(idx,a) result(res)
use psb_const_mod use psb_const_mod
use psb_sort_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 end subroutine psb_z_coo_csmv
subroutine psb_z_coo_csmm(alpha,a,x,beta,y,info,trans) subroutine psb_z_coo_csmm(alpha,a,x,beta,y,info,trans)
use psb_const_mod use psb_const_mod
use psb_error_mod use psb_error_mod
@ -1709,11 +1744,9 @@ subroutine psb_z_coo_csmm(alpha,a,x,beta,y,info,trans)
trans_ = 'N' trans_ = 'N'
end if end if
tra = (psb_toupper(trans_) == 'T') tra = (psb_toupper(trans_) == 'T')
ctra = (psb_toupper(trans_) == 'C') ctra = (psb_toupper(trans_) == 'C')
if (tra.or.ctra) then if (tra.or.ctra) then
m = a%get_ncols() m = a%get_ncols()
n = a%get_nrows() n = a%get_nrows()
@ -1895,7 +1928,15 @@ function psb_z_coo_maxval(a) result(res)
nnz = a%get_nzeros() nnz = a%get_nzeros()
if (allocated(a%val)) then if (allocated(a%val)) then
nnz = min(nnz,size(a%val)) 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))) res = maxval(abs(a%val(1:nnz)))
#endif
end if end if
end function psb_z_coo_maxval end function psb_z_coo_maxval
@ -2275,11 +2316,13 @@ subroutine psb_z_coo_csgetptn(imin,imax,a,nz,ia,ja,info,&
& iren) & iren)
if (rscale_) then if (rscale_) then
!$omp parallel do private(i)
do i=nzin_+1, nzin_+nz do i=nzin_+1, nzin_+nz
ia(i) = ia(i) - imin + 1 ia(i) = ia(i) - imin + 1
end do end do
end if end if
if (cscale_) then if (cscale_) then
!$omp parallel do private(i)
do i=nzin_+1, nzin_+nz do i=nzin_+1, nzin_+nz
ja(i) = ja(i) - jmin_ + 1 ja(i) = ja(i) - jmin_ + 1
end do end do
@ -2553,11 +2596,13 @@ subroutine psb_z_coo_csgetrow(imin,imax,a,nz,ia,ja,val,info,&
& iren) & iren)
if (rscale_) then if (rscale_) then
!$omp parallel do private(i)
do i=nzin_+1, nzin_+nz do i=nzin_+1, nzin_+nz
ia(i) = ia(i) - imin + 1 ia(i) = ia(i) - imin + 1
end do end do
end if end if
if (cscale_) then if (cscale_) then
!$omp parallel do private(i)
do i=nzin_+1, nzin_+nz do i=nzin_+1, nzin_+nz
ja(i) = ja(i) - jmin_ + 1 ja(i) = ja(i) - jmin_ + 1
end do end do
@ -2768,7 +2813,6 @@ contains
end subroutine psb_z_coo_csgetrow end subroutine psb_z_coo_csgetrow
subroutine psb_z_coo_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info) subroutine psb_z_coo_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info)
use psb_error_mod use psb_error_mod
use psb_realloc_mod use psb_realloc_mod
@ -3021,7 +3065,6 @@ contains
end subroutine psb_z_coo_csput_a end subroutine psb_z_coo_csput_a
subroutine psb_z_cp_coo_to_coo(a,b,info) subroutine psb_z_cp_coo_to_coo(a,b,info)
use psb_error_mod use psb_error_mod
use psb_z_base_mat_mod, psb_protect_name => psb_z_cp_coo_to_coo 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%set_nzeros(nz)
call b%reallocate(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%ia(1:nz) = a%ia(1:nz)
b%ja(1:nz) = a%ja(1:nz) b%ja(1:nz) = a%ja(1:nz)
b%val(1:nz) = a%val(1:nz) b%val(1:nz) = a%val(1:nz)
#endif
call b%set_host() call b%set_host()
if (.not.b%is_by_rows()) call b%fix(info) 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%set_nzeros(nz)
call a%reallocate(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%ia(1:nz) = b%ia(1:nz)
a%ja(1:nz) = b%ja(1:nz) a%ja(1:nz) = b%ja(1:nz)
a%val(1:nz) = b%val(1:nz) a%val(1:nz) = b%val(1:nz)
#endif
call a%set_host() call a%set_host()
if (.not.a%is_by_rows()) call a%fix(info) 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 end subroutine psb_z_fix_coo
subroutine psb_z_fix_coo_inner(nr,nc,nzin,dupl,ia,ja,val,nzout,info,idir) subroutine psb_z_fix_coo_inner(nr,nc,nzin,dupl,ia,ja,val,nzout,info,idir)
use psb_const_mod use psb_const_mod
use psb_error_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 end subroutine psb_z_fix_coo_inner
subroutine psb_z_cp_coo_to_lcoo(a,b,info) subroutine psb_z_cp_coo_to_lcoo(a,b,info)
use psb_error_mod use psb_error_mod
use psb_z_base_mat_mod, psb_protect_name => psb_z_cp_coo_to_lcoo 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%set_nzeros(nz)
call b%reallocate(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%ia(1:nz) = a%ia(1:nz)
b%ja(1:nz) = a%ja(1:nz) b%ja(1:nz) = a%ja(1:nz)
b%val(1:nz) = a%val(1:nz) b%val(1:nz) = a%val(1:nz)
#endif
call b%set_host() call b%set_host()
if (.not.b%is_by_rows()) call b%fix(info) 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%set_nzeros(nz)
call a%reallocate(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%ia(1:nz) = b%ia(1:nz)
a%ja(1:nz) = b%ja(1:nz) a%ja(1:nz) = b%ja(1:nz)
a%val(1:nz) = b%val(1:nz) a%val(1:nz) = b%val(1:nz)
#endif
call a%set_host() call a%set_host()
if (.not.a%is_by_rows()) call a%fix(info) 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() nnz = a%get_nzeros()
if (allocated(a%val)) then if (allocated(a%val)) then
nnz = min(nnz,size(a%val)) 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))) res = maxval(abs(a%val(1:nnz)))
#endif
end if end if
end function psb_lz_coo_maxval end function psb_lz_coo_maxval
@ -4499,7 +4593,17 @@ function psb_lz_coo_csnmi(a) result(res)
i = a%ia(j) i = a%ia(j)
vt(i) = vt(i) + abs(a%val(j)) vt(i) = vt(i) + abs(a%val(j))
end do 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)) res = maxval(vt(1:m))
#endif
deallocate(vt,stat=info) deallocate(vt,stat=info)
end if end if
@ -4539,7 +4643,17 @@ function psb_lz_coo_csnm1(a) result(res)
i = a%ja(j) i = a%ja(j)
vt(i) = vt(i) + abs(a%val(j)) vt(i) = vt(i) + abs(a%val(j))
end do 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)) res = maxval(vt(1:n))
#endif
deallocate(vt,stat=info) deallocate(vt,stat=info)
return return
@ -4584,7 +4698,6 @@ subroutine psb_lz_coo_rowsum(d,a)
d(i) = d(i) + a%val(j) d(i) = d(i) + a%val(j)
end do end do
return return
call psb_erractionrestore(err_act) call psb_erractionrestore(err_act)
return return
@ -4592,7 +4705,6 @@ subroutine psb_lz_coo_rowsum(d,a)
9999 call psb_error_handler(err_act) 9999 call psb_error_handler(err_act)
return return
end subroutine psb_lz_coo_rowsum end subroutine psb_lz_coo_rowsum
subroutine psb_lz_coo_arwsum(d,a) subroutine psb_lz_coo_arwsum(d,a)
@ -4761,6 +4873,7 @@ subroutine psb_lz_coo_scalplusidentity(d,a,info)
end if end if
mnm = min(a%get_nrows(),a%get_ncols()) mnm = min(a%get_nrows(),a%get_ncols())
!$omp parallel do private(i,j)
do i=1,a%get_nzeros() do i=1,a%get_nzeros()
a%val(i) = a%val(i) * d a%val(i) = a%val(i) * d
j=a%ia(i) j=a%ia(i)
@ -4813,12 +4926,30 @@ subroutine psb_lz_coo_spaxpby(alpha,a,beta,b,info)
! Allocate (temporary) space for the solution ! Allocate (temporary) space for the solution
call tcoo%allocate(M,N,(nza+nzb)) call tcoo%allocate(M,N,(nza+nzb))
! Compute the sum ! 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%ia(1:nza) = a%ia(1:nza)
tcoo%ja(1:nza) = a%ja(1:nza) tcoo%ja(1:nza) = a%ja(1:nza)
tcoo%val(1:nza) = alpha*a%val(1:nza) tcoo%val(1:nza) = alpha*a%val(1:nza)
tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb) tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb)
tcoo%ja(nza+1:nza+nzb) = bcoo%ja(1:nzb) tcoo%ja(nza+1:nza+nzb) = bcoo%ja(1:nzb)
tcoo%val(nza+1:nza+nzb) = beta*bcoo%val(1:nzb) tcoo%val(nza+1:nza+nzb) = beta*bcoo%val(1:nzb)
#endif
! Fix the indexes ! Fix the indexes
call tcoo%fix(info) call tcoo%fix(info)
! Move to correct output format ! 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 ! Allocate (temporary) space for the solution
call tcoo%allocate(M,N,(nza+nzb)) call tcoo%allocate(M,N,(nza+nzb))
! Compute the sum ! 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%ia(1:nza) = a%ia(1:nza)
tcoo%ja(1:nza) = a%ja(1:nza) tcoo%ja(1:nza) = a%ja(1:nza)
tcoo%val(1:nza) = a%val(1:nza) tcoo%val(1:nza) = a%val(1:nza)
tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb) tcoo%ia(nza+1:nza+nzb) = bcoo%ia(1:nzb)
tcoo%ja(nza+1:nza+nzb) = bcoo%ja(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) tcoo%val(nza+1:nza+nzb) = (-1_psb_dpk_)*bcoo%val(1:nzb)
#endif
! Fix the indexes ! Fix the indexes
call tcoo%fix(info) call tcoo%fix(info)
if (info /= psb_success_) then 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 if (nz < 0) then
info = psb_err_iarg_neg_ 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 goto 9999
end if end if
if (size(ia) < nz) then if (size(ia) < nz) then

@ -130,10 +130,12 @@ contains
if (alpha == zzero) then if (alpha == zzero) then
if (beta == zzero) then if (beta == zzero) then
!$omp parallel do private(i)
do i = 1, m do i = 1, m
y(i) = zzero y(i) = zzero
enddo enddo
else else
!$omp parallel do private(i)
do i = 1, m do i = 1, m
y(i) = beta*y(i) y(i) = beta*y(i)
end do end do
@ -147,6 +149,7 @@ contains
if (beta == zzero) then if (beta == zzero) then
if (alpha == zone) then if (alpha == zone) then
!$omp parallel do private(i,j, acc) schedule(static)
do i=1,m do i=1,m
acc = zzero acc = zzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -157,6 +160,7 @@ contains
else if (alpha == -zone) then else if (alpha == -zone) then
!$omp parallel do private(i,j, acc)
do i=1,m do i=1,m
acc = zzero acc = zzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -167,6 +171,7 @@ contains
else else
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc = zzero acc = zzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -181,6 +186,7 @@ contains
else if (beta == zone) then else if (beta == zone) then
if (alpha == zone) then if (alpha == zone) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc = zzero acc = zzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -191,6 +197,7 @@ contains
else if (alpha == -zone) then else if (alpha == -zone) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc = zzero acc = zzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -201,6 +208,7 @@ contains
else else
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc = zzero acc = zzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -214,6 +222,7 @@ contains
else if (beta == -zone) then else if (beta == -zone) then
if (alpha == zone) then if (alpha == zone) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc = zzero acc = zzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -224,6 +233,7 @@ contains
else if (alpha == -zone) then else if (alpha == -zone) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc = zzero acc = zzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -234,6 +244,7 @@ contains
else else
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc = zzero acc = zzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -247,6 +258,7 @@ contains
else else
if (alpha == zone) then if (alpha == zone) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc = zzero acc = zzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -257,6 +269,7 @@ contains
else if (alpha == -zone) then else if (alpha == -zone) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc = zzero acc = zzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -267,6 +280,7 @@ contains
else else
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc = zzero acc = zzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -282,16 +296,19 @@ contains
else if (tra) then else if (tra) then
if (beta == zzero) then if (beta == zzero) then
!$omp parallel do private(i)
do i=1, m do i=1, m
y(i) = zzero y(i) = zzero
end do end do
else if (beta == zone) then else if (beta == zone) then
! Do nothing ! Do nothing
else if (beta == -zone) then else if (beta == -zone) then
!$omp parallel do private(i)
do i=1, m do i=1, m
y(i) = -y(i) y(i) = -y(i)
end do end do
else else
!$omp parallel do private(i)
do i=1, m do i=1, m
y(i) = beta*y(i) y(i) = beta*y(i)
end do end do
@ -476,16 +493,18 @@ contains
complex(psb_dpk_), intent(inout) :: y(ldy,*) complex(psb_dpk_), intent(inout) :: y(ldy,*)
logical, intent(in) :: is_triangle,is_unit,tra,ctra 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 integer(psb_ipk_) :: i,j, ir
if (alpha == zzero) then if (alpha == zzero) then
if (beta == zzero) then if (beta == zzero) then
!$omp parallel do private(i)
do i = 1, m do i = 1, m
y(i,1:nc) = zzero y(i,1:nc) = zzero
enddo enddo
else else
!$omp parallel do private(i)
do i = 1, m do i = 1, m
y(i,1:nc) = beta*y(i,1:nc) y(i,1:nc) = beta*y(i,1:nc)
end do end do
@ -497,6 +516,7 @@ contains
if (beta == zzero) then if (beta == zzero) then
if (alpha == zone) then if (alpha == zone) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = zzero acc(1:nc) = zzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -507,6 +527,7 @@ contains
else if (alpha == -zone) then else if (alpha == -zone) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = zzero acc(1:nc) = zzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -517,6 +538,7 @@ contains
else else
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = zzero acc(1:nc) = zzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -531,6 +553,7 @@ contains
else if (beta == zone) then else if (beta == zone) then
if (alpha == zone) then if (alpha == zone) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = zzero acc(1:nc) = zzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -541,6 +564,7 @@ contains
else if (alpha == -zone) then else if (alpha == -zone) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = zzero acc(1:nc) = zzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -551,6 +575,7 @@ contains
else else
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = zzero acc(1:nc) = zzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -564,6 +589,7 @@ contains
else if (beta == -zone) then else if (beta == -zone) then
if (alpha == zone) then if (alpha == zone) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = zzero acc(1:nc) = zzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -574,6 +600,7 @@ contains
else if (alpha == -zone) then else if (alpha == -zone) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = zzero acc(1:nc) = zzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -584,6 +611,7 @@ contains
else else
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = zzero acc(1:nc) = zzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -597,6 +625,7 @@ contains
else else
if (alpha == zone) then if (alpha == zone) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = zzero acc(1:nc) = zzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -607,6 +636,7 @@ contains
else if (alpha == -zone) then else if (alpha == -zone) then
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = zzero acc(1:nc) = zzero
do j=irp(i), irp(i+1)-1 do j=irp(i), irp(i+1)-1
@ -617,6 +647,7 @@ contains
else else
!$omp parallel do private(i,j,acc)
do i=1,m do i=1,m
acc(1:nc) = zzero acc(1:nc) = zzero
do j=irp(i), irp(i+1)-1 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_mat_mod, psb_protect_name => psb_z_csall
use psb_z_base_mat_mod use psb_z_base_mat_mod
use psb_error_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(in) :: nr,nc
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: nz 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 integer(psb_ipk_) :: err_act
character(len=20) :: name='csall' character(len=20) :: name='csall'
@ -601,7 +603,23 @@ subroutine psb_z_csall(nr,nc,a,info,nz)
call a%free() call a%free()
info = psb_success_ info = psb_success_
allocate(psb_z_coo_sparse_mat :: a%a, stat=info) 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 if (info /= psb_success_) then
info = psb_err_alloc_dealloc_ info = psb_err_alloc_dealloc_
call psb_errpush(info, name) 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_mat_mod, psb_protect_name => psb_lz_csall
use psb_z_base_mat_mod use psb_z_base_mat_mod
use psb_error_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_lpk_), intent(in) :: nr,nc
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
integer(psb_lpk_), intent(in), optional :: nz 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 integer(psb_ipk_) :: err_act
character(len=20) :: name='csall' character(len=20) :: name='csall'
@ -3400,7 +3420,22 @@ subroutine psb_lz_csall(nr,nc,a,info,nz)
call a%free() call a%free()
info = psb_success_ info = psb_success_
allocate(psb_lz_coo_sparse_mat :: a%a, stat=info) 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 if (info /= psb_success_) then
info = psb_err_alloc_dealloc_ info = psb_err_alloc_dealloc_
call psb_errpush(info, name) 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. ! 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) subroutine psi_caxpby(m,n,alpha, x, beta, y, info)
use psb_const_mod use psb_const_mod
@ -40,9 +441,9 @@ subroutine psi_caxpby(m,n,alpha, x, beta, y, info)
complex(psb_spk_), intent (in) :: alpha, beta complex(psb_spk_), intent (in) :: alpha, beta
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act integer(psb_ipk_) :: err_act
integer(psb_ipk_) :: lx, ly integer(psb_ipk_) :: lx, ly, i
integer(psb_ipk_) :: ierr(5) integer(psb_ipk_) :: ierr(5)
character(len=20) :: name, ch_err character(len=20) :: name, ch_err
name='psb_geaxpby' name='psb_geaxpby'
info=psb_success_ info=psb_success_
@ -101,7 +502,8 @@ subroutine psi_caxpbyv(m,alpha, x, beta, y, info)
integer(psb_ipk_) :: err_act integer(psb_ipk_) :: err_act
integer(psb_ipk_) :: lx, ly integer(psb_ipk_) :: lx, ly
integer(psb_ipk_) :: ierr(5) integer(psb_ipk_) :: ierr(5)
character(len=20) :: name, ch_err integer(psb_ipk_) :: i
character(len=20) :: name, ch_err
name='psb_geaxpby' name='psb_geaxpby'
info=psb_success_ info=psb_success_
@ -131,7 +533,106 @@ subroutine psi_caxpbyv(m,alpha, x, beta, y, info)
goto 9999 goto 9999
end if 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) call psb_erractionrestore(err_act)
return return
@ -154,7 +655,7 @@ subroutine psi_caxpbyv2(m,alpha, x, beta, y, z, info)
complex(psb_spk_), intent (in) :: alpha, beta complex(psb_spk_), intent (in) :: alpha, beta
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act integer(psb_ipk_) :: err_act
integer(psb_ipk_) :: lx, ly, lz integer(psb_ipk_) :: lx, ly, lz, i
integer(psb_ipk_) :: ierr(5) integer(psb_ipk_) :: ierr(5)
character(len=20) :: name, ch_err character(len=20) :: name, ch_err
@ -193,7 +694,105 @@ subroutine psi_caxpbyv2(m,alpha, x, beta, y, z, info)
goto 9999 goto 9999
end if 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) call psb_erractionrestore(err_act)
return return
@ -541,6 +1140,7 @@ subroutine caxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
if (alpha.eq.czero) then if (alpha.eq.czero) then
if (beta.eq.czero) then if (beta.eq.czero) then
do j=1, n do j=1, n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = czero y(i,j) = czero
enddo enddo
@ -552,12 +1152,14 @@ subroutine caxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
else if (beta.eq.-cone) then else if (beta.eq.-cone) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = - y(i,j) y(i,j) = - y(i,j)
enddo enddo
enddo enddo
else else
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = beta*y(i,j) y(i,j) = beta*y(i,j)
enddo enddo
@ -568,12 +1170,14 @@ subroutine caxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
if (beta.eq.czero) then if (beta.eq.czero) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = x(i,j) y(i,j) = x(i,j)
enddo enddo
enddo enddo
else if (beta.eq.cone) then else if (beta.eq.cone) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = x(i,j) + y(i,j) y(i,j) = x(i,j) + y(i,j)
enddo enddo
@ -581,12 +1185,14 @@ subroutine caxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
else if (beta.eq.-cone) then else if (beta.eq.-cone) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = x(i,j) - y(i,j) y(i,j) = x(i,j) - y(i,j)
enddo enddo
enddo enddo
else else
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = x(i,j) + beta*y(i,j) y(i,j) = x(i,j) + beta*y(i,j)
enddo enddo
@ -597,12 +1203,14 @@ subroutine caxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
if (beta.eq.czero) then if (beta.eq.czero) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = -x(i,j) y(i,j) = -x(i,j)
enddo enddo
enddo enddo
else if (beta.eq.cone) then else if (beta.eq.cone) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = -x(i,j) + y(i,j) y(i,j) = -x(i,j) + y(i,j)
enddo enddo
@ -610,12 +1218,14 @@ subroutine caxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
else if (beta.eq.-cone) then else if (beta.eq.-cone) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = -x(i,j) - y(i,j) y(i,j) = -x(i,j) - y(i,j)
enddo enddo
enddo enddo
else else
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = -x(i,j) + beta*y(i,j) y(i,j) = -x(i,j) + beta*y(i,j)
enddo enddo
@ -626,12 +1236,14 @@ subroutine caxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
if (beta.eq.czero) then if (beta.eq.czero) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = alpha*x(i,j) y(i,j) = alpha*x(i,j)
enddo enddo
enddo enddo
else if (beta.eq.cone) then else if (beta.eq.cone) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = alpha*x(i,j) + y(i,j) y(i,j) = alpha*x(i,j) + y(i,j)
enddo enddo
@ -639,12 +1251,14 @@ subroutine caxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
else if (beta.eq.-cone) then else if (beta.eq.-cone) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = alpha*x(i,j) - y(i,j) y(i,j) = alpha*x(i,j) - y(i,j)
enddo enddo
enddo enddo
else else
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = alpha*x(i,j) + beta*y(i,j) y(i,j) = alpha*x(i,j) + beta*y(i,j)
enddo enddo
@ -730,12 +1344,14 @@ subroutine caxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
else if (beta.eq.-cone) then else if (beta.eq.-cone) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
Z(i,j) = - y(i,j) Z(i,j) = - y(i,j)
enddo enddo
enddo enddo
else else
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
Z(i,j) = beta*y(i,j) Z(i,j) = beta*y(i,j)
enddo enddo
@ -746,12 +1362,14 @@ subroutine caxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
if (beta.eq.czero) then if (beta.eq.czero) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
Z(i,j) = x(i,j) Z(i,j) = x(i,j)
enddo enddo
enddo enddo
else if (beta.eq.cone) then else if (beta.eq.cone) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
Z(i,j) = x(i,j) + y(i,j) Z(i,j) = x(i,j) + y(i,j)
enddo enddo
@ -759,12 +1377,14 @@ subroutine caxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
else if (beta.eq.-cone) then else if (beta.eq.-cone) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
Z(i,j) = x(i,j) - y(i,j) Z(i,j) = x(i,j) - y(i,j)
enddo enddo
enddo enddo
else else
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
Z(i,j) = x(i,j) + beta*y(i,j) Z(i,j) = x(i,j) + beta*y(i,j)
enddo enddo
@ -775,12 +1395,14 @@ subroutine caxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
if (beta.eq.czero) then if (beta.eq.czero) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
Z(i,j) = -x(i,j) Z(i,j) = -x(i,j)
enddo enddo
enddo enddo
else if (beta.eq.cone) then else if (beta.eq.cone) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
Z(i,j) = -x(i,j) + y(i,j) Z(i,j) = -x(i,j) + y(i,j)
enddo enddo
@ -788,12 +1410,14 @@ subroutine caxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
else if (beta.eq.-cone) then else if (beta.eq.-cone) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
Z(i,j) = -x(i,j) - y(i,j) Z(i,j) = -x(i,j) - y(i,j)
enddo enddo
enddo enddo
else else
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
Z(i,j) = -x(i,j) + beta*y(i,j) Z(i,j) = -x(i,j) + beta*y(i,j)
enddo enddo
@ -804,12 +1428,14 @@ subroutine caxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
if (beta.eq.czero) then if (beta.eq.czero) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
Z(i,j) = alpha*x(i,j) Z(i,j) = alpha*x(i,j)
enddo enddo
enddo enddo
else if (beta.eq.cone) then else if (beta.eq.cone) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
Z(i,j) = alpha*x(i,j) + y(i,j) Z(i,j) = alpha*x(i,j) + y(i,j)
enddo enddo
@ -817,12 +1443,14 @@ subroutine caxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
else if (beta.eq.-cone) then else if (beta.eq.-cone) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
Z(i,j) = alpha*x(i,j) - y(i,j) Z(i,j) = alpha*x(i,j) - y(i,j)
enddo enddo
enddo enddo
else else
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
Z(i,j) = alpha*x(i,j) + beta*y(i,j) Z(i,j) = alpha*x(i,j) + beta*y(i,j)
enddo enddo

@ -29,6 +29,407 @@
! POSSIBILITY OF SUCH DAMAGE. ! 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) subroutine psi_daxpby(m,n,alpha, x, beta, y, info)
use psb_const_mod use psb_const_mod
@ -40,9 +441,9 @@ subroutine psi_daxpby(m,n,alpha, x, beta, y, info)
real(psb_dpk_), intent (in) :: alpha, beta real(psb_dpk_), intent (in) :: alpha, beta
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act integer(psb_ipk_) :: err_act
integer(psb_ipk_) :: lx, ly integer(psb_ipk_) :: lx, ly, i
integer(psb_ipk_) :: ierr(5) integer(psb_ipk_) :: ierr(5)
character(len=20) :: name, ch_err character(len=20) :: name, ch_err
name='psb_geaxpby' name='psb_geaxpby'
info=psb_success_ info=psb_success_
@ -101,7 +502,8 @@ subroutine psi_daxpbyv(m,alpha, x, beta, y, info)
integer(psb_ipk_) :: err_act integer(psb_ipk_) :: err_act
integer(psb_ipk_) :: lx, ly integer(psb_ipk_) :: lx, ly
integer(psb_ipk_) :: ierr(5) integer(psb_ipk_) :: ierr(5)
character(len=20) :: name, ch_err integer(psb_ipk_) :: i
character(len=20) :: name, ch_err
name='psb_geaxpby' name='psb_geaxpby'
info=psb_success_ info=psb_success_
@ -131,7 +533,106 @@ subroutine psi_daxpbyv(m,alpha, x, beta, y, info)
goto 9999 goto 9999
end if 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) call psb_erractionrestore(err_act)
return return
@ -154,7 +655,7 @@ subroutine psi_daxpbyv2(m,alpha, x, beta, y, z, info)
real(psb_dpk_), intent (in) :: alpha, beta real(psb_dpk_), intent (in) :: alpha, beta
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act integer(psb_ipk_) :: err_act
integer(psb_ipk_) :: lx, ly, lz integer(psb_ipk_) :: lx, ly, lz, i
integer(psb_ipk_) :: ierr(5) integer(psb_ipk_) :: ierr(5)
character(len=20) :: name, ch_err character(len=20) :: name, ch_err
@ -193,7 +694,105 @@ subroutine psi_daxpbyv2(m,alpha, x, beta, y, z, info)
goto 9999 goto 9999
end if 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) call psb_erractionrestore(err_act)
return return
@ -541,6 +1140,7 @@ subroutine daxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
if (alpha.eq.dzero) then if (alpha.eq.dzero) then
if (beta.eq.dzero) then if (beta.eq.dzero) then
do j=1, n do j=1, n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = dzero y(i,j) = dzero
enddo enddo
@ -552,12 +1152,14 @@ subroutine daxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
else if (beta.eq.-done) then else if (beta.eq.-done) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = - y(i,j) y(i,j) = - y(i,j)
enddo enddo
enddo enddo
else else
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = beta*y(i,j) y(i,j) = beta*y(i,j)
enddo enddo
@ -568,12 +1170,14 @@ subroutine daxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
if (beta.eq.dzero) then if (beta.eq.dzero) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = x(i,j) y(i,j) = x(i,j)
enddo enddo
enddo enddo
else if (beta.eq.done) then else if (beta.eq.done) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = x(i,j) + y(i,j) y(i,j) = x(i,j) + y(i,j)
enddo enddo
@ -581,12 +1185,14 @@ subroutine daxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
else if (beta.eq.-done) then else if (beta.eq.-done) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = x(i,j) - y(i,j) y(i,j) = x(i,j) - y(i,j)
enddo enddo
enddo enddo
else else
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = x(i,j) + beta*y(i,j) y(i,j) = x(i,j) + beta*y(i,j)
enddo enddo
@ -597,12 +1203,14 @@ subroutine daxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
if (beta.eq.dzero) then if (beta.eq.dzero) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = -x(i,j) y(i,j) = -x(i,j)
enddo enddo
enddo enddo
else if (beta.eq.done) then else if (beta.eq.done) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = -x(i,j) + y(i,j) y(i,j) = -x(i,j) + y(i,j)
enddo enddo
@ -610,12 +1218,14 @@ subroutine daxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
else if (beta.eq.-done) then else if (beta.eq.-done) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = -x(i,j) - y(i,j) y(i,j) = -x(i,j) - y(i,j)
enddo enddo
enddo enddo
else else
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = -x(i,j) + beta*y(i,j) y(i,j) = -x(i,j) + beta*y(i,j)
enddo enddo
@ -626,12 +1236,14 @@ subroutine daxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
if (beta.eq.dzero) then if (beta.eq.dzero) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = alpha*x(i,j) y(i,j) = alpha*x(i,j)
enddo enddo
enddo enddo
else if (beta.eq.done) then else if (beta.eq.done) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = alpha*x(i,j) + y(i,j) y(i,j) = alpha*x(i,j) + y(i,j)
enddo enddo
@ -639,12 +1251,14 @@ subroutine daxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
else if (beta.eq.-done) then else if (beta.eq.-done) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = alpha*x(i,j) - y(i,j) y(i,j) = alpha*x(i,j) - y(i,j)
enddo enddo
enddo enddo
else else
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = alpha*x(i,j) + beta*y(i,j) y(i,j) = alpha*x(i,j) + beta*y(i,j)
enddo enddo
@ -730,12 +1344,14 @@ subroutine daxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
else if (beta.eq.-done) then else if (beta.eq.-done) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
Z(i,j) = - y(i,j) Z(i,j) = - y(i,j)
enddo enddo
enddo enddo
else else
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
Z(i,j) = beta*y(i,j) Z(i,j) = beta*y(i,j)
enddo enddo
@ -746,12 +1362,14 @@ subroutine daxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
if (beta.eq.dzero) then if (beta.eq.dzero) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
Z(i,j) = x(i,j) Z(i,j) = x(i,j)
enddo enddo
enddo enddo
else if (beta.eq.done) then else if (beta.eq.done) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
Z(i,j) = x(i,j) + y(i,j) Z(i,j) = x(i,j) + y(i,j)
enddo enddo
@ -759,12 +1377,14 @@ subroutine daxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
else if (beta.eq.-done) then else if (beta.eq.-done) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
Z(i,j) = x(i,j) - y(i,j) Z(i,j) = x(i,j) - y(i,j)
enddo enddo
enddo enddo
else else
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
Z(i,j) = x(i,j) + beta*y(i,j) Z(i,j) = x(i,j) + beta*y(i,j)
enddo enddo
@ -775,12 +1395,14 @@ subroutine daxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
if (beta.eq.dzero) then if (beta.eq.dzero) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
Z(i,j) = -x(i,j) Z(i,j) = -x(i,j)
enddo enddo
enddo enddo
else if (beta.eq.done) then else if (beta.eq.done) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
Z(i,j) = -x(i,j) + y(i,j) Z(i,j) = -x(i,j) + y(i,j)
enddo enddo
@ -788,12 +1410,14 @@ subroutine daxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
else if (beta.eq.-done) then else if (beta.eq.-done) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
Z(i,j) = -x(i,j) - y(i,j) Z(i,j) = -x(i,j) - y(i,j)
enddo enddo
enddo enddo
else else
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
Z(i,j) = -x(i,j) + beta*y(i,j) Z(i,j) = -x(i,j) + beta*y(i,j)
enddo enddo
@ -804,12 +1428,14 @@ subroutine daxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
if (beta.eq.dzero) then if (beta.eq.dzero) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
Z(i,j) = alpha*x(i,j) Z(i,j) = alpha*x(i,j)
enddo enddo
enddo enddo
else if (beta.eq.done) then else if (beta.eq.done) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
Z(i,j) = alpha*x(i,j) + y(i,j) Z(i,j) = alpha*x(i,j) + y(i,j)
enddo enddo
@ -817,12 +1443,14 @@ subroutine daxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
else if (beta.eq.-done) then else if (beta.eq.-done) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
Z(i,j) = alpha*x(i,j) - y(i,j) Z(i,j) = alpha*x(i,j) - y(i,j)
enddo enddo
enddo enddo
else else
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
Z(i,j) = alpha*x(i,j) + beta*y(i,j) Z(i,j) = alpha*x(i,j) + beta*y(i,j)
enddo enddo

@ -29,6 +29,407 @@
! POSSIBILITY OF SUCH DAMAGE. ! 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) subroutine psi_eaxpby(m,n,alpha, x, beta, y, info)
use psb_const_mod use psb_const_mod

@ -29,6 +29,407 @@
! POSSIBILITY OF SUCH DAMAGE. ! 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) subroutine psi_i2axpby(m,n,alpha, x, beta, y, info)
use psb_const_mod use psb_const_mod

@ -29,6 +29,407 @@
! POSSIBILITY OF SUCH DAMAGE. ! 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) subroutine psi_maxpby(m,n,alpha, x, beta, y, info)
use psb_const_mod use psb_const_mod

@ -29,6 +29,407 @@
! POSSIBILITY OF SUCH DAMAGE. ! 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) subroutine psi_saxpby(m,n,alpha, x, beta, y, info)
use psb_const_mod use psb_const_mod
@ -40,9 +441,9 @@ subroutine psi_saxpby(m,n,alpha, x, beta, y, info)
real(psb_spk_), intent (in) :: alpha, beta real(psb_spk_), intent (in) :: alpha, beta
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act integer(psb_ipk_) :: err_act
integer(psb_ipk_) :: lx, ly integer(psb_ipk_) :: lx, ly, i
integer(psb_ipk_) :: ierr(5) integer(psb_ipk_) :: ierr(5)
character(len=20) :: name, ch_err character(len=20) :: name, ch_err
name='psb_geaxpby' name='psb_geaxpby'
info=psb_success_ info=psb_success_
@ -101,7 +502,8 @@ subroutine psi_saxpbyv(m,alpha, x, beta, y, info)
integer(psb_ipk_) :: err_act integer(psb_ipk_) :: err_act
integer(psb_ipk_) :: lx, ly integer(psb_ipk_) :: lx, ly
integer(psb_ipk_) :: ierr(5) integer(psb_ipk_) :: ierr(5)
character(len=20) :: name, ch_err integer(psb_ipk_) :: i
character(len=20) :: name, ch_err
name='psb_geaxpby' name='psb_geaxpby'
info=psb_success_ info=psb_success_
@ -131,7 +533,106 @@ subroutine psi_saxpbyv(m,alpha, x, beta, y, info)
goto 9999 goto 9999
end if 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) call psb_erractionrestore(err_act)
return return
@ -154,7 +655,7 @@ subroutine psi_saxpbyv2(m,alpha, x, beta, y, z, info)
real(psb_spk_), intent (in) :: alpha, beta real(psb_spk_), intent (in) :: alpha, beta
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act integer(psb_ipk_) :: err_act
integer(psb_ipk_) :: lx, ly, lz integer(psb_ipk_) :: lx, ly, lz, i
integer(psb_ipk_) :: ierr(5) integer(psb_ipk_) :: ierr(5)
character(len=20) :: name, ch_err character(len=20) :: name, ch_err
@ -193,7 +694,105 @@ subroutine psi_saxpbyv2(m,alpha, x, beta, y, z, info)
goto 9999 goto 9999
end if 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) call psb_erractionrestore(err_act)
return return
@ -541,6 +1140,7 @@ subroutine saxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
if (alpha.eq.szero) then if (alpha.eq.szero) then
if (beta.eq.szero) then if (beta.eq.szero) then
do j=1, n do j=1, n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = szero y(i,j) = szero
enddo enddo
@ -552,12 +1152,14 @@ subroutine saxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
else if (beta.eq.-sone) then else if (beta.eq.-sone) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = - y(i,j) y(i,j) = - y(i,j)
enddo enddo
enddo enddo
else else
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = beta*y(i,j) y(i,j) = beta*y(i,j)
enddo enddo
@ -568,12 +1170,14 @@ subroutine saxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
if (beta.eq.szero) then if (beta.eq.szero) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = x(i,j) y(i,j) = x(i,j)
enddo enddo
enddo enddo
else if (beta.eq.sone) then else if (beta.eq.sone) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = x(i,j) + y(i,j) y(i,j) = x(i,j) + y(i,j)
enddo enddo
@ -581,12 +1185,14 @@ subroutine saxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
else if (beta.eq.-sone) then else if (beta.eq.-sone) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = x(i,j) - y(i,j) y(i,j) = x(i,j) - y(i,j)
enddo enddo
enddo enddo
else else
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = x(i,j) + beta*y(i,j) y(i,j) = x(i,j) + beta*y(i,j)
enddo enddo
@ -597,12 +1203,14 @@ subroutine saxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
if (beta.eq.szero) then if (beta.eq.szero) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = -x(i,j) y(i,j) = -x(i,j)
enddo enddo
enddo enddo
else if (beta.eq.sone) then else if (beta.eq.sone) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = -x(i,j) + y(i,j) y(i,j) = -x(i,j) + y(i,j)
enddo enddo
@ -610,12 +1218,14 @@ subroutine saxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
else if (beta.eq.-sone) then else if (beta.eq.-sone) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = -x(i,j) - y(i,j) y(i,j) = -x(i,j) - y(i,j)
enddo enddo
enddo enddo
else else
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = -x(i,j) + beta*y(i,j) y(i,j) = -x(i,j) + beta*y(i,j)
enddo enddo
@ -626,12 +1236,14 @@ subroutine saxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
if (beta.eq.szero) then if (beta.eq.szero) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = alpha*x(i,j) y(i,j) = alpha*x(i,j)
enddo enddo
enddo enddo
else if (beta.eq.sone) then else if (beta.eq.sone) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = alpha*x(i,j) + y(i,j) y(i,j) = alpha*x(i,j) + y(i,j)
enddo enddo
@ -639,12 +1251,14 @@ subroutine saxpby(m, n, alpha, X, lldx, beta, Y, lldy, info)
else if (beta.eq.-sone) then else if (beta.eq.-sone) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = alpha*x(i,j) - y(i,j) y(i,j) = alpha*x(i,j) - y(i,j)
enddo enddo
enddo enddo
else else
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
y(i,j) = alpha*x(i,j) + beta*y(i,j) y(i,j) = alpha*x(i,j) + beta*y(i,j)
enddo enddo
@ -730,12 +1344,14 @@ subroutine saxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
else if (beta.eq.-sone) then else if (beta.eq.-sone) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
Z(i,j) = - y(i,j) Z(i,j) = - y(i,j)
enddo enddo
enddo enddo
else else
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
Z(i,j) = beta*y(i,j) Z(i,j) = beta*y(i,j)
enddo enddo
@ -746,12 +1362,14 @@ subroutine saxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
if (beta.eq.szero) then if (beta.eq.szero) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
Z(i,j) = x(i,j) Z(i,j) = x(i,j)
enddo enddo
enddo enddo
else if (beta.eq.sone) then else if (beta.eq.sone) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
Z(i,j) = x(i,j) + y(i,j) Z(i,j) = x(i,j) + y(i,j)
enddo enddo
@ -759,12 +1377,14 @@ subroutine saxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
else if (beta.eq.-sone) then else if (beta.eq.-sone) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
Z(i,j) = x(i,j) - y(i,j) Z(i,j) = x(i,j) - y(i,j)
enddo enddo
enddo enddo
else else
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
Z(i,j) = x(i,j) + beta*y(i,j) Z(i,j) = x(i,j) + beta*y(i,j)
enddo enddo
@ -775,12 +1395,14 @@ subroutine saxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
if (beta.eq.szero) then if (beta.eq.szero) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
Z(i,j) = -x(i,j) Z(i,j) = -x(i,j)
enddo enddo
enddo enddo
else if (beta.eq.sone) then else if (beta.eq.sone) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
Z(i,j) = -x(i,j) + y(i,j) Z(i,j) = -x(i,j) + y(i,j)
enddo enddo
@ -788,12 +1410,14 @@ subroutine saxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
else if (beta.eq.-sone) then else if (beta.eq.-sone) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
Z(i,j) = -x(i,j) - y(i,j) Z(i,j) = -x(i,j) - y(i,j)
enddo enddo
enddo enddo
else else
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
Z(i,j) = -x(i,j) + beta*y(i,j) Z(i,j) = -x(i,j) + beta*y(i,j)
enddo enddo
@ -804,12 +1428,14 @@ subroutine saxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
if (beta.eq.szero) then if (beta.eq.szero) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
Z(i,j) = alpha*x(i,j) Z(i,j) = alpha*x(i,j)
enddo enddo
enddo enddo
else if (beta.eq.sone) then else if (beta.eq.sone) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
Z(i,j) = alpha*x(i,j) + y(i,j) Z(i,j) = alpha*x(i,j) + y(i,j)
enddo enddo
@ -817,12 +1443,14 @@ subroutine saxpbyv2(m, n, alpha, X, lldx, beta, Y, lldy, Z, lldz, info)
else if (beta.eq.-sone) then else if (beta.eq.-sone) then
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
Z(i,j) = alpha*x(i,j) - y(i,j) Z(i,j) = alpha*x(i,j) - y(i,j)
enddo enddo
enddo enddo
else else
do j=1,n do j=1,n
!$omp parallel do private(i)
do i=1,m do i=1,m
Z(i,j) = alpha*x(i,j) + beta*y(i,j) Z(i,j) = alpha*x(i,j) + beta*y(i,j)
enddo enddo

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

Loading…
Cancel
Save