|
|
@ -31,28 +31,22 @@
|
|
|
|
!
|
|
|
|
!
|
|
|
|
module psi_c_collective_mod
|
|
|
|
module psi_c_collective_mod
|
|
|
|
use psi_penv_mod
|
|
|
|
use psi_penv_mod
|
|
|
|
use psi_comm_buffers_mod
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
interface psb_sum
|
|
|
|
interface psb_sum
|
|
|
|
module procedure psb_csums, psb_csumv, psb_csumm, &
|
|
|
|
module procedure psb_csums, psb_csumv, psb_csumm
|
|
|
|
& psb_csums_ec, psb_csumv_ec, psb_csumm_ec
|
|
|
|
|
|
|
|
end interface
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
|
|
interface psb_amx
|
|
|
|
interface psb_amx
|
|
|
|
module procedure psb_camxs, psb_camxv, psb_camxm, &
|
|
|
|
module procedure psb_camxs, psb_camxv, psb_camxm
|
|
|
|
& psb_camxs_ec, psb_camxv_ec, psb_camxm_ec
|
|
|
|
|
|
|
|
end interface
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
|
|
interface psb_amn
|
|
|
|
interface psb_amn
|
|
|
|
module procedure psb_camns, psb_camnv, psb_camnm, &
|
|
|
|
module procedure psb_camns, psb_camnv, psb_camnm
|
|
|
|
& psb_camns_ec, psb_camnv_ec, psb_camnm_ec
|
|
|
|
|
|
|
|
end interface
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
interface psb_bcast
|
|
|
|
interface psb_bcast
|
|
|
|
module procedure psb_cbcasts, psb_cbcastv, psb_cbcastm, &
|
|
|
|
module procedure psb_cbcasts, psb_cbcastv, psb_cbcastm
|
|
|
|
& psb_cbcasts_ec, psb_cbcastv_ec, psb_cbcastm_ec
|
|
|
|
|
|
|
|
end interface psb_bcast
|
|
|
|
end interface psb_bcast
|
|
|
|
|
|
|
|
|
|
|
|
interface psb_scan_sum
|
|
|
|
interface psb_scan_sum
|
|
|
@ -71,7 +65,6 @@ module psi_c_collective_mod
|
|
|
|
module procedure psb_c_e_simple_triad_a2av, psb_c_m_simple_triad_a2av
|
|
|
|
module procedure psb_c_e_simple_triad_a2av, psb_c_m_simple_triad_a2av
|
|
|
|
end interface psb_simple_triad_a2av
|
|
|
|
end interface psb_simple_triad_a2av
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
contains
|
|
|
|
contains
|
|
|
|
|
|
|
|
|
|
|
|
! !!!!!!!!!!!!!!!!!!!!!!
|
|
|
|
! !!!!!!!!!!!!!!!!!!!!!!
|
|
|
@ -94,15 +87,14 @@ contains
|
|
|
|
#ifdef MPI_H
|
|
|
|
#ifdef MPI_H
|
|
|
|
include 'mpif.h'
|
|
|
|
include 'mpif.h'
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
integer(psb_mpk_), intent(in) :: ictxt
|
|
|
|
type(psb_ctxt_type), intent(in) :: ictxt
|
|
|
|
complex(psb_spk_), intent(inout) :: dat
|
|
|
|
complex(psb_spk_), intent(inout) :: dat
|
|
|
|
integer(psb_mpk_), intent(in), optional :: root
|
|
|
|
integer(psb_mpk_), intent(in), optional :: root
|
|
|
|
integer(psb_mpk_) :: root_
|
|
|
|
integer(psb_mpk_) :: root_
|
|
|
|
complex(psb_spk_) :: dat_
|
|
|
|
complex(psb_spk_) :: dat_
|
|
|
|
integer(psb_mpk_) :: iam, np, info
|
|
|
|
integer(psb_mpk_) :: iam, np, info, icomm
|
|
|
|
integer(psb_ipk_) :: iinfo
|
|
|
|
integer(psb_ipk_) :: iinfo
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(SERIAL_MPI)
|
|
|
|
#if !defined(SERIAL_MPI)
|
|
|
|
call psb_info(ictxt,iam,np)
|
|
|
|
call psb_info(ictxt,iam,np)
|
|
|
|
|
|
|
|
|
|
|
@ -111,11 +103,12 @@ contains
|
|
|
|
else
|
|
|
|
else
|
|
|
|
root_ = -1
|
|
|
|
root_ = -1
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
icomm = psb_get_mpi_comm(ictxt)
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call mpi_allreduce(dat,dat_,1,psb_mpi_c_spk_,mpi_sum,ictxt,info)
|
|
|
|
call mpi_allreduce(dat,dat_,1,psb_mpi_c_spk_,mpi_sum,icomm,info)
|
|
|
|
dat = dat_
|
|
|
|
dat = dat_
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call mpi_reduce(dat,dat_,1,psb_mpi_c_spk_,mpi_sum,root_,ictxt,info)
|
|
|
|
call mpi_reduce(dat,dat_,1,psb_mpi_c_spk_,mpi_sum,root_,icomm,info)
|
|
|
|
if (iam == root_) dat = dat_
|
|
|
|
if (iam == root_) dat = dat_
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -130,15 +123,14 @@ contains
|
|
|
|
#ifdef MPI_H
|
|
|
|
#ifdef MPI_H
|
|
|
|
include 'mpif.h'
|
|
|
|
include 'mpif.h'
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
integer(psb_mpk_), intent(in) :: ictxt
|
|
|
|
type(psb_ctxt_type), intent(in) :: ictxt
|
|
|
|
complex(psb_spk_), intent(inout) :: dat(:)
|
|
|
|
complex(psb_spk_), intent(inout) :: dat(:)
|
|
|
|
integer(psb_mpk_), intent(in), optional :: root
|
|
|
|
integer(psb_mpk_), intent(in), optional :: root
|
|
|
|
integer(psb_mpk_) :: root_
|
|
|
|
integer(psb_mpk_) :: root_
|
|
|
|
complex(psb_spk_), allocatable :: dat_(:)
|
|
|
|
complex(psb_spk_), allocatable :: dat_(:)
|
|
|
|
integer(psb_mpk_) :: iam, np, info
|
|
|
|
integer(psb_mpk_) :: iam, np, info, icomm
|
|
|
|
integer(psb_ipk_) :: iinfo
|
|
|
|
integer(psb_ipk_) :: iinfo
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(SERIAL_MPI)
|
|
|
|
#if !defined(SERIAL_MPI)
|
|
|
|
call psb_info(ictxt,iam,np)
|
|
|
|
call psb_info(ictxt,iam,np)
|
|
|
|
|
|
|
|
|
|
|
@ -147,19 +139,20 @@ contains
|
|
|
|
else
|
|
|
|
else
|
|
|
|
root_ = -1
|
|
|
|
root_ = -1
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
icomm = psb_get_mpi_comm(ictxt)
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call psb_realloc(size(dat),dat_,iinfo)
|
|
|
|
call psb_realloc(size(dat),dat_,iinfo)
|
|
|
|
dat_ = dat
|
|
|
|
dat_ = dat
|
|
|
|
if (iinfo == psb_success_) &
|
|
|
|
if (iinfo == psb_success_) &
|
|
|
|
& call mpi_allreduce(dat_,dat,size(dat),psb_mpi_c_spk_,mpi_sum,ictxt,info)
|
|
|
|
& call mpi_allreduce(dat_,dat,size(dat),psb_mpi_c_spk_,mpi_sum,icomm,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
if (iam == root_) then
|
|
|
|
if (iam == root_) then
|
|
|
|
call psb_realloc(size(dat),dat_,iinfo)
|
|
|
|
call psb_realloc(size(dat),dat_,iinfo)
|
|
|
|
dat_ = dat
|
|
|
|
dat_ = dat
|
|
|
|
call mpi_reduce(dat_,dat,size(dat),psb_mpi_c_spk_,mpi_sum,root_,ictxt,info)
|
|
|
|
call mpi_reduce(dat_,dat,size(dat),psb_mpi_c_spk_,mpi_sum,root_,icomm,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call psb_realloc(1,dat_,iinfo)
|
|
|
|
call psb_realloc(1,dat_,iinfo)
|
|
|
|
call mpi_reduce(dat,dat_,size(dat),psb_mpi_c_spk_,mpi_sum,root_,ictxt,info)
|
|
|
|
call mpi_reduce(dat,dat_,size(dat),psb_mpi_c_spk_,mpi_sum,root_,icomm,info)
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -174,12 +167,12 @@ contains
|
|
|
|
#ifdef MPI_H
|
|
|
|
#ifdef MPI_H
|
|
|
|
include 'mpif.h'
|
|
|
|
include 'mpif.h'
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
integer(psb_mpk_), intent(in) :: ictxt
|
|
|
|
type(psb_ctxt_type), intent(in) :: ictxt
|
|
|
|
complex(psb_spk_), intent(inout) :: dat(:,:)
|
|
|
|
complex(psb_spk_), intent(inout) :: dat(:,:)
|
|
|
|
integer(psb_mpk_), intent(in), optional :: root
|
|
|
|
integer(psb_mpk_), intent(in), optional :: root
|
|
|
|
integer(psb_mpk_) :: root_
|
|
|
|
integer(psb_mpk_) :: root_
|
|
|
|
complex(psb_spk_), allocatable :: dat_(:,:)
|
|
|
|
complex(psb_spk_), allocatable :: dat_(:,:)
|
|
|
|
integer(psb_mpk_) :: iam, np, info
|
|
|
|
integer(psb_mpk_) :: iam, np, info, icomm
|
|
|
|
integer(psb_ipk_) :: iinfo
|
|
|
|
integer(psb_ipk_) :: iinfo
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(SERIAL_MPI)
|
|
|
|
#if !defined(SERIAL_MPI)
|
|
|
@ -191,73 +184,25 @@ contains
|
|
|
|
else
|
|
|
|
else
|
|
|
|
root_ = -1
|
|
|
|
root_ = -1
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
icomm = psb_get_mpi_comm(ictxt)
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call psb_realloc(size(dat,1),size(dat,2),dat_,iinfo)
|
|
|
|
call psb_realloc(size(dat,1),size(dat,2),dat_,iinfo)
|
|
|
|
dat_ = dat
|
|
|
|
dat_ = dat
|
|
|
|
if (iinfo == psb_success_)&
|
|
|
|
if (iinfo == psb_success_)&
|
|
|
|
& call mpi_allreduce(dat_,dat,size(dat),psb_mpi_c_spk_,mpi_sum,ictxt,info)
|
|
|
|
& call mpi_allreduce(dat_,dat,size(dat),psb_mpi_c_spk_,mpi_sum,icomm,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
if (iam == root_) then
|
|
|
|
if (iam == root_) then
|
|
|
|
call psb_realloc(size(dat,1),size(dat,2),dat_,iinfo)
|
|
|
|
call psb_realloc(size(dat,1),size(dat,2),dat_,iinfo)
|
|
|
|
dat_ = dat
|
|
|
|
dat_ = dat
|
|
|
|
call mpi_reduce(dat_,dat,size(dat),psb_mpi_c_spk_,mpi_sum,root_,ictxt,info)
|
|
|
|
call mpi_reduce(dat_,dat,size(dat),psb_mpi_c_spk_,mpi_sum,root_,icomm,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call psb_realloc(1,1,dat_,iinfo)
|
|
|
|
call psb_realloc(1,1,dat_,iinfo)
|
|
|
|
call mpi_reduce(dat,dat_,size(dat),psb_mpi_c_spk_,mpi_sum,root_,ictxt,info)
|
|
|
|
call mpi_reduce(dat,dat_,size(dat),psb_mpi_c_spk_,mpi_sum,root_,icomm,info)
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
end subroutine psb_csumm
|
|
|
|
end subroutine psb_csumm
|
|
|
|
|
|
|
|
|
|
|
|
subroutine psb_csums_ec(ictxt,dat,root)
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
integer(psb_epk_), intent(in) :: ictxt
|
|
|
|
|
|
|
|
complex(psb_spk_), intent(inout) :: dat
|
|
|
|
|
|
|
|
integer(psb_epk_), intent(in), optional :: root
|
|
|
|
|
|
|
|
integer(psb_mpk_) :: ictxt_, root_
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ictxt_ = ictxt
|
|
|
|
|
|
|
|
if (present(root)) then
|
|
|
|
|
|
|
|
root_ = root
|
|
|
|
|
|
|
|
call psb_sum(ictxt_,dat,root_)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call psb_sum(ictxt_,dat)
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
end subroutine psb_csums_ec
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
subroutine psb_csumv_ec(ictxt,dat,root)
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
integer(psb_epk_), intent(in) :: ictxt
|
|
|
|
|
|
|
|
complex(psb_spk_), intent(inout) :: dat(:)
|
|
|
|
|
|
|
|
integer(psb_epk_), intent(in), optional :: root
|
|
|
|
|
|
|
|
integer(psb_mpk_) :: ictxt_, root_
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ictxt_ = ictxt
|
|
|
|
|
|
|
|
if (present(root)) then
|
|
|
|
|
|
|
|
root_ = root
|
|
|
|
|
|
|
|
call psb_sum(ictxt_,dat,root_)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call psb_sum(ictxt_,dat)
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
end subroutine psb_csumv_ec
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
subroutine psb_csumm_ec(ictxt,dat,root)
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
integer(psb_epk_), intent(in) :: ictxt
|
|
|
|
|
|
|
|
complex(psb_spk_), intent(inout) :: dat(:,:)
|
|
|
|
|
|
|
|
integer(psb_epk_), intent(in), optional :: root
|
|
|
|
|
|
|
|
integer(psb_mpk_) :: ictxt_, root_
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ictxt_ = ictxt
|
|
|
|
|
|
|
|
if (present(root)) then
|
|
|
|
|
|
|
|
root_ = root
|
|
|
|
|
|
|
|
call psb_sum(ictxt_,dat,root_)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call psb_sum(ictxt_,dat)
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
end subroutine psb_csumm_ec
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! AMX: Maximum Absolute Value
|
|
|
|
! AMX: Maximum Absolute Value
|
|
|
|
!
|
|
|
|
!
|
|
|
@ -270,15 +215,14 @@ contains
|
|
|
|
#ifdef MPI_H
|
|
|
|
#ifdef MPI_H
|
|
|
|
include 'mpif.h'
|
|
|
|
include 'mpif.h'
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
integer(psb_mpk_), intent(in) :: ictxt
|
|
|
|
type(psb_ctxt_type), intent(in) :: ictxt
|
|
|
|
complex(psb_spk_), intent(inout) :: dat
|
|
|
|
complex(psb_spk_), intent(inout) :: dat
|
|
|
|
integer(psb_mpk_), intent(in), optional :: root
|
|
|
|
integer(psb_mpk_), intent(in), optional :: root
|
|
|
|
integer(psb_mpk_) :: root_
|
|
|
|
integer(psb_mpk_) :: root_
|
|
|
|
complex(psb_spk_) :: dat_
|
|
|
|
complex(psb_spk_) :: dat_
|
|
|
|
integer(psb_mpk_) :: iam, np, info
|
|
|
|
integer(psb_mpk_) :: iam, np, info, icomm
|
|
|
|
integer(psb_ipk_) :: iinfo
|
|
|
|
integer(psb_ipk_) :: iinfo
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(SERIAL_MPI)
|
|
|
|
#if !defined(SERIAL_MPI)
|
|
|
|
call psb_info(ictxt,iam,np)
|
|
|
|
call psb_info(ictxt,iam,np)
|
|
|
|
|
|
|
|
|
|
|
@ -287,11 +231,12 @@ contains
|
|
|
|
else
|
|
|
|
else
|
|
|
|
root_ = -1
|
|
|
|
root_ = -1
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
icomm = psb_get_mpi_comm(ictxt)
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call mpi_allreduce(dat,dat_,1,psb_mpi_c_spk_,mpi_camx_op,ictxt,info)
|
|
|
|
call mpi_allreduce(dat,dat_,1,psb_mpi_c_spk_,mpi_camx_op,icomm,info)
|
|
|
|
dat = dat_
|
|
|
|
dat = dat_
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call mpi_reduce(dat,dat_,1,psb_mpi_c_spk_,mpi_camx_op,root_,ictxt,info)
|
|
|
|
call mpi_reduce(dat,dat_,1,psb_mpi_c_spk_,mpi_camx_op,root_,icomm,info)
|
|
|
|
if (iam == root_) dat = dat_
|
|
|
|
if (iam == root_) dat = dat_
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -306,15 +251,14 @@ contains
|
|
|
|
#ifdef MPI_H
|
|
|
|
#ifdef MPI_H
|
|
|
|
include 'mpif.h'
|
|
|
|
include 'mpif.h'
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
integer(psb_mpk_), intent(in) :: ictxt
|
|
|
|
type(psb_ctxt_type), intent(in) :: ictxt
|
|
|
|
complex(psb_spk_), intent(inout) :: dat(:)
|
|
|
|
complex(psb_spk_), intent(inout) :: dat(:)
|
|
|
|
integer(psb_mpk_), intent(in), optional :: root
|
|
|
|
integer(psb_mpk_), intent(in), optional :: root
|
|
|
|
integer(psb_mpk_) :: root_
|
|
|
|
integer(psb_mpk_) :: root_
|
|
|
|
complex(psb_spk_), allocatable :: dat_(:)
|
|
|
|
complex(psb_spk_), allocatable :: dat_(:)
|
|
|
|
integer(psb_mpk_) :: iam, np, info
|
|
|
|
integer(psb_mpk_) :: iam, np, info, icomm
|
|
|
|
integer(psb_ipk_) :: iinfo
|
|
|
|
integer(psb_ipk_) :: iinfo
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(SERIAL_MPI)
|
|
|
|
#if !defined(SERIAL_MPI)
|
|
|
|
call psb_info(ictxt,iam,np)
|
|
|
|
call psb_info(ictxt,iam,np)
|
|
|
|
|
|
|
|
|
|
|
@ -323,19 +267,20 @@ contains
|
|
|
|
else
|
|
|
|
else
|
|
|
|
root_ = -1
|
|
|
|
root_ = -1
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
icomm = psb_get_mpi_comm(ictxt)
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call psb_realloc(size(dat),dat_,iinfo)
|
|
|
|
call psb_realloc(size(dat),dat_,iinfo)
|
|
|
|
dat_ = dat
|
|
|
|
dat_ = dat
|
|
|
|
if (iinfo == psb_success_) &
|
|
|
|
if (iinfo == psb_success_) &
|
|
|
|
& call mpi_allreduce(dat_,dat,size(dat),psb_mpi_c_spk_,mpi_camx_op,ictxt,info)
|
|
|
|
& call mpi_allreduce(dat_,dat,size(dat),psb_mpi_c_spk_,mpi_camx_op,icomm,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
if (iam == root_) then
|
|
|
|
if (iam == root_) then
|
|
|
|
call psb_realloc(size(dat),dat_,iinfo)
|
|
|
|
call psb_realloc(size(dat),dat_,iinfo)
|
|
|
|
dat_ = dat
|
|
|
|
dat_ = dat
|
|
|
|
call mpi_reduce(dat_,dat,size(dat),psb_mpi_c_spk_,mpi_camx_op,root_,ictxt,info)
|
|
|
|
call mpi_reduce(dat_,dat,size(dat),psb_mpi_c_spk_,mpi_camx_op,root_,icomm,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call psb_realloc(1,dat_,iinfo)
|
|
|
|
call psb_realloc(1,dat_,iinfo)
|
|
|
|
call mpi_reduce(dat,dat_,size(dat),psb_mpi_c_spk_,mpi_camx_op,root_,ictxt,info)
|
|
|
|
call mpi_reduce(dat,dat_,size(dat),psb_mpi_c_spk_,mpi_camx_op,root_,icomm,info)
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -350,12 +295,12 @@ contains
|
|
|
|
#ifdef MPI_H
|
|
|
|
#ifdef MPI_H
|
|
|
|
include 'mpif.h'
|
|
|
|
include 'mpif.h'
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
integer(psb_mpk_), intent(in) :: ictxt
|
|
|
|
type(psb_ctxt_type), intent(in) :: ictxt
|
|
|
|
complex(psb_spk_), intent(inout) :: dat(:,:)
|
|
|
|
complex(psb_spk_), intent(inout) :: dat(:,:)
|
|
|
|
integer(psb_mpk_), intent(in), optional :: root
|
|
|
|
integer(psb_mpk_), intent(in), optional :: root
|
|
|
|
integer(psb_mpk_) :: root_
|
|
|
|
integer(psb_mpk_) :: root_
|
|
|
|
complex(psb_spk_), allocatable :: dat_(:,:)
|
|
|
|
complex(psb_spk_), allocatable :: dat_(:,:)
|
|
|
|
integer(psb_mpk_) :: iam, np, info
|
|
|
|
integer(psb_mpk_) :: iam, np, info, icomm
|
|
|
|
integer(psb_ipk_) :: iinfo
|
|
|
|
integer(psb_ipk_) :: iinfo
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(SERIAL_MPI)
|
|
|
|
#if !defined(SERIAL_MPI)
|
|
|
@ -367,74 +312,25 @@ contains
|
|
|
|
else
|
|
|
|
else
|
|
|
|
root_ = -1
|
|
|
|
root_ = -1
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
icomm = psb_get_mpi_comm(ictxt)
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call psb_realloc(size(dat,1),size(dat,2),dat_,iinfo)
|
|
|
|
call psb_realloc(size(dat,1),size(dat,2),dat_,iinfo)
|
|
|
|
dat_ = dat
|
|
|
|
dat_ = dat
|
|
|
|
if (iinfo == psb_success_)&
|
|
|
|
if (iinfo == psb_success_)&
|
|
|
|
& call mpi_allreduce(dat_,dat,size(dat),psb_mpi_c_spk_,mpi_camx_op,ictxt,info)
|
|
|
|
& call mpi_allreduce(dat_,dat,size(dat),psb_mpi_c_spk_,mpi_camx_op,icomm,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
if (iam == root_) then
|
|
|
|
if (iam == root_) then
|
|
|
|
call psb_realloc(size(dat,1),size(dat,2),dat_,iinfo)
|
|
|
|
call psb_realloc(size(dat,1),size(dat,2),dat_,iinfo)
|
|
|
|
dat_ = dat
|
|
|
|
dat_ = dat
|
|
|
|
call mpi_reduce(dat_,dat,size(dat),psb_mpi_c_spk_,mpi_camx_op,root_,ictxt,info)
|
|
|
|
call mpi_reduce(dat_,dat,size(dat),psb_mpi_c_spk_,mpi_camx_op,root_,icomm,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call psb_realloc(1,1,dat_,iinfo)
|
|
|
|
call psb_realloc(1,1,dat_,iinfo)
|
|
|
|
call mpi_reduce(dat,dat_,size(dat),psb_mpi_c_spk_,mpi_camx_op,root_,ictxt,info)
|
|
|
|
call mpi_reduce(dat,dat_,size(dat),psb_mpi_c_spk_,mpi_camx_op,root_,icomm,info)
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
end subroutine psb_camxm
|
|
|
|
end subroutine psb_camxm
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
subroutine psb_camxs_ec(ictxt,dat,root)
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
integer(psb_epk_), intent(in) :: ictxt
|
|
|
|
|
|
|
|
complex(psb_spk_), intent(inout) :: dat
|
|
|
|
|
|
|
|
integer(psb_epk_), intent(in), optional :: root
|
|
|
|
|
|
|
|
integer(psb_mpk_) :: ictxt_, root_
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ictxt_ = ictxt
|
|
|
|
|
|
|
|
if (present(root)) then
|
|
|
|
|
|
|
|
root_ = root
|
|
|
|
|
|
|
|
call psb_amx(ictxt_,dat,root_)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call psb_amx(ictxt_,dat)
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
end subroutine psb_camxs_ec
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
subroutine psb_camxv_ec(ictxt,dat,root)
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
integer(psb_epk_), intent(in) :: ictxt
|
|
|
|
|
|
|
|
complex(psb_spk_), intent(inout) :: dat(:)
|
|
|
|
|
|
|
|
integer(psb_epk_), intent(in), optional :: root
|
|
|
|
|
|
|
|
integer(psb_mpk_) :: ictxt_, root_
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ictxt_ = ictxt
|
|
|
|
|
|
|
|
if (present(root)) then
|
|
|
|
|
|
|
|
root_ = root
|
|
|
|
|
|
|
|
call psb_amx(ictxt_,dat,root_)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call psb_amx(ictxt_,dat)
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
end subroutine psb_camxv_ec
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
subroutine psb_camxm_ec(ictxt,dat,root)
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
integer(psb_epk_), intent(in) :: ictxt
|
|
|
|
|
|
|
|
complex(psb_spk_), intent(inout) :: dat(:,:)
|
|
|
|
|
|
|
|
integer(psb_epk_), intent(in), optional :: root
|
|
|
|
|
|
|
|
integer(psb_mpk_) :: ictxt_, root_
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ictxt_ = ictxt
|
|
|
|
|
|
|
|
if (present(root)) then
|
|
|
|
|
|
|
|
root_ = root
|
|
|
|
|
|
|
|
call psb_amx(ictxt_,dat,root_)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call psb_amx(ictxt_,dat)
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
end subroutine psb_camxm_ec
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! AMN: Minimum Absolute Value
|
|
|
|
! AMN: Minimum Absolute Value
|
|
|
|
!
|
|
|
|
!
|
|
|
@ -447,15 +343,14 @@ contains
|
|
|
|
#ifdef MPI_H
|
|
|
|
#ifdef MPI_H
|
|
|
|
include 'mpif.h'
|
|
|
|
include 'mpif.h'
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
integer(psb_mpk_), intent(in) :: ictxt
|
|
|
|
type(psb_ctxt_type), intent(in) :: ictxt
|
|
|
|
complex(psb_spk_), intent(inout) :: dat
|
|
|
|
complex(psb_spk_), intent(inout) :: dat
|
|
|
|
integer(psb_mpk_), intent(in), optional :: root
|
|
|
|
integer(psb_mpk_), intent(in), optional :: root
|
|
|
|
integer(psb_mpk_) :: root_
|
|
|
|
integer(psb_mpk_) :: root_
|
|
|
|
complex(psb_spk_) :: dat_
|
|
|
|
complex(psb_spk_) :: dat_
|
|
|
|
integer(psb_mpk_) :: iam, np, info
|
|
|
|
integer(psb_mpk_) :: iam, np, info, icomm
|
|
|
|
integer(psb_ipk_) :: iinfo
|
|
|
|
integer(psb_ipk_) :: iinfo
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(SERIAL_MPI)
|
|
|
|
#if !defined(SERIAL_MPI)
|
|
|
|
call psb_info(ictxt,iam,np)
|
|
|
|
call psb_info(ictxt,iam,np)
|
|
|
|
|
|
|
|
|
|
|
@ -464,11 +359,12 @@ contains
|
|
|
|
else
|
|
|
|
else
|
|
|
|
root_ = -1
|
|
|
|
root_ = -1
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
icomm = psb_get_mpi_comm(ictxt)
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call mpi_allreduce(dat,dat_,1,psb_mpi_c_spk_,mpi_camn_op,ictxt,info)
|
|
|
|
call mpi_allreduce(dat,dat_,1,psb_mpi_c_spk_,mpi_camn_op,icomm,info)
|
|
|
|
dat = dat_
|
|
|
|
dat = dat_
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call mpi_reduce(dat,dat_,1,psb_mpi_c_spk_,mpi_camn_op,root_,ictxt,info)
|
|
|
|
call mpi_reduce(dat,dat_,1,psb_mpi_c_spk_,mpi_camn_op,root_,icomm,info)
|
|
|
|
if (iam == root_) dat = dat_
|
|
|
|
if (iam == root_) dat = dat_
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -483,15 +379,14 @@ contains
|
|
|
|
#ifdef MPI_H
|
|
|
|
#ifdef MPI_H
|
|
|
|
include 'mpif.h'
|
|
|
|
include 'mpif.h'
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
integer(psb_mpk_), intent(in) :: ictxt
|
|
|
|
type(psb_ctxt_type), intent(in) :: ictxt
|
|
|
|
complex(psb_spk_), intent(inout) :: dat(:)
|
|
|
|
complex(psb_spk_), intent(inout) :: dat(:)
|
|
|
|
integer(psb_mpk_), intent(in), optional :: root
|
|
|
|
integer(psb_mpk_), intent(in), optional :: root
|
|
|
|
integer(psb_mpk_) :: root_
|
|
|
|
integer(psb_mpk_) :: root_
|
|
|
|
complex(psb_spk_), allocatable :: dat_(:)
|
|
|
|
complex(psb_spk_), allocatable :: dat_(:)
|
|
|
|
integer(psb_mpk_) :: iam, np, info
|
|
|
|
integer(psb_mpk_) :: iam, np, info, icomm
|
|
|
|
integer(psb_ipk_) :: iinfo
|
|
|
|
integer(psb_ipk_) :: iinfo
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(SERIAL_MPI)
|
|
|
|
#if !defined(SERIAL_MPI)
|
|
|
|
call psb_info(ictxt,iam,np)
|
|
|
|
call psb_info(ictxt,iam,np)
|
|
|
|
|
|
|
|
|
|
|
@ -500,19 +395,20 @@ contains
|
|
|
|
else
|
|
|
|
else
|
|
|
|
root_ = -1
|
|
|
|
root_ = -1
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
icomm = psb_get_mpi_comm(ictxt)
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call psb_realloc(size(dat),dat_,iinfo)
|
|
|
|
call psb_realloc(size(dat),dat_,iinfo)
|
|
|
|
dat_ = dat
|
|
|
|
dat_ = dat
|
|
|
|
if (iinfo == psb_success_) &
|
|
|
|
if (iinfo == psb_success_) &
|
|
|
|
& call mpi_allreduce(dat_,dat,size(dat),psb_mpi_c_spk_,mpi_camn_op,ictxt,info)
|
|
|
|
& call mpi_allreduce(dat_,dat,size(dat),psb_mpi_c_spk_,mpi_camn_op,icomm,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
if (iam == root_) then
|
|
|
|
if (iam == root_) then
|
|
|
|
call psb_realloc(size(dat),dat_,iinfo)
|
|
|
|
call psb_realloc(size(dat),dat_,iinfo)
|
|
|
|
dat_ = dat
|
|
|
|
dat_ = dat
|
|
|
|
call mpi_reduce(dat_,dat,size(dat),psb_mpi_c_spk_,mpi_camn_op,root_,ictxt,info)
|
|
|
|
call mpi_reduce(dat_,dat,size(dat),psb_mpi_c_spk_,mpi_camn_op,root_,icomm,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call psb_realloc(1,dat_,iinfo)
|
|
|
|
call psb_realloc(1,dat_,iinfo)
|
|
|
|
call mpi_reduce(dat,dat_,size(dat),psb_mpi_c_spk_,mpi_camn_op,root_,ictxt,info)
|
|
|
|
call mpi_reduce(dat,dat_,size(dat),psb_mpi_c_spk_,mpi_camn_op,root_,icomm,info)
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -527,12 +423,12 @@ contains
|
|
|
|
#ifdef MPI_H
|
|
|
|
#ifdef MPI_H
|
|
|
|
include 'mpif.h'
|
|
|
|
include 'mpif.h'
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
integer(psb_mpk_), intent(in) :: ictxt
|
|
|
|
type(psb_ctxt_type), intent(in) :: ictxt
|
|
|
|
complex(psb_spk_), intent(inout) :: dat(:,:)
|
|
|
|
complex(psb_spk_), intent(inout) :: dat(:,:)
|
|
|
|
integer(psb_mpk_), intent(in), optional :: root
|
|
|
|
integer(psb_mpk_), intent(in), optional :: root
|
|
|
|
integer(psb_mpk_) :: root_
|
|
|
|
integer(psb_mpk_) :: root_
|
|
|
|
complex(psb_spk_), allocatable :: dat_(:,:)
|
|
|
|
complex(psb_spk_), allocatable :: dat_(:,:)
|
|
|
|
integer(psb_mpk_) :: iam, np, info
|
|
|
|
integer(psb_mpk_) :: iam, np, info, icomm
|
|
|
|
integer(psb_ipk_) :: iinfo
|
|
|
|
integer(psb_ipk_) :: iinfo
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(SERIAL_MPI)
|
|
|
|
#if !defined(SERIAL_MPI)
|
|
|
@ -544,74 +440,25 @@ contains
|
|
|
|
else
|
|
|
|
else
|
|
|
|
root_ = -1
|
|
|
|
root_ = -1
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
icomm = psb_get_mpi_comm(ictxt)
|
|
|
|
if (root_ == -1) then
|
|
|
|
if (root_ == -1) then
|
|
|
|
call psb_realloc(size(dat,1),size(dat,2),dat_,iinfo)
|
|
|
|
call psb_realloc(size(dat,1),size(dat,2),dat_,iinfo)
|
|
|
|
dat_ = dat
|
|
|
|
dat_ = dat
|
|
|
|
if (iinfo == psb_success_)&
|
|
|
|
if (iinfo == psb_success_)&
|
|
|
|
& call mpi_allreduce(dat_,dat,size(dat),psb_mpi_c_spk_,mpi_camn_op,ictxt,info)
|
|
|
|
& call mpi_allreduce(dat_,dat,size(dat),psb_mpi_c_spk_,mpi_camn_op,icomm,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
if (iam == root_) then
|
|
|
|
if (iam == root_) then
|
|
|
|
call psb_realloc(size(dat,1),size(dat,2),dat_,iinfo)
|
|
|
|
call psb_realloc(size(dat,1),size(dat,2),dat_,iinfo)
|
|
|
|
dat_ = dat
|
|
|
|
dat_ = dat
|
|
|
|
call mpi_reduce(dat_,dat,size(dat),psb_mpi_c_spk_,mpi_camn_op,root_,ictxt,info)
|
|
|
|
call mpi_reduce(dat_,dat,size(dat),psb_mpi_c_spk_,mpi_camn_op,root_,icomm,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call psb_realloc(1,1,dat_,iinfo)
|
|
|
|
call psb_realloc(1,1,dat_,iinfo)
|
|
|
|
call mpi_reduce(dat,dat_,size(dat),psb_mpi_c_spk_,mpi_camn_op,root_,ictxt,info)
|
|
|
|
call mpi_reduce(dat,dat_,size(dat),psb_mpi_c_spk_,mpi_camn_op,root_,icomm,info)
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
end subroutine psb_camnm
|
|
|
|
end subroutine psb_camnm
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
subroutine psb_camns_ec(ictxt,dat,root)
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
integer(psb_epk_), intent(in) :: ictxt
|
|
|
|
|
|
|
|
complex(psb_spk_), intent(inout) :: dat
|
|
|
|
|
|
|
|
integer(psb_epk_), intent(in), optional :: root
|
|
|
|
|
|
|
|
integer(psb_mpk_) :: ictxt_, root_
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ictxt_ = ictxt
|
|
|
|
|
|
|
|
if (present(root)) then
|
|
|
|
|
|
|
|
root_ = root
|
|
|
|
|
|
|
|
call psb_amn(ictxt_,dat,root_)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call psb_amn(ictxt_,dat)
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
end subroutine psb_camns_ec
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
subroutine psb_camnv_ec(ictxt,dat,root)
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
integer(psb_epk_), intent(in) :: ictxt
|
|
|
|
|
|
|
|
complex(psb_spk_), intent(inout) :: dat(:)
|
|
|
|
|
|
|
|
integer(psb_epk_), intent(in), optional :: root
|
|
|
|
|
|
|
|
integer(psb_mpk_) :: ictxt_, root_
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ictxt_ = ictxt
|
|
|
|
|
|
|
|
if (present(root)) then
|
|
|
|
|
|
|
|
root_ = root
|
|
|
|
|
|
|
|
call psb_amn(ictxt_,dat,root_)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call psb_amn(ictxt_,dat)
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
end subroutine psb_camnv_ec
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
subroutine psb_camnm_ec(ictxt,dat,root)
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
integer(psb_epk_), intent(in) :: ictxt
|
|
|
|
|
|
|
|
complex(psb_spk_), intent(inout) :: dat(:,:)
|
|
|
|
|
|
|
|
integer(psb_epk_), intent(in), optional :: root
|
|
|
|
|
|
|
|
integer(psb_mpk_) :: ictxt_, root_
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ictxt_ = ictxt
|
|
|
|
|
|
|
|
if (present(root)) then
|
|
|
|
|
|
|
|
root_ = root
|
|
|
|
|
|
|
|
call psb_amn(ictxt_,dat,root_)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call psb_amn(ictxt_,dat)
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
end subroutine psb_camnm_ec
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! BCAST Broadcast
|
|
|
|
! BCAST Broadcast
|
|
|
|
!
|
|
|
|
!
|
|
|
@ -624,15 +471,14 @@ contains
|
|
|
|
#ifdef MPI_H
|
|
|
|
#ifdef MPI_H
|
|
|
|
include 'mpif.h'
|
|
|
|
include 'mpif.h'
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
integer(psb_mpk_), intent(in) :: ictxt
|
|
|
|
type(psb_ctxt_type), intent(in) :: ictxt
|
|
|
|
complex(psb_spk_), intent(inout) :: dat
|
|
|
|
complex(psb_spk_), intent(inout) :: dat
|
|
|
|
integer(psb_mpk_), intent(in), optional :: root
|
|
|
|
integer(psb_mpk_), intent(in), optional :: root
|
|
|
|
integer(psb_mpk_) :: root_
|
|
|
|
integer(psb_mpk_) :: root_
|
|
|
|
|
|
|
|
|
|
|
|
integer(psb_mpk_) :: iam, np, info
|
|
|
|
integer(psb_mpk_) :: iam, np, info, icomm
|
|
|
|
integer(psb_ipk_) :: iinfo
|
|
|
|
integer(psb_ipk_) :: iinfo
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(SERIAL_MPI)
|
|
|
|
#if !defined(SERIAL_MPI)
|
|
|
|
call psb_info(ictxt,iam,np)
|
|
|
|
call psb_info(ictxt,iam,np)
|
|
|
|
|
|
|
|
|
|
|
@ -641,7 +487,8 @@ contains
|
|
|
|
else
|
|
|
|
else
|
|
|
|
root_ = psb_root_
|
|
|
|
root_ = psb_root_
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
call mpi_bcast(dat,1,psb_mpi_c_spk_,root_,ictxt,info)
|
|
|
|
icomm = psb_get_mpi_comm(ictxt)
|
|
|
|
|
|
|
|
call mpi_bcast(dat,1,psb_mpi_c_spk_,root_,icomm,info)
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
end subroutine psb_cbcasts
|
|
|
|
end subroutine psb_cbcasts
|
|
|
@ -655,14 +502,13 @@ contains
|
|
|
|
#ifdef MPI_H
|
|
|
|
#ifdef MPI_H
|
|
|
|
include 'mpif.h'
|
|
|
|
include 'mpif.h'
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
integer(psb_mpk_), intent(in) :: ictxt
|
|
|
|
type(psb_ctxt_type), intent(in) :: ictxt
|
|
|
|
complex(psb_spk_), intent(inout) :: dat(:)
|
|
|
|
complex(psb_spk_), intent(inout) :: dat(:)
|
|
|
|
integer(psb_mpk_), intent(in), optional :: root
|
|
|
|
integer(psb_mpk_), intent(in), optional :: root
|
|
|
|
integer(psb_mpk_) :: root_
|
|
|
|
integer(psb_mpk_) :: root_
|
|
|
|
integer(psb_mpk_) :: iam, np, info
|
|
|
|
integer(psb_mpk_) :: iam, np, info, icomm
|
|
|
|
integer(psb_ipk_) :: iinfo
|
|
|
|
integer(psb_ipk_) :: iinfo
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(SERIAL_MPI)
|
|
|
|
#if !defined(SERIAL_MPI)
|
|
|
|
call psb_info(ictxt,iam,np)
|
|
|
|
call psb_info(ictxt,iam,np)
|
|
|
|
|
|
|
|
|
|
|
@ -671,8 +517,8 @@ contains
|
|
|
|
else
|
|
|
|
else
|
|
|
|
root_ = psb_root_
|
|
|
|
root_ = psb_root_
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
icomm = psb_get_mpi_comm(ictxt)
|
|
|
|
call mpi_bcast(dat,size(dat),psb_mpi_c_spk_,root_,ictxt,info)
|
|
|
|
call mpi_bcast(dat,size(dat),psb_mpi_c_spk_,root_,icomm,info)
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
end subroutine psb_cbcastv
|
|
|
|
end subroutine psb_cbcastv
|
|
|
|
|
|
|
|
|
|
|
@ -685,12 +531,12 @@ contains
|
|
|
|
#ifdef MPI_H
|
|
|
|
#ifdef MPI_H
|
|
|
|
include 'mpif.h'
|
|
|
|
include 'mpif.h'
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
integer(psb_mpk_), intent(in) :: ictxt
|
|
|
|
type(psb_ctxt_type), intent(in) :: ictxt
|
|
|
|
complex(psb_spk_), intent(inout) :: dat(:,:)
|
|
|
|
complex(psb_spk_), intent(inout) :: dat(:,:)
|
|
|
|
integer(psb_mpk_), intent(in), optional :: root
|
|
|
|
integer(psb_mpk_), intent(in), optional :: root
|
|
|
|
integer(psb_mpk_) :: root_
|
|
|
|
integer(psb_mpk_) :: root_
|
|
|
|
|
|
|
|
|
|
|
|
integer(psb_mpk_) :: iam, np, info
|
|
|
|
integer(psb_mpk_) :: iam, np, info, icomm
|
|
|
|
integer(psb_ipk_) :: iinfo
|
|
|
|
integer(psb_ipk_) :: iinfo
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(SERIAL_MPI)
|
|
|
|
#if !defined(SERIAL_MPI)
|
|
|
@ -702,61 +548,11 @@ contains
|
|
|
|
else
|
|
|
|
else
|
|
|
|
root_ = psb_root_
|
|
|
|
root_ = psb_root_
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
icomm = psb_get_mpi_comm(ictxt)
|
|
|
|
call mpi_bcast(dat,size(dat),psb_mpi_c_spk_,root_,ictxt,info)
|
|
|
|
call mpi_bcast(dat,size(dat),psb_mpi_c_spk_,root_,icomm,info)
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
end subroutine psb_cbcastm
|
|
|
|
end subroutine psb_cbcastm
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
subroutine psb_cbcasts_ec(ictxt,dat,root)
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
integer(psb_epk_), intent(in) :: ictxt
|
|
|
|
|
|
|
|
complex(psb_spk_), intent(inout) :: dat
|
|
|
|
|
|
|
|
integer(psb_epk_), intent(in), optional :: root
|
|
|
|
|
|
|
|
integer(psb_mpk_) :: ictxt_, root_
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ictxt_ = ictxt
|
|
|
|
|
|
|
|
if (present(root)) then
|
|
|
|
|
|
|
|
root_ = root
|
|
|
|
|
|
|
|
call psb_bcast(ictxt_,dat,root_)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call psb_bcast(ictxt_,dat)
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
end subroutine psb_cbcasts_ec
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
subroutine psb_cbcastv_ec(ictxt,dat,root)
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
integer(psb_epk_), intent(in) :: ictxt
|
|
|
|
|
|
|
|
complex(psb_spk_), intent(inout) :: dat(:)
|
|
|
|
|
|
|
|
integer(psb_epk_), intent(in), optional :: root
|
|
|
|
|
|
|
|
integer(psb_mpk_) :: ictxt_, root_
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ictxt_ = ictxt
|
|
|
|
|
|
|
|
if (present(root)) then
|
|
|
|
|
|
|
|
root_ = root
|
|
|
|
|
|
|
|
call psb_bcast(ictxt_,dat,root_)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call psb_bcast(ictxt_,dat)
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
end subroutine psb_cbcastv_ec
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
subroutine psb_cbcastm_ec(ictxt,dat,root)
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
integer(psb_epk_), intent(in) :: ictxt
|
|
|
|
|
|
|
|
complex(psb_spk_), intent(inout) :: dat(:,:)
|
|
|
|
|
|
|
|
integer(psb_epk_), intent(in), optional :: root
|
|
|
|
|
|
|
|
integer(psb_mpk_) :: ictxt_, root_
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ictxt_ = ictxt
|
|
|
|
|
|
|
|
if (present(root)) then
|
|
|
|
|
|
|
|
root_ = root
|
|
|
|
|
|
|
|
call psb_bcast(ictxt_,dat,root_)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call psb_bcast(ictxt_,dat)
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
end subroutine psb_cbcastm_ec
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! SCAN
|
|
|
|
! SCAN
|
|
|
@ -771,13 +567,12 @@ contains
|
|
|
|
#ifdef MPI_H
|
|
|
|
#ifdef MPI_H
|
|
|
|
include 'mpif.h'
|
|
|
|
include 'mpif.h'
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
integer(psb_ipk_), intent(in) :: ictxt
|
|
|
|
type(psb_ctxt_type), intent(in) :: ictxt
|
|
|
|
complex(psb_spk_), intent(inout) :: dat
|
|
|
|
complex(psb_spk_), intent(inout) :: dat
|
|
|
|
complex(psb_spk_) :: dat_
|
|
|
|
complex(psb_spk_) :: dat_
|
|
|
|
integer(psb_ipk_) :: iam, np, info
|
|
|
|
integer(psb_ipk_) :: iam, np, info
|
|
|
|
integer(psb_mpk_) :: minfo, icomm
|
|
|
|
integer(psb_mpk_) :: minfo, icomm
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(SERIAL_MPI)
|
|
|
|
#if !defined(SERIAL_MPI)
|
|
|
|
call psb_info(ictxt,iam,np)
|
|
|
|
call psb_info(ictxt,iam,np)
|
|
|
|
icomm = psb_get_mpi_comm(ictxt)
|
|
|
|
icomm = psb_get_mpi_comm(ictxt)
|
|
|
@ -795,7 +590,7 @@ contains
|
|
|
|
#ifdef MPI_H
|
|
|
|
#ifdef MPI_H
|
|
|
|
include 'mpif.h'
|
|
|
|
include 'mpif.h'
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
integer(psb_ipk_), intent(in) :: ictxt
|
|
|
|
type(psb_ctxt_type), intent(in) :: ictxt
|
|
|
|
complex(psb_spk_), intent(inout) :: dat
|
|
|
|
complex(psb_spk_), intent(inout) :: dat
|
|
|
|
complex(psb_spk_) :: dat_
|
|
|
|
complex(psb_spk_) :: dat_
|
|
|
|
integer(psb_ipk_) :: iam, np, info
|
|
|
|
integer(psb_ipk_) :: iam, np, info
|
|
|
@ -821,7 +616,7 @@ contains
|
|
|
|
#ifdef MPI_H
|
|
|
|
#ifdef MPI_H
|
|
|
|
include 'mpif.h'
|
|
|
|
include 'mpif.h'
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
integer(psb_ipk_), intent(in) :: ictxt
|
|
|
|
type(psb_ctxt_type), intent(in) :: ictxt
|
|
|
|
complex(psb_spk_), intent(inout) :: dat(:)
|
|
|
|
complex(psb_spk_), intent(inout) :: dat(:)
|
|
|
|
integer(psb_ipk_), intent(in), optional :: root
|
|
|
|
integer(psb_ipk_), intent(in), optional :: root
|
|
|
|
integer(psb_mpk_) :: root_
|
|
|
|
integer(psb_mpk_) :: root_
|
|
|
@ -848,7 +643,7 @@ contains
|
|
|
|
#ifdef MPI_H
|
|
|
|
#ifdef MPI_H
|
|
|
|
include 'mpif.h'
|
|
|
|
include 'mpif.h'
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
integer(psb_ipk_), intent(in) :: ictxt
|
|
|
|
type(psb_ctxt_type), intent(in) :: ictxt
|
|
|
|
complex(psb_spk_), intent(inout) :: dat(:)
|
|
|
|
complex(psb_spk_), intent(inout) :: dat(:)
|
|
|
|
integer(psb_ipk_), intent(in), optional :: root
|
|
|
|
integer(psb_ipk_), intent(in), optional :: root
|
|
|
|
integer(psb_mpk_) :: root_
|
|
|
|
integer(psb_mpk_) :: root_
|
|
|
@ -875,9 +670,8 @@ contains
|
|
|
|
complex(psb_spk_), intent(in) :: valsnd(:)
|
|
|
|
complex(psb_spk_), intent(in) :: valsnd(:)
|
|
|
|
complex(psb_spk_), intent(out) :: valrcv(:)
|
|
|
|
complex(psb_spk_), intent(out) :: valrcv(:)
|
|
|
|
integer(psb_mpk_), intent(in) :: bsdindx(:), brvindx(:), sdsz(:), rvsz(:)
|
|
|
|
integer(psb_mpk_), intent(in) :: bsdindx(:), brvindx(:), sdsz(:), rvsz(:)
|
|
|
|
integer(psb_ipk_), intent(in) :: ictxt
|
|
|
|
type(psb_ctxt_type), intent(in) :: ictxt
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
|
|
|
|
|
|
|
integer(psb_ipk_) :: iam, np, i,j,k, ip, ipx, idx, sz
|
|
|
|
integer(psb_ipk_) :: iam, np, i,j,k, ip, ipx, idx, sz
|
|
|
|
|
|
|
|
|
|
|
|
call psb_info(ictxt,iam,np)
|
|
|
|
call psb_info(ictxt,iam,np)
|
|
|
@ -919,7 +713,7 @@ contains
|
|
|
|
complex(psb_spk_), intent(out) :: valrcv(:)
|
|
|
|
complex(psb_spk_), intent(out) :: valrcv(:)
|
|
|
|
integer(psb_mpk_), intent(out) :: iarcv(:), jarcv(:)
|
|
|
|
integer(psb_mpk_), intent(out) :: iarcv(:), jarcv(:)
|
|
|
|
integer(psb_mpk_), intent(in) :: bsdindx(:), brvindx(:), sdsz(:), rvsz(:)
|
|
|
|
integer(psb_mpk_), intent(in) :: bsdindx(:), brvindx(:), sdsz(:), rvsz(:)
|
|
|
|
integer(psb_ipk_), intent(in) :: ictxt
|
|
|
|
type(psb_ctxt_type), intent(in) :: ictxt
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
|
|
|
|
|
|
|
!Local variables
|
|
|
|
!Local variables
|
|
|
@ -1002,7 +796,7 @@ contains
|
|
|
|
complex(psb_spk_), intent(out) :: valrcv(:)
|
|
|
|
complex(psb_spk_), intent(out) :: valrcv(:)
|
|
|
|
integer(psb_epk_), intent(out) :: iarcv(:), jarcv(:)
|
|
|
|
integer(psb_epk_), intent(out) :: iarcv(:), jarcv(:)
|
|
|
|
integer(psb_mpk_), intent(in) :: bsdindx(:), brvindx(:), sdsz(:), rvsz(:)
|
|
|
|
integer(psb_mpk_), intent(in) :: bsdindx(:), brvindx(:), sdsz(:), rvsz(:)
|
|
|
|
integer(psb_ipk_), intent(in) :: ictxt
|
|
|
|
type(psb_ctxt_type), intent(in) :: ictxt
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
|
|
|
|
|
|
|
!Local variables
|
|
|
|
!Local variables
|
|
|
|