@ -154,7 +154,7 @@ contains
return
end subroutine psi_dswapdatam
subroutine psi_dswapidxm ( i i ctxt, i icomm, flag , n , beta , y , idx , &
subroutine psi_dswapidxm ( i ctxt, icomm, flag , n , beta , y , idx , &
& totxch , totsnd , totrcv , work , info )
use psi_serial_mod
use psb_error_mod
@ -168,14 +168,14 @@ contains
include 'mpif.h'
# endif
integer ( psb_ipk_ ) , intent ( in ) :: i i ctxt, i icomm, flag , n
integer ( psb_ipk_ ) , intent ( in ) :: i ctxt, icomm, flag , n
integer ( psb_ipk_ ) , intent ( out ) :: info
real ( psb_dpk_ ) :: y ( : , : ) , beta
real ( psb_dpk_ ) , target :: work ( : )
integer ( psb_ipk_ ) , intent ( in ) :: idx ( : ) , totxch , totsnd , totrcv
! locals
integer ( psb_mpik_ ) :: i ctxt, icomm, np , me , &
integer ( psb_mpik_ ) :: i i ctxt, i icomm, np , me , &
& proc_to_comm , p2ptag , p2pstat ( mpi_status_size ) , iret
integer ( psb_mpik_ ) , allocatable , dimension ( : ) :: bsdidx , brvidx , &
& sdsz , rvsz , prcid , rvhd , sdhd
@ -196,9 +196,9 @@ contains
info = psb_success_
name = 'psi_swap_data'
call psb_erractionsave ( err_act )
i ctxt = i ictxt
i comm = i icomm
call psb_info ( i ctxt, me , np )
i i ctxt = ictxt
i i comm = icomm
call psb_info ( i i ctxt, me , np )
if ( np == - 1 ) then
info = psb_err_context_error_
call psb_errpush ( info , name )
@ -239,7 +239,7 @@ contains
proc_to_comm = idx ( pnti + psb_proc_id_ )
nerv = idx ( pnti + psb_n_elem_recv_ )
nesd = idx ( pnti + nerv + psb_n_elem_send_ )
call psb_get_rank ( prcid ( proc_to_comm ) , i ctxt, proc_to_comm )
call psb_get_rank ( prcid ( proc_to_comm ) , i i ctxt, proc_to_comm )
brvidx ( proc_to_comm ) = rcv_pt
rvsz ( proc_to_comm ) = n * nerv
@ -301,7 +301,7 @@ contains
! swap elements using mpi_alltoallv
call mpi_alltoallv ( sndbuf , sdsz , bsdidx , &
& psb_mpi_r_dpk_ , rcvbuf , rvsz , &
& brvidx , psb_mpi_r_dpk_ , i comm, iret )
& brvidx , psb_mpi_r_dpk_ , i i comm, iret )
if ( iret / = mpi_success ) then
ierr ( 1 ) = iret
info = psb_err_mpi_error_
@ -321,14 +321,14 @@ contains
nesd = idx ( pnti + nerv + psb_n_elem_send_ )
if ( proc_to_comm < me ) then
if ( nesd > 0 ) call psb_snd ( i ctxt, &
if ( nesd > 0 ) call psb_snd ( i i ctxt, &
& sndbuf ( snd_pt : snd_pt + n * nesd - 1 ) , proc_to_comm )
if ( nerv > 0 ) call psb_rcv ( i ctxt, &
if ( nerv > 0 ) call psb_rcv ( i i ctxt, &
& rcvbuf ( rcv_pt : rcv_pt + n * nerv - 1 ) , proc_to_comm )
else if ( proc_to_comm > me ) then
if ( nerv > 0 ) call psb_rcv ( i ctxt, &
if ( nerv > 0 ) call psb_rcv ( i i ctxt, &
& rcvbuf ( rcv_pt : rcv_pt + n * nerv - 1 ) , proc_to_comm )
if ( nesd > 0 ) call psb_snd ( i ctxt, &
if ( nesd > 0 ) call psb_snd ( i i ctxt, &
& sndbuf ( snd_pt : snd_pt + n * nesd - 1 ) , proc_to_comm )
else if ( proc_to_comm == me ) then
if ( nesd / = nerv ) then
@ -357,12 +357,12 @@ contains
proc_to_comm = idx ( pnti + psb_proc_id_ )
nerv = idx ( pnti + psb_n_elem_recv_ )
nesd = idx ( pnti + nerv + psb_n_elem_send_ )
call psb_get_rank ( prcid ( i ) , i ctxt, proc_to_comm )
call psb_get_rank ( prcid ( i ) , i i ctxt, proc_to_comm )
if ( ( nerv > 0 ) . and . ( proc_to_comm / = me ) ) then
p2ptag = psb_double_swap_tag
call mpi_irecv ( rcvbuf ( rcv_pt ) , n * nerv , &
& psb_mpi_r_dpk_ , prcid ( i ) , &
& p2ptag , i comm, rvhd ( i ) , iret )
& p2ptag , i i comm, rvhd ( i ) , iret )
end if
rcv_pt = rcv_pt + n * nerv
snd_pt = snd_pt + n * nesd
@ -371,7 +371,7 @@ contains
! Then I post all the blocking sends
if ( usersend ) call mpi_barrier ( i comm, iret )
if ( usersend ) call mpi_barrier ( i i comm, iret )
pnti = 1
@ -387,11 +387,11 @@ contains
if ( usersend ) then
call mpi_rsend ( sndbuf ( snd_pt ) , n * nesd , &
& psb_mpi_r_dpk_ , prcid ( i ) , &
& p2ptag , i comm, iret )
& p2ptag , i i comm, iret )
else
call mpi_send ( sndbuf ( snd_pt ) , n * nesd , &
& psb_mpi_r_dpk_ , prcid ( i ) , &
& p2ptag , i comm, iret )
& p2ptag , i i comm, iret )
end if
if ( iret / = mpi_success ) then
@ -447,7 +447,7 @@ contains
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_snd ( i ctxt, &
if ( nesd > 0 ) call psb_snd ( i i ctxt, &
& sndbuf ( snd_pt : snd_pt + n * nesd - 1 ) , proc_to_comm )
rcv_pt = rcv_pt + n * nerv
@ -466,7 +466,7 @@ contains
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_rcv ( i ctxt, &
if ( nerv > 0 ) call psb_rcv ( i i ctxt, &
& rcvbuf ( rcv_pt : rcv_pt + n * nerv - 1 ) , proc_to_comm )
rcv_pt = rcv_pt + n * nerv
snd_pt = snd_pt + n * nesd
@ -517,7 +517,7 @@ contains
call psb_erractionrestore ( err_act )
return
9999 call psb_error_handler ( i ctxt, err_act )
9999 call psb_error_handler ( i i ctxt, err_act )
return
end subroutine psi_dswapidxm
@ -655,7 +655,7 @@ contains
!
!
!
subroutine psi_dswapidxv ( i i ctxt, i icomm, flag , beta , y , idx , &
subroutine psi_dswapidxv ( i ctxt, icomm, flag , beta , y , idx , &
& totxch , totsnd , totrcv , work , info )
use psi_serial_mod
use psb_error_mod
@ -669,14 +669,14 @@ contains
include 'mpif.h'
# endif
integer ( psb_ipk_ ) , intent ( in ) :: i i ctxt, i icomm, flag
integer ( psb_ipk_ ) , intent ( in ) :: i ctxt, icomm, flag
integer ( psb_ipk_ ) , intent ( out ) :: info
real ( psb_dpk_ ) :: y ( : ) , beta
real ( psb_dpk_ ) , target :: work ( : )
integer ( psb_ipk_ ) , intent ( in ) :: idx ( : ) , totxch , totsnd , totrcv
! locals
integer ( psb_mpik_ ) :: i ctxt, icomm, np , me , &
integer ( psb_mpik_ ) :: i i ctxt, i icomm, np , me , &
& proc_to_comm , p2ptag , p2pstat ( mpi_status_size ) , iret
integer ( psb_mpik_ ) , allocatable , dimension ( : ) :: bsdidx , brvidx , &
& sdsz , rvsz , prcid , rvhd , sdhd
@ -697,9 +697,9 @@ contains
info = psb_success_
name = 'psi_swap_datav'
call psb_erractionsave ( err_act )
i ctxt = i ictxt
i comm = i icomm
call psb_info ( i ctxt, me , np )
i i ctxt = ictxt
i i comm = icomm
call psb_info ( i i ctxt, me , np )
if ( np == - 1 ) then
info = psb_err_context_error_
call psb_errpush ( info , name )
@ -740,7 +740,7 @@ contains
proc_to_comm = idx ( pnti + psb_proc_id_ )
nerv = idx ( pnti + psb_n_elem_recv_ )
nesd = idx ( pnti + nerv + psb_n_elem_send_ )
call psb_get_rank ( prcid ( proc_to_comm ) , i ctxt, proc_to_comm )
call psb_get_rank ( prcid ( proc_to_comm ) , i i ctxt, proc_to_comm )
brvidx ( proc_to_comm ) = rcv_pt
rvsz ( proc_to_comm ) = nerv
@ -802,7 +802,7 @@ contains
! swap elements using mpi_alltoallv
call mpi_alltoallv ( sndbuf , sdsz , bsdidx , &
& psb_mpi_r_dpk_ , rcvbuf , rvsz , &
& brvidx , psb_mpi_r_dpk_ , i comm, iret )
& brvidx , psb_mpi_r_dpk_ , i i comm, iret )
if ( iret / = mpi_success ) then
ierr ( 1 ) = iret
info = psb_err_mpi_error_
@ -821,14 +821,14 @@ contains
nesd = idx ( pnti + nerv + psb_n_elem_send_ )
if ( proc_to_comm < me ) then
if ( nesd > 0 ) call psb_snd ( i ctxt, &
if ( nesd > 0 ) call psb_snd ( i i ctxt, &
& sndbuf ( snd_pt : snd_pt + nesd - 1 ) , proc_to_comm )
if ( nerv > 0 ) call psb_rcv ( i ctxt, &
if ( nerv > 0 ) call psb_rcv ( i i ctxt, &
& rcvbuf ( rcv_pt : rcv_pt + nerv - 1 ) , proc_to_comm )
else if ( proc_to_comm > me ) then
if ( nerv > 0 ) call psb_rcv ( i ctxt, &
if ( nerv > 0 ) call psb_rcv ( i i ctxt, &
& rcvbuf ( rcv_pt : rcv_pt + nerv - 1 ) , proc_to_comm )
if ( nesd > 0 ) call psb_snd ( i ctxt, &
if ( nesd > 0 ) call psb_snd ( i i ctxt, &
& sndbuf ( snd_pt : snd_pt + nesd - 1 ) , proc_to_comm )
else if ( proc_to_comm == me ) then
if ( nesd / = nerv ) then
@ -855,12 +855,12 @@ contains
nerv = idx ( pnti + psb_n_elem_recv_ )
nesd = idx ( pnti + nerv + psb_n_elem_send_ )
call psb_get_rank ( prcid ( i ) , i ctxt, proc_to_comm )
call psb_get_rank ( prcid ( i ) , i i ctxt, proc_to_comm )
if ( ( nerv > 0 ) . and . ( proc_to_comm / = me ) ) then
p2ptag = psb_double_swap_tag
call mpi_irecv ( rcvbuf ( rcv_pt ) , nerv , &
& psb_mpi_r_dpk_ , prcid ( i ) , &
& p2ptag , i comm, rvhd ( i ) , iret )
& p2ptag , i i comm, rvhd ( i ) , iret )
end if
rcv_pt = rcv_pt + nerv
snd_pt = snd_pt + nesd
@ -869,7 +869,7 @@ contains
! Then I post all the blocking sends
if ( usersend ) call mpi_barrier ( i comm, iret )
if ( usersend ) call mpi_barrier ( i i comm, iret )
pnti = 1
snd_pt = 1
@ -885,11 +885,11 @@ contains
if ( usersend ) then
call mpi_rsend ( sndbuf ( snd_pt ) , nesd , &
& psb_mpi_r_dpk_ , prcid ( i ) , &
& p2ptag , i comm, iret )
& p2ptag , i i comm, iret )
else
call mpi_send ( sndbuf ( snd_pt ) , nesd , &
& psb_mpi_r_dpk_ , prcid ( i ) , &
& p2ptag , i comm, iret )
& p2ptag , i i comm, iret )
end if
if ( iret / = mpi_success ) then
@ -942,7 +942,7 @@ contains
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_snd ( i ctxt, &
if ( nesd > 0 ) call psb_snd ( i i ctxt, &
& sndbuf ( snd_pt : snd_pt + nesd - 1 ) , proc_to_comm )
rcv_pt = rcv_pt + nerv
snd_pt = snd_pt + nesd
@ -958,7 +958,7 @@ contains
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_rcv ( i ctxt, &
if ( nerv > 0 ) call psb_rcv ( i i ctxt, &
& rcvbuf ( rcv_pt : rcv_pt + nerv - 1 ) , proc_to_comm )
rcv_pt = rcv_pt + nerv
snd_pt = snd_pt + nesd
@ -1005,7 +1005,7 @@ contains
call psb_erractionrestore ( err_act )
return
9999 call psb_error_handler ( i ctxt, err_act )
9999 call psb_error_handler ( i i ctxt, err_act )
return
end subroutine psi_dswapidxv
@ -1103,7 +1103,7 @@ contains
!
!
!
subroutine psi_dswap_vidx_vect ( i i ctxt, i icomm, flag , beta , y , idx , &
subroutine psi_dswap_vidx_vect ( i ctxt, icomm, flag , beta , y , idx , &
& totxch , totsnd , totrcv , work , info )
use psb_error_mod
@ -1120,7 +1120,7 @@ contains
include 'mpif.h'
# endif
integer ( psb_ipk_ ) , intent ( in ) :: i i ctxt, i icomm, flag
integer ( psb_ipk_ ) , intent ( in ) :: i ctxt, icomm, flag
integer ( psb_ipk_ ) , intent ( out ) :: info
class ( psb_d_base_vect_type ) :: y
real ( psb_dpk_ ) :: beta
@ -1129,7 +1129,7 @@ contains
integer ( psb_ipk_ ) , intent ( in ) :: totxch , totsnd , totrcv
! locals
integer ( psb_mpik_ ) :: i ctxt, icomm, np , me , &
integer ( psb_mpik_ ) :: i i ctxt, i icomm, np , me , &
& proc_to_comm , p2ptag , p2pstat ( mpi_status_size ) , iret
integer ( psb_mpik_ ) , allocatable :: prcid ( : )
integer ( psb_ipk_ ) :: nesd , nerv , &
@ -1144,10 +1144,10 @@ contains
info = psb_success_
name = 'psi_swap_datav'
call psb_erractionsave ( err_act )
i ctxt = i ictxt
i comm = i icomm
i i ctxt = ictxt
i i comm = icomm
call psb_info ( i ctxt, me , np )
call psb_info ( i i ctxt, me , np )
if ( np == - 1 ) then
info = psb_err_context_error_
call psb_errpush ( info , name )
@ -1190,13 +1190,13 @@ contains
nesd = idx % v ( pnti + nerv + psb_n_elem_send_ )
rcv_pt = 1 + pnti + psb_n_elem_recv_
call psb_get_rank ( prcid ( i ) , i ctxt, proc_to_comm )
call psb_get_rank ( prcid ( i ) , i i ctxt, proc_to_comm )
if ( ( nerv > 0 ) . and . ( proc_to_comm / = me ) ) then
if ( debug ) write ( * , * ) me , 'Posting receive from' , prcid ( i ) , rcv_pt
p2ptag = psb_double_swap_tag
call mpi_irecv ( y % combuf ( rcv_pt ) , nerv , &
& psb_mpi_r_dpk_ , prcid ( i ) , &
& p2ptag , i comm, y % comid ( i , 2 ) , iret )
& p2ptag , i i comm, y % comid ( i , 2 ) , iret )
end if
pnti = pnti + nerv + nesd + 3
end do
@ -1239,7 +1239,7 @@ contains
if ( ( nesd > 0 ) . and . ( proc_to_comm / = me ) ) then
call mpi_isend ( y % combuf ( snd_pt ) , nesd , &
& psb_mpi_r_dpk_ , prcid ( i ) , &
& p2ptag , i comm, y % comid ( i , 1 ) , iret )
& p2ptag , i i comm, y % comid ( i , 1 ) , iret )
end if
if ( iret / = mpi_success ) then
@ -1344,7 +1344,7 @@ contains
call psb_erractionrestore ( err_act )
return
9999 call psb_error_handler ( i ctxt, err_act )
9999 call psb_error_handler ( i i ctxt, err_act )
return
end subroutine psi_dswap_vidx_vect