|
|
@ -45,6 +45,14 @@ module psi_d_collective_mod
|
|
|
|
module procedure psb_d_nrm2s, psb_d_nrm2v
|
|
|
|
module procedure psb_d_nrm2s, psb_d_nrm2v
|
|
|
|
end interface psb_nrm2
|
|
|
|
end interface psb_nrm2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
interface psb_gather
|
|
|
|
|
|
|
|
module procedure psb_dgather_s, psb_dgather_v
|
|
|
|
|
|
|
|
end interface psb_gather
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
interface psb_gatherv
|
|
|
|
|
|
|
|
module procedure psb_dgatherv_v
|
|
|
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
|
|
interface psb_sum
|
|
|
|
interface psb_sum
|
|
|
|
module procedure psb_dsums, psb_dsumv, psb_dsumm
|
|
|
|
module procedure psb_dsums, psb_dsumv, psb_dsumm
|
|
|
|
end interface
|
|
|
|
end interface
|
|
|
@ -110,6 +118,7 @@ contains
|
|
|
|
integer(psb_mpk_) :: icomm
|
|
|
|
integer(psb_mpk_) :: icomm
|
|
|
|
integer(psb_mpk_) :: status(mpi_status_size)
|
|
|
|
integer(psb_mpk_) :: status(mpi_status_size)
|
|
|
|
logical :: collective_start, collective_end, collective_sync
|
|
|
|
logical :: collective_start, collective_end, collective_sync
|
|
|
|
|
|
|
|
real(psb_dpk_) :: dat_
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(SERIAL_MPI)
|
|
|
|
#if !defined(SERIAL_MPI)
|
|
|
|
call psb_info(ctxt,iam,np)
|
|
|
|
call psb_info(ctxt,iam,np)
|
|
|
@ -134,20 +143,29 @@ contains
|
|
|
|
collective_start = .false.
|
|
|
|
collective_start = .false.
|
|
|
|
collective_end = .false.
|
|
|
|
collective_end = .false.
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
if (collective_sync) then
|
|
|
|
if (collective_sync) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call mpi_allreduce(MPI_IN_PLACE,dat,1,psb_mpi_r_dpk_,mpi_max,icomm,info)
|
|
|
|
call mpi_allreduce(mpi_in_place,dat,1,psb_mpi_r_dpk_,mpi_max,icomm,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call mpi_reduce(MPI_IN_PLACE,dat,1,psb_mpi_r_dpk_,mpi_max,root_,icomm,info)
|
|
|
|
if (iam==root_) then
|
|
|
|
|
|
|
|
call mpi_reduce(mpi_in_place,dat,1,psb_mpi_r_dpk_,mpi_max,root_,icomm,info)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call mpi_reduce(dat,dat,1,psb_mpi_r_dpk_,mpi_max,root_,icomm,info)
|
|
|
|
|
|
|
|
end if
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
else
|
|
|
|
if (collective_start) then
|
|
|
|
if (collective_start) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call mpi_iallreduce(MPI_IN_PLACE,dat,1,&
|
|
|
|
call mpi_iallreduce(mpi_in_place,dat,1,&
|
|
|
|
& psb_mpi_r_dpk_,mpi_max,icomm,request,info)
|
|
|
|
& psb_mpi_r_dpk_,mpi_max,icomm,request,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call mpi_ireduce(MPI_IN_PLACE,dat,1,&
|
|
|
|
if (iam==root_) then
|
|
|
|
& psb_mpi_r_dpk_,mpi_max,root_,icomm,request,info)
|
|
|
|
call mpi_ireduce(mpi_in_place,dat,1,&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_max,root_,icomm,request,info)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call mpi_ireduce(dat,dat,1,&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_max,root_,icomm,request,info)
|
|
|
|
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
else if (collective_end) then
|
|
|
|
else if (collective_end) then
|
|
|
|
call mpi_wait(request,status,info)
|
|
|
|
call mpi_wait(request,status,info)
|
|
|
@ -174,6 +192,7 @@ contains
|
|
|
|
integer(psb_mpk_) :: icomm
|
|
|
|
integer(psb_mpk_) :: icomm
|
|
|
|
integer(psb_mpk_) :: status(mpi_status_size)
|
|
|
|
integer(psb_mpk_) :: status(mpi_status_size)
|
|
|
|
logical :: collective_start, collective_end, collective_sync
|
|
|
|
logical :: collective_start, collective_end, collective_sync
|
|
|
|
|
|
|
|
real(psb_dpk_) :: dat_(1) ! This is a dummy
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(SERIAL_MPI)
|
|
|
|
#if !defined(SERIAL_MPI)
|
|
|
@ -200,21 +219,31 @@ contains
|
|
|
|
collective_end = .false.
|
|
|
|
collective_end = .false.
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
if (collective_sync) then
|
|
|
|
if (collective_sync) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call mpi_allreduce(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
call mpi_allreduce(mpi_in_place,dat,size(dat),&
|
|
|
|
& psb_mpi_r_dpk_,mpi_max,icomm,info)
|
|
|
|
& psb_mpi_r_dpk_,mpi_max,icomm,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call mpi_reduce(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
if(iam==root_) then
|
|
|
|
& psb_mpi_r_dpk_,mpi_max,root_,icomm,info)
|
|
|
|
call mpi_reduce(mpi_in_place,dat,size(dat),&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_max,root_,icomm,info)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call mpi_reduce(dat,dat,size(dat),&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_max,root_,icomm,info)
|
|
|
|
|
|
|
|
end if
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
else
|
|
|
|
if (collective_start) then
|
|
|
|
if (collective_start) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call mpi_iallreduce(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
call mpi_iallreduce(mpi_in_place,dat,size(dat),&
|
|
|
|
& psb_mpi_r_dpk_,mpi_max,icomm,request,info)
|
|
|
|
& psb_mpi_r_dpk_,mpi_max,icomm,request,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call mpi_ireduce(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
if(iam==root_) then
|
|
|
|
& psb_mpi_r_dpk_,mpi_max,root_,icomm,request,info)
|
|
|
|
call mpi_ireduce(mpi_in_place,dat,size(dat),&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_max,root_,icomm,request,info)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call mpi_ireduce(dat,dat,size(dat),&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_max,root_,icomm,request,info)
|
|
|
|
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
else if (collective_end) then
|
|
|
|
else if (collective_end) then
|
|
|
|
call mpi_wait(request,status,info)
|
|
|
|
call mpi_wait(request,status,info)
|
|
|
@ -242,6 +271,7 @@ contains
|
|
|
|
integer(psb_mpk_) :: icomm
|
|
|
|
integer(psb_mpk_) :: icomm
|
|
|
|
integer(psb_mpk_) :: status(mpi_status_size)
|
|
|
|
integer(psb_mpk_) :: status(mpi_status_size)
|
|
|
|
logical :: collective_start, collective_end, collective_sync
|
|
|
|
logical :: collective_start, collective_end, collective_sync
|
|
|
|
|
|
|
|
real(psb_dpk_) :: dat_(1,1) ! this is a dummy
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(SERIAL_MPI)
|
|
|
|
#if !defined(SERIAL_MPI)
|
|
|
@ -268,28 +298,37 @@ contains
|
|
|
|
collective_start = .false.
|
|
|
|
collective_start = .false.
|
|
|
|
collective_end = .false.
|
|
|
|
collective_end = .false.
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
if (collective_sync) then
|
|
|
|
if (collective_sync) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call mpi_allreduce(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
call mpi_allreduce(mpi_in_place,dat,size(dat),&
|
|
|
|
& psb_mpi_r_dpk_,mpi_max,icomm,info)
|
|
|
|
& psb_mpi_r_dpk_,mpi_max,icomm,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call mpi_reduce(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
if(iam==root_) then
|
|
|
|
& psb_mpi_r_dpk_,mpi_max,root_,icomm,info)
|
|
|
|
call mpi_reduce(mpi_in_place,dat,size(dat),&
|
|
|
|
endif
|
|
|
|
& psb_mpi_r_dpk_,mpi_max,root_,icomm,info)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call mpi_reduce(dat,dat,size(dat),&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_max,root_,icomm,info)
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
end if
|
|
|
|
else
|
|
|
|
else
|
|
|
|
if (collective_start) then
|
|
|
|
if (collective_start) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call mpi_iallreduce(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
call mpi_iallreduce(mpi_in_place,dat,size(dat),&
|
|
|
|
& psb_mpi_r_dpk_,mpi_max,icomm,request,info)
|
|
|
|
& psb_mpi_r_dpk_,mpi_max,icomm,request,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call mpi_ireduce(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
if(iam==root_) then
|
|
|
|
& psb_mpi_r_dpk_,mpi_max,root_,icomm,request,info)
|
|
|
|
call mpi_ireduce(mpi_in_place,dat,size(dat),&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_max,root_,icomm,request,info)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call mpi_ireduce(dat,dat,size(dat),&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_max,root_,icomm,request,info)
|
|
|
|
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
else if (collective_end) then
|
|
|
|
else if (collective_end) then
|
|
|
|
call mpi_wait(request,status,info)
|
|
|
|
call mpi_wait(request,status,info)
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
end subroutine psb_dmaxm
|
|
|
|
end subroutine psb_dmaxm
|
|
|
|
|
|
|
|
|
|
|
@ -340,18 +379,27 @@ contains
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
if (collective_sync) then
|
|
|
|
if (collective_sync) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call mpi_allreduce(MPI_IN_PLACE,dat,1,psb_mpi_r_dpk_,mpi_min,icomm,info)
|
|
|
|
call mpi_allreduce(mpi_in_place,dat,1,psb_mpi_r_dpk_,mpi_min,icomm,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call mpi_reduce(MPI_IN_PLACE,dat,1,psb_mpi_r_dpk_,mpi_min,root_,icomm,info)
|
|
|
|
if(iam==root_) then
|
|
|
|
|
|
|
|
call mpi_reduce(mpi_in_place,dat,1,psb_mpi_r_dpk_,mpi_min,root_,icomm,info)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call mpi_reduce(dat,dat,1,psb_mpi_r_dpk_,mpi_min,root_,icomm,info)
|
|
|
|
|
|
|
|
end if
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
else
|
|
|
|
if (collective_start) then
|
|
|
|
if (collective_start) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call mpi_iallreduce(MPI_IN_PLACE,dat,1,&
|
|
|
|
call mpi_iallreduce(mpi_in_place,dat,1,&
|
|
|
|
& psb_mpi_r_dpk_,mpi_min,icomm,request,info)
|
|
|
|
& psb_mpi_r_dpk_,mpi_min,icomm,request,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call mpi_ireduce(MPI_IN_PLACE,dat,1,&
|
|
|
|
if(iam==root_) then
|
|
|
|
& psb_mpi_r_dpk_,mpi_min,root_,icomm,request,info)
|
|
|
|
call mpi_ireduce(mpi_in_place,dat,1,&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_min,root_,icomm,request,info)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call mpi_ireduce(dat,dat,1,&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_min,root_,icomm,request,info)
|
|
|
|
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
else if (collective_end) then
|
|
|
|
else if (collective_end) then
|
|
|
|
call mpi_wait(request,status,info)
|
|
|
|
call mpi_wait(request,status,info)
|
|
|
@ -405,20 +453,30 @@ contains
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
if (collective_sync) then
|
|
|
|
if (collective_sync) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call mpi_allreduce(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
call mpi_allreduce(mpi_in_place,dat,size(dat),&
|
|
|
|
& psb_mpi_r_dpk_,mpi_min,icomm,info)
|
|
|
|
& psb_mpi_r_dpk_,mpi_min,icomm,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call mpi_reduce(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
if(iam==root_) then
|
|
|
|
& psb_mpi_r_dpk_,mpi_min,root_,icomm,info)
|
|
|
|
call mpi_reduce(mpi_in_place,dat,size(dat),&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_min,root_,icomm,info)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call mpi_reduce(dat,dat,size(dat),&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_min,root_,icomm,info)
|
|
|
|
|
|
|
|
end if
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
else
|
|
|
|
if (collective_start) then
|
|
|
|
if (collective_start) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call mpi_iallreduce(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
call mpi_iallreduce(mpi_in_place,dat,size(dat),&
|
|
|
|
& psb_mpi_r_dpk_,mpi_min,icomm,request,info)
|
|
|
|
& psb_mpi_r_dpk_,mpi_min,icomm,request,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call mpi_ireduce(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
if(iam==root_) then
|
|
|
|
& psb_mpi_r_dpk_,mpi_min,root_,icomm,request,info)
|
|
|
|
call mpi_ireduce(mpi_in_place,dat,size(dat),&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_min,root_,icomm,request,info)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call mpi_ireduce(dat,dat,size(dat),&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_min,root_,icomm,request,info)
|
|
|
|
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
else if (collective_end) then
|
|
|
|
else if (collective_end) then
|
|
|
|
call mpi_wait(request,status,info)
|
|
|
|
call mpi_wait(request,status,info)
|
|
|
@ -473,20 +531,30 @@ contains
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
if (collective_sync) then
|
|
|
|
if (collective_sync) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call mpi_allreduce(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
call mpi_allreduce(mpi_in_place,dat,size(dat),&
|
|
|
|
& psb_mpi_r_dpk_,mpi_min,icomm,info)
|
|
|
|
& psb_mpi_r_dpk_,mpi_min,icomm,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call mpi_reduce(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
if(iam==root_) then
|
|
|
|
& psb_mpi_r_dpk_,mpi_min,root_,icomm,info)
|
|
|
|
call mpi_reduce(mpi_in_place,dat,size(dat),&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_min,root_,icomm,info)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call mpi_reduce(dat,dat,size(dat),&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_min,root_,icomm,info)
|
|
|
|
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
else
|
|
|
|
else
|
|
|
|
if (collective_start) then
|
|
|
|
if (collective_start) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call mpi_iallreduce(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
call mpi_iallreduce(mpi_in_place,dat,size(dat),&
|
|
|
|
& psb_mpi_r_dpk_,mpi_min,icomm,request,info)
|
|
|
|
& psb_mpi_r_dpk_,mpi_min,icomm,request,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call mpi_ireduce(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
if(iam==root_) then
|
|
|
|
& psb_mpi_r_dpk_,mpi_min,root_,icomm,request,info)
|
|
|
|
call mpi_ireduce(mpi_in_place,dat,size(dat),&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_min,root_,icomm,request,info)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call mpi_ireduce(dat,dat,size(dat),&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_min,root_,icomm,request,info)
|
|
|
|
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
else if (collective_end) then
|
|
|
|
else if (collective_end) then
|
|
|
|
call mpi_wait(request,status,info)
|
|
|
|
call mpi_wait(request,status,info)
|
|
|
@ -545,20 +613,30 @@ contains
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
if (collective_sync) then
|
|
|
|
if (collective_sync) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call mpi_allreduce(MPI_IN_PLACE,dat,1,&
|
|
|
|
call mpi_allreduce(mpi_in_place,dat,1,&
|
|
|
|
& psb_mpi_r_dpk_,mpi_dnrm2_op,icomm,info)
|
|
|
|
& psb_mpi_r_dpk_,mpi_dnrm2_op,icomm,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call mpi_reduce(MPI_IN_PLACE,dat,1,&
|
|
|
|
if(iam==root_) then
|
|
|
|
& psb_mpi_r_dpk_,mpi_dnrm2_op,root_,icomm,info)
|
|
|
|
call mpi_reduce(mpi_in_place,dat,1,&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_dnrm2_op,root_,icomm,info)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call mpi_reduce(dat,dat,1,&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_dnrm2_op,root_,icomm,info)
|
|
|
|
|
|
|
|
end if
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
else
|
|
|
|
if (collective_start) then
|
|
|
|
if (collective_start) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call mpi_iallreduce(MPI_IN_PLACE,dat,1,&
|
|
|
|
call mpi_iallreduce(mpi_in_place,dat,1,&
|
|
|
|
& psb_mpi_r_dpk_,mpi_dnrm2_op,icomm,request,info)
|
|
|
|
& psb_mpi_r_dpk_,mpi_dnrm2_op,icomm,request,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call mpi_ireduce(MPI_IN_PLACE,dat,1,&
|
|
|
|
if(iam==root_) then
|
|
|
|
& psb_mpi_r_dpk_,mpi_dnrm2_op,root_,icomm,request,info)
|
|
|
|
call mpi_ireduce(mpi_in_place,dat,1,&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_dnrm2_op,root_,icomm,request,info)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call mpi_ireduce(dat,dat,1,&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_dnrm2_op,root_,icomm,request,info)
|
|
|
|
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
else if (collective_end) then
|
|
|
|
else if (collective_end) then
|
|
|
|
call mpi_wait(request,status,info)
|
|
|
|
call mpi_wait(request,status,info)
|
|
|
@ -612,20 +690,30 @@ contains
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
if (collective_sync) then
|
|
|
|
if (collective_sync) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call mpi_allreduce(MPI_IN_PLACE,dat,size(dat),psb_mpi_r_dpk_,&
|
|
|
|
call mpi_allreduce(mpi_in_place,dat,size(dat),psb_mpi_r_dpk_,&
|
|
|
|
& mpi_dnrm2_op,icomm,info)
|
|
|
|
& mpi_dnrm2_op,icomm,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call mpi_reduce(MPI_IN_PLACE,dat,size(dat),psb_mpi_r_dpk_,&
|
|
|
|
if(iam==root_) then
|
|
|
|
& mpi_dnrm2_op,root_,icomm,info)
|
|
|
|
call mpi_reduce(mpi_in_place,dat,size(dat),psb_mpi_r_dpk_,&
|
|
|
|
|
|
|
|
& mpi_dnrm2_op,root_,icomm,info)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call mpi_reduce(dat,dat,size(dat),psb_mpi_r_dpk_,&
|
|
|
|
|
|
|
|
& mpi_dnrm2_op,root_,icomm,info)
|
|
|
|
|
|
|
|
end if
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
else
|
|
|
|
if (collective_start) then
|
|
|
|
if (collective_start) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call mpi_iallreduce(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
call mpi_iallreduce(mpi_in_place,dat,size(dat),&
|
|
|
|
& psb_mpi_r_dpk_,mpi_dnrm2_op,icomm,request,info)
|
|
|
|
& psb_mpi_r_dpk_,mpi_dnrm2_op,icomm,request,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call mpi_ireduce(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
if(iam==root_) then
|
|
|
|
& psb_mpi_r_dpk_,mpi_dnrm2_op,root_,icomm,request,info)
|
|
|
|
call mpi_ireduce(mpi_in_place,dat,size(dat),&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_dnrm2_op,root_,icomm,request,info)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call mpi_ireduce(dat,dat,size(dat),&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_dnrm2_op,root_,icomm,request,info)
|
|
|
|
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
else if (collective_end) then
|
|
|
|
else if (collective_end) then
|
|
|
|
call mpi_wait(request,status,info)
|
|
|
|
call mpi_wait(request,status,info)
|
|
|
@ -636,6 +724,250 @@ contains
|
|
|
|
end subroutine psb_d_nrm2v
|
|
|
|
end subroutine psb_d_nrm2v
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
! gather
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
subroutine psb_dgather_s(ctxt,dat,resv,root,mode,request)
|
|
|
|
|
|
|
|
#ifdef MPI_MOD
|
|
|
|
|
|
|
|
use mpi
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
#ifdef MPI_H
|
|
|
|
|
|
|
|
include 'mpif.h'
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
type(psb_ctxt_type), intent(in) :: ctxt
|
|
|
|
|
|
|
|
real(psb_dpk_), intent(inout) :: dat, resv(:)
|
|
|
|
|
|
|
|
integer(psb_mpk_), intent(in), optional :: root
|
|
|
|
|
|
|
|
integer(psb_ipk_), intent(in), optional :: mode
|
|
|
|
|
|
|
|
integer(psb_mpk_), intent(inout), optional :: request
|
|
|
|
|
|
|
|
integer(psb_mpk_) :: root_
|
|
|
|
|
|
|
|
integer(psb_mpk_) :: iam, np, info
|
|
|
|
|
|
|
|
integer(psb_mpk_) :: icomm
|
|
|
|
|
|
|
|
integer(psb_mpk_) :: status(mpi_status_size)
|
|
|
|
|
|
|
|
logical :: collective_start, collective_end, collective_sync
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if defined(SERIAL_MPI)
|
|
|
|
|
|
|
|
resv(0) = dat
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
call psb_info(ctxt,iam,np)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (present(root)) then
|
|
|
|
|
|
|
|
root_ = root
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
root_ = -1
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
icomm = psb_get_mpi_comm(ctxt)
|
|
|
|
|
|
|
|
if (present(mode)) then
|
|
|
|
|
|
|
|
collective_sync = .false.
|
|
|
|
|
|
|
|
collective_start = iand(mode,psb_collective_start_) /= 0
|
|
|
|
|
|
|
|
collective_end = iand(mode,psb_collective_end_) /= 0
|
|
|
|
|
|
|
|
if (.not.present(request)) then
|
|
|
|
|
|
|
|
collective_sync = .true.
|
|
|
|
|
|
|
|
collective_start = .false.
|
|
|
|
|
|
|
|
collective_end = .false.
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
collective_sync = .true.
|
|
|
|
|
|
|
|
collective_start = .false.
|
|
|
|
|
|
|
|
collective_end = .false.
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
if (collective_sync) then
|
|
|
|
|
|
|
|
if (root_ == -1) then
|
|
|
|
|
|
|
|
call mpi_allgather(dat,1,psb_mpi_r_dpk_,&
|
|
|
|
|
|
|
|
& resv,1,psb_mpi_r_dpk_,icomm,info)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call mpi_gather(dat,1,psb_mpi_r_dpk_,&
|
|
|
|
|
|
|
|
& resv,1,psb_mpi_r_dpk_,root_,icomm,info)
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
if (collective_start) then
|
|
|
|
|
|
|
|
if (root_ == -1) then
|
|
|
|
|
|
|
|
call mpi_iallgather(dat,1,psb_mpi_r_dpk_,&
|
|
|
|
|
|
|
|
& resv,1,psb_mpi_r_dpk_,icomm,request,info)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call mpi_igather(dat,1,psb_mpi_r_dpk_,&
|
|
|
|
|
|
|
|
& resv,1,psb_mpi_r_dpk_,root_,icomm,request,info)
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
else if (collective_end) then
|
|
|
|
|
|
|
|
call mpi_wait(request,status,info)
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
end subroutine psb_dgather_s
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
subroutine psb_dgather_v(ctxt,dat,resv,root,mode,request)
|
|
|
|
|
|
|
|
#ifdef MPI_MOD
|
|
|
|
|
|
|
|
use mpi
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
#ifdef MPI_H
|
|
|
|
|
|
|
|
include 'mpif.h'
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
type(psb_ctxt_type), intent(in) :: ctxt
|
|
|
|
|
|
|
|
real(psb_dpk_), intent(inout) :: dat(:), resv(:)
|
|
|
|
|
|
|
|
integer(psb_mpk_), intent(in), optional :: root
|
|
|
|
|
|
|
|
integer(psb_ipk_), intent(in), optional :: mode
|
|
|
|
|
|
|
|
integer(psb_mpk_), intent(inout), optional :: request
|
|
|
|
|
|
|
|
integer(psb_mpk_) :: root_
|
|
|
|
|
|
|
|
integer(psb_mpk_) :: iam, np, info
|
|
|
|
|
|
|
|
integer(psb_mpk_) :: icomm
|
|
|
|
|
|
|
|
integer(psb_mpk_) :: status(mpi_status_size)
|
|
|
|
|
|
|
|
logical :: collective_start, collective_end, collective_sync
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if defined(SERIAL_MPI)
|
|
|
|
|
|
|
|
resv(0) = dat
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
call psb_info(ctxt,iam,np)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (present(root)) then
|
|
|
|
|
|
|
|
root_ = root
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
root_ = -1
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
icomm = psb_get_mpi_comm(ctxt)
|
|
|
|
|
|
|
|
if (present(mode)) then
|
|
|
|
|
|
|
|
collective_sync = .false.
|
|
|
|
|
|
|
|
collective_start = iand(mode,psb_collective_start_) /= 0
|
|
|
|
|
|
|
|
collective_end = iand(mode,psb_collective_end_) /= 0
|
|
|
|
|
|
|
|
if (.not.present(request)) then
|
|
|
|
|
|
|
|
collective_sync = .true.
|
|
|
|
|
|
|
|
collective_start = .false.
|
|
|
|
|
|
|
|
collective_end = .false.
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
collective_sync = .true.
|
|
|
|
|
|
|
|
collective_start = .false.
|
|
|
|
|
|
|
|
collective_end = .false.
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
if (collective_sync) then
|
|
|
|
|
|
|
|
if (root_ == -1) then
|
|
|
|
|
|
|
|
call mpi_allgather(dat,size(dat),psb_mpi_r_dpk_,&
|
|
|
|
|
|
|
|
& resv,size(dat),psb_mpi_r_dpk_,icomm,info)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call mpi_gather(dat,size(dat),psb_mpi_r_dpk_,&
|
|
|
|
|
|
|
|
& resv,size(dat),psb_mpi_r_dpk_,root_,icomm,info)
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
if (collective_start) then
|
|
|
|
|
|
|
|
if (root_ == -1) then
|
|
|
|
|
|
|
|
call mpi_iallgather(dat,size(dat),psb_mpi_r_dpk_,&
|
|
|
|
|
|
|
|
& resv,size(dat),psb_mpi_r_dpk_,icomm,request,info)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call mpi_igather(dat,size(dat),psb_mpi_r_dpk_,&
|
|
|
|
|
|
|
|
& resv,size(dat),psb_mpi_r_dpk_,root_,icomm,request,info)
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
else if (collective_end) then
|
|
|
|
|
|
|
|
call mpi_wait(request,status,info)
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
end subroutine psb_dgather_v
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
subroutine psb_dgatherv_v(ctxt,dat,resv,szs,root,mode,request)
|
|
|
|
|
|
|
|
#ifdef MPI_MOD
|
|
|
|
|
|
|
|
use mpi
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
#ifdef MPI_H
|
|
|
|
|
|
|
|
include 'mpif.h'
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
type(psb_ctxt_type), intent(in) :: ctxt
|
|
|
|
|
|
|
|
real(psb_dpk_), intent(inout) :: dat(:), resv(:)
|
|
|
|
|
|
|
|
integer(psb_mpk_), intent(in), optional :: root
|
|
|
|
|
|
|
|
integer(psb_mpk_), intent(in), optional :: szs(:)
|
|
|
|
|
|
|
|
integer(psb_ipk_), intent(in), optional :: mode
|
|
|
|
|
|
|
|
integer(psb_mpk_), intent(inout), optional :: request
|
|
|
|
|
|
|
|
integer(psb_mpk_) :: root_
|
|
|
|
|
|
|
|
integer(psb_mpk_) :: iam, np, info,i
|
|
|
|
|
|
|
|
integer(psb_mpk_) :: icomm
|
|
|
|
|
|
|
|
integer(psb_mpk_) :: status(mpi_status_size)
|
|
|
|
|
|
|
|
integer(psb_mpk_), allocatable :: displs(:)
|
|
|
|
|
|
|
|
logical :: collective_start, collective_end, collective_sync
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if defined(SERIAL_MPI)
|
|
|
|
|
|
|
|
resv(0) = dat
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
call psb_info(ctxt,iam,np)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (present(root)) then
|
|
|
|
|
|
|
|
root_ = root
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
root_ = -1
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
icomm = psb_get_mpi_comm(ctxt)
|
|
|
|
|
|
|
|
if (present(mode)) then
|
|
|
|
|
|
|
|
collective_sync = .false.
|
|
|
|
|
|
|
|
collective_start = iand(mode,psb_collective_start_) /= 0
|
|
|
|
|
|
|
|
collective_end = iand(mode,psb_collective_end_) /= 0
|
|
|
|
|
|
|
|
if (.not.present(request)) then
|
|
|
|
|
|
|
|
collective_sync = .true.
|
|
|
|
|
|
|
|
collective_start = .false.
|
|
|
|
|
|
|
|
collective_end = .false.
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
collective_sync = .true.
|
|
|
|
|
|
|
|
collective_start = .false.
|
|
|
|
|
|
|
|
collective_end = .false.
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
if (collective_sync) then
|
|
|
|
|
|
|
|
if (root_ == -1) then
|
|
|
|
|
|
|
|
if (size(szs) < np) write(0,*) 'Error: bad input sizes'
|
|
|
|
|
|
|
|
allocate(displs(np))
|
|
|
|
|
|
|
|
displs(1) = 0
|
|
|
|
|
|
|
|
do i=2, np
|
|
|
|
|
|
|
|
displs(i) = displs(i-1) + szs(i-1)
|
|
|
|
|
|
|
|
end do
|
|
|
|
|
|
|
|
call mpi_allgatherv(dat,size(dat),psb_mpi_r_dpk_,&
|
|
|
|
|
|
|
|
& resv,szs,displs,psb_mpi_r_dpk_,icomm,info)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
if (iam == root_) then
|
|
|
|
|
|
|
|
if (size(szs) < np) write(0,*) 'Error: bad input sizes'
|
|
|
|
|
|
|
|
allocate(displs(np))
|
|
|
|
|
|
|
|
displs(1) = 0
|
|
|
|
|
|
|
|
do i=2, np
|
|
|
|
|
|
|
|
displs(i) = displs(i-1) + szs(i-1)
|
|
|
|
|
|
|
|
end do
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
allocate(displs(0))
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
call mpi_gatherv(dat,size(dat),psb_mpi_r_dpk_,&
|
|
|
|
|
|
|
|
& resv,szs,displs,psb_mpi_r_dpk_,root_,icomm,info)
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
if (collective_start) then
|
|
|
|
|
|
|
|
if (root_ == -1) then
|
|
|
|
|
|
|
|
if (size(szs) < np) write(0,*) 'Error: bad input sizes'
|
|
|
|
|
|
|
|
allocate(displs(np))
|
|
|
|
|
|
|
|
displs(1) = 0
|
|
|
|
|
|
|
|
do i=2, np
|
|
|
|
|
|
|
|
displs(i) = displs(i-1) + szs(i-1)
|
|
|
|
|
|
|
|
end do
|
|
|
|
|
|
|
|
call mpi_iallgatherv(dat,size(dat),psb_mpi_r_dpk_,&
|
|
|
|
|
|
|
|
& resv,szs,displs,psb_mpi_r_dpk_,icomm,request,info)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
if (iam == root_) then
|
|
|
|
|
|
|
|
if (size(szs) < np) write(0,*) 'Error: bad input sizes'
|
|
|
|
|
|
|
|
allocate(displs(np))
|
|
|
|
|
|
|
|
displs(1) = 0
|
|
|
|
|
|
|
|
do i=2, np
|
|
|
|
|
|
|
|
displs(i) = displs(i-1) + szs(i-1)
|
|
|
|
|
|
|
|
end do
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
allocate(displs(0))
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
call mpi_igatherv(dat,size(dat),psb_mpi_r_dpk_,&
|
|
|
|
|
|
|
|
& resv,szs,displs,psb_mpi_r_dpk_,root_,icomm,request,info)
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else if (collective_end) then
|
|
|
|
|
|
|
|
call mpi_wait(request,status,info)
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
end subroutine psb_dgatherv_v
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! SUM
|
|
|
|
! SUM
|
|
|
|
!
|
|
|
|
!
|
|
|
@ -684,20 +1016,30 @@ contains
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
if (collective_sync) then
|
|
|
|
if (collective_sync) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call mpi_allreduce(MPI_IN_PLACE,dat,1,&
|
|
|
|
call mpi_allreduce(mpi_in_place,dat,1,&
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,icomm,info)
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,icomm,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call mpi_reduce(MPI_IN_PLACE,dat,1,&
|
|
|
|
if(iam==root_) then
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,root_,icomm,info)
|
|
|
|
call mpi_reduce(mpi_in_place,dat,1,&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,root_,icomm,info)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call mpi_reduce(dat,dat,1,&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,root_,icomm,info)
|
|
|
|
|
|
|
|
end if
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
else
|
|
|
|
if (collective_start) then
|
|
|
|
if (collective_start) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call mpi_iallreduce(MPI_IN_PLACE,dat,1,&
|
|
|
|
call mpi_iallreduce(mpi_in_place,dat,1,&
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,icomm,request,info)
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,icomm,request,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call mpi_ireduce(MPI_IN_PLACE,dat,1,&
|
|
|
|
if(iam==root_) then
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,root_,icomm,request,info)
|
|
|
|
call mpi_ireduce(mpi_in_place,dat,1,&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,root_,icomm,request,info)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call mpi_ireduce(dat,dat,1,&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,root_,icomm,request,info)
|
|
|
|
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
else if (collective_end) then
|
|
|
|
else if (collective_end) then
|
|
|
|
call mpi_wait(request,status,info)
|
|
|
|
call mpi_wait(request,status,info)
|
|
|
@ -750,20 +1092,30 @@ contains
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
if (collective_sync) then
|
|
|
|
if (collective_sync) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call mpi_allreduce(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
call mpi_allreduce(mpi_in_place,dat,size(dat),&
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,icomm,info)
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,icomm,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call mpi_reduce(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
if(iam==root_) then
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,root_,icomm,info)
|
|
|
|
call mpi_reduce(mpi_in_place,dat,size(dat),&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,root_,icomm,info)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call mpi_reduce(dat,dat,size(dat),&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,root_,icomm,info)
|
|
|
|
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
else
|
|
|
|
else
|
|
|
|
if (collective_start) then
|
|
|
|
if (collective_start) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call mpi_iallreduce(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
call mpi_iallreduce(mpi_in_place,dat,size(dat),&
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,icomm,request,info)
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,icomm,request,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call mpi_ireduce(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
if(iam==root_) then
|
|
|
|
|
|
|
|
call mpi_ireduce(mpi_in_place,dat,size(dat),&
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,root_,icomm,request,info)
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,root_,icomm,request,info)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call mpi_ireduce(dat,dat,size(dat),&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,root_,icomm,request,info)
|
|
|
|
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
else if (collective_end) then
|
|
|
|
else if (collective_end) then
|
|
|
|
call mpi_wait(request,status,info)
|
|
|
|
call mpi_wait(request,status,info)
|
|
|
@ -818,20 +1170,30 @@ contains
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
if (collective_sync) then
|
|
|
|
if (collective_sync) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call mpi_allreduce(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
call mpi_allreduce(mpi_in_place,dat,size(dat),&
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,icomm,info)
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,icomm,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call mpi_reduce(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
if(iam==root_) then
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,root_,icomm,info)
|
|
|
|
call mpi_reduce(mpi_in_place,dat,size(dat),&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,root_,icomm,info)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call mpi_reduce(dat,dat,size(dat),&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,root_,icomm,info)
|
|
|
|
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
else
|
|
|
|
else
|
|
|
|
if (collective_start) then
|
|
|
|
if (collective_start) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call mpi_iallreduce(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
call mpi_iallreduce(mpi_in_place,dat,size(dat),&
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,icomm,request,info)
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,icomm,request,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call mpi_ireduce(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
if(iam==root_) then
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,root_, icomm,request,info)
|
|
|
|
call mpi_ireduce(mpi_in_place,dat,size(dat),&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,root_, icomm,request,info)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call mpi_ireduce(dat,dat,size(dat),&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,root_, icomm,request,info)
|
|
|
|
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
else if (collective_end) then
|
|
|
|
else if (collective_end) then
|
|
|
|
call mpi_wait(request,status,info)
|
|
|
|
call mpi_wait(request,status,info)
|
|
|
@ -888,20 +1250,30 @@ contains
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
if (collective_sync) then
|
|
|
|
if (collective_sync) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call mpi_allreduce(MPI_IN_PLACE,dat,1,&
|
|
|
|
call mpi_allreduce(mpi_in_place,dat,1,&
|
|
|
|
& psb_mpi_r_dpk_,mpi_damx_op,icomm,info)
|
|
|
|
& psb_mpi_r_dpk_,mpi_damx_op,icomm,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call mpi_reduce(MPI_IN_PLACE,dat,1,&
|
|
|
|
if(iam==root_) then
|
|
|
|
& psb_mpi_r_dpk_,mpi_damx_op,root_,icomm,info)
|
|
|
|
call mpi_reduce(mpi_in_place,dat,1,&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_damx_op,root_,icomm,info)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call mpi_reduce(dat,dat,1,&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_damx_op,root_,icomm,info)
|
|
|
|
|
|
|
|
end if
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
else
|
|
|
|
if (collective_start) then
|
|
|
|
if (collective_start) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call mpi_iallreduce(MPI_IN_PLACE,dat,1,&
|
|
|
|
call mpi_iallreduce(mpi_in_place,dat,1,&
|
|
|
|
& psb_mpi_r_dpk_,mpi_damx_op,icomm,request,info)
|
|
|
|
& psb_mpi_r_dpk_,mpi_damx_op,icomm,request,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call mpi_ireduce(MPI_IN_PLACE,dat,1,&
|
|
|
|
if(iam==root_) then
|
|
|
|
& psb_mpi_r_dpk_,mpi_damx_op,root_,icomm,request,info)
|
|
|
|
call mpi_ireduce(mpi_in_place,dat,1,&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_damx_op,root_,icomm,request,info)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call mpi_ireduce(dat,dat,1,&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_damx_op,root_,icomm,request,info)
|
|
|
|
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
else if (collective_end) then
|
|
|
|
else if (collective_end) then
|
|
|
|
call mpi_wait(request,status,info)
|
|
|
|
call mpi_wait(request,status,info)
|
|
|
@ -955,20 +1327,30 @@ contains
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
if (collective_sync) then
|
|
|
|
if (collective_sync) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call mpi_allreduce(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
call mpi_allreduce(mpi_in_place,dat,size(dat),&
|
|
|
|
psb_mpi_r_dpk_,mpi_damx_op,icomm,info)
|
|
|
|
psb_mpi_r_dpk_,mpi_damx_op,icomm,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call mpi_reduce(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
if(iam==root_) then
|
|
|
|
|
|
|
|
call mpi_reduce(mpi_in_place,dat,size(dat),&
|
|
|
|
& psb_mpi_r_dpk_,mpi_damx_op,root_,icomm,info)
|
|
|
|
& psb_mpi_r_dpk_,mpi_damx_op,root_,icomm,info)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call mpi_reduce(dat,dat,size(dat),&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_damx_op,root_,icomm,info)
|
|
|
|
|
|
|
|
end if
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
else
|
|
|
|
if (collective_start) then
|
|
|
|
if (collective_start) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call mpi_iallreduce(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
call mpi_iallreduce(mpi_in_place,dat,size(dat),&
|
|
|
|
& psb_mpi_r_dpk_,mpi_damx_op,icomm,request,info)
|
|
|
|
& psb_mpi_r_dpk_,mpi_damx_op,icomm,request,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call mpi_ireduce(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
if(iam==root_) then
|
|
|
|
& psb_mpi_r_dpk_,mpi_damx_op,root_,icomm,request,info)
|
|
|
|
call mpi_ireduce(mpi_in_place,dat,size(dat),&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_damx_op,root_,icomm,request,info)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call mpi_ireduce(dat,dat,size(dat),&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_damx_op,root_,icomm,request,info)
|
|
|
|
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
else if (collective_end) then
|
|
|
|
else if (collective_end) then
|
|
|
|
call mpi_wait(request,status,info)
|
|
|
|
call mpi_wait(request,status,info)
|
|
|
@ -1023,20 +1405,30 @@ contains
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
if (collective_sync) then
|
|
|
|
if (collective_sync) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call mpi_allreduce(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
call mpi_allreduce(mpi_in_place,dat,size(dat),&
|
|
|
|
& psb_mpi_r_dpk_,mpi_damx_op,icomm,info)
|
|
|
|
& psb_mpi_r_dpk_,mpi_damx_op,icomm,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call mpi_reduce(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
if(iam==root_) then
|
|
|
|
& psb_mpi_r_dpk_,mpi_damx_op,root_,icomm,info)
|
|
|
|
call mpi_reduce(mpi_in_place,dat,size(dat),&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_damx_op,root_,icomm,info)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call mpi_reduce(dat,dat,size(dat),&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_damx_op,root_,icomm,info)
|
|
|
|
|
|
|
|
end if
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
else
|
|
|
|
if (collective_start) then
|
|
|
|
if (collective_start) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call mpi_iallreduce(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
call mpi_iallreduce(mpi_in_place,dat,size(dat),&
|
|
|
|
& psb_mpi_r_dpk_,mpi_damx_op,icomm,request,info)
|
|
|
|
& psb_mpi_r_dpk_,mpi_damx_op,icomm,request,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call mpi_ireduce(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
if(iam==root_) then
|
|
|
|
|
|
|
|
call mpi_ireduce(mpi_in_place,dat,size(dat),&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_damx_op,root_,icomm,request,info)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call mpi_ireduce(dat,dat,size(dat),&
|
|
|
|
& psb_mpi_r_dpk_,mpi_damx_op,root_,icomm,request,info)
|
|
|
|
& psb_mpi_r_dpk_,mpi_damx_op,root_,icomm,request,info)
|
|
|
|
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
else if (collective_end) then
|
|
|
|
else if (collective_end) then
|
|
|
|
call mpi_wait(request,status,info)
|
|
|
|
call mpi_wait(request,status,info)
|
|
|
@ -1092,20 +1484,30 @@ contains
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
if (collective_sync) then
|
|
|
|
if (collective_sync) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call mpi_allreduce(MPI_IN_PLACE,dat,1,&
|
|
|
|
call mpi_allreduce(mpi_in_place,dat,1,&
|
|
|
|
& psb_mpi_r_dpk_,mpi_damn_op,icomm,info)
|
|
|
|
& psb_mpi_r_dpk_,mpi_damn_op,icomm,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call mpi_reduce(MPI_IN_PLACE,dat,1,&
|
|
|
|
if(iam==root_) then
|
|
|
|
& psb_mpi_r_dpk_,mpi_damn_op,root_,icomm,info)
|
|
|
|
call mpi_reduce(mpi_in_place,dat,1,&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_damn_op,root_,icomm,info)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call mpi_reduce(dat,dat,1,&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_damn_op,root_,icomm,info)
|
|
|
|
|
|
|
|
end if
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
else
|
|
|
|
if (collective_start) then
|
|
|
|
if (collective_start) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call mpi_iallreduce(MPI_IN_PLACE,dat,1,&
|
|
|
|
call mpi_iallreduce(mpi_in_place,dat,1,&
|
|
|
|
& psb_mpi_r_dpk_,mpi_damn_op,icomm,request,info)
|
|
|
|
& psb_mpi_r_dpk_,mpi_damn_op,icomm,request,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call mpi_ireduce(MPI_IN_PLACE,dat,1,&
|
|
|
|
if(iam==root_) then
|
|
|
|
& psb_mpi_r_dpk_,mpi_damn_op,root_,icomm,request,info)
|
|
|
|
call mpi_ireduce(mpi_in_place,dat,1,&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_damn_op,root_,icomm,request,info)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call mpi_ireduce(dat,dat,1,&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_damn_op,root_,icomm,request,info)
|
|
|
|
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
else if (collective_end) then
|
|
|
|
else if (collective_end) then
|
|
|
|
call mpi_wait(request,status,info)
|
|
|
|
call mpi_wait(request,status,info)
|
|
|
@ -1159,20 +1561,30 @@ contains
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
if (collective_sync) then
|
|
|
|
if (collective_sync) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call mpi_allreduce(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
call mpi_allreduce(mpi_in_place,dat,size(dat),&
|
|
|
|
& psb_mpi_r_dpk_,mpi_damn_op,icomm,info)
|
|
|
|
& psb_mpi_r_dpk_,mpi_damn_op,icomm,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call mpi_reduce(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
if(iam==root_) then
|
|
|
|
|
|
|
|
call mpi_reduce(mpi_in_place,dat,size(dat),&
|
|
|
|
& psb_mpi_r_dpk_,mpi_damn_op,root_,icomm,info)
|
|
|
|
& psb_mpi_r_dpk_,mpi_damn_op,root_,icomm,info)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call mpi_reduce(dat,dat,size(dat),&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_damn_op,root_,icomm,info)
|
|
|
|
|
|
|
|
end if
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
else
|
|
|
|
if (collective_start) then
|
|
|
|
if (collective_start) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call mpi_iallreduce(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
call mpi_iallreduce(mpi_in_place,dat,size(dat),&
|
|
|
|
& psb_mpi_r_dpk_,mpi_damn_op,icomm,request,info)
|
|
|
|
& psb_mpi_r_dpk_,mpi_damn_op,icomm,request,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call mpi_ireduce(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
if(iam==root_) then
|
|
|
|
& psb_mpi_r_dpk_,mpi_damn_op,root_,icomm,request,info)
|
|
|
|
call mpi_ireduce(mpi_in_place,dat,size(dat),&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_damn_op,root_,icomm,request,info)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call mpi_ireduce(dat,dat,size(dat),&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_damn_op,root_,icomm,request,info)
|
|
|
|
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
else if (collective_end) then
|
|
|
|
else if (collective_end) then
|
|
|
|
call mpi_wait(request,status,info)
|
|
|
|
call mpi_wait(request,status,info)
|
|
|
@ -1227,20 +1639,30 @@ contains
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
if (collective_sync) then
|
|
|
|
if (collective_sync) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call mpi_allreduce(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
call mpi_allreduce(mpi_in_place,dat,size(dat),&
|
|
|
|
& psb_mpi_r_dpk_,mpi_damn_op,icomm,info)
|
|
|
|
& psb_mpi_r_dpk_,mpi_damn_op,icomm,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call mpi_reduce(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
if(iam==root_) then
|
|
|
|
& psb_mpi_r_dpk_,mpi_damn_op,root_,icomm,info)
|
|
|
|
call mpi_reduce(mpi_in_place,dat,size(dat),&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_damn_op,root_,icomm,info)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call mpi_reduce(dat,dat,size(dat),&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_damn_op,root_,icomm,info)
|
|
|
|
|
|
|
|
end if
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
else
|
|
|
|
if (collective_start) then
|
|
|
|
if (collective_start) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call mpi_iallreduce(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
call mpi_iallreduce(mpi_in_place,dat,size(dat),&
|
|
|
|
& psb_mpi_r_dpk_,mpi_damn_op,icomm,request,info)
|
|
|
|
& psb_mpi_r_dpk_,mpi_damn_op,icomm,request,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call mpi_ireduce(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
if(iam==root_) then
|
|
|
|
& psb_mpi_r_dpk_,mpi_damn_op,root_,icomm,request,info)
|
|
|
|
call mpi_ireduce(mpi_in_place,dat,size(dat),&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_damn_op,root_,icomm,request,info)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call mpi_ireduce(dat,dat,size(dat),&
|
|
|
|
|
|
|
|
& psb_mpi_r_dpk_,mpi_damn_op,root_,icomm,request,info)
|
|
|
|
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
else if (collective_end) then
|
|
|
|
else if (collective_end) then
|
|
|
|
call mpi_wait(request,status,info)
|
|
|
|
call mpi_wait(request,status,info)
|
|
|
@ -1461,12 +1883,13 @@ contains
|
|
|
|
collective_start = .false.
|
|
|
|
collective_start = .false.
|
|
|
|
collective_end = .false.
|
|
|
|
collective_end = .false.
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
dat_ = dat
|
|
|
|
if (collective_sync) then
|
|
|
|
if (collective_sync) then
|
|
|
|
call mpi_scan(MPI_IN_PLACE,dat,1,&
|
|
|
|
call mpi_scan(dat_,dat,1,&
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,icomm,minfo)
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,icomm,minfo)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
if (collective_start) then
|
|
|
|
if (collective_start) then
|
|
|
|
call mpi_iscan(MPI_IN_PLACE,dat,1,&
|
|
|
|
call mpi_iscan(dat_,dat,1,&
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,icomm,request,minfo)
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,icomm,request,minfo)
|
|
|
|
else if (collective_end) then
|
|
|
|
else if (collective_end) then
|
|
|
|
call mpi_wait(request,status,minfo)
|
|
|
|
call mpi_wait(request,status,minfo)
|
|
|
@ -1512,12 +1935,13 @@ contains
|
|
|
|
collective_start = .false.
|
|
|
|
collective_start = .false.
|
|
|
|
collective_end = .false.
|
|
|
|
collective_end = .false.
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
dat_ = dat
|
|
|
|
if (collective_sync) then
|
|
|
|
if (collective_sync) then
|
|
|
|
call mpi_exscan(MPI_IN_PLACE,dat,1,&
|
|
|
|
call mpi_exscan(dat_,dat,1,&
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,icomm,minfo)
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,icomm,minfo)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
if (collective_start) then
|
|
|
|
if (collective_start) then
|
|
|
|
call mpi_iexscan(MPI_IN_PLACE,dat,1,&
|
|
|
|
call mpi_iexscan(dat_,dat,1,&
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,icomm,request,minfo)
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,icomm,request,minfo)
|
|
|
|
else if (collective_end) then
|
|
|
|
else if (collective_end) then
|
|
|
|
call mpi_wait(request,status,minfo)
|
|
|
|
call mpi_wait(request,status,minfo)
|
|
|
@ -1540,12 +1964,13 @@ contains
|
|
|
|
real(psb_dpk_), intent(inout) :: dat(:)
|
|
|
|
real(psb_dpk_), intent(inout) :: dat(:)
|
|
|
|
integer(psb_ipk_), intent(in), optional :: mode
|
|
|
|
integer(psb_ipk_), intent(in), optional :: mode
|
|
|
|
integer(psb_mpk_), intent(inout), optional :: request
|
|
|
|
integer(psb_mpk_), intent(inout), optional :: request
|
|
|
|
|
|
|
|
|
|
|
|
integer(psb_ipk_) :: iam, np, info
|
|
|
|
integer(psb_ipk_) :: iam, np, info
|
|
|
|
integer(psb_mpk_) :: minfo
|
|
|
|
integer(psb_mpk_) :: minfo
|
|
|
|
integer(psb_mpk_) :: icomm
|
|
|
|
integer(psb_mpk_) :: icomm
|
|
|
|
integer(psb_mpk_) :: status(mpi_status_size)
|
|
|
|
integer(psb_mpk_) :: status(mpi_status_size)
|
|
|
|
logical :: collective_start, collective_end, collective_sync
|
|
|
|
logical :: collective_start, collective_end, collective_sync
|
|
|
|
|
|
|
|
real(psb_dpk_), allocatable :: dat_(:)
|
|
|
|
#if !defined(SERIAL_MPI)
|
|
|
|
#if !defined(SERIAL_MPI)
|
|
|
|
call psb_info(ctxt,iam,np)
|
|
|
|
call psb_info(ctxt,iam,np)
|
|
|
|
icomm = psb_get_mpi_comm(ctxt)
|
|
|
|
icomm = psb_get_mpi_comm(ctxt)
|
|
|
@ -1563,12 +1988,13 @@ contains
|
|
|
|
collective_start = .false.
|
|
|
|
collective_start = .false.
|
|
|
|
collective_end = .false.
|
|
|
|
collective_end = .false.
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
dat_ = dat
|
|
|
|
if (collective_sync) then
|
|
|
|
if (collective_sync) then
|
|
|
|
call mpi_scan(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
call mpi_scan(dat_,dat,size(dat),&
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,icomm,minfo)
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,icomm,minfo)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
if (collective_start) then
|
|
|
|
if (collective_start) then
|
|
|
|
call mpi_iscan(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
call mpi_iscan(dat_,dat,size(dat),&
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,icomm,request,info)
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,icomm,request,info)
|
|
|
|
else if (collective_end) then
|
|
|
|
else if (collective_end) then
|
|
|
|
call mpi_wait(request,status,info)
|
|
|
|
call mpi_wait(request,status,info)
|
|
|
@ -1589,12 +2015,13 @@ contains
|
|
|
|
real(psb_dpk_), intent(inout) :: dat(:)
|
|
|
|
real(psb_dpk_), intent(inout) :: dat(:)
|
|
|
|
integer(psb_ipk_), intent(in), optional :: mode
|
|
|
|
integer(psb_ipk_), intent(in), optional :: mode
|
|
|
|
integer(psb_mpk_), intent(inout), optional :: request
|
|
|
|
integer(psb_mpk_), intent(inout), optional :: request
|
|
|
|
real(psb_dpk_), allocatable :: dat_(:)
|
|
|
|
|
|
|
|
integer(psb_ipk_) :: iam, np, info
|
|
|
|
integer(psb_ipk_) :: iam, np, info
|
|
|
|
integer(psb_mpk_) :: minfo
|
|
|
|
integer(psb_mpk_) :: minfo
|
|
|
|
integer(psb_mpk_) :: icomm
|
|
|
|
integer(psb_mpk_) :: icomm
|
|
|
|
integer(psb_mpk_) :: status(mpi_status_size)
|
|
|
|
integer(psb_mpk_) :: status(mpi_status_size)
|
|
|
|
logical :: collective_start, collective_end, collective_sync
|
|
|
|
logical :: collective_start, collective_end, collective_sync
|
|
|
|
|
|
|
|
real(psb_dpk_), allocatable :: dat_(:)
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(SERIAL_MPI)
|
|
|
|
#if !defined(SERIAL_MPI)
|
|
|
|
call psb_info(ctxt,iam,np)
|
|
|
|
call psb_info(ctxt,iam,np)
|
|
|
@ -1613,12 +2040,13 @@ contains
|
|
|
|
collective_start = .false.
|
|
|
|
collective_start = .false.
|
|
|
|
collective_end = .false.
|
|
|
|
collective_end = .false.
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
dat_ = dat
|
|
|
|
if (collective_sync) then
|
|
|
|
if (collective_sync) then
|
|
|
|
call mpi_exscan(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
call mpi_exscan(dat_,dat,size(dat),&
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,icomm,minfo)
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,icomm,minfo)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
if (collective_start) then
|
|
|
|
if (collective_start) then
|
|
|
|
call mpi_iexscan(MPI_IN_PLACE,dat,size(dat),&
|
|
|
|
call mpi_iexscan(dat_,dat,size(dat),&
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,icomm,request,info)
|
|
|
|
& psb_mpi_r_dpk_,mpi_sum,icomm,request,info)
|
|
|
|
else if (collective_end) then
|
|
|
|
else if (collective_end) then
|
|
|
|
call mpi_wait(request,status,info)
|
|
|
|
call mpi_wait(request,status,info)
|
|
|
@ -1831,6 +2259,5 @@ contains
|
|
|
|
Enddo
|
|
|
|
Enddo
|
|
|
|
|
|
|
|
|
|
|
|
end subroutine psb_d_e_simple_triad_a2av
|
|
|
|
end subroutine psb_d_e_simple_triad_a2av
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end module psi_d_collective_mod
|
|
|
|
end module psi_d_collective_mod
|
|
|
|