Reworked bcast and reduce into a "collective" module

ILmat
Salvatore Filippone 8 years ago
parent 1f6bbaffd5
commit 317af0d8ba

@ -8,20 +8,20 @@ BASIC_MODS= psb_const_mod.o psb_error_mod.o psb_realloc_mod.o \
auxil/psb_c_realloc_mod.o \
auxil/psb_z_realloc_mod.o
COMMINT=penv/psi_comm_buffers_mod.o penv/psi_penv_mod.o penv/psi_bcast_mod.o \
COMMINT=penv/psi_comm_buffers_mod.o penv/psi_penv_mod.o \
penv/psi_p2p_mod.o penv/psi_m_p2p_mod.o \
penv/psi_e_p2p_mod.o \
penv/psi_s_p2p_mod.o \
penv/psi_d_p2p_mod.o \
penv/psi_c_p2p_mod.o \
penv/psi_z_p2p_mod.o \
penv/psi_reduce_mod.o \
penv/psi_e_reduce_mod.o \
penv/psi_m_reduce_mod.o \
penv/psi_s_reduce_mod.o \
penv/psi_d_reduce_mod.o \
penv/psi_c_reduce_mod.o \
penv/psi_z_reduce_mod.o
penv/psi_collective_mod.o \
penv/psi_e_collective_mod.o \
penv/psi_m_collective_mod.o \
penv/psi_s_collective_mod.o \
penv/psi_d_collective_mod.o \
penv/psi_c_collective_mod.o \
penv/psi_z_collective_mod.o
UTIL_MODS = auxil/psb_string_mod.o desc/psb_desc_const_mod.o desc/psb_indx_map_mod.o\
desc/psb_gen_block_map_mod.o desc/psb_list_map_mod.o desc/psb_repl_map_mod.o\
@ -119,7 +119,7 @@ psb_realloc_mod.o \
$(UTIL_MODS): $(BASIC_MODS)
penv/psi_penv_mod.o: penv/psi_comm_buffers_mod.o
penv/psi_bcast_mod.o penv/psi_reduce_mod.o penv/psi_p2p_mod.o: penv/psi_penv_mod.o
penv/psi_collective_mod.o penv/psi_p2p_mod.o: penv/psi_penv_mod.o
psb_realloc_mod.o: auxil/psb_m_realloc_mod.o \
auxil/psb_e_realloc_mod.o \
@ -134,17 +134,17 @@ penv/psi_p2p_mod.o: penv/psi_m_p2p_mod.o \
penv/psi_d_p2p_mod.o \
penv/psi_c_p2p_mod.o \
penv/psi_z_p2p_mod.o
penv/psi_reduce_mod.o: penv/psi_e_reduce_mod.o \
penv/psi_m_reduce_mod.o \
penv/psi_s_reduce_mod.o \
penv/psi_d_reduce_mod.o \
penv/psi_c_reduce_mod.o \
penv/psi_z_reduce_mod.o
penv/psi_collective_mod.o: penv/psi_e_collective_mod.o \
penv/psi_m_collective_mod.o \
penv/psi_s_collective_mod.o \
penv/psi_d_collective_mod.o \
penv/psi_c_collective_mod.o \
penv/psi_z_collective_mod.o
penv/psi_m_p2p_mod.o penv/psi_e_p2p_mod.o penv/psi_s_p2p_mod.o \
penv/psi_d_p2p_mod.o penv/psi_c_p2p_mod.o penv/psi_z_p2p_mod.o\
penv/psi_e_reduce_mod.o penv/psi_m_reduce_mod.o penv/psi_s_reduce_mod.o \
penv/psi_d_reduce_mod.o penv/psi_c_reduce_mod.o penv/psi_z_reduce_mod.o: penv/psi_penv_mod.o
penv/psi_e_collective_mod.o penv/psi_m_collective_mod.o penv/psi_s_collective_mod.o \
penv/psi_d_collective_mod.o penv/psi_c_collective_mod.o penv/psi_z_collective_mod.o: penv/psi_penv_mod.o
auxil/psb_string_mod.o desc/psb_desc_const_mod.o psi_comm_buffers_mod.o: psb_const_mod.o
auxil/psb_hash_mod.o: psb_realloc_mod.o psb_const_mod.o
@ -212,7 +212,7 @@ serial/psb_d_vect_mod.o: serial/psb_d_base_vect_mod.o serial/psb_i_vect_mod.o
serial/psb_c_vect_mod.o: serial/psb_c_base_vect_mod.o serial/psb_i_vect_mod.o
serial/psb_z_vect_mod.o: serial/psb_z_base_vect_mod.o serial/psb_i_vect_mod.o
serial/psb_s_serial_mod.o serial/psb_d_serial_mod.o serial/psb_c_serial_mod.o serial/psb_z_serial_mod.o: serial/psb_mat_mod.o auxil/psb_string_mod.o auxil/psb_sort_mod.o auxil/psi_serial_mod.o
serial/psb_vect_mod.o: serial/psb_i_vect_mod.o serial/psb_d_vect_mod.o serial/psb_s_vect_mod.o serial/psb_c_vect_mod.o serial/psb_z_vect_mod.o
serial/psb_vect_mod.o: serial/psb_i_vect_mod.o serial/psb_l_vect_mod.o serial/psb_d_vect_mod.o serial/psb_s_vect_mod.o serial/psb_c_vect_mod.o serial/psb_z_vect_mod.o
error.o psb_realloc_mod.o: psb_error_mod.o
psb_error_impl.o: psb_penv_mod.o
@ -310,10 +310,7 @@ penv/psi_comm_buffers_mod.o: penv/psi_comm_buffers_mod.F90 $(BASIC_MODS)
penv/psi_p2p_mod.o: penv/psi_p2p_mod.F90 $(BASIC_MODS)
$(FC) $(FINCLUDES) $(FDEFINES) $(FCOPT) $(EXTRA_OPT) -c $< -o $@
penv/psi_bcast_mod.o: penv/psi_bcast_mod.F90 $(BASIC_MODS)
$(FC) $(FINCLUDES) $(FDEFINES) $(FCOPT) $(EXTRA_OPT) -c $< -o $@
penv/psi_reduce_mod.o: penv/psi_reduce_mod.F90 $(BASIC_MODS)
penv/psi_collective_mod.o: penv/psi_collective_mod.F90 $(BASIC_MODS)
$(FC) $(FINCLUDES) $(FDEFINES) $(FCOPT) $(EXTRA_OPT) -c $< -o $@
clean:

