|
|
@ -30,12 +30,27 @@
|
|
|
|
!
|
|
|
|
!
|
|
|
|
!
|
|
|
|
!
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! File: psi_fnd_owner.f90
|
|
|
|
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! Subroutine: psi_fnd_owner
|
|
|
|
! File: psi_adjcncy_fnd_owner.f90
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
! Subroutine: psi_adjcncy_fnd_owner
|
|
|
|
! Figure out who owns global indices.
|
|
|
|
! Figure out who owns global indices.
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! Arguments:
|
|
|
|
! Arguments:
|
|
|
|
|
|
|
|
! idx(:) - integer Required indices on the calling process.
|
|
|
|
|
|
|
|
! Note: the indices should be unique!
|
|
|
|
|
|
|
|
! iprc(:) - integer(psb_ipk_), allocatable Output: process identifiers for the corresponding
|
|
|
|
|
|
|
|
! indices
|
|
|
|
|
|
|
|
! adj(:) - integer(psb_ipk_) Input: list of topological neighbours for current process.
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
! idxmap - class(psb_indx_map). The index map
|
|
|
|
|
|
|
|
! info - integer. return code.
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
! This version takes on input a list of processes that are assumed to
|
|
|
|
|
|
|
|
! be topological neighbours of the current one. Each process will send to all
|
|
|
|
|
|
|
|
! of its neighbours the list of indices for which it is trying to find the
|
|
|
|
|
|
|
|
! owner, prepare its own answers, and collect answers from others.
|
|
|
|
|
|
|
|
! There are
|
|
|
|
!
|
|
|
|
!
|
|
|
|
subroutine psi_adjcncy_fnd_owner(idx,iprc,adj,idxmap,info)
|
|
|
|
subroutine psi_adjcncy_fnd_owner(idx,iprc,adj,idxmap,info)
|
|
|
|
use psb_serial_mod
|
|
|
|
use psb_serial_mod
|
|
|
@ -69,8 +84,10 @@ subroutine psi_adjcncy_fnd_owner(idx,iprc,adj,idxmap,info)
|
|
|
|
& last_ih, last_j, nidx, nrecv, nadj
|
|
|
|
& last_ih, last_j, nidx, nrecv, nadj
|
|
|
|
integer(psb_lpk_) :: mglob, ih
|
|
|
|
integer(psb_lpk_) :: mglob, ih
|
|
|
|
integer(psb_ipk_) :: ictxt,np,me
|
|
|
|
integer(psb_ipk_) :: ictxt,np,me
|
|
|
|
logical, parameter :: gettime=.false., new_impl=.true.
|
|
|
|
logical, parameter :: gettime=.false., debug=.false.
|
|
|
|
logical, parameter :: a2av_impl=.true., debug=.false.
|
|
|
|
logical, parameter :: a2av_impl=.true.
|
|
|
|
|
|
|
|
logical, parameter :: mpi_irecv_impl=.false.
|
|
|
|
|
|
|
|
logical, parameter :: psb_rcv_impl=.false.
|
|
|
|
real(psb_dpk_) :: t0, t1, t2, t3, t4, tamx, tidx
|
|
|
|
real(psb_dpk_) :: t0, t1, t2, t3, t4, tamx, tidx
|
|
|
|
character(len=20) :: name
|
|
|
|
character(len=20) :: name
|
|
|
|
|
|
|
|
|
|
|
@ -175,6 +192,10 @@ subroutine psi_adjcncy_fnd_owner(idx,iprc,adj,idxmap,info)
|
|
|
|
call mpi_alltoallv(tproc,rvsz,rvidx,psb_mpi_ipk_,&
|
|
|
|
call mpi_alltoallv(tproc,rvsz,rvidx,psb_mpi_ipk_,&
|
|
|
|
& lclidx,sdsz,sdidx,psb_mpi_ipk_,icomm,iret)
|
|
|
|
& lclidx,sdsz,sdidx,psb_mpi_ipk_,icomm,iret)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
! Because IPRC has been initialized to -1, the MAX operation selects
|
|
|
|
|
|
|
|
! the answers.
|
|
|
|
|
|
|
|
!
|
|
|
|
do i=0, np-1
|
|
|
|
do i=0, np-1
|
|
|
|
if (sdsz(i)>0) then
|
|
|
|
if (sdsz(i)>0) then
|
|
|
|
! Must be nidx == sdsz(i)
|
|
|
|
! Must be nidx == sdsz(i)
|
|
|
@ -183,8 +204,7 @@ subroutine psi_adjcncy_fnd_owner(idx,iprc,adj,idxmap,info)
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
|
|
|
|
|
|
|
|
if (debug) write(0,*) me,' End of adjcncy_fnd ',iprc(1:nidx)
|
|
|
|
if (debug) write(0,*) me,' End of adjcncy_fnd ',iprc(1:nidx)
|
|
|
|
else
|
|
|
|
else if (mpi_irecv_impl) then
|
|
|
|
if (new_impl) then
|
|
|
|
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! First simple minded version with auxiliary arrays
|
|
|
|
! First simple minded version with auxiliary arrays
|
|
|
|
! dimensioned on NP.
|
|
|
|
! dimensioned on NP.
|
|
|
@ -292,7 +312,7 @@ subroutine psi_adjcncy_fnd_owner(idx,iprc,adj,idxmap,info)
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
if (debug) write(0,*) me,' End of adjcncy_fnd ',iprc(1:nidx)
|
|
|
|
if (debug) write(0,*) me,' End of adjcncy_fnd ',iprc(1:nidx)
|
|
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
else if (psb_rcv_impl) then
|
|
|
|
|
|
|
|
|
|
|
|
Allocate(hidx(0:np),hsz(np),&
|
|
|
|
Allocate(hidx(0:np),hsz(np),&
|
|
|
|
& sdsz(0:np-1),rvsz(0:np-1),stat=info)
|
|
|
|
& sdsz(0:np-1),rvsz(0:np-1),stat=info)
|
|
|
@ -360,7 +380,10 @@ subroutine psi_adjcncy_fnd_owner(idx,iprc,adj,idxmap,info)
|
|
|
|
if (nidx > 0) call psb_rcv(ictxt,tproc(1:nidx),adj(j))
|
|
|
|
if (nidx > 0) call psb_rcv(ictxt,tproc(1:nidx),adj(j))
|
|
|
|
iprc(1:nidx) = max(iprc(1:nidx), tproc(1:nidx))
|
|
|
|
iprc(1:nidx) = max(iprc(1:nidx), tproc(1:nidx))
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
end if
|
|
|
|
else
|
|
|
|
|
|
|
|
info = psb_err_internal_error_
|
|
|
|
|
|
|
|
call psb_errpush(info,name,a_err='invalid exchange alg choice')
|
|
|
|
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
call psb_erractionrestore(err_act)
|
|
|
|
call psb_erractionrestore(err_act)
|
|
|
|