|
|
|
@ -110,7 +110,9 @@ subroutine psi_i2swaptranm(flag,n,beta,y,desc_a,work,info,data)
|
|
|
|
|
integer(psb_ipk_), optional :: data
|
|
|
|
|
|
|
|
|
|
! locals
|
|
|
|
|
integer(psb_ipk_) :: ictxt, np, me, icomm, idxs, idxr, err_act, totxch, data_
|
|
|
|
|
type(psb_ctxt_type) :: ctxt
|
|
|
|
|
integer(psb_mpk_) :: icomm
|
|
|
|
|
integer(psb_ipk_) :: np, me, idxs, idxr, err_act, totxch, data_
|
|
|
|
|
integer(psb_ipk_), pointer :: d_idx(:)
|
|
|
|
|
character(len=20) :: name
|
|
|
|
|
|
|
|
|
@ -118,10 +120,10 @@ subroutine psi_i2swaptranm(flag,n,beta,y,desc_a,work,info,data)
|
|
|
|
|
name='psi_swap_tran'
|
|
|
|
|
call psb_erractionsave(err_act)
|
|
|
|
|
|
|
|
|
|
ictxt = desc_a%get_context()
|
|
|
|
|
ctxt = desc_a%get_context()
|
|
|
|
|
icomm = desc_a%get_mpic()
|
|
|
|
|
|
|
|
|
|
call psb_info(ictxt,me,np)
|
|
|
|
|
call psb_info(ctxt,me,np)
|
|
|
|
|
if (np == -1) then
|
|
|
|
|
info=psb_err_context_error_
|
|
|
|
|
call psb_errpush(info,name)
|
|
|
|
@ -146,18 +148,18 @@ subroutine psi_i2swaptranm(flag,n,beta,y,desc_a,work,info,data)
|
|
|
|
|
goto 9999
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
call psi_swaptran(ictxt,icomm,flag,n,beta,y,d_idx,totxch,idxs,idxr,work,info)
|
|
|
|
|
call psi_swaptran(ctxt,icomm,flag,n,beta,y,d_idx,totxch,idxs,idxr,work,info)
|
|
|
|
|
if (info /= psb_success_) goto 9999
|
|
|
|
|
|
|
|
|
|
call psb_erractionrestore(err_act)
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
9999 call psb_error_handler(ictxt,err_act)
|
|
|
|
|
9999 call psb_error_handler(ctxt,err_act)
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
end subroutine psi_i2swaptranm
|
|
|
|
|
|
|
|
|
|
subroutine psi_i2tranidxm(iictxt,iicomm,flag,n,beta,y,idx,&
|
|
|
|
|
subroutine psi_i2tranidxm(ctxt,icomm,flag,n,beta,y,idx,&
|
|
|
|
|
& totxch,totsnd,totrcv,work,info)
|
|
|
|
|
|
|
|
|
|
use psi_mod, psb_protect_name => psi_i2tranidxm
|
|
|
|
@ -172,15 +174,17 @@ subroutine psi_i2tranidxm(iictxt,iicomm,flag,n,beta,y,idx,&
|
|
|
|
|
include 'mpif.h'
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
integer(psb_ipk_), intent(in) :: iictxt,iicomm,flag,n
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
type(psb_ctxt_type), intent(in) :: ctxt
|
|
|
|
|
integer(psb_mpk_), intent(in) :: icomm
|
|
|
|
|
integer(psb_ipk_), intent(in) :: flag,n
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
integer(psb_i2pk_) :: y(:,:), beta
|
|
|
|
|
integer(psb_i2pk_), target :: work(:)
|
|
|
|
|
integer(psb_ipk_), intent(in) :: idx(:),totxch,totsnd, totrcv
|
|
|
|
|
|
|
|
|
|
! locals
|
|
|
|
|
integer(psb_mpk_) :: ictxt, icomm, np, me,&
|
|
|
|
|
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
|
|
|
|
|
integer(psb_ipk_) :: np, me
|
|
|
|
|
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
|
|
|
|
|
integer(psb_mpk_), allocatable, dimension(:) :: bsdidx, brvidx,&
|
|
|
|
|
& sdsz, rvsz, prcid, rvhd, sdhd
|
|
|
|
|
integer(psb_ipk_) :: nesd, nerv,&
|
|
|
|
@ -197,10 +201,7 @@ subroutine psi_i2tranidxm(iictxt,iicomm,flag,n,beta,y,idx,&
|
|
|
|
|
info=psb_success_
|
|
|
|
|
name='psi_swap_tran'
|
|
|
|
|
call psb_erractionsave(err_act)
|
|
|
|
|
ictxt = iictxt
|
|
|
|
|
icomm = iicomm
|
|
|
|
|
|
|
|
|
|
call psb_info(ictxt,me,np)
|
|
|
|
|
call psb_info(ctxt,me,np)
|
|
|
|
|
if (np == -1) then
|
|
|
|
|
info=psb_err_context_error_
|
|
|
|
|
call psb_errpush(info,name)
|
|
|
|
@ -240,7 +241,7 @@ subroutine psi_i2tranidxm(iictxt,iicomm,flag,n,beta,y,idx,&
|
|
|
|
|
proc_to_comm = idx(pnti+psb_proc_id_)
|
|
|
|
|
nerv = idx(pnti+psb_n_elem_recv_)
|
|
|
|
|
nesd = idx(pnti+nerv+psb_n_elem_send_)
|
|
|
|
|
prcid(proc_to_comm) = psb_get_mpi_rank(ictxt,proc_to_comm)
|
|
|
|
|
prcid(proc_to_comm) = psb_get_mpi_rank(ctxt,proc_to_comm)
|
|
|
|
|
|
|
|
|
|
brvidx(proc_to_comm) = rcv_pt
|
|
|
|
|
rvsz(proc_to_comm) = n*nerv
|
|
|
|
@ -324,14 +325,14 @@ subroutine psi_i2tranidxm(iictxt,iicomm,flag,n,beta,y,idx,&
|
|
|
|
|
nesd = idx(pnti+nerv+psb_n_elem_send_)
|
|
|
|
|
|
|
|
|
|
if (proc_to_comm < me) then
|
|
|
|
|
if (nerv>0) call psb_snd(ictxt,&
|
|
|
|
|
if (nerv>0) call psb_snd(ctxt,&
|
|
|
|
|
& rcvbuf(rcv_pt:rcv_pt+n*nerv-1), proc_to_comm)
|
|
|
|
|
if (nesd>0) call psb_rcv(ictxt,&
|
|
|
|
|
if (nesd>0) call psb_rcv(ctxt,&
|
|
|
|
|
& sndbuf(snd_pt:snd_pt+n*nesd-1), proc_to_comm)
|
|
|
|
|
else if (proc_to_comm > me) then
|
|
|
|
|
if (nesd>0) call psb_rcv(ictxt,&
|
|
|
|
|
if (nesd>0) call psb_rcv(ctxt,&
|
|
|
|
|
& sndbuf(snd_pt:snd_pt+n*nesd-1), proc_to_comm)
|
|
|
|
|
if (nerv>0) call psb_snd(ictxt,&
|
|
|
|
|
if (nerv>0) call psb_snd(ctxt,&
|
|
|
|
|
& rcvbuf(rcv_pt:rcv_pt+n*nerv-1), proc_to_comm)
|
|
|
|
|
else if (proc_to_comm == me) then
|
|
|
|
|
if (nesd /= nerv) then
|
|
|
|
@ -358,7 +359,7 @@ subroutine psi_i2tranidxm(iictxt,iicomm,flag,n,beta,y,idx,&
|
|
|
|
|
proc_to_comm = idx(pnti+psb_proc_id_)
|
|
|
|
|
nerv = idx(pnti+psb_n_elem_recv_)
|
|
|
|
|
nesd = idx(pnti+nerv+psb_n_elem_send_)
|
|
|
|
|
prcid(i) = psb_get_mpi_rank(ictxt,proc_to_comm)
|
|
|
|
|
prcid(i) = psb_get_mpi_rank(ctxt,proc_to_comm)
|
|
|
|
|
if ((nesd>0).and.(proc_to_comm /= me)) then
|
|
|
|
|
p2ptag = psb_int2_swap_tag
|
|
|
|
|
call mpi_irecv(sndbuf(snd_pt),n*nesd,&
|
|
|
|
@ -443,7 +444,7 @@ subroutine psi_i2tranidxm(iictxt,iicomm,flag,n,beta,y,idx,&
|
|
|
|
|
proc_to_comm = idx(pnti+psb_proc_id_)
|
|
|
|
|
nerv = idx(pnti+psb_n_elem_recv_)
|
|
|
|
|
nesd = idx(pnti+nerv+psb_n_elem_send_)
|
|
|
|
|
if (nerv>0) call psb_snd(ictxt,&
|
|
|
|
|
if (nerv>0) call psb_snd(ctxt,&
|
|
|
|
|
& rcvbuf(rcv_pt:rcv_pt+n*nerv-1), proc_to_comm)
|
|
|
|
|
rcv_pt = rcv_pt + n*nerv
|
|
|
|
|
snd_pt = snd_pt + n*nesd
|
|
|
|
@ -460,7 +461,7 @@ subroutine psi_i2tranidxm(iictxt,iicomm,flag,n,beta,y,idx,&
|
|
|
|
|
proc_to_comm = idx(pnti+psb_proc_id_)
|
|
|
|
|
nerv = idx(pnti+psb_n_elem_recv_)
|
|
|
|
|
nesd = idx(pnti+nerv+psb_n_elem_send_)
|
|
|
|
|
if (nesd>0) call psb_rcv(ictxt,&
|
|
|
|
|
if (nesd>0) call psb_rcv(ctxt,&
|
|
|
|
|
& sndbuf(snd_pt:snd_pt+n*nesd-1), proc_to_comm)
|
|
|
|
|
rcv_pt = rcv_pt + n*nerv
|
|
|
|
|
snd_pt = snd_pt + n*nesd
|
|
|
|
@ -508,7 +509,7 @@ subroutine psi_i2tranidxm(iictxt,iicomm,flag,n,beta,y,idx,&
|
|
|
|
|
call psb_erractionrestore(err_act)
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
9999 call psb_error_handler(iictxt,err_act)
|
|
|
|
|
9999 call psb_error_handler(ctxt,err_act)
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
end subroutine psi_i2tranidxm
|
|
|
|
@ -592,7 +593,9 @@ subroutine psi_i2swaptranv(flag,beta,y,desc_a,work,info,data)
|
|
|
|
|
integer(psb_ipk_), optional :: data
|
|
|
|
|
|
|
|
|
|
! locals
|
|
|
|
|
integer(psb_ipk_) :: ictxt, np, me, icomm, idxs, idxr, totxch, err_act, data_
|
|
|
|
|
type(psb_ctxt_type) :: ctxt
|
|
|
|
|
integer(psb_mpk_) :: icomm
|
|
|
|
|
integer(psb_ipk_) :: np, me, idxs, idxr, totxch, err_act, data_
|
|
|
|
|
integer(psb_ipk_), pointer :: d_idx(:)
|
|
|
|
|
character(len=20) :: name
|
|
|
|
|
|
|
|
|
@ -600,9 +603,9 @@ subroutine psi_i2swaptranv(flag,beta,y,desc_a,work,info,data)
|
|
|
|
|
name='psi_swap_tranv'
|
|
|
|
|
call psb_erractionsave(err_act)
|
|
|
|
|
|
|
|
|
|
ictxt = desc_a%get_context()
|
|
|
|
|
ctxt = desc_a%get_context()
|
|
|
|
|
icomm = desc_a%get_mpic()
|
|
|
|
|
call psb_info(ictxt,me,np)
|
|
|
|
|
call psb_info(ctxt,me,np)
|
|
|
|
|
if (np == -1) then
|
|
|
|
|
info=psb_err_context_error_
|
|
|
|
|
call psb_errpush(info,name)
|
|
|
|
@ -627,13 +630,13 @@ subroutine psi_i2swaptranv(flag,beta,y,desc_a,work,info,data)
|
|
|
|
|
goto 9999
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
call psi_swaptran(ictxt,icomm,flag,beta,y,d_idx,totxch,idxs,idxr,work,info)
|
|
|
|
|
call psi_swaptran(ctxt,icomm,flag,beta,y,d_idx,totxch,idxs,idxr,work,info)
|
|
|
|
|
if (info /= psb_success_) goto 9999
|
|
|
|
|
|
|
|
|
|
call psb_erractionrestore(err_act)
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
9999 call psb_error_handler(ictxt,err_act)
|
|
|
|
|
9999 call psb_error_handler(ctxt,err_act)
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
end subroutine psi_i2swaptranv
|
|
|
|
@ -649,7 +652,7 @@ end subroutine psi_i2swaptranv
|
|
|
|
|
!
|
|
|
|
|
!
|
|
|
|
|
!
|
|
|
|
|
subroutine psi_i2tranidxv(iictxt,iicomm,flag,beta,y,idx,&
|
|
|
|
|
subroutine psi_i2tranidxv(ctxt,icomm,flag,beta,y,idx,&
|
|
|
|
|
& totxch,totsnd,totrcv,work,info)
|
|
|
|
|
|
|
|
|
|
use psi_mod, psb_protect_name => psi_i2tranidxv
|
|
|
|
@ -664,15 +667,17 @@ subroutine psi_i2tranidxv(iictxt,iicomm,flag,beta,y,idx,&
|
|
|
|
|
include 'mpif.h'
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
integer(psb_ipk_), intent(in) :: iictxt,iicomm,flag
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
type(psb_ctxt_type), intent(in) :: ctxt
|
|
|
|
|
integer(psb_mpk_), intent(in) :: icomm
|
|
|
|
|
integer(psb_ipk_), intent(in) :: flag
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
integer(psb_i2pk_) :: y(:), beta
|
|
|
|
|
integer(psb_i2pk_), target :: work(:)
|
|
|
|
|
integer(psb_ipk_), intent(in) :: idx(:),totxch,totsnd, totrcv
|
|
|
|
|
|
|
|
|
|
! locals
|
|
|
|
|
integer(psb_mpk_) :: ictxt, icomm, np, me,&
|
|
|
|
|
& proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
|
|
|
|
|
integer(psb_ipk_) :: np, me
|
|
|
|
|
integer(psb_mpk_) :: proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret
|
|
|
|
|
integer(psb_mpk_), allocatable, dimension(:) :: bsdidx, brvidx,&
|
|
|
|
|
& sdsz, rvsz, prcid, rvhd, sdhd
|
|
|
|
|
integer(psb_ipk_) :: nesd, nerv,&
|
|
|
|
@ -689,10 +694,7 @@ subroutine psi_i2tranidxv(iictxt,iicomm,flag,beta,y,idx,&
|
|
|
|
|
info=psb_success_
|
|
|
|
|
name='psi_swap_tran'
|
|
|
|
|
call psb_erractionsave(err_act)
|
|
|
|
|
ictxt = iictxt
|
|
|
|
|
icomm = iicomm
|
|
|
|
|
|
|
|
|
|
call psb_info(ictxt,me,np)
|
|
|
|
|
call psb_info(ctxt,me,np)
|
|
|
|
|
if (np == -1) then
|
|
|
|
|
info=psb_err_context_error_
|
|
|
|
|
call psb_errpush(info,name)
|
|
|
|
@ -732,7 +734,7 @@ subroutine psi_i2tranidxv(iictxt,iicomm,flag,beta,y,idx,&
|
|
|
|
|
proc_to_comm = idx(pnti+psb_proc_id_)
|
|
|
|
|
nerv = idx(pnti+psb_n_elem_recv_)
|
|
|
|
|
nesd = idx(pnti+nerv+psb_n_elem_send_)
|
|
|
|
|
prcid(proc_to_comm) = psb_get_mpi_rank(ictxt,proc_to_comm)
|
|
|
|
|
prcid(proc_to_comm) = psb_get_mpi_rank(ctxt,proc_to_comm)
|
|
|
|
|
|
|
|
|
|
brvidx(proc_to_comm) = rcv_pt
|
|
|
|
|
rvsz(proc_to_comm) = nerv
|
|
|
|
@ -817,14 +819,14 @@ subroutine psi_i2tranidxv(iictxt,iicomm,flag,beta,y,idx,&
|
|
|
|
|
nesd = idx(pnti+nerv+psb_n_elem_send_)
|
|
|
|
|
|
|
|
|
|
if (proc_to_comm < me) then
|
|
|
|
|
if (nerv>0) call psb_snd(ictxt,&
|
|
|
|
|
if (nerv>0) call psb_snd(ctxt,&
|
|
|
|
|
& rcvbuf(rcv_pt:rcv_pt+nerv-1), proc_to_comm)
|
|
|
|
|
if (nesd>0) call psb_rcv(ictxt,&
|
|
|
|
|
if (nesd>0) call psb_rcv(ctxt,&
|
|
|
|
|
& sndbuf(snd_pt:snd_pt+nesd-1), proc_to_comm)
|
|
|
|
|
else if (proc_to_comm > me) then
|
|
|
|
|
if (nesd>0) call psb_rcv(ictxt,&
|
|
|
|
|
if (nesd>0) call psb_rcv(ctxt,&
|
|
|
|
|
& sndbuf(snd_pt:snd_pt+nesd-1), proc_to_comm)
|
|
|
|
|
if (nerv>0) call psb_snd(ictxt,&
|
|
|
|
|
if (nerv>0) call psb_snd(ctxt,&
|
|
|
|
|
& rcvbuf(rcv_pt:rcv_pt+nerv-1), proc_to_comm)
|
|
|
|
|
else if (proc_to_comm == me) then
|
|
|
|
|
if (nesd /= nerv) then
|
|
|
|
@ -850,7 +852,7 @@ subroutine psi_i2tranidxv(iictxt,iicomm,flag,beta,y,idx,&
|
|
|
|
|
proc_to_comm = idx(pnti+psb_proc_id_)
|
|
|
|
|
nerv = idx(pnti+psb_n_elem_recv_)
|
|
|
|
|
nesd = idx(pnti+nerv+psb_n_elem_send_)
|
|
|
|
|
prcid(i) = psb_get_mpi_rank(ictxt,proc_to_comm)
|
|
|
|
|
prcid(i) = psb_get_mpi_rank(ctxt,proc_to_comm)
|
|
|
|
|
if ((nesd>0).and.(proc_to_comm /= me)) then
|
|
|
|
|
p2ptag = psb_int2_swap_tag
|
|
|
|
|
call mpi_irecv(sndbuf(snd_pt),nesd,&
|
|
|
|
@ -933,7 +935,7 @@ subroutine psi_i2tranidxv(iictxt,iicomm,flag,beta,y,idx,&
|
|
|
|
|
proc_to_comm = idx(pnti+psb_proc_id_)
|
|
|
|
|
nerv = idx(pnti+psb_n_elem_recv_)
|
|
|
|
|
nesd = idx(pnti+nerv+psb_n_elem_send_)
|
|
|
|
|
if (nerv>0) call psb_snd(ictxt,&
|
|
|
|
|
if (nerv>0) call psb_snd(ctxt,&
|
|
|
|
|
& rcvbuf(rcv_pt:rcv_pt+nerv-1), proc_to_comm)
|
|
|
|
|
rcv_pt = rcv_pt + nerv
|
|
|
|
|
snd_pt = snd_pt + nesd
|
|
|
|
@ -949,7 +951,7 @@ subroutine psi_i2tranidxv(iictxt,iicomm,flag,beta,y,idx,&
|
|
|
|
|
proc_to_comm = idx(pnti+psb_proc_id_)
|
|
|
|
|
nerv = idx(pnti+psb_n_elem_recv_)
|
|
|
|
|
nesd = idx(pnti+nerv+psb_n_elem_send_)
|
|
|
|
|
if (nesd>0) call psb_rcv(ictxt,&
|
|
|
|
|
if (nesd>0) call psb_rcv(ctxt,&
|
|
|
|
|
& sndbuf(snd_pt:snd_pt+nesd-1), proc_to_comm)
|
|
|
|
|
rcv_pt = rcv_pt + nerv
|
|
|
|
|
snd_pt = snd_pt + nesd
|
|
|
|
@ -996,7 +998,7 @@ subroutine psi_i2tranidxv(iictxt,iicomm,flag,beta,y,idx,&
|
|
|
|
|
call psb_erractionrestore(err_act)
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
9999 call psb_error_handler(iictxt,err_act)
|
|
|
|
|
9999 call psb_error_handler(ctxt,err_act)
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
end subroutine psi_i2tranidxv
|
|
|
|
|