Added MODE to PSB_OVRL interface: this allows to apply the overlap

scaling for average independent of the communication (needed to apply
the transpose of an overlapped preconditioner).
psblas3-type-indexed
Salvatore Filippone 17 years ago
parent 842efca6d1
commit 031052b157

@ -45,8 +45,24 @@
! psb_none_ do nothing
! psb_sum_ sum of overlaps
! psb_avg_ average of overlaps
! mode - integer(optional). Choose the algorithm for data exchange:
! this is chosen through bit fields.
! swap_mpi = iand(flag,psb_swap_mpi_) /= 0
! swap_sync = iand(flag,psb_swap_sync_) /= 0
! swap_send = iand(flag,psb_swap_send_) /= 0
! swap_recv = iand(flag,psb_swap_recv_) /= 0
! if (swap_mpi): use underlying MPI_ALLTOALLV.
! if (swap_sync): use PSB_SND and PSB_RCV in
! synchronized pairs
! if (swap_send .and. swap_recv): use mpi_irecv
! and mpi_send
! if (swap_send): use psb_snd (but need another
! call with swap_recv to complete)
! if (swap_recv): use psb_rcv (completing a
! previous call with swap_send)
!
subroutine psb_dovrlm(x,desc_a,info,jx,ik,work,update)
!
subroutine psb_dovrlm(x,desc_a,info,jx,ik,work,update,mode)
use psb_descriptor_type
use psb_const_mod
use psi_mod
@ -60,7 +76,7 @@ subroutine psb_dovrlm(x,desc_a,info,jx,ik,work,update)
type(psb_desc_type), intent(in) :: desc_a
integer, intent(out) :: info
real(kind(1.d0)), optional, target :: work(:)
integer, intent(in), optional :: update,jx,ik
integer, intent(in), optional :: update,jx,ik,mode
! locals
integer :: int_err(5), ictxt, np, me, &
@ -115,9 +131,12 @@ subroutine psb_dovrlm(x,desc_a,info,jx,ik,work,update)
else
iupdate = psb_avg_
endif
do_update = (iupdate /= psb_none_)
imode = IOR(psb_swap_send_,psb_swap_recv_)
if (present(mode)) then
imode = mode
else
imode = IOR(psb_swap_send_,psb_swap_recv_)
endif
! check vector correctness
call psb_chkvect(m,1,size(x,1),ix,ijx,desc_a,info,iix,jjx)
@ -261,8 +280,24 @@ end subroutine psb_dovrlm
! psb_none_ do nothing
! psb_sum_ sum of overlaps
! psb_avg_ average of overlaps
! mode - integer(optional). Choose the algorithm for data exchange:
! this is chosen through bit fields.
! swap_mpi = iand(flag,psb_swap_mpi_) /= 0
! swap_sync = iand(flag,psb_swap_sync_) /= 0
! swap_send = iand(flag,psb_swap_send_) /= 0
! swap_recv = iand(flag,psb_swap_recv_) /= 0
! if (swap_mpi): use underlying MPI_ALLTOALLV.
! if (swap_sync): use PSB_SND and PSB_RCV in
! synchronized pairs
! if (swap_send .and. swap_recv): use mpi_irecv
! and mpi_send
! if (swap_send): use psb_snd (but need another
! call with swap_recv to complete)
! if (swap_recv): use psb_rcv (completing a
! previous call with swap_send)
!
subroutine psb_dovrlv(x,desc_a,info,work,update)
!
subroutine psb_dovrlv(x,desc_a,info,work,update,mode)
use psb_descriptor_type
use psi_mod
use psb_const_mod
@ -276,7 +311,7 @@ subroutine psb_dovrlv(x,desc_a,info,work,update)
type(psb_desc_type), intent(in) :: desc_a
integer, intent(out) :: info
real(kind(1.d0)), optional, target :: work(:)
integer, intent(in), optional :: update
integer, intent(in), optional :: update,mode
! locals
integer :: int_err(5), ictxt, np, me, &
@ -319,7 +354,11 @@ subroutine psb_dovrlv(x,desc_a,info,work,update)
endif
do_update = (iupdate /= psb_none_)
imode = IOR(psb_swap_send_,psb_swap_recv_)
if (present(mode)) then
imode = mode
else
imode = IOR(psb_swap_send_,psb_swap_recv_)
endif
! check vector correctness
call psb_chkvect(m,1,size(x),ix,ijx,desc_a,info,iix,jjx)