File diff suppressed because it is too large Load Diff

@ -29,7 +29,7 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
module psi_c_reduce_mod
module psi_c_collective_mod
use psi_penv_mod
@ -49,6 +49,11 @@ module psi_c_reduce_mod
end interface
interface psb_bcast
module procedure psb_cbcasts, psb_cbcastv, psb_cbcastm, &
& psb_cbcasts_ec, psb_cbcastv_ec, psb_cbcastm_ec
end interface
contains
@ -589,4 +594,151 @@ contains
end if
end subroutine psb_camnm_ec
end module psi_c_reduce_mod
!
! BCAST Broadcast
!
subroutine psb_cbcasts(ictxt,dat,root)
#ifdef MPI_MOD
use mpi
#endif
implicit none
#ifdef MPI_H
include 'mpif.h'
#endif
integer(psb_mpk_), intent(in) :: ictxt
complex(psb_spk_), intent(inout) :: dat
integer(psb_mpk_), intent(in), optional :: root
integer(psb_mpk_) :: root_
integer(psb_mpk_) :: iam, np, info
integer(psb_ipk_) :: iinfo
#if !defined(SERIAL_MPI)
call psb_info(ictxt,iam,np)
if (present(root)) then
root_ = root
else
root_ = psb_root_
endif
call mpi_bcast(dat,1,psb_mpi_c_spk_,root_,ictxt,info)
#endif
end subroutine psb_cbcasts
subroutine psb_cbcastv(ictxt,dat,root)
use psb_realloc_mod
#ifdef MPI_MOD
use mpi
#endif
implicit none
#ifdef MPI_H
include 'mpif.h'
#endif
integer(psb_mpk_), intent(in) :: ictxt
complex(psb_spk_), intent(inout) :: dat(:)
integer(psb_mpk_), intent(in), optional :: root
integer(psb_mpk_) :: root_
integer(psb_mpk_) :: iam, np, info
integer(psb_ipk_) :: iinfo
#if !defined(SERIAL_MPI)
call psb_info(ictxt,iam,np)
if (present(root)) then
root_ = root
else
root_ = psb_root_
endif
call mpi_bcast(dat,size(dat),psb_mpi_c_spk_,root_,ictxt,info)
#endif
end subroutine psb_cbcastv
subroutine psb_cbcastm(ictxt,dat,root)
use psb_realloc_mod
#ifdef MPI_MOD
use mpi
#endif
implicit none
#ifdef MPI_H
include 'mpif.h'
#endif
integer(psb_mpk_), intent(in) :: ictxt
complex(psb_spk_), intent(inout) :: dat(:,:)
integer(psb_mpk_), intent(in), optional :: root
integer(psb_mpk_) :: root_
integer(psb_mpk_) :: iam, np, info
integer(psb_ipk_) :: iinfo
#if !defined(SERIAL_MPI)
call psb_info(ictxt,iam,np)
if (present(root)) then
root_ = root
else
root_ = psb_root_
endif
call mpi_bcast(dat,size(dat),psb_mpi_c_spk_,root_,ictxt,info)
#endif
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
end module psi_c_collective_mod

