@ -30,9 +30,9 @@
! ! $
! ! $
!
! File : psi_ s swaptran. F90
! File : psi_ z swaptran. F90
!
! Subroutine : psi_ s swaptranm
! Subroutine : psi_ z swaptranm
! Does the data exchange among processes . This is similar to Xswapdata , but
! the list is read "in reverse" , i . e . indices that are normally SENT are used
! for the RECEIVE part and vice - versa . This is the basic data exchange operation
@ -42,8 +42,8 @@
! it is capable of pruning empty exchanges , which are very likely in out
! application environment . All the variants have the same structure
! In all these subroutines X may be : I Integer
! D real ( psb_ s pk_)
! Z complex ( psb_ s pk_)
! D real ( psb_ d pk_)
! Z complex ( psb_ d pk_)
! Basically the operation is as follows : on each process , we identify
! sections SND ( Y ) and RCV ( Y ) ; then we do a SEND ( PACK ( SND ( Y ) ) ) ;
! then we receive , and we do an update with Y = UNPACK ( RCV ( Y ) ) + BETA * Y
@ -85,9 +85,9 @@
! psb_comm_mov_ use ovr_mst_idx
!
!
subroutine psi_ s swaptranm( flag , n , beta , y , desc_a , work , info , data )
subroutine psi_ z swaptranm( flag , n , beta , y , desc_a , work , info , data )
use psi_mod , psb_protect_name = > psi_ s swaptranm
use psi_mod , psb_protect_name = > psi_ z swaptranm
use psb_error_mod
use psb_descriptor_type
use psb_penv_mod
@ -103,8 +103,8 @@ subroutine psi_sswaptranm(flag,n,beta,y,desc_a,work,info,data)
integer , intent ( out ) :: info
real ( psb_spk_ ) :: y ( : , : ) , beta
real ( psb_spk_ ) , target :: work ( : )
type ( psb_desc_type ) , target :: desc_a
integer , optional :: data
type ( psb_desc_type ) , target :: desc_a
integer , optional :: data
! locals
integer :: ictxt , np , me , icomm , idxs , idxr , err_act , totxch , data_
@ -138,7 +138,7 @@ subroutine psi_sswaptranm(flag,n,beta,y,desc_a,work,info,data)
data_ = psb_comm_halo_
end if
call psb_cd_get_list( data_ , desc_a , d_idx , totxch , idxr , idxs , info )
call desc_a% get_list ( data_ , d_idx , totxch , idxr , idxs , info )
if ( info / = psb_success_ ) then
call psb_errpush ( psb_err_internal_error_ , name , a_err = 'psb_cd_get_list' )
go to 9999
@ -157,11 +157,11 @@ subroutine psi_sswaptranm(flag,n,beta,y,desc_a,work,info,data)
return
end if
return
end subroutine psi_ s swaptranm
end subroutine psi_ z swaptranm
subroutine psi_ s tranidxm( ictxt , icomm , flag , n , beta , y , idx , totxch , totsnd , totrcv , work , info )
subroutine psi_ z tranidxm( ictxt , icomm , flag , n , beta , y , idx , totxch , totsnd , totrcv , work , info )
use psi_mod , psb_protect_name = > psi_ s tranidxm
use psi_mod , psb_protect_name = > psi_ z tranidxm
use psb_error_mod
use psb_descriptor_type
use psb_penv_mod
@ -340,7 +340,9 @@ subroutine psi_stranidxm(ictxt,icomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work
& rcvbuf ( rcv_pt : rcv_pt + n * nerv - 1 ) , proc_to_comm )
else if ( proc_to_comm == me ) then
if ( nesd / = nerv ) then
write ( psb_err_unit , * ) 'Fatal error in swaptran: mismatch on self sendf' , nerv , nesd
write ( psb_err_unit , * ) &
& 'Fatal error in swaptran: mismatch on self send' , &
& nerv , nesd
end if
sndbuf ( snd_pt : snd_pt + n * nesd - 1 ) = rcvbuf ( rcv_pt : rcv_pt + n * nerv - 1 )
end if
@ -386,7 +388,7 @@ subroutine psi_stranidxm(ictxt,icomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work
nesd = idx ( pnti + nerv + psb_n_elem_send_ )
if ( ( nerv > 0 ) . and . ( proc_to_comm / = me ) ) then
p2ptag = psb_real_swap_tag
p2ptag = psb_real_swap_tag
if ( usersend ) then
call mpi_rsend ( rcvbuf ( rcv_pt ) , n * nerv , &
& mpi_real , prcid ( i ) , &
@ -429,7 +431,9 @@ subroutine psi_stranidxm(ictxt,icomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work
end if
else if ( proc_to_comm == me ) then
if ( nesd / = nerv ) then
write ( psb_err_unit , * ) 'Fatal error in swaptran: mismatch on self sendf' , nerv , nesd
write ( psb_err_unit , * ) &
& 'Fatal error in swaptran: mismatch on self send' , &
& nerv , nesd
end if
sndbuf ( snd_pt : snd_pt + n * nesd - 1 ) = rcvbuf ( rcv_pt : rcv_pt + n * nerv - 1 )
end if
@ -518,10 +522,10 @@ subroutine psi_stranidxm(ictxt,icomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work
return
end if
return
end subroutine psi_ s tranidxm
end subroutine psi_ z tranidxm
!
!
! Subroutine : psi_ s swaptranv
! Subroutine : psi_ z swaptranv
! Does the data exchange among processes . This is similar to Xswapdata , but
! the list is read "in reverse" , i . e . indices that are normally SENT are used
! for the RECEIVE part and vice - versa . This is the basic data exchange operation
@ -531,8 +535,8 @@ end subroutine psi_stranidxm
! it is capable of pruning empty exchanges , which are very likely in out
! application environment . All the variants have the same structure
! In all these subroutines X may be : I Integer
! D real ( psb_ s pk_)
! Z complex ( psb_ s pk_)
! D real ( psb_ d pk_)
! Z complex ( psb_ d pk_)
! Basically the operation is as follows : on each process , we identify
! sections SND ( Y ) and RCV ( Y ) ; then we do a SEND ( PACK ( SND ( Y ) ) ) ;
! then we receive , and we do an update with Y = UNPACK ( RCV ( Y ) ) + BETA * Y
@ -574,9 +578,9 @@ end subroutine psi_stranidxm
! psb_comm_mov_ use ovr_mst_idx
!
!
subroutine psi_ s swaptranv( flag , beta , y , desc_a , work , info , data )
subroutine psi_ z swaptranv( flag , beta , y , desc_a , work , info , data )
use psi_mod , psb_protect_name = > psi_ s swaptranv
use psi_mod , psb_protect_name = > psi_ z swaptranv
use psb_error_mod
use psb_descriptor_type
use psb_penv_mod
@ -626,7 +630,7 @@ subroutine psi_sswaptranv(flag,beta,y,desc_a,work,info,data)
data_ = psb_comm_halo_
end if
call psb_cd_get_list( data_ , desc_a , d_idx , totxch , idxr , idxs , info )
call desc_a% get_list ( data_ , d_idx , totxch , idxr , idxs , info )
if ( info / = psb_success_ ) then
call psb_errpush ( psb_err_internal_error_ , name , a_err = 'psb_cd_get_list' )
go to 9999
@ -645,13 +649,13 @@ subroutine psi_sswaptranv(flag,beta,y,desc_a,work,info,data)
return
end if
return
end subroutine psi_ s swaptranv
end subroutine psi_ z swaptranv
subroutine psi_ s tranidxv( ictxt , icomm , flag , beta , y , idx , totxch , totsnd , totrcv , work , info )
subroutine psi_ z tranidxv( ictxt , icomm , flag , beta , y , idx , totxch , totsnd , totrcv , work , info )
use psi_mod , psb_protect_name = > psi_ s tranidxv
use psi_mod , psb_protect_name = > psi_ z tranidxv
use psb_error_mod
use psb_descriptor_type
use psb_penv_mod
@ -829,7 +833,9 @@ subroutine psi_stranidxv(ictxt,icomm,flag,beta,y,idx,totxch,totsnd,totrcv,work,i
& rcvbuf ( rcv_pt : rcv_pt + nerv - 1 ) , proc_to_comm )
else if ( proc_to_comm == me ) then
if ( nesd / = nerv ) then
write ( psb_err_unit , * ) 'Fatal error in swaptran: mismatch on self sendf' , nerv , nesd
write ( psb_err_unit , * ) &
& 'Fatal error in swaptran: mismatch on self send' , &
& nerv , nesd
end if
sndbuf ( snd_pt : snd_pt + nesd - 1 ) = rcvbuf ( rcv_pt : rcv_pt + nerv - 1 )
end if
@ -875,7 +881,7 @@ subroutine psi_stranidxv(ictxt,icomm,flag,beta,y,idx,totxch,totsnd,totrcv,work,i
nesd = idx ( pnti + nerv + psb_n_elem_send_ )
if ( ( nerv > 0 ) . and . ( proc_to_comm / = me ) ) then
p2ptag = psb_real_swap_tag
p2ptag = psb_real_swap_tag
if ( usersend ) then
call mpi_rsend ( rcvbuf ( rcv_pt ) , nerv , &
& mpi_real , prcid ( i ) , &
@ -917,7 +923,9 @@ subroutine psi_stranidxv(ictxt,icomm,flag,beta,y,idx,totxch,totsnd,totrcv,work,i
end if
else if ( proc_to_comm == me ) then
if ( nesd / = nerv ) then
write ( psb_err_unit , * ) 'Fatal error in swaptran: mismatch on self sendf' , nerv , nesd
write ( psb_err_unit , * ) &
& 'Fatal error in swaptran: mismatch on self send' , &
& nerv , nesd
end if
sndbuf ( snd_pt : snd_pt + nesd - 1 ) = rcvbuf ( rcv_pt : rcv_pt + nerv - 1 )
end if
@ -1008,12 +1016,12 @@ subroutine psi_stranidxv(ictxt,icomm,flag,beta,y,idx,totxch,totsnd,totrcv,work,i
return
end if
return
end subroutine psi_ s tranidxv
end subroutine psi_ z tranidxv
subroutine psi_ s swaptran_vect( flag , beta , y , desc_a , work , info , data )
subroutine psi_ z swaptran_vect( flag , beta , y , desc_a , work , info , data )
use psi_mod , psb_protect_name = > psi_ s swaptran_vect
use psi_mod , psb_protect_name = > psi_ z swaptran_vect
use psb_error_mod
use psb_descriptor_type
use psb_penv_mod
@ -1026,11 +1034,11 @@ subroutine psi_sswaptran_vect(flag,beta,y,desc_a,work,info,data)
include 'mpif.h'
# endif
integer , intent ( in ) :: flag
integer , intent ( out ) :: info
integer , intent ( in ) :: flag
integer , intent ( out ) :: info
class ( psb_s_base_vect_type ) :: y
real ( psb_spk_ ) :: beta
real ( psb_spk_ ) , target :: work ( : )
real ( psb_spk_ ) :: beta
real ( psb_spk_ ) , target :: work ( : )
type ( psb_desc_type ) , target :: desc_a
integer , optional :: data
@ -1065,7 +1073,7 @@ subroutine psi_sswaptran_vect(flag,beta,y,desc_a,work,info,data)
data_ = psb_comm_halo_
end if
call psb_cd_get_list( data_ , desc_a , d_idx , totxch , idxr , idxs , info )
call desc_a% get_list ( data_ , d_idx , totxch , idxr , idxs , info )
if ( info / = psb_success_ ) then
call psb_errpush ( psb_err_internal_error_ , name , a_err = 'psb_cd_get_list' )
go to 9999
@ -1084,14 +1092,14 @@ subroutine psi_sswaptran_vect(flag,beta,y,desc_a,work,info,data)
return
end if
return
end subroutine psi_ s swaptran_vect
end subroutine psi_ z swaptran_vect
subroutine psi_ s tranidx_vect( ictxt , icomm , flag , beta , y , idx , &
subroutine psi_ z tranidx_vect( ictxt , icomm , flag , beta , y , idx , &
& totxch , totsnd , totrcv , work , info )
use psi_mod , psb_protect_name = > psi_ s tranidx_vect
use psi_mod , psb_protect_name = > psi_ z tranidx_vect
use psb_error_mod
use psb_descriptor_type
use psb_penv_mod
@ -1271,7 +1279,9 @@ subroutine psi_stranidx_vect(ictxt,icomm,flag,beta,y,idx,&
& rcvbuf ( rcv_pt : rcv_pt + nerv - 1 ) , proc_to_comm )
else if ( proc_to_comm == me ) then
if ( nesd / = nerv ) then
write ( psb_err_unit , * ) 'Fatal error in swaptran: mismatch on self sendf' , nerv , nesd
write ( psb_err_unit , * ) &
& 'Fatal error in swaptran: mismatch on self send' , &
& nerv , nesd
end if
sndbuf ( snd_pt : snd_pt + nesd - 1 ) = rcvbuf ( rcv_pt : rcv_pt + nerv - 1 )
end if
@ -1317,7 +1327,7 @@ subroutine psi_stranidx_vect(ictxt,icomm,flag,beta,y,idx,&
nesd = idx ( pnti + nerv + psb_n_elem_send_ )
if ( ( nerv > 0 ) . and . ( proc_to_comm / = me ) ) then
p2ptag = psb_real_swap_tag
p2ptag = psb_real_swap_tag
if ( usersend ) then
call mpi_rsend ( rcvbuf ( rcv_pt ) , nerv , &
& mpi_real , prcid ( i ) , &
@ -1359,7 +1369,9 @@ subroutine psi_stranidx_vect(ictxt,icomm,flag,beta,y,idx,&
end if
else if ( proc_to_comm == me ) then
if ( nesd / = nerv ) then
write ( psb_err_unit , * ) 'Fatal error in swaptran: mismatch on self sendf' , nerv , nesd
write ( psb_err_unit , * ) &
& 'Fatal error in swaptran: mismatch on self send' , &
& nerv , nesd
end if
sndbuf ( snd_pt : snd_pt + nesd - 1 ) = rcvbuf ( rcv_pt : rcv_pt + nerv - 1 )
end if
@ -1450,7 +1462,7 @@ subroutine psi_stranidx_vect(ictxt,icomm,flag,beta,y,idx,&
return
end if
return
end subroutine psi_ s tranidx_vect
end subroutine psi_ z tranidx_vect