@ -45,8 +45,24 @@
! psb_none_ do nothing
! psb_sum_ sum of overlaps
! psb_avg_ average of overlaps
! mode - integer(optional). Choose the algorithm for data exchange:
! this is chosen through bit fields.
! swap_mpi = iand(flag,psb_swap_mpi_) /= 0
! swap_sync = iand(flag,psb_swap_sync_) /= 0
! swap_send = iand(flag,psb_swap_send_) /= 0
! swap_recv = iand(flag,psb_swap_recv_) /= 0
! if (swap_mpi): use underlying MPI_ALLTOALLV.
! if (swap_sync): use PSB_SND and PSB_RCV in
! synchronized pairs
! if (swap_send .and. swap_recv): use mpi_irecv
! and mpi_send
! if (swap_send): use psb_snd (but need another
! call with swap_recv to complete)
! if (swap_recv): use psb_rcv (completing a
! previous call with swap_send)
!
subroutine psb_zovrlm(x,desc_a,info,jx,ik,work,update)
!
subroutine psb_zovrlm(x,desc_a,info,jx,ik,work,update,mode)
use psb_descriptor_type
use psb_const_mod
use psi_mod
@ -60,7 +76,7 @@ subroutine psb_zovrlm(x,desc_a,info,jx,ik,work,update)
type(psb_desc_type), intent(in) :: desc_a
integer, intent(out) :: info
complex(kind(1.d0)), optional, target :: work(:)
integer, intent(in), optional :: update,jx,ik
integer, intent(in), optional :: update,jx,ik,mode
! locals
integer :: int_err(5), ictxt, np, me, &
@ -115,9 +131,13 @@ subroutine psb_zovrlm(x,desc_a,info,jx,ik,work,update)
else
iupdate = psb_avg_
endif
do_update = (iupdate /= psb_none_)
imode = IOR(psb_swap_send_,psb_swap_recv_)
if (present(mode)) then
imode = mode
else
imode = IOR(psb_swap_send_,psb_swap_recv_)
endif
! check vector correctness
call psb_chkvect(m,1,size(x,1),ix,ijx,desc_a,info,iix,jjx)
@ -260,9 +280,25 @@ end subroutine psb_zovrlm
! psb_none_ do nothing
! psb_sum_ sum of overlaps
! psb_avg_ average of overlaps
! mode - integer(optional). Choose the algorithm for data exchange:
! this is chosen through bit fields.
! swap_mpi = iand(flag,psb_swap_mpi_) /= 0
! swap_sync = iand(flag,psb_swap_sync_) /= 0
! swap_send = iand(flag,psb_swap_send_) /= 0
! swap_recv = iand(flag,psb_swap_recv_) /= 0
! if (swap_mpi): use underlying MPI_ALLTOALLV.
! if (swap_sync): use PSB_SND and PSB_RCV in
! synchronized pairs
! if (swap_send .and. swap_recv): use mpi_irecv
! and mpi_send
! if (swap_send): use psb_snd (but need another
! call with swap_recv to complete)
! if (swap_recv): use psb_rcv (completing a
! previous call with swap_send)
!
!
!
subroutine psb_zovrlv(x,desc_a,info,work,update)
subroutine psb_zovrlv(x,desc_a,info,work,update,mode)
use psb_descriptor_type
use psi_mod
use psb_const_mod
@ -272,11 +308,11 @@ subroutine psb_zovrlv(x,desc_a,info,work,update)
use psb_penv_mod
implicit none
complex(kind(1.d0)), intent(inout), target :: x(:)
type(psb_desc_type), intent(in) :: desc_a
integer, intent(out) :: info
complex(kind(1.d0)), optional, target :: work(:)
integer, intent(in), optional :: update
complex(kind(1.d0)), intent(inout), target :: x(:)
type(psb_desc_type), intent(in) :: desc_a
integer, intent(out) :: info
complex(kind(1.d0)), optional, target :: work(:)
integer, intent(in), optional :: update,mode
! locals
integer :: int_err(5), ictxt, np, me, &
@ -317,9 +353,13 @@ subroutine psb_zovrlv(x,desc_a,info,work,update)
else
iupdate = psb_none_
endif
do_update = (iupdate /= psb_none_)
imode = IOR(psb_swap_send_,psb_swap_recv_)
if (present(mode)) then
imode = mode
else
imode = IOR(psb_swap_send_,psb_swap_recv_)
endif
! check vector correctness
call psb_chkvect(m,1,size(x),ix,ijx,desc_a,info,iix,jjx)