@ -29,23 +29,221 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
module psi_reduce_mod
module psi_collective_mod
use psi_penv_mod
use psi_m_reduce_mod
use psi_e_reduce_mod
use psi_s_reduce_mod
use psi_d_reduce_mod
use psi_c_reduce_mod
use psi_z_reduce_mod
use psi_m_collective_mod
use psi_e_collective_mod
use psi_s_collective_mod
use psi_d_collective_mod
use psi_c_collective_mod
use psi_z_collective_mod
interface psb_bcast
module procedure psb_hbcasts, psb_hbcastv,&
& psb_hbcasts_ec, psb_hbcastv_ec,&
& psb_lbcasts, psb_lbcastv, &
& psb_lbcasts_ec, psb_lbcastv_ec
end interface psb_bcast
#if defined(SHORT_INTEGERS)
interface psb_sum
module procedure psb_i2sums, psb_i2sumv, psb_i2summ, &
& psb_i2sums_ec, psb_i2sumv_ec, psb_i2summ_ec
end interface psb_sum
#endif
contains
subroutine psb_hbcasts(ictxt,dat,root,length)
#ifdef MPI_MOD
use mpi
#endif
implicit none
#ifdef MPI_H
include 'mpif.h'
#endif
integer(psb_mpk_), intent(in) :: ictxt
character(len=*), intent(inout) :: dat
integer(psb_mpk_), intent(in), optional :: root,length
integer(psb_mpk_) :: iam, np, root_,length_,info
#if !defined(SERIAL_MPI)
if (present(root)) then
root_ = root
else
root_ = psb_root_
endif
if (present(length)) then
length_ = length
else
length_ = len(dat)
endif
call psb_info(ictxt,iam,np)
call mpi_bcast(dat,length_,MPI_CHARACTER,root_,ictxt,info)
#endif
end subroutine psb_hbcasts
subroutine psb_hbcastv(ictxt,dat,root)
#ifdef MPI_MOD
use mpi
#endif
implicit none
#ifdef MPI_H
include 'mpif.h'
#endif
integer(psb_mpk_), intent(in) :: ictxt
character(len=*), intent(inout) :: dat(:)
integer(psb_mpk_), intent(in), optional :: root
integer(psb_mpk_) :: iam, np, root_,length_,info, size_
#if !defined(SERIAL_MPI)
if (present(root)) then
root_ = root
else
root_ = psb_root_
endif
length_ = len(dat)
size_ = size(dat)
call psb_info(ictxt,iam,np)
call mpi_bcast(dat,length_*size_,MPI_CHARACTER,root_,ictxt,info)
#endif
end subroutine psb_hbcastv
subroutine psb_hbcasts_ec(ictxt,dat,root)
implicit none
integer(psb_epk_), intent(in) :: ictxt
character(len=*), 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_hbcasts_ec
subroutine psb_hbcastv_ec(ictxt,dat,root)
implicit none
integer(psb_epk_), intent(in) :: ictxt
character(len=*), 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_hbcastv_ec
subroutine psb_lbcasts(ictxt,dat,root)
#ifdef MPI_MOD
use mpi
#endif
implicit none
#ifdef MPI_H
include 'mpif.h'
#endif
integer(psb_mpk_), intent(in) :: ictxt
logical, intent(inout) :: dat
integer(psb_mpk_), intent(in), optional :: root
integer(psb_mpk_) :: iam, np, root_,info
#if !defined(SERIAL_MPI)
if (present(root)) then
root_ = root
else
root_ = psb_root_
endif
call psb_info(ictxt,iam,np)
call mpi_bcast(dat,1,MPI_LOGICAL,root_,ictxt,info)
#endif
end subroutine psb_lbcasts
subroutine psb_lbcastv(ictxt,dat,root)
#ifdef MPI_MOD
use mpi
#endif
implicit none
#ifdef MPI_H
include 'mpif.h'
#endif
integer(psb_mpk_), intent(in) :: ictxt
logical, intent(inout) :: dat(:)
integer(psb_mpk_), intent(in), optional :: root
integer(psb_mpk_) :: iam, np, root_,info
#if !defined(SERIAL_MPI)
if (present(root)) then
root_ = root
else
root_ = psb_root_
endif
call psb_info(ictxt,iam,np)
call mpi_bcast(dat,size(dat),MPI_LOGICAL,root_,ictxt,info)
#endif
end subroutine psb_lbcastv
subroutine psb_lbcasts_ec(ictxt,dat,root)
implicit none
integer(psb_epk_), intent(in) :: ictxt
logical, 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_lbcasts_ec
subroutine psb_lbcastv_ec(ictxt,dat,root)
implicit none
integer(psb_epk_), intent(in) :: ictxt
logical, 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_lbcastv_ec
#if defined(SHORT_INTEGERS)
subroutine psb_i2sums(ictxt,dat,root)
#ifdef MPI_MOD
@ -219,4 +417,4 @@ contains
#endif
end module psi_reduce_mod
end module psi_collective_mod

