From 317af0d8baba505677d8ed3833960e3af638cdd1 Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Sun, 11 Mar 2018 17:16:32 +0000 Subject: [PATCH] Reworked bcast and reduce into a "collective" module --- base/modules/Makefile | 41 +- base/modules/penv/psi_bcast_mod.F90 | 1002 ----------------- ...educe_mod.F90 => psi_c_collective_mod.F90} | 156 ++- ..._reduce_mod.F90 => psi_collective_mod.F90} | 214 +++- ...educe_mod.F90 => psi_d_collective_mod.F90} | 156 ++- ...educe_mod.F90 => psi_e_collective_mod.F90} | 156 ++- ...educe_mod.F90 => psi_m_collective_mod.F90} | 156 ++- ...educe_mod.F90 => psi_s_collective_mod.F90} | 156 ++- ...educe_mod.F90 => psi_z_collective_mod.F90} | 156 ++- base/modules/psb_penv_mod.F90 | 5 +- 10 files changed, 1151 insertions(+), 1047 deletions(-) delete mode 100644 base/modules/penv/psi_bcast_mod.F90 rename base/modules/penv/{psi_c_reduce_mod.F90 => psi_c_collective_mod.F90} (81%) rename base/modules/penv/{psi_reduce_mod.F90 => psi_collective_mod.F90} (57%) rename base/modules/penv/{psi_d_reduce_mod.F90 => psi_d_collective_mod.F90} (88%) rename base/modules/penv/{psi_e_reduce_mod.F90 => psi_e_collective_mod.F90} (87%) rename base/modules/penv/{psi_m_reduce_mod.F90 => psi_m_collective_mod.F90} (87%) rename base/modules/penv/{psi_s_reduce_mod.F90 => psi_s_collective_mod.F90} (88%) rename base/modules/penv/{psi_z_reduce_mod.F90 => psi_z_collective_mod.F90} (81%) diff --git a/base/modules/Makefile b/base/modules/Makefile index 5b1b3a73..a39dbbe7 100644 --- a/base/modules/Makefile +++ b/base/modules/Makefile @@ -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: diff --git a/base/modules/penv/psi_bcast_mod.F90 b/base/modules/penv/psi_bcast_mod.F90 deleted file mode 100644 index 1e048624..00000000 --- a/base/modules/penv/psi_bcast_mod.F90 +++ /dev/null @@ -1,1002 +0,0 @@ -! -! Parallel Sparse BLAS version 3.5 -! (C) Copyright 2006-2018 -! Salvatore Filippone -! Alfredo Buttari -! -! Redistribution and use in source and binary forms, with or without -! modification, are permitted provided that the following conditions -! are met: -! 1. Redistributions of source code must retain the above copyright -! notice, this list of conditions and the following disclaimer. -! 2. Redistributions in binary form must reproduce the above copyright -! notice, this list of conditions, and the following disclaimer in the -! documentation and/or other materials provided with the distribution. -! 3. The name of the PSBLAS group or the names of its contributors may -! not be used to endorse or promote products derived from this -! software without specific written permission. -! -! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS -! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -! POSSIBILITY OF SUCH DAMAGE. -! -! - - -module psi_bcast_mod - use psb_const_mod - use psi_penv_mod - interface psb_bcast - module procedure psb_ibcasts, psb_ibcastv, psb_ibcastm,& - & psb_dbcasts, psb_dbcastv, psb_dbcastm,& - & psb_zbcasts, psb_zbcastv, psb_zbcastm,& - & psb_sbcasts, psb_sbcastv, psb_sbcastm,& - & psb_cbcasts, psb_cbcastv, psb_cbcastm,& - & psb_hbcasts, psb_hbcastv,& - & psb_lbcasts, psb_lbcastv - end interface psb_bcast - -#if defined(LONG_INTEGERS) - interface psb_bcast - module procedure psb_ibcasts_ic, psb_ibcastv_ic, psb_ibcastm_ic,& - & psb_dbcasts_ic, psb_dbcastv_ic, psb_dbcastm_ic,& - & psb_zbcasts_ic, psb_zbcastv_ic, psb_zbcastm_ic,& - & psb_sbcasts_ic, psb_sbcastv_ic, psb_sbcastm_ic,& - & psb_cbcasts_ic, psb_cbcastv_ic, psb_cbcastm_ic,& - & psb_hbcasts_ic, psb_hbcastv_ic, & - & psb_lbcasts_ic, psb_lbcastv_ic - end interface psb_bcast -#else - interface psb_bcast - module procedure psb_i8bcasts, psb_i8bcastv, psb_i8bcastm - end interface psb_bcast -#endif - -contains - - ! !!!!!!!!!!!!!!!!!!!!!! - ! - ! Broadcasts - ! - ! !!!!!!!!!!!!!!!!!!!!!! - - - subroutine psb_ibcasts(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_ipk_), 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,psb_mpi_ipk_,root_,ictxt,info) -#endif - end subroutine psb_ibcasts - - subroutine psb_ibcastv(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_ipk_), 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),psb_mpi_ipk_,root_,ictxt,info) -#endif - end subroutine psb_ibcastv - - subroutine psb_ibcastm(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_ipk_), 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),psb_mpi_ipk_,root_,ictxt,info) -#endif - end subroutine psb_ibcastm - - - 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_) :: 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,psb_mpi_r_spk_,root_,ictxt,info) -#endif - end subroutine psb_sbcasts - - - subroutine psb_sbcastv(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_) :: 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),psb_mpi_r_spk_,root_,ictxt,info) - -#endif - end subroutine psb_sbcastv - - subroutine psb_sbcastm(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_) :: 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),psb_mpi_r_spk_,root_,ictxt,info) - -#endif - end subroutine psb_sbcastm - - - 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_) :: 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,psb_mpi_r_dpk_,root_,ictxt,info) -#endif - end subroutine psb_dbcasts - - - subroutine psb_dbcastv(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_) :: 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),psb_mpi_r_dpk_,root_,ictxt,info) -#endif - end subroutine psb_dbcastv - - subroutine psb_dbcastm(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_) :: 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),psb_mpi_r_dpk_,root_,ictxt,info) -#endif - end subroutine psb_dbcastm - - 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_) :: 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,psb_mpi_c_spk_,root_,ictxt,info) -#endif - end subroutine psb_cbcasts - - subroutine psb_cbcastv(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_) :: 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),psb_mpi_c_spk_,root_,ictxt,info) -#endif - end subroutine psb_cbcastv - - subroutine psb_cbcastm(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_) :: 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),psb_mpi_c_spk_,root_,ictxt,info) -#endif - end subroutine psb_cbcastm - - 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_) :: 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,psb_mpi_c_dpk_,root_,ictxt,info) -#endif - end subroutine psb_zbcasts - - subroutine psb_zbcastv(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_) :: 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),psb_mpi_c_dpk_,root_,ictxt,info) -#endif - end subroutine psb_zbcastv - - subroutine psb_zbcastm(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_) :: 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),psb_mpi_c_dpk_,root_,ictxt,info) -#endif - end subroutine psb_zbcastm - - - 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_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 - - -#if !defined(LONG_INTEGERS) - - subroutine psb_i8bcasts(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_) :: 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,psb_mpi_lpk_,root_,ictxt,info) -#endif - end subroutine psb_i8bcasts - - subroutine psb_i8bcastv(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_) :: 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),psb_mpi_lpk_,root_,ictxt,info) -#endif - end subroutine psb_i8bcastv - - subroutine psb_i8bcastm(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_) :: 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),psb_mpi_lpk_,root_,ictxt,info) -#endif - end subroutine psb_i8bcastm - -#endif - - -#if defined(LONG_INTEGERS) - - subroutine psb_ibcasts_ic(ictxt,dat,root) - implicit none - integer(psb_ipk_), intent(in) :: ictxt - integer(psb_ipk_), intent(inout) :: dat - integer(psb_ipk_), intent(in), optional :: root - - integer(psb_mpk_) :: iictxt, root_ - - iictxt = ictxt - if (present(root)) then - root_ = root - else - root_ = psb_root_ - endif - call psb_bcast(iictxt,dat,root_) - end subroutine psb_ibcasts_ic - - subroutine psb_ibcastv_ic(ictxt,dat,root) - implicit none - integer(psb_ipk_), intent(in) :: ictxt - integer(psb_ipk_), intent(inout) :: dat(:) - integer(psb_ipk_), intent(in), optional :: root - - integer(psb_mpk_) :: iictxt, root_ - - iictxt = ictxt - if (present(root)) then - root_ = root - else - root_ = psb_root_ - endif - call psb_bcast(iictxt,dat,root_) - end subroutine psb_ibcastv_ic - - subroutine psb_ibcastm_ic(ictxt,dat,root) - implicit none - integer(psb_ipk_), intent(in) :: ictxt - integer(psb_ipk_), intent(inout) :: dat(:,:) - integer(psb_ipk_), intent(in), optional :: root - - integer(psb_mpk_) :: iictxt, root_ - - iictxt = ictxt - if (present(root)) then - root_ = root - else - root_ = psb_root_ - endif - call psb_bcast(iictxt,dat,root_) - end subroutine psb_ibcastm_ic - - - subroutine psb_sbcasts_ic(ictxt,dat,root) - implicit none - integer(psb_ipk_), intent(in) :: ictxt - real(psb_spk_), intent(inout) :: dat - integer(psb_ipk_), intent(in), optional :: root - - integer(psb_mpk_) :: iictxt, root_ - - iictxt = ictxt - if (present(root)) then - root_ = root - else - root_ = psb_root_ - endif - call psb_bcast(iictxt,dat,root_) - end subroutine psb_sbcasts_ic - - - subroutine psb_sbcastv_ic(ictxt,dat,root) - implicit none - integer(psb_ipk_), intent(in) :: ictxt - real(psb_spk_), intent(inout) :: dat(:) - integer(psb_ipk_), intent(in), optional :: root - - integer(psb_mpk_) :: iictxt, root_ - - iictxt = ictxt - if (present(root)) then - root_ = root - else - root_ = psb_root_ - endif - call psb_bcast(iictxt,dat,root_) - end subroutine psb_sbcastv_ic - - subroutine psb_sbcastm_ic(ictxt,dat,root) - implicit none - integer(psb_ipk_), intent(in) :: ictxt - real(psb_spk_), intent(inout) :: dat(:,:) - integer(psb_ipk_), intent(in), optional :: root - - integer(psb_mpk_) :: iictxt, root_ - - iictxt = ictxt - if (present(root)) then - root_ = root - else - root_ = psb_root_ - endif - call psb_bcast(iictxt,dat,root_) - end subroutine psb_sbcastm_ic - - - subroutine psb_dbcasts_ic(ictxt,dat,root) - implicit none - integer(psb_ipk_), intent(in) :: ictxt - real(psb_dpk_), intent(inout) :: dat - integer(psb_ipk_), intent(in), optional :: root - - integer(psb_mpk_) :: iictxt, root_ - - iictxt = ictxt - if (present(root)) then - root_ = root - else - root_ = psb_root_ - endif - call psb_bcast(iictxt,dat,root_) - end subroutine psb_dbcasts_ic - - - subroutine psb_dbcastv_ic(ictxt,dat,root) - implicit none - integer(psb_ipk_), intent(in) :: ictxt - real(psb_dpk_), intent(inout) :: dat(:) - integer(psb_ipk_), intent(in), optional :: root - - integer(psb_mpk_) :: iictxt, root_ - - iictxt = ictxt - if (present(root)) then - root_ = root - else - root_ = psb_root_ - endif - call psb_bcast(iictxt,dat,root_) - end subroutine psb_dbcastv_ic - - subroutine psb_dbcastm_ic(ictxt,dat,root) - implicit none - integer(psb_ipk_), intent(in) :: ictxt - real(psb_dpk_), intent(inout) :: dat(:,:) - integer(psb_ipk_), intent(in), optional :: root - - integer(psb_mpk_) :: iictxt, root_ - - iictxt = ictxt - if (present(root)) then - root_ = root - else - root_ = psb_root_ - endif - call psb_bcast(iictxt,dat,root_) - end subroutine psb_dbcastm_ic - - subroutine psb_cbcasts_ic(ictxt,dat,root) - implicit none - integer(psb_ipk_), intent(in) :: ictxt - complex(psb_spk_), intent(inout) :: dat - integer(psb_ipk_), intent(in), optional :: root - - integer(psb_mpk_) :: iictxt, root_ - - iictxt = ictxt - if (present(root)) then - root_ = root - else - root_ = psb_root_ - endif - call psb_bcast(iictxt,dat,root_) - end subroutine psb_cbcasts_ic - - subroutine psb_cbcastv_ic(ictxt,dat,root) - implicit none - integer(psb_ipk_), intent(in) :: ictxt - complex(psb_spk_), intent(inout) :: dat(:) - integer(psb_ipk_), intent(in), optional :: root - - integer(psb_mpk_) :: iictxt, root_ - - iictxt = ictxt - if (present(root)) then - root_ = root - else - root_ = psb_root_ - endif - call psb_bcast(iictxt,dat,root_) - end subroutine psb_cbcastv_ic - - subroutine psb_cbcastm_ic(ictxt,dat,root) - implicit none - integer(psb_ipk_), intent(in) :: ictxt - complex(psb_spk_), intent(inout) :: dat(:,:) - integer(psb_ipk_), intent(in), optional :: root - - integer(psb_mpk_) :: iictxt, root_ - - iictxt = ictxt - if (present(root)) then - root_ = root - else - root_ = psb_root_ - endif - call psb_bcast(iictxt,dat,root_) - end subroutine psb_cbcastm_ic - - subroutine psb_zbcasts_ic(ictxt,dat,root) - implicit none - integer(psb_ipk_), intent(in) :: ictxt - complex(psb_dpk_), intent(inout) :: dat - integer(psb_ipk_), intent(in), optional :: root - - integer(psb_mpk_) :: iictxt, root_ - - iictxt = ictxt - if (present(root)) then - root_ = root - else - root_ = psb_root_ - endif - call psb_bcast(iictxt,dat,root_) - end subroutine psb_zbcasts_ic - - subroutine psb_zbcastv_ic(ictxt,dat,root) - implicit none - integer(psb_ipk_), intent(in) :: ictxt - complex(psb_dpk_), intent(inout) :: dat(:) - integer(psb_ipk_), intent(in), optional :: root - - integer(psb_mpk_) :: iictxt, root_ - - iictxt = ictxt - if (present(root)) then - root_ = root - else - root_ = psb_root_ - endif - call psb_bcast(iictxt,dat,root_) - end subroutine psb_zbcastv_ic - - subroutine psb_zbcastm_ic(ictxt,dat,root) - implicit none - integer(psb_ipk_), intent(in) :: ictxt - complex(psb_dpk_), intent(inout) :: dat(:,:) - integer(psb_ipk_), intent(in), optional :: root - - integer(psb_mpk_) :: iictxt, root_ - - iictxt = ictxt - if (present(root)) then - root_ = root - else - root_ = psb_root_ - endif - call psb_bcast(iictxt,dat,root_) - end subroutine psb_zbcastm_ic - - - subroutine psb_hbcasts_ic(ictxt,dat,root,length) - implicit none - integer(psb_ipk_), intent(in) :: ictxt - character(len=*), intent(inout) :: dat - integer(psb_ipk_), intent(in), optional :: root,length - - integer(psb_mpk_) :: iictxt, root_ - - iictxt = ictxt - if (present(root)) then - root_ = root - else - root_ = psb_root_ - endif - call psb_bcast(iictxt,dat,root_) - end subroutine psb_hbcasts_ic - - subroutine psb_hbcastv_ic(ictxt,dat,root) - implicit none - integer(psb_ipk_), intent(in) :: ictxt - character(len=*), intent(inout) :: dat(:) - integer(psb_ipk_), intent(in), optional :: root - - integer(psb_mpk_) :: iictxt, root_ - - iictxt = ictxt - if (present(root)) then - root_ = root - else - root_ = psb_root_ - endif - call psb_bcast(iictxt,dat,root_) - end subroutine psb_hbcastv_ic - - subroutine psb_lbcasts_ic(ictxt,dat,root) - implicit none - integer(psb_ipk_), intent(in) :: ictxt - logical, intent(inout) :: dat - integer(psb_ipk_), intent(in), optional :: root - - integer(psb_mpk_) :: iictxt, root_ - - iictxt = ictxt - if (present(root)) then - root_ = root - else - root_ = psb_root_ - endif - call psb_bcast(iictxt,dat,root_) - end subroutine psb_lbcasts_ic - - - subroutine psb_lbcastv_ic(ictxt,dat,root) - implicit none - integer(psb_ipk_), intent(in) :: ictxt - logical, intent(inout) :: dat(:) - integer(psb_ipk_), intent(in), optional :: root - - integer(psb_mpk_) :: iictxt, root_ - - iictxt = ictxt - if (present(root)) then - root_ = root - else - root_ = psb_root_ - endif - call psb_bcast(iictxt,dat,root_) - end subroutine psb_lbcastv_ic -#endif - - -end module psi_bcast_mod diff --git a/base/modules/penv/psi_c_reduce_mod.F90 b/base/modules/penv/psi_c_collective_mod.F90 similarity index 81% rename from base/modules/penv/psi_c_reduce_mod.F90 rename to base/modules/penv/psi_c_collective_mod.F90 index d3da30f5..2ae40807 100644 --- a/base/modules/penv/psi_c_reduce_mod.F90 +++ b/base/modules/penv/psi_c_collective_mod.F90 @@ -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 diff --git a/base/modules/penv/psi_reduce_mod.F90 b/base/modules/penv/psi_collective_mod.F90 similarity index 57% rename from base/modules/penv/psi_reduce_mod.F90 rename to base/modules/penv/psi_collective_mod.F90 index b244cf96..e382d692 100644 --- a/base/modules/penv/psi_reduce_mod.F90 +++ b/base/modules/penv/psi_collective_mod.F90 @@ -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 diff --git a/base/modules/penv/psi_d_reduce_mod.F90 b/base/modules/penv/psi_d_collective_mod.F90 similarity index 88% rename from base/modules/penv/psi_d_reduce_mod.F90 rename to base/modules/penv/psi_d_collective_mod.F90 index 59779823..537cf3a0 100644 --- a/base/modules/penv/psi_d_reduce_mod.F90 +++ b/base/modules/penv/psi_d_collective_mod.F90 @@ -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 diff --git a/base/modules/penv/psi_e_reduce_mod.F90 b/base/modules/penv/psi_e_collective_mod.F90 similarity index 87% rename from base/modules/penv/psi_e_reduce_mod.F90 rename to base/modules/penv/psi_e_collective_mod.F90 index 0f34ddc3..e0053915 100644 --- a/base/modules/penv/psi_e_reduce_mod.F90 +++ b/base/modules/penv/psi_e_collective_mod.F90 @@ -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 diff --git a/base/modules/penv/psi_m_reduce_mod.F90 b/base/modules/penv/psi_m_collective_mod.F90 similarity index 87% rename from base/modules/penv/psi_m_reduce_mod.F90 rename to base/modules/penv/psi_m_collective_mod.F90 index c827c767..d0ca82d7 100644 --- a/base/modules/penv/psi_m_reduce_mod.F90 +++ b/base/modules/penv/psi_m_collective_mod.F90 @@ -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 diff --git a/base/modules/penv/psi_s_reduce_mod.F90 b/base/modules/penv/psi_s_collective_mod.F90 similarity index 88% rename from base/modules/penv/psi_s_reduce_mod.F90 rename to base/modules/penv/psi_s_collective_mod.F90 index d584dd3a..0c985f2d 100644 --- a/base/modules/penv/psi_s_reduce_mod.F90 +++ b/base/modules/penv/psi_s_collective_mod.F90 @@ -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 diff --git a/base/modules/penv/psi_z_reduce_mod.F90 b/base/modules/penv/psi_z_collective_mod.F90 similarity index 81% rename from base/modules/penv/psi_z_reduce_mod.F90 rename to base/modules/penv/psi_z_collective_mod.F90 index abcae856..3ed7e4f6 100644 --- a/base/modules/penv/psi_z_reduce_mod.F90 +++ b/base/modules/penv/psi_z_collective_mod.F90 @@ -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 diff --git a/base/modules/psb_penv_mod.F90 b/base/modules/psb_penv_mod.F90 index 17f0f6a7..14c3f238 100644 --- a/base/modules/psb_penv_mod.F90 +++ b/base/modules/psb_penv_mod.F90 @@ -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