@ -31,37 +31,37 @@
module psb_comm_mod
interface psb_ovrl
subroutine psb_dovrlm(x,desc_a,info,jx,ik,work,update)
subroutine psb_dovrlm(x,desc_a,info,jx,ik,work,update,mode)
use psb_descriptor_type
real(kind(1.d0)), intent(inout) :: x(:,:)
type(psb_desc_type), intent(in) :: desc_a
integer, intent(out) :: info
real(kind(1.d0)), intent(inout), optional :: work(:)
integer, intent(in), optional :: update,jx,ik
integer, intent(in), optional :: update,jx,ik,mode
end subroutine psb_dovrlm
subroutine psb_dovrlv(x,desc_a,info,work,update)
subroutine psb_dovrlv(x,desc_a,info,work,update,mode)
use psb_descriptor_type
real(kind(1.d0)), intent(inout) :: x(:)
type(psb_desc_type), intent(in) :: desc_a
integer, intent(out) :: info
real(kind(1.d0)), intent(inout), optional :: work(:)
integer, intent(in), optional :: update
integer, intent(in), optional :: update,mode
end subroutine psb_dovrlv
subroutine psb_zovrlm(x,desc_a,info,jx,ik,work,update)
subroutine psb_zovrlm(x,desc_a,info,jx,ik,work,update,mode)
use psb_descriptor_type
complex(kind(1.d0)), intent(inout) :: x(:,:)
complex(kind(1.d0)), intent(inout) :: x(:,:)
type(psb_desc_type), intent(in) :: desc_a
integer, intent(out) :: info
complex(kind(1.d0)), intent(inout), optional :: work(:)
integer, intent(in), optional :: update,jx,ik
integer, intent(in), optional :: update,jx,ik,mode
end subroutine psb_zovrlm
subroutine psb_zovrlv(x,desc_a,info,work,update)
subroutine psb_zovrlv(x,desc_a,info,work,update,mode)
use psb_descriptor_type
complex(kind(1.d0)), intent(inout) :: x(:)
complex(kind(1.d0)), intent(inout) :: x(:)
type(psb_desc_type), intent(in) :: desc_a
integer, intent(out) :: info
complex(kind(1.d0)), intent(inout), optional :: work(:)
integer, intent(in), optional :: update
integer, intent(in), optional :: update,mode
end subroutine psb_zovrlv
end interface
@ -108,21 +108,21 @@ module psb_comm_mod
end subroutine psb_ihalov
subroutine psb_zhalom(x,desc_a,info,alpha,jx,ik,work,tran,mode,data)
use psb_descriptor_type
complex(kind(1.d0)), intent(inout) :: x(:,:)
complex(kind(1.d0)), intent(inout) :: x(:,:)
type(psb_desc_type), intent(in) :: desc_a
integer, intent(out) :: info
complex(kind(1.d0)), intent(in), optional :: alpha
complex(kind(1.d0)), target, optional :: work(:)
complex(kind(1.d0)), intent(in), optional :: alpha
complex(kind(1.d0)), target, optional :: work(:)
integer, intent(in), optional :: mode,jx,ik,data
character, intent(in), optional :: tran
end subroutine psb_zhalom
subroutine psb_zhalov(x,desc_a,info,alpha,work,tran,mode,data)
use psb_descriptor_type
complex(kind(1.d0)), intent(inout) :: x(:)
complex(kind(1.d0)), intent(inout) :: x(:)
type(psb_desc_type), intent(in) :: desc_a
integer, intent(out) :: info
complex(kind(1.d0)), intent(in), optional :: alpha
complex(kind(1.d0)), target, optional :: work(:)
complex(kind(1.d0)), intent(in), optional :: alpha
complex(kind(1.d0)), target, optional :: work(:)
integer, intent(in), optional :: mode,data
character, intent(in), optional :: tran
end subroutine psb_zhalov
@ -148,32 +148,32 @@ module psb_comm_mod
end subroutine psb_dscatterv
subroutine psb_zscatterm(globx, locx, desc_a, info, root)
use psb_descriptor_type
complex(kind(1.d0)), intent(out) :: locx(:,:)
complex(kind(1.d0)), intent(in) :: globx(:,:)
complex(kind(1.d0)), intent(out) :: locx(:,:)
complex(kind(1.d0)), intent(in) :: globx(:,:)
type(psb_desc_type), intent(in) :: desc_a
integer, intent(out) :: info
integer, intent(in), optional :: root
end subroutine psb_zscatterm
subroutine psb_zscatterv(globx, locx, desc_a, info, root)
use psb_descriptor_type
complex(kind(1.d0)), intent(out) :: locx(:)
complex(kind(1.d0)), intent(in) :: globx(:)
complex(kind(1.d0)), intent(out) :: locx(:)
complex(kind(1.d0)), intent(in) :: globx(:)
type(psb_desc_type), intent(in) :: desc_a
integer, intent(out) :: info
integer, intent(in), optional :: root
end subroutine psb_zscatterv
subroutine psb_iscatterm(globx, locx, desc_a, info, root)
use psb_descriptor_type
integer, intent(out) :: locx(:,:)
integer, intent(in) :: globx(:,:)
integer, intent(out) :: locx(:,:)
integer, intent(in) :: globx(:,:)
type(psb_desc_type), intent(in) :: desc_a
integer, intent(out) :: info
integer, intent(in), optional :: root
end subroutine psb_iscatterm
subroutine psb_iscatterv(globx, locx, desc_a, info, root)
use psb_descriptor_type
integer, intent(out) :: locx(:)
integer, intent(in) :: globx(:)
integer, intent(out) :: locx(:)
integer, intent(in) :: globx(:)
type(psb_desc_type), intent(in) :: desc_a
integer, intent(out) :: info
integer, intent(in), optional :: root
@ -183,16 +183,16 @@ module psb_comm_mod
interface psb_gather
subroutine psb_igatherm(globx, locx, desc_a, info, root)
use psb_descriptor_type
integer, intent(in) :: locx(:,:)
integer, intent(out) :: globx(:,:)
integer, intent(in) :: locx(:,:)
integer, intent(out) :: globx(:,:)
type(psb_desc_type), intent(in) :: desc_a
integer, intent(out) :: info
integer, intent(in), optional :: root
end subroutine psb_igatherm
subroutine psb_igatherv(globx, locx, desc_a, info, root)
use psb_descriptor_type
integer, intent(in) :: locx(:)
integer, intent(out) :: globx(:)
integer, intent(in) :: locx(:)
integer, intent(out) :: globx(:)
type(psb_desc_type), intent(in) :: desc_a
integer, intent(out) :: info
integer, intent(in), optional :: root
@ -215,19 +215,19 @@ module psb_comm_mod
end subroutine psb_dgatherv
subroutine psb_zgatherm(globx, locx, desc_a, info, root)
use psb_descriptor_type
complex(kind(1.d0)), intent(in) :: locx(:,:)
complex(kind(1.d0)), intent(out) :: globx(:,:)
type(psb_desc_type), intent(in) :: desc_a
integer, intent(out) :: info
integer, intent(in), optional :: root
complex(kind(1.d0)), intent(in) :: locx(:,:)
complex(kind(1.d0)), intent(out) :: globx(:,:)
type(psb_desc_type), intent(in) :: desc_a
integer, intent(out) :: info
integer, intent(in), optional :: root
end subroutine psb_zgatherm
subroutine psb_zgatherv(globx, locx, desc_a, info, root)
use psb_descriptor_type
complex(kind(1.d0)), intent(in) :: locx(:)
complex(kind(1.d0)), intent(out) :: globx(:)
type(psb_desc_type), intent(in) :: desc_a
integer, intent(out) :: info
integer, intent(in), optional :: root
complex(kind(1.d0)), intent(in) :: locx(:)
complex(kind(1.d0)), intent(out) :: globx(:)
type(psb_desc_type), intent(in) :: desc_a
integer, intent(out) :: info
integer, intent(in), optional :: root
end subroutine psb_zgatherv
end interface

@ -45,6 +45,7 @@ module psb_descriptor_type
integer, parameter :: psb_nohalo_=0, psb_halo_=1
integer, parameter :: psb_none_=0, psb_sum_=1
integer, parameter :: psb_avg_=2, psb_square_root_=3
! The following are bit fields.
integer, parameter :: psb_swap_send_=1, psb_swap_recv_=2
integer, parameter :: psb_swap_sync_=4, psb_swap_mpi_=8

Loading…
Cancel
Save