@ -29,7 +29,7 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
module psi_d_reduce_mod
module psi_d_collective_mod
use psi_penv_mod
interface psb_max
@ -63,6 +63,11 @@ module psi_d_reduce_mod
end interface
interface psb_bcast
module procedure psb_dbcasts, psb_dbcastv, psb_dbcastm, &
& psb_dbcasts_ec, psb_dbcastv_ec, psb_dbcastm_ec
end interface
contains
@ -1080,4 +1085,151 @@ contains
end if
end subroutine psb_damnm_ec
end module psi_d_reduce_mod
!
! BCAST Broadcast
!
subroutine psb_dbcasts(ictxt,dat,root)
#ifdef MPI_MOD
use mpi
#endif
implicit none
#ifdef MPI_H
include 'mpif.h'
#endif
integer(psb_mpk_), intent(in) :: ictxt
real(psb_dpk_), intent(inout) :: dat
integer(psb_mpk_), intent(in), optional :: root
integer(psb_mpk_) :: root_
integer(psb_mpk_) :: iam, np, info
integer(psb_ipk_) :: iinfo
#if !defined(SERIAL_MPI)
call psb_info(ictxt,iam,np)
if (present(root)) then
root_ = root
else
root_ = psb_root_
endif
call mpi_bcast(dat,1,psb_mpi_r_dpk_,root_,ictxt,info)
#endif
end subroutine psb_dbcasts
subroutine psb_dbcastv(ictxt,dat,root)
use psb_realloc_mod
#ifdef MPI_MOD
use mpi
#endif
implicit none
#ifdef MPI_H
include 'mpif.h'
#endif
integer(psb_mpk_), intent(in) :: ictxt
real(psb_dpk_), intent(inout) :: dat(:)
integer(psb_mpk_), intent(in), optional :: root
integer(psb_mpk_) :: root_
integer(psb_mpk_) :: iam, np, info
integer(psb_ipk_) :: iinfo
#if !defined(SERIAL_MPI)
call psb_info(ictxt,iam,np)
if (present(root)) then
root_ = root
else
root_ = psb_root_
endif
call mpi_bcast(dat,size(dat),psb_mpi_r_dpk_,root_,ictxt,info)
#endif
end subroutine psb_dbcastv
subroutine psb_dbcastm(ictxt,dat,root)
use psb_realloc_mod
#ifdef MPI_MOD
use mpi
#endif
implicit none
#ifdef MPI_H
include 'mpif.h'
#endif
integer(psb_mpk_), intent(in) :: ictxt
real(psb_dpk_), intent(inout) :: dat(:,:)
integer(psb_mpk_), intent(in), optional :: root
integer(psb_mpk_) :: root_
integer(psb_mpk_) :: iam, np, info
integer(psb_ipk_) :: iinfo
#if !defined(SERIAL_MPI)
call psb_info(ictxt,iam,np)
if (present(root)) then
root_ = root
else
root_ = psb_root_
endif
call mpi_bcast(dat,size(dat),psb_mpi_r_dpk_,root_,ictxt,info)
#endif
end subroutine psb_dbcastm
subroutine psb_dbcasts_ec(ictxt,dat,root)
implicit none
integer(psb_epk_), intent(in) :: ictxt
real(psb_dpk_), 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_dbcasts_ec
subroutine psb_dbcastv_ec(ictxt,dat,root)
implicit none
integer(psb_epk_), intent(in) :: ictxt
real(psb_dpk_), 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_dbcastv_ec
subroutine psb_dbcastm_ec(ictxt,dat,root)
implicit none
integer(psb_epk_), intent(in) :: ictxt
real(psb_dpk_), 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_dbcastm_ec
end module psi_d_collective_mod

@ -29,7 +29,7 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
module psi_e_reduce_mod
module psi_e_collective_mod
use psi_penv_mod
interface psb_max
@ -59,6 +59,11 @@ module psi_e_reduce_mod
end interface
interface psb_bcast
module procedure psb_ebcasts, psb_ebcastv, psb_ebcastm, &
& psb_ebcasts_ec, psb_ebcastv_ec, psb_ebcastm_ec
end interface
contains
@ -957,4 +962,151 @@ contains
end if
end subroutine psb_eamnm_ec
end module psi_e_reduce_mod
!
! BCAST Broadcast
!
subroutine psb_ebcasts(ictxt,dat,root)
#ifdef MPI_MOD
use mpi
#endif
implicit none
#ifdef MPI_H
include 'mpif.h'
#endif
integer(psb_mpk_), intent(in) :: ictxt
integer(psb_epk_), intent(inout) :: dat
integer(psb_mpk_), intent(in), optional :: root
integer(psb_mpk_) :: root_
integer(psb_mpk_) :: iam, np, info
integer(psb_ipk_) :: iinfo
#if !defined(SERIAL_MPI)
call psb_info(ictxt,iam,np)
if (present(root)) then
root_ = root
else
root_ = psb_root_
endif
call mpi_bcast(dat,1,psb_mpi_epk_,root_,ictxt,info)
#endif
end subroutine psb_ebcasts
subroutine psb_ebcastv(ictxt,dat,root)
use psb_realloc_mod
#ifdef MPI_MOD
use mpi
#endif
implicit none
#ifdef MPI_H
include 'mpif.h'
#endif
integer(psb_mpk_), intent(in) :: ictxt
integer(psb_epk_), intent(inout) :: dat(:)
integer(psb_mpk_), intent(in), optional :: root
integer(psb_mpk_) :: root_
integer(psb_mpk_) :: iam, np, info
integer(psb_ipk_) :: iinfo
#if !defined(SERIAL_MPI)
call psb_info(ictxt,iam,np)
if (present(root)) then
root_ = root
else
root_ = psb_root_
endif
call mpi_bcast(dat,size(dat),psb_mpi_epk_,root_,ictxt,info)
#endif
end subroutine psb_ebcastv
subroutine psb_ebcastm(ictxt,dat,root)
use psb_realloc_mod
#ifdef MPI_MOD
use mpi
#endif
implicit none
#ifdef MPI_H
include 'mpif.h'
#endif
integer(psb_mpk_), intent(in) :: ictxt
integer(psb_epk_), intent(inout) :: dat(:,:)
integer(psb_mpk_), intent(in), optional :: root
integer(psb_mpk_) :: root_
integer(psb_mpk_) :: iam, np, info
integer(psb_ipk_) :: iinfo
#if !defined(SERIAL_MPI)
call psb_info(ictxt,iam,np)
if (present(root)) then
root_ = root
else
root_ = psb_root_
endif
call mpi_bcast(dat,size(dat),psb_mpi_epk_,root_,ictxt,info)
#endif
end subroutine psb_ebcastm
subroutine psb_ebcasts_ec(ictxt,dat,root)
implicit none
integer(psb_epk_), intent(in) :: ictxt
integer(psb_epk_), 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_ebcasts_ec
subroutine psb_ebcastv_ec(ictxt,dat,root)
implicit none
integer(psb_epk_), intent(in) :: ictxt
integer(psb_epk_), 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_ebcastv_ec
subroutine psb_ebcastm_ec(ictxt,dat,root)
implicit none
integer(psb_epk_), intent(in) :: ictxt
integer(psb_epk_), 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_ebcastm_ec
end module psi_e_collective_mod

@ -29,7 +29,7 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
module psi_m_reduce_mod
module psi_m_collective_mod
use psi_penv_mod
interface psb_max
@ -59,6 +59,11 @@ module psi_m_reduce_mod
end interface
interface psb_bcast
module procedure psb_mbcasts, psb_mbcastv, psb_mbcastm, &
& psb_mbcasts_ec, psb_mbcastv_ec, psb_mbcastm_ec
end interface
contains
@ -957,4 +962,151 @@ contains
end if
end subroutine psb_mamnm_ec
end module psi_m_reduce_mod
!
! BCAST Broadcast
!
subroutine psb_mbcasts(ictxt,dat,root)
#ifdef MPI_MOD
use mpi
#endif
implicit none
#ifdef MPI_H
include 'mpif.h'
#endif
integer(psb_mpk_), intent(in) :: ictxt
integer(psb_mpk_), intent(inout) :: dat
integer(psb_mpk_), intent(in), optional :: root
integer(psb_mpk_) :: root_
integer(psb_mpk_) :: iam, np, info
integer(psb_ipk_) :: iinfo
#if !defined(SERIAL_MPI)
call psb_info(ictxt,iam,np)
if (present(root)) then
root_ = root
else
root_ = psb_root_
endif
call mpi_bcast(dat,1,psb_mpi_mpk_,root_,ictxt,info)
#endif
end subroutine psb_mbcasts
subroutine psb_mbcastv(ictxt,dat,root)
use psb_realloc_mod
#ifdef MPI_MOD
use mpi
#endif
implicit none
#ifdef MPI_H
include 'mpif.h'
#endif
integer(psb_mpk_), intent(in) :: ictxt
integer(psb_mpk_), intent(inout) :: dat(:)
integer(psb_mpk_), intent(in), optional :: root
integer(psb_mpk_) :: root_
integer(psb_mpk_) :: iam, np, info
integer(psb_ipk_) :: iinfo
#if !defined(SERIAL_MPI)
call psb_info(ictxt,iam,np)
if (present(root)) then
root_ = root
else
root_ = psb_root_
endif
call mpi_bcast(dat,size(dat),psb_mpi_mpk_,root_,ictxt,info)
#endif
end subroutine psb_mbcastv
subroutine psb_mbcastm(ictxt,dat,root)
use psb_realloc_mod
#ifdef MPI_MOD
use mpi
#endif
implicit none
#ifdef MPI_H
include 'mpif.h'
#endif
integer(psb_mpk_), intent(in) :: ictxt
integer(psb_mpk_), intent(inout) :: dat(:,:)
integer(psb_mpk_), intent(in), optional :: root
integer(psb_mpk_) :: root_
integer(psb_mpk_) :: iam, np, info
integer(psb_ipk_) :: iinfo
#if !defined(SERIAL_MPI)
call psb_info(ictxt,iam,np)
if (present(root)) then
root_ = root
else
root_ = psb_root_
endif
call mpi_bcast(dat,size(dat),psb_mpi_mpk_,root_,ictxt,info)
#endif
end subroutine psb_mbcastm
subroutine psb_mbcasts_ec(ictxt,dat,root)
implicit none
integer(psb_epk_), intent(in) :: ictxt
integer(psb_mpk_), 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_mbcasts_ec
subroutine psb_mbcastv_ec(ictxt,dat,root)
implicit none
integer(psb_epk_), intent(in) :: ictxt
integer(psb_mpk_), 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_mbcastv_ec
subroutine psb_mbcastm_ec(ictxt,dat,root)
implicit none
integer(psb_epk_), intent(in) :: ictxt
integer(psb_mpk_), 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_mbcastm_ec
end module psi_m_collective_mod

@ -29,7 +29,7 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
module psi_s_reduce_mod
module psi_s_collective_mod
use psi_penv_mod
interface psb_max
@ -63,6 +63,11 @@ module psi_s_reduce_mod
end interface
interface psb_bcast
module procedure psb_sbcasts, psb_sbcastv, psb_sbcastm, &
& psb_sbcasts_ec, psb_sbcastv_ec, psb_sbcastm_ec
end interface
contains
@ -1080,4 +1085,151 @@ contains
end if
end subroutine psb_samnm_ec
end module psi_s_reduce_mod
!
! BCAST Broadcast
!
subroutine psb_sbcasts(ictxt,dat,root)
#ifdef MPI_MOD
use mpi
#endif
implicit none
#ifdef MPI_H
include 'mpif.h'
#endif
integer(psb_mpk_), intent(in) :: ictxt
real(psb_spk_), intent(inout) :: dat
integer(psb_mpk_), intent(in), optional :: root
integer(psb_mpk_) :: root_
integer(psb_mpk_) :: iam, np, info
integer(psb_ipk_) :: iinfo
#if !defined(SERIAL_MPI)
call psb_info(ictxt,iam,np)
if (present(root)) then
root_ = root
else
root_ = psb_root_
endif
call mpi_bcast(dat,1,psb_mpi_r_spk_,root_,ictxt,info)
#endif
end subroutine psb_sbcasts
subroutine psb_sbcastv(ictxt,dat,root)
use psb_realloc_mod
#ifdef MPI_MOD
use mpi
#endif
implicit none
#ifdef MPI_H
include 'mpif.h'
#endif
integer(psb_mpk_), intent(in) :: ictxt
real(psb_spk_), intent(inout) :: dat(:)
integer(psb_mpk_), intent(in), optional :: root
integer(psb_mpk_) :: root_
integer(psb_mpk_) :: iam, np, info
integer(psb_ipk_) :: iinfo
#if !defined(SERIAL_MPI)
call psb_info(ictxt,iam,np)
if (present(root)) then
root_ = root
else
root_ = psb_root_
endif
call mpi_bcast(dat,size(dat),psb_mpi_r_spk_,root_,ictxt,info)
#endif
end subroutine psb_sbcastv
subroutine psb_sbcastm(ictxt,dat,root)
use psb_realloc_mod
#ifdef MPI_MOD
use mpi
#endif
implicit none
#ifdef MPI_H
include 'mpif.h'
#endif
integer(psb_mpk_), intent(in) :: ictxt
real(psb_spk_), intent(inout) :: dat(:,:)
integer(psb_mpk_), intent(in), optional :: root
integer(psb_mpk_) :: root_
integer(psb_mpk_) :: iam, np, info
integer(psb_ipk_) :: iinfo
#if !defined(SERIAL_MPI)
call psb_info(ictxt,iam,np)
if (present(root)) then
root_ = root
else
root_ = psb_root_
endif
call mpi_bcast(dat,size(dat),psb_mpi_r_spk_,root_,ictxt,info)
#endif
end subroutine psb_sbcastm
subroutine psb_sbcasts_ec(ictxt,dat,root)
implicit none
integer(psb_epk_), intent(in) :: ictxt
real(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_sbcasts_ec
subroutine psb_sbcastv_ec(ictxt,dat,root)
implicit none
integer(psb_epk_), intent(in) :: ictxt
real(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_sbcastv_ec
subroutine psb_sbcastm_ec(ictxt,dat,root)
implicit none
integer(psb_epk_), intent(in) :: ictxt
real(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_sbcastm_ec
end module psi_s_collective_mod

@ -29,7 +29,7 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
module psi_z_reduce_mod
module psi_z_collective_mod
use psi_penv_mod
@ -49,6 +49,11 @@ module psi_z_reduce_mod
end interface
interface psb_bcast
module procedure psb_zbcasts, psb_zbcastv, psb_zbcastm, &
& psb_zbcasts_ec, psb_zbcastv_ec, psb_zbcastm_ec
end interface
contains
@ -589,4 +594,151 @@ contains
end if
end subroutine psb_zamnm_ec
end module psi_z_reduce_mod
!
! BCAST Broadcast
!
subroutine psb_zbcasts(ictxt,dat,root)
#ifdef MPI_MOD
use mpi
#endif
implicit none
#ifdef MPI_H
include 'mpif.h'
#endif
integer(psb_mpk_), intent(in) :: ictxt
complex(psb_dpk_), intent(inout) :: dat
integer(psb_mpk_), intent(in), optional :: root
integer(psb_mpk_) :: root_
integer(psb_mpk_) :: iam, np, info
integer(psb_ipk_) :: iinfo
#if !defined(SERIAL_MPI)
call psb_info(ictxt,iam,np)
if (present(root)) then
root_ = root
else
root_ = psb_root_
endif
call mpi_bcast(dat,1,psb_mpi_c_dpk_,root_,ictxt,info)
#endif
end subroutine psb_zbcasts
subroutine psb_zbcastv(ictxt,dat,root)
use psb_realloc_mod
#ifdef MPI_MOD
use mpi
#endif
implicit none
#ifdef MPI_H
include 'mpif.h'
#endif
integer(psb_mpk_), intent(in) :: ictxt
complex(psb_dpk_), intent(inout) :: dat(:)
integer(psb_mpk_), intent(in), optional :: root
integer(psb_mpk_) :: root_
integer(psb_mpk_) :: iam, np, info
integer(psb_ipk_) :: iinfo
#if !defined(SERIAL_MPI)
call psb_info(ictxt,iam,np)
if (present(root)) then
root_ = root
else
root_ = psb_root_
endif
call mpi_bcast(dat,size(dat),psb_mpi_c_dpk_,root_,ictxt,info)
#endif
end subroutine psb_zbcastv
subroutine psb_zbcastm(ictxt,dat,root)
use psb_realloc_mod
#ifdef MPI_MOD
use mpi
#endif
implicit none
#ifdef MPI_H
include 'mpif.h'
#endif
integer(psb_mpk_), intent(in) :: ictxt
complex(psb_dpk_), intent(inout) :: dat(:,:)
integer(psb_mpk_), intent(in), optional :: root
integer(psb_mpk_) :: root_
integer(psb_mpk_) :: iam, np, info
integer(psb_ipk_) :: iinfo
#if !defined(SERIAL_MPI)
call psb_info(ictxt,iam,np)
if (present(root)) then
root_ = root
else
root_ = psb_root_
endif
call mpi_bcast(dat,size(dat),psb_mpi_c_dpk_,root_,ictxt,info)
#endif
end subroutine psb_zbcastm
subroutine psb_zbcasts_ec(ictxt,dat,root)
implicit none
integer(psb_epk_), intent(in) :: ictxt
complex(psb_dpk_), 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_zbcasts_ec
subroutine psb_zbcastv_ec(ictxt,dat,root)
implicit none
integer(psb_epk_), intent(in) :: ictxt
complex(psb_dpk_), 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_zbcastv_ec
subroutine psb_zbcastm_ec(ictxt,dat,root)
implicit none
integer(psb_epk_), intent(in) :: ictxt
complex(psb_dpk_), 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_zbcastm_ec
end module psi_z_collective_mod

@ -3,9 +3,8 @@
module psb_penv_mod
use psi_penv_mod
use psi_bcast_mod
use psi_reduce_mod
use psi_p2p_mod
use psi_collective_mod
end module psb_penv_mod

Loading…
Cancel